bearermanagement/mpm/inc/mpmvpntogglewatcher.h
changeset 71 9f263f780e41
parent 41 bbb64eb3bdee
equal deleted inserted replaced
70:ac5daea24fb0 71:9f263f780e41
     1 /*
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    32 * VPN toggle key changes in central repository.
    32 * VPN toggle key changes in central repository.
    33 */
    33 */
    34 class MMpmVpnToggleWatcherNotify
    34 class MMpmVpnToggleWatcherNotify
    35 {
    35 {
    36 public:
    36 public:
    37     
    37 
    38     /**
    38     /**
    39      * Sets values for VPN toggle after VPN toggle key changes in central
    39      * Sets values for VPN toggle after VPN toggle key changes in central
    40      * repository.
    40      * repository.
    41      * @param aVpnPreferred Informs if VPN connection is preferred
    41      * @param aVpnPreferred Informs if VPN connection is preferred
    42      *                      connection
    42      *                      connection
    43      * @param aVpnIapId VPN IAP Id, which is used for VPN connection, when
    43      * @param aVpnIapId VPN IAP Id, which is used for VPN connection, when
    44      *                  VPN connection is preferred                           
    44      *                  VPN connection is preferred
    45      * @param aSnapId SNAP Id SNAP Id, which is used for VPN connection,
    45      * @param aSnapId SNAP Id SNAP Id, which is used for VPN connection,
    46      *                when VPN connection is preferred
    46      *                when VPN connection is preferred
    47      */
    47      */
    48      virtual void SetVpnToggleValuesL( const TBool aVpnPreferred,
    48      virtual void SetVpnToggleValuesL( const TBool aVpnPreferred,
    49                                        const TUint32 aVpnIapId,
    49                                        const TUint32 aVpnIapId,
    60 public:
    60 public:
    61 
    61 
    62     /**
    62     /**
    63     * Two-phased constructor.
    63     * Two-phased constructor.
    64     * @param aNotify Handler for notify messages.
    64     * @param aNotify Handler for notify messages.
    65     */    
    65     */
    66     static CMpmVpnToggleWatcher* NewL( MMpmVpnToggleWatcherNotify& aNotify );
    66     static CMpmVpnToggleWatcher* NewL( MMpmVpnToggleWatcherNotify& aNotify );
    67 
    67 
    68     /**
    68     /**
    69     * Destructor.
    69     * Destructor.
    70     */
    70     */
    71     virtual ~CMpmVpnToggleWatcher();
    71     virtual ~CMpmVpnToggleWatcher();
    72     
    72 
    73     /**
    73     /**
    74      * Call this when you want to start listen event.
    74      * Call this when you want to start listen event.
    75      */
    75      */
    76     void StartL();    
    76     void StartL();
    77         
    77 
    78     /**
    78     /**
    79      * Informs if VPN connection is preferred.
    79      * Informs if VPN connection is preferred.
    80      * @return True if VPN connection is preferred.
    80      * @return True if VPN connection is preferred.
    81      */
    81      */
    82     TBool IsVpnConnectionPreferred() const;
    82     TBool IsVpnConnectionPreferred() const;
    83     
    83 
    84     /**
    84     /**
    85      * Returns VPN IAP Id, which is used for VPN connection, when VPN
    85      * Returns VPN IAP Id, which is used for VPN connection, when VPN
    86      * connection is preferred.
    86      * connection is preferred.
    87      * @return VPN IAP Id
    87      * @return VPN IAP Id
    88      */
    88      */
    89     TUint32 VpnIapId() const;
    89     TUint32 VpnIapId() const;
    90     
    90 
    91     /**
    91     /**
    92      * Returns SNAP Id, which is used for VPN connection, when VPN
    92      * Returns SNAP Id, which is used for VPN connection, when VPN
    93      * connection is preferred.
    93      * connection is preferred.
    94      * @return SNAP Id
    94      * @return SNAP Id
    95      */
    95      */
    96     TUint32 SnapId() const;    
    96     TUint32 SnapId() const;
    97     
    97 
    98     /**
    98     /**
    99      * Resets VPN toggle values.
    99      * Resets VPN toggle values.
   100      */    
   100      */
   101     void ResetVpnToggleValues();
   101     void ResetVpnToggleValues();
   102     
   102 
   103 private:
   103 private:
   104 
   104 
   105     CMpmVpnToggleWatcher( MMpmVpnToggleWatcherNotify& aNotify );
   105     CMpmVpnToggleWatcher( MMpmVpnToggleWatcherNotify& aNotify );
   106 
   106 
   107     void ConstructL();
   107     void ConstructL();
   108     
   108 
   109     /**
   109     /**
   110      * Request for notifications.
   110      * Request for notifications.
   111      * @return Error value
   111      * @return Error value
   112      */
   112      */
   113     TInt RequestNotifications();
   113     TInt RequestNotifications();
   114     
   114 
   115     /**
   115     /**
   116      * Gets VPN toggle values.
   116      * Gets VPN toggle values.
   117      * @return Error value
   117      * @return Error value
   118      */
   118      */
   119     TInt GetVpnToggleValues();
   119     TInt GetVpnToggleValues();
   120 
   120 
   121 // from base class CActive
   121 protected: // from base class CActive
   122 
   122 
       
   123     /**
       
   124      * Active object's RunL.
       
   125      */
   123     void RunL();
   126     void RunL();
   124 
   127 
       
   128     /**
       
   129      * Handles a leave occurring in RunL.
       
   130      * @param aError Leave code of RunL method.
       
   131      * @return KErrNone
       
   132      */
       
   133     TInt RunError( TInt aError );
       
   134 
       
   135     /**
       
   136      * Active object's DoCancel.
       
   137      */
   125     void DoCancel();
   138     void DoCancel();
   126     
   139 
   127 private: // data
   140 private: // data
   128     
   141 
   129     /**
   142     /**
   130      * Central repository handle
   143      * Central repository handle
   131      * Own.
   144      * Own.
   132      */
   145      */
   133     CRepository* iRepository;    
   146     CRepository* iRepository;
   134     
   147 
   135     /**
   148     /**
   136      * Informs if VPN connection is preferred connection
   149      * Informs if VPN connection is preferred connection
   137      * Own.
   150      * Own.
   138      */
   151      */
   139     TBool iVpnConnectionPreferred;
   152     TBool iVpnConnectionPreferred;
   140     
   153 
   141     /**
   154     /**
   142      * VPN IAP Id which is used, when VPN connection is preferred
   155      * VPN IAP Id which is used, when VPN connection is preferred
   143      * Own.
   156      * Own.
   144      */
   157      */
   145     TUint32 iVpnIapId;
   158     TUint32 iVpnIapId;
   146     
   159 
   147     /**
   160     /**
   148      * SNAP Id which is used, when VPN connection is preferred
   161      * SNAP Id which is used, when VPN connection is preferred
   149      * Own.
   162      * Own.
   150      */
   163      */
   151     TUint32 iSnapId;
   164     TUint32 iSnapId;
   152     
   165 
   153     /**
   166     /**
   154      * Error counter.
   167      * Error counter.
   155      */
   168      */
   156     TUint iErrorCounter;
   169     TUint iErrorCounter;
   157 
   170 
   158     /**
   171     /**
   159      * Handler for notify messages.
   172      * Handler for notify messages.
   160      * Not own.
   173      * Not own.
   161      */
   174      */
   162     MMpmVpnToggleWatcherNotify& iNotify;
   175     MMpmVpnToggleWatcherNotify& iNotify;
   163     
   176 
   164     };
   177     };
   165 
   178 
   166 #endif // MPMVPNTOGGLEWATCHER_H
   179 #endif // MPMVPNTOGGLEWATCHER_H