convergedconnectionhandler/cchserver/inc/cchconnmonhandler.h
changeset 0 a4daefaec16c
child 14 be41ab7b952f
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2007 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:  CCCHConnMonHandler declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CCHCONNMONHANDLER_H
       
    20 #define C_CCHCONNMONHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <rconnmon.h>
       
    26 
       
    27 // CONSTANTS
       
    28 // None
       
    29 
       
    30 // MACROS
       
    31 // None
       
    32 
       
    33 // DATA TYPES
       
    34 // None
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 // None
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CCCHServerBase;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45  *  CCCHConnMonHandler declaration
       
    46  *  Handles Connection Monitor for CCH server
       
    47  *  @lib cchserver.exe
       
    48  *  @since S60 3.2
       
    49  */
       
    50 NONSHARABLE_CLASS( CCCHConnMonHandler ) : public CActive,
       
    51                                           private MConnectionMonitorObserver
       
    52     {
       
    53 public: // Constructors and destructor
       
    54 
       
    55     /**
       
    56      * State's of object
       
    57      */
       
    58     enum TCCHConnMonHandlerState
       
    59         {
       
    60           EUninitialized,   /// Uninitialized
       
    61           EInitialized,     /// Initalized
       
    62           EGetIAPS,
       
    63           EGetSNAPs,
       
    64           EError            /// Error condition
       
    65         };
       
    66 
       
    67     /**
       
    68      * Two-phased constructor.
       
    69      */
       
    70     static CCCHConnMonHandler* NewL( CCCHServerBase& aServer );
       
    71 
       
    72     /**
       
    73      * Two-phased constructor.
       
    74      */
       
    75     static CCCHConnMonHandler* NewLC( CCCHServerBase& aServer );
       
    76 
       
    77     /**
       
    78      * Destructor.
       
    79      */
       
    80     virtual ~CCCHConnMonHandler();
       
    81 
       
    82 public: // New functions
       
    83 
       
    84     /**
       
    85      * Scan available networks
       
    86      * @since S60 3.2
       
    87      * @param aWlanScan ETrue if WLAN network scan needed
       
    88      */
       
    89     void ScanNetworks( TBool aWlanScan = EFalse );
       
    90 
       
    91     /**
       
    92      * Cancel network scanning
       
    93      * @since S60 3.2
       
    94      */
       
    95     void ScanNetworksCancel();
       
    96 
       
    97     /**
       
    98      * Is Snap available
       
    99      * @since S60 3.2
       
   100      * @param aSNAPId
       
   101      * @return ETrue if SNAP is available
       
   102      */
       
   103     TBool IsSNAPAvailable( TUint aSNAPId ) const;
       
   104 
       
   105     /**
       
   106      * Is IAP available
       
   107      * @since S60 3.2
       
   108      * @param aIapId
       
   109      * @return ETrue if IAP is available
       
   110      */
       
   111     TBool IsIapAvailable( TUint aIapId ) const;
       
   112 
       
   113 protected: // From base classes
       
   114 
       
   115     /**
       
   116      * From CActive
       
   117      * @since Series 60 3.0
       
   118      */
       
   119     void RunL();
       
   120 
       
   121     /**
       
   122      * From CActive
       
   123      * @since Series 60 3.0
       
   124      */
       
   125     void DoCancel();
       
   126 
       
   127 private: // From MConnectionMonitorObserver
       
   128 
       
   129     /**
       
   130      * @see MConnectionMonitorObserver, called when ConnMon event occured.
       
   131      */
       
   132     void EventL( const CConnMonEventBase &aConnMonEvent );
       
   133 
       
   134 private:
       
   135 
       
   136     /**
       
   137      * C++ default constructor.
       
   138      */
       
   139     CCCHConnMonHandler( CCCHServerBase& aServer );
       
   140 
       
   141     /**
       
   142      * By default Symbian 2nd phase constructor is private.
       
   143      */
       
   144     void ConstructL();
       
   145 
       
   146     /**
       
   147      * Get IAPs from Connection Monitor and performs network scan
       
   148      * @since S60 3.2
       
   149      * @param aBearerId Bearer specific connection id.
       
   150      */
       
   151     void GetIaps( TConnMonBearerId aBearerId );
       
   152 
       
   153     /**
       
   154      * Updates available IAP Array
       
   155      * @since S60 3.2
       
   156      * @param aIaps available IAPs
       
   157      */
       
   158     void UpdateIapArray( TConnMonIapInfo aIaps );
       
   159 
       
   160     /**
       
   161      * Get SNAPs from Connection Monitor
       
   162      * @since S60 3.2
       
   163      */
       
   164     void GetSNAPs();
       
   165 
       
   166     /**
       
   167      * Updates available SNAP array
       
   168      * @since S60 3.2
       
   169      * @param aSNAPs available SNAPs
       
   170      */
       
   171     void UpdateSnapArray( TConnMonSNAPInfo aSNAPs );
       
   172 
       
   173     /**
       
   174      * Request SNAP/IAP availability notifications from Connection Monitor.
       
   175      * @since S60 3.2
       
   176      */
       
   177     void NotifyL() ;
       
   178 
       
   179     /**
       
   180      * Stops notifications.
       
   181      * @since S60 3.2
       
   182      */
       
   183     void StopNotify();
       
   184 
       
   185 private: // data
       
   186 
       
   187     /**
       
   188      * State of active object
       
   189      */
       
   190     TCCHConnMonHandlerState         iState;
       
   191 
       
   192     /**
       
   193      * Handle to server
       
   194      */
       
   195     CCCHServerBase&                 iServer;
       
   196 
       
   197     /**
       
   198      * Connection Monitor
       
   199      */
       
   200     RConnectionMonitor              iConnMon;
       
   201 
       
   202     /**
       
   203      * Package buffer for getting available IAPs
       
   204      */
       
   205     TConnMonIapInfoBuf              iIapsBuf;
       
   206 
       
   207     /**
       
   208      * Package buffer for getting available SNAPs
       
   209      */
       
   210     TConnMonSNAPInfoBuf             iSNAPbuf;
       
   211 
       
   212     /**
       
   213      * SNAP array
       
   214      */
       
   215     RArray<TUint>                   iAvailableSNAPs;
       
   216 
       
   217     /**
       
   218      * IAP Array
       
   219      */
       
   220     RArray<TUint>                   iAvailableIAPs;
       
   221 
       
   222     };
       
   223 
       
   224 #endif // C_CCHCONNMONHANDLER_H
       
   225 
       
   226 // End of file