alwayson_net_plugin/pdpcontextmanager2/inc/caoconnectionmonitorimpl.h
changeset 0 5a93021fdf25
child 3 f7816ffc66ed
equal deleted inserted replaced
-1:000000000000 0:5a93021fdf25
       
     1 /*
       
     2 * Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAOCONNECTIONMONITORIMPL_H
       
    20 #define CAOCONNECTIONMONITORIMPL_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 #include <rconnmon.h>
       
    25 #include <etel3rdparty.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MAOSettings;
       
    29 class MAOConnectionMonitorObserver;
       
    30 class CConnMonEventBase;
       
    31 template<class T> class CAOAsyncWrapper;
       
    32 class CActiveSchedulerWait;
       
    33 
       
    34 /**
       
    35  *  Connection monitor implementation.
       
    36  *  @see CAOConnectionMonitor
       
    37  *
       
    38  *  @lib PDPContextManager.lib
       
    39  *  @since S60 v3.1
       
    40  */
       
    41 NONSHARABLE_CLASS( CAOConnectionMonitorImpl ):
       
    42     public CBase,
       
    43     public MConnectionMonitorObserver
       
    44     {
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      *
       
    50      * @since S60 v3.1
       
    51      * @param aObserver ?
       
    52      * @param aSettings Commsdat settings
       
    53      */
       
    54     static CAOConnectionMonitorImpl* NewL(
       
    55         MAOConnectionMonitorObserver& aObserver,
       
    56         MAOSettings& aSettings  );
       
    57 
       
    58     /**
       
    59      * Default destructor
       
    60      *
       
    61      * @since S60 v3.1
       
    62      */
       
    63     virtual ~CAOConnectionMonitorImpl();
       
    64     
       
    65 public:
       
    66     
       
    67     /**
       
    68      * @see CAOConnectionMonitor
       
    69      *
       
    70      * @since S60 v3.1
       
    71      */
       
    72     void FetchNetworkRegistrationStatus();
       
    73     
       
    74     /**
       
    75      * @see CAOConnectionMonitor
       
    76      *
       
    77      * @since S60 v3.1
       
    78      */
       
    79     CTelephony::TRegistrationStatus NetworkRegistration() const;
       
    80     
       
    81 
       
    82 private: // New methods
       
    83 
       
    84     /**
       
    85      * Default constructor.
       
    86      *
       
    87      * @since S60 v3.1
       
    88      * @param aObserver ?
       
    89      * @param aSettings Commsdat settings
       
    90      */
       
    91     CAOConnectionMonitorImpl(
       
    92         MAOConnectionMonitorObserver& aObserver,
       
    93         MAOSettings& aSettings );
       
    94 
       
    95     /**
       
    96      * Default Symbian constructor
       
    97      *
       
    98      * @since S60 v3.1
       
    99      */
       
   100     void ConstructL();
       
   101 
       
   102     /**
       
   103      * Start listening nw registration
       
   104      *
       
   105      * @since S60 v3.1
       
   106      */
       
   107     void ListenNetworkRegistrationStatusChange();
       
   108     
       
   109     /**
       
   110      * Handle error situations
       
   111      *
       
   112      * @since S60 v3.1
       
   113      * @param aError ?
       
   114      */
       
   115     void HandleError( TInt aError );
       
   116     
       
   117     /**
       
   118      * Network registration status
       
   119      *
       
   120      * @since S60 v3.1
       
   121      * @param aStatus ?
       
   122      */
       
   123     void NWRegStatusIssueRequest( TRequestStatus& aStatus );
       
   124     
       
   125     /**
       
   126      * ?
       
   127      *
       
   128      * @since S60 v3.1
       
   129      * @param aStatus ?
       
   130      */
       
   131     void NWRegStatusRunL( TInt aStatus );
       
   132     
       
   133     /**
       
   134      * ?
       
   135      *
       
   136      * @since S60 v3.1
       
   137      */
       
   138     void NWRegStatusDoCancel();
       
   139     
       
   140     /**
       
   141      * ?
       
   142      *
       
   143      * @since S60 v3.1
       
   144      * @param aError ?
       
   145      * @return ?
       
   146      */
       
   147     TInt NWRegStatusRunError( TInt aError );
       
   148 
       
   149     /**
       
   150      * Network registration status
       
   151      *
       
   152      * @since S60 v3.1
       
   153      * @param aStatus ?
       
   154      */
       
   155     void NWRegStatusChangeIssueRequest( TRequestStatus& aStatus );
       
   156     
       
   157     /**
       
   158      * ?
       
   159      *
       
   160      * @since S60 v3.1
       
   161      * @param aStatus ?
       
   162      */
       
   163     void NWRegStatusChangeRunL( TInt aStatus );
       
   164     
       
   165     /**
       
   166      * ?
       
   167      *
       
   168      * @since S60 v3.1
       
   169      */
       
   170     void NWRegStatusChangeDoCancel();
       
   171     
       
   172     /**
       
   173      * ?
       
   174      *
       
   175      * @since S60 v3.1
       
   176      * @param aError ?
       
   177      * @return ?
       
   178      */
       
   179     TInt NWRegStatusChangeRunError( TInt aError );
       
   180 
       
   181     /**
       
   182      * Bearer type
       
   183      *
       
   184      * @since S60 v3.1
       
   185      */
       
   186     void FetchBearerType();
       
   187     
       
   188     /**
       
   189      * ?
       
   190      *
       
   191      * @since S60 v3.1
       
   192      */
       
   193     void CancelFetchBearerType();
       
   194     
       
   195     /**
       
   196      * ?
       
   197      *
       
   198      * @since S60 v3.1
       
   199      */
       
   200     void BearerIssueRequest( TRequestStatus& aStatus );
       
   201     
       
   202     /**
       
   203      * ?
       
   204      *
       
   205      * @since S60 v3.1
       
   206      */
       
   207     void BearerRunL( TInt aStatus );
       
   208     
       
   209     /**
       
   210      * ?
       
   211      *
       
   212      * @since S60 v3.1
       
   213      */
       
   214     void BearerDoCancel();
       
   215     
       
   216     /**
       
   217      * ?
       
   218      *
       
   219      * @since S60 v3.1
       
   220      */
       
   221     TInt BearerRunError( TInt aError );
       
   222 
       
   223 // From base class MConnectionMonitorObserver
       
   224 
       
   225     /**
       
   226      * From MConnectionMonitorObserver
       
   227      *
       
   228      * @since S60 v3.1
       
   229      * @param aConnMonEvent ?
       
   230      */
       
   231     void EventL( const CConnMonEventBase &aConnMonEvent );
       
   232 
       
   233 private: // Data
       
   234 
       
   235     /**
       
   236      * Ref: Observer
       
   237      */
       
   238     MAOConnectionMonitorObserver& iObserver;
       
   239     
       
   240     /**
       
   241      * Ref: Settings
       
   242      */
       
   243     MAOSettings& iSettings;
       
   244     
       
   245     /**
       
   246      * Own: Connection monitor
       
   247      */
       
   248     RConnectionMonitor iConnectionMonitor;
       
   249     
       
   250     /**
       
   251      * Own: Telephony
       
   252      */
       
   253     CTelephony* iTelephony;
       
   254     
       
   255     /**
       
   256      * Own: NW registration status package
       
   257      */
       
   258     CTelephony::TNetworkRegistrationV1Pckg iWNRegPckg;
       
   259     
       
   260     /**
       
   261      * Own: NW registration status
       
   262      */
       
   263     CTelephony::TNetworkRegistrationV1 iWNReg;
       
   264     
       
   265     /**
       
   266      * Own: NW registration status change package
       
   267      */
       
   268     CTelephony::TNetworkRegistrationV1Pckg iWNRegChangePckg;
       
   269     
       
   270     /**
       
   271      * Own: NW registration status change
       
   272      */
       
   273     CTelephony::TNetworkRegistrationV1 iWNChangeReg;
       
   274     
       
   275     /**
       
   276      * Own: Network registration status fetcher ao
       
   277      */
       
   278     CAOAsyncWrapper<CAOConnectionMonitorImpl>*
       
   279         iNWRegistrationStatus;
       
   280 
       
   281     /**
       
   282      * Own: Network registration status change handler ao
       
   283      */
       
   284     CAOAsyncWrapper<CAOConnectionMonitorImpl>*
       
   285         iNWRegistrationStatusChange;
       
   286     
       
   287     /**
       
   288      * Own: Bearer type fetcher
       
   289      */
       
   290     CAOAsyncWrapper<CAOConnectionMonitorImpl>*
       
   291         iBearer;
       
   292         
       
   293     /**
       
   294      * Own: New created connection id
       
   295      */
       
   296     TUint iMyConnectionId;
       
   297     
       
   298     /**
       
   299      * Own: Shows if the connection is beeing open.
       
   300      */
       
   301     TBool iConnectionAlive;
       
   302     
       
   303     /**
       
   304      * Own: Bearer type
       
   305      */
       
   306     TInt iBearerValue;
       
   307     };
       
   308 
       
   309 #endif /* CAOCONNECTIONMONITORIMPL_H */