supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_comasupletelnotifier.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     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:   class for receiving network change event 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef EPOS_COMASUPLETELNOTIFIER_H
       
    20 #define EPOS_COMASUPLETELNOTIFIER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32def.h>
       
    24 #include <e32base.h>
       
    25 #include <etelmm.h>
       
    26 
       
    27 //Forward declaration
       
    28 class COMASuplLocationId;
       
    29 class RMobilePhone;
       
    30 class COMASuplTrace;
       
    31 
       
    32 /**
       
    33 *  Observer class for listening to Etel Events
       
    34 *  @lib eposomasuplprotocolhandler.lib
       
    35 *  @since S60 v3.1u
       
    36 */
       
    37 
       
    38 class MOMASuplETelNotifierObserver
       
    39 	{
       
    40 	public:
       
    41 		// ETel Notifier invoked for current network change 
       
    42 		virtual void HandleCurrentNetworkChangeL(TInt aErrorCode, TBool aHomeNw) = 0;
       
    43 
       
    44 		virtual void HandleRoamingCheckCompleteL(TInt aErrorCode, TBool aHomeNw) = 0;
       
    45 	};
       
    46 
       
    47 /**
       
    48 *  Class for getting the network change info 
       
    49 *  @lib eposomasuplprotocolhandler.lib
       
    50 *  @since S60 v3.2
       
    51 */
       
    52 
       
    53 class COMASuplETelNotifier : public CActive
       
    54     {
       
    55     public:            
       
    56 		enum TCellReqType
       
    57 			{
       
    58 				EOMASuplNone = 0,			
       
    59 				EOMASuplCellIdHome,			
       
    60 				EOMASuplCellIdCurrent,
       
    61                 EOMASuplCellIdNotify
       
    62 			};   
       
    63     public:  // Constructors and destructor
       
    64         
       
    65    		 /**
       
    66         * Performs construction of an object
       
    67         * @since S60  v3.1u
       
    68         * @param None
       
    69         * @return None
       
    70         */
       
    71    		static COMASuplETelNotifier* NewL(MOMASuplETelNotifierObserver& aObserver,RMobilePhone& aPhone);
       
    72    		
       
    73         /**
       
    74         * Performs destructor
       
    75         * @since S60  v3.1u
       
    76         * @param None
       
    77         * @return None
       
    78         */
       
    79         ~COMASuplETelNotifier();
       
    80         
       
    81         /**
       
    82         * Checks whether the terminal is in the roming mode or not 
       
    83         * @since S60  v3.2
       
    84         * @param None
       
    85         * @return None
       
    86         */        
       
    87         void CheckForRoaming();
       
    88 
       
    89         void GetCurrentNetwork();
       
    90 
       
    91         void NotifyCurrentNetworkChange();
       
    92         
       
    93         
       
    94      private:
       
    95      
       
    96         void CompareForRoamingL();
       
    97 
       
    98         void CompeteRoamingCheckL();
       
    99      	
       
   100      private:
       
   101      
       
   102        /**
       
   103         * Performs construction of an object
       
   104         * @since S60  v3.1u
       
   105         * @param aObserver, MOMASuplETelNotifierObserver observer for request completion.
       
   106         * @param aPhone,RMobilePhone 
       
   107         * @return None
       
   108         */
       
   109         COMASuplETelNotifier(MOMASuplETelNotifierObserver& aObserver,RMobilePhone& aPhone);
       
   110 
       
   111      	/**
       
   112         * Performs Second phase constrcution
       
   113         * @since S60  v3.1u
       
   114         * @param None
       
   115         * @return None
       
   116         */
       
   117         void ConstructL();
       
   118 
       
   119     protected:  // CActive        
       
   120     	 /**
       
   121         * Performs cancelling of asynchronour request
       
   122         * @since S60  v3.1u
       
   123         * @param None
       
   124         * @return None
       
   125         */ 
       
   126         void DoCancel();
       
   127 
       
   128         /**
       
   129         * Performs RunL
       
   130         * @since S60  v3.1u
       
   131         * @param None
       
   132         * @return None
       
   133         */ 
       
   134         void RunL();  
       
   135         
       
   136         /**
       
   137         * Performs RunError
       
   138         * @since S60  v3.1u
       
   139         * @param aError, Error code containing leave reason
       
   140         * @return TInt , informs to activescheduler about handling of leave.
       
   141         */ 
       
   142         TInt RunError(TInt aError);  
       
   143         
       
   144     private:    // Data
       
   145   
       
   146       	//For access to a mobile phone
       
   147         RMobilePhone& iPhone; 
       
   148         
       
   149         // For Network information 
       
   150         RMobilePhone::TMobilePhoneNetworkInfoV1 iNetworkInfo;
       
   151         
       
   152         //for network information
       
   153         RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iNetworkInfoPkg;
       
   154         
       
   155      	 // For location information
       
   156         RMobilePhone::TMobilePhoneLocationAreaV1 iLocationInfo;
       
   157 
       
   158         // For Network information 
       
   159         RMobilePhone::TMobilePhoneNetworkInfoV1 iHomeNetworkInfo;
       
   160         
       
   161         //for network information
       
   162         RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iHomeNetworkInfoPkg;
       
   163         
       
   164      	 // For location information
       
   165         RMobilePhone::TMobilePhoneLocationAreaV1 iHomeLocationInfo;
       
   166 
       
   167 		//Trace Utility
       
   168 		COMASuplTrace* iTrace;
       
   169 		
       
   170         //Observer for request completion
       
   171         MOMASuplETelNotifierObserver& iObserver;
       
   172 
       
   173 		// For type of request... home or current 
       
   174 		TCellReqType iCellMode;
       
   175     };
       
   176 
       
   177 #endif      // EPOS_COMASUPLETELNOTIFIER_H
       
   178             
       
   179 // End of File