nwnotifier/inc/nwregistrationstatusmonitor.h
branchRCL_3
changeset 20 987c9837762f
parent 3 a4a774cb6ea7
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2010 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: This file contains the header file of the NWRegistrationStatusMonitor class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NWREGISTRATION_STATUS_H
       
    19 #define NWREGISTRATION_STATUS_H
       
    20 
       
    21 //  SYSTEM INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <e32std.h>
       
    24 #include <etelmm.h>
       
    25 
       
    26 // INCLUDES
       
    27 #include "networknotifiernotewrapper.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33 *  Monitors network registration status change event
       
    34 *  from MMEtel
       
    35 */
       
    36 class CNWRegistrationStatusMonitor : public CActive, 
       
    37                                             MNoteWrapperObserver
       
    38     {
       
    39     public:  // Constructors and destructor
       
    40         
       
    41         /**
       
    42         * Two-phased constructor.
       
    43         */
       
    44         static CNWRegistrationStatusMonitor* NewL();
       
    45 
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49         virtual ~CNWRegistrationStatusMonitor();
       
    50         
       
    51     
       
    52     protected:  // Functions from CActive
       
    53 
       
    54         /**
       
    55         * Cancels asyncronous request(s).
       
    56         * 
       
    57         */
       
    58         void DoCancel();
       
    59 
       
    60         /**
       
    61         * Informs object that asyncronous request is ready.
       
    62         * 
       
    63         */
       
    64         void RunL();
       
    65         
       
    66         /**
       
    67          * From CActive, RunError.
       
    68          * Processes any errors.
       
    69          * @param aError The leave code reported.
       
    70          * @result return KErrNone if leave is handled.
       
    71          */
       
    72          TInt RunError( TInt aError );
       
    73 
       
    74     private:
       
    75    
       
    76         /**
       
    77         * C++ default constructor.
       
    78         * 
       
    79         */
       
    80         CNWRegistrationStatusMonitor(); 
       
    81                      
       
    82         /**
       
    83         * Second-phase constructor.
       
    84         * 
       
    85         */
       
    86         void ConstructL();  
       
    87         
       
    88         /**
       
    89         * Issues a request to ETel to provide NW registration 
       
    90         * status information.
       
    91         * 
       
    92         */
       
    93         void IssueRequest();
       
    94 
       
    95         /**
       
    96         * Maps network registration status errors to resource ids.
       
    97         * 
       
    98         */
       
    99         void ParseErrCode();
       
   100         
       
   101         // from MNoteWrapperObserver
       
   102         void PopupNoteClosed();
       
   103        
       
   104         /**
       
   105         * Open the connection to RMobilePhone
       
   106         * 
       
   107         */
       
   108         void OpenConnectionL();
       
   109         
       
   110         /**
       
   111         * Closes the connection to RMobilePhone
       
   112         * 
       
   113         */
       
   114         void CloseConnection();
       
   115         
       
   116         
       
   117     private: // Data
       
   118         
       
   119         // Current registration status info.
       
   120         RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus;
       
   121         
       
   122         // Handle to RMobilePhone
       
   123         RMobilePhone iPhone;
       
   124   
       
   125         // Handle to Telephony server
       
   126         RTelServer iTelServer;
       
   127         
       
   128         // Parsed res id#
       
   129         TInt iResID;
       
   130         
       
   131         // Note wrapper
       
   132         CNetworkNotifierNoteWrapper* iNoteWrapper;
       
   133    };
       
   134 #endif      // NWREGISTRATION_STATUS_H
       
   135             
       
   136 // End of File
       
   137