pnpmobileservices/pnpms/OnlineSupport/inc/CCMRegistrationMonitor.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2003-2006 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:  Header file for the registeration monitor class, This class is 
       
    15 *                is used to monitor the registeration status between the phone 
       
    16 *                and network.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef CCMREGISTRATIONMONITOR_H
       
    23 #define CCMREGISTRATIONMONITOR_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 #include <etelmm.h>
       
    28 
       
    29 // CONSTANTS
       
    30 //None
       
    31 
       
    32 // MACROS
       
    33 // None
       
    34 
       
    35 // DATA TYPES
       
    36 // None
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 // None
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class MCMRegisterationStatusNotifier;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 *  CCMRegistrationMonitor.
       
    48 *  Monitors the registeration status of the phone
       
    49 *
       
    50 *  @lib Confmanager.app
       
    51 *  @since 2.0
       
    52 */
       
    53 class CCMRegistrationMonitor : public CActive
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56         /**
       
    57         * Registeration status.
       
    58         */
       
    59         enum TNetworkStatus 
       
    60             {
       
    61             EStatusUnknown = 0,
       
    62             EHomenetwork,
       
    63             ERoaming,
       
    64             ERequestCancelled
       
    65             };
       
    66 
       
    67         enum TMonitoringStatus
       
    68             {
       
    69             EInactive = 0,
       
    70             ERequestingNetworkStatus,
       
    71             EWaitingForChangesInNetworkStatus,
       
    72             ERequestingServiceProviderName,
       
    73             ERequestingHomeNetworkInfo,
       
    74             ERequestingCurrentNetworkInfo,
       
    75             ERequestingOwnNumberInfo,
       
    76             ERequestingPhoneIdentity,
       
    77             ERequestingIMSI,
       
    78             EDone
       
    79             };
       
    80 
       
    81         /**
       
    82         * Two-phased constructor.
       
    83         */
       
    84         static CCMRegistrationMonitor* NewL( MCMRegisterationStatusNotifier& aNotifier );
       
    85         
       
    86         /**
       
    87         * Destructor.
       
    88         */
       
    89         ~CCMRegistrationMonitor();
       
    90 
       
    91     public: // New functions
       
    92             
       
    93 
       
    94         /**
       
    95         * StartMonitoring.
       
    96         * @since 2.0
       
    97         * @return void
       
    98         */
       
    99         void StartMonitoring( );
       
   100         
       
   101         /**
       
   102         * StopMonitoring.
       
   103         * @since 2.0
       
   104         * @return void
       
   105         */
       
   106         void StopMonitoring( );
       
   107 
       
   108     public: // Functions from base classes
       
   109         
       
   110     protected:  // New functions
       
   111 
       
   112     protected:  // Functions from base classes
       
   113 
       
   114     private: // Functions from base classes
       
   115         
       
   116         /**
       
   117         * From CActive Handles an active object’s request completion event.
       
   118         * @since 2.0
       
   119         * @return void
       
   120         */
       
   121         void RunL();
       
   122         
       
   123         /**
       
   124         * From CActive Cancels any outstanding request.
       
   125         * @since 2.0
       
   126         * @return void
       
   127         */
       
   128         void DoCancel();
       
   129 
       
   130         /**
       
   131         * From CActive Handles a leave occurring in the request completion event handler RunL().
       
   132         */
       
   133         TInt RunError( TInt aError );
       
   134     private:
       
   135 
       
   136         /**
       
   137         * C++ default constructor.
       
   138         */
       
   139         CCMRegistrationMonitor( MCMRegisterationStatusNotifier& aNotifier );
       
   140 
       
   141         /**
       
   142         * By default Symbian 2nd phase constructor is private.
       
   143         */
       
   144         void ConstructL();
       
   145     
       
   146     public:     // Data
       
   147         TBool IsReady(){ return iMonitoringStatus == EDone; };
       
   148         RMobilePhone::TMobilePhoneNetworkInfoV1 GetHomeNetworkInfo(){ return iHomeNetworkInfo; };
       
   149         RMobilePhone::TMobilePhoneNetworkInfoV1 GetCurrentNetworkInfo(){ return iCurrentNetworkInfo; };
       
   150         RMobileONStore::TMobileONEntryV1 GetOwnNumberInfo(){ return iOwnNumberInfo; };
       
   151         RMobilePhone::TMobilePhoneSubscriberId GetImsi(){ return iIMSI; };
       
   152         RMobilePhone::TMobilePhoneServiceProviderNameV2 GetServiceProviderName(){ return iServiceProviderName; };
       
   153         RMobilePhone::TMobilePhoneIdentityV1 GetPhoneIdentity(){ return iPhoneIdentity; };
       
   154     protected:  // Data        
       
   155 
       
   156     private:    // Data
       
   157         TMonitoringStatus iMonitoringStatus;
       
   158         MCMRegisterationStatusNotifier& iNotifier;
       
   159 
       
   160         // Telephony Server
       
   161         RTelServer iServer;
       
   162         // Phone Object
       
   163         RMobilePhone iPhone;
       
   164         // Network registeration status
       
   165         RMobilePhone::TMobilePhoneRegistrationStatus iRegisterationStatus;
       
   166         // Phone info object
       
   167         RTelServer::TPhoneInfo iPhoneInfo;
       
   168         // Time when the monitor is started
       
   169         TTime iStartTime;
       
   170         // Current network info packaged
       
   171         RMobilePhone::TMobilePhoneNetworkInfoV1 iCurrentNetworkInfo;
       
   172         RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iCurrentNetworkInfoPckg;
       
   173         // Home network info packaged
       
   174         RMobilePhone::TMobilePhoneNetworkInfoV1 iHomeNetworkInfo;
       
   175         RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iHomeNetworkInfoPckg;
       
   176         RMobileONStore iONStore;
       
   177         // Own number 
       
   178         RMobileONStore::TMobileONEntryV1 iOwnNumberInfo;
       
   179         RMobileONStore::TMobileONEntryV1Pckg iOwnNumberInfoPckg;
       
   180         // IMSI
       
   181         RMobilePhone::TMobilePhoneSubscriberId iIMSI;
       
   182         // sp name
       
   183         RMobilePhone::TMobilePhoneServiceProviderNameV2 iServiceProviderName;
       
   184         RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg iServiceProviderNamePckg;
       
   185 
       
   186         // to get IMEI
       
   187         RMobilePhone::TMobilePhoneIdentityV1 iPhoneIdentity;
       
   188 
       
   189     public:     // Friend classes
       
   190         
       
   191     protected:  // Friend classes
       
   192         
       
   193     private:    // Friend classes
       
   194 
       
   195     };
       
   196 
       
   197 #endif      // CCMREGISTRATIONMONITOR_H   
       
   198             
       
   199 // End of File