datasourcemodules/locationapesuplpsy/inc/suplpsycellidhandler.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Definition of CSuplPsyCellIdHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SUPLPSYCELLIDHANDLER_H
       
    19 #define SUPLPSYCELLIDHANDLER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32def.h>
       
    23 #include <e32base.h>
       
    24 #include <etelmm.h>
       
    25 
       
    26 #include "suplpsycellidinfo.h"
       
    27 
       
    28 /**
       
    29 *  Observer class for listening to Etel Events
       
    30 *  @lib nlacidsuplpsy.lib
       
    31 *  @since S60 v3.1
       
    32 */
       
    33 
       
    34 class MBasicCellIDListener
       
    35 	{
       
    36 	public:
       
    37 		// Cell Id Information & Error while completing request
       
    38 		virtual void BasicCellIDRequestCompletedL(TInt aErrorCode) = 0;
       
    39 
       
    40 	};
       
    41 
       
    42 /**
       
    43 *  Class for getting the Cell Id information	
       
    44 *  @lib nlacidsuplpsy.lib
       
    45 *  @since S60 v3.1
       
    46 */
       
    47 
       
    48 class CSuplPsyCellIdHandler : public CActive
       
    49     {
       
    50    
       
    51     public: 
       
    52     
       
    53         enum TNetworkTypeInfo
       
    54 			{
       
    55 			EGSM = 0,			
       
    56 			EWCDMA,
       
    57 			EUnknown
       
    58 			};
       
    59     
       
    60     public:  
       
    61         
       
    62    	   /**
       
    63         * Performs construction of an object
       
    64         * @since S60  v3.1
       
    65         * @param None
       
    66         * @return None
       
    67         */
       
    68    		static CSuplPsyCellIdHandler* NewL(MBasicCellIDListener& aObserver);
       
    69    		
       
    70         /**
       
    71         * Performs destructor
       
    72         * @since S60  v3.1
       
    73         * @param None
       
    74         * @return None
       
    75         */
       
    76         ~CSuplPsyCellIdHandler();
       
    77         
       
    78         /**
       
    79         * Retrieves cell id information
       
    80         * @since S60  v3.1
       
    81         * @param None
       
    82         * @return None
       
    83         */        
       
    84         void GetCellID( TCellIdInfo& aCellIdInfo );
       
    85         
       
    86        /**
       
    87         * Returns type of network
       
    88         * @since S60  v3.1
       
    89         * @param None
       
    90         * @return Network type
       
    91         */        
       
    92         TNetworkTypeInfo NetworkType() const;
       
    93         
       
    94      private:
       
    95      
       
    96        /**
       
    97         * Handles the cell id information
       
    98         * @since S60  v3.1
       
    99         * @param None
       
   100         * @return None
       
   101         */        
       
   102      	void HandleCellInfoL();
       
   103      	
       
   104      	 /**
       
   105         * Reads cell ID stored in Central Repository
       
   106         * @since S60  v3.1
       
   107         * @param None
       
   108         * @return None
       
   109         */        
       
   110      	void ReadCurrentCellIdFromCRL();
       
   111 
       
   112      	 /**
       
   113         * Save Current cell ID in Central Repository
       
   114         * @since S60  v3.1
       
   115         * @param None
       
   116         * @return None
       
   117         */        
       
   118      	void SaveCurrentCellIdToCRL();     	
       
   119      	
       
   120      private:
       
   121      
       
   122        /**
       
   123         * Performs construction of an object
       
   124         * @since S60  v3.1
       
   125         * @param aObserver, MBasicCellIDChecker observer for request completion.
       
   126         * @return None
       
   127         */
       
   128         CSuplPsyCellIdHandler(MBasicCellIDListener& aObserver);
       
   129 
       
   130      	/**
       
   131         * Performs Second phase constrcution
       
   132         * @since S60  v3.1
       
   133         * @param None
       
   134         * @return None
       
   135         */
       
   136         void ConstructL();
       
   137 
       
   138 		/**
       
   139 		* ConnectToETelL, Connects to Telephony server & RMobilePhone
       
   140 		* @since S60 v3.1u     
       
   141 		* @param      None, 
       
   142 		* @return     TInt, returns system wide error code
       
   143 		*/
       
   144 		TInt  ConnectToETelL();
       
   145 
       
   146     protected:  // CActive        
       
   147     	 /**
       
   148         * Performs cancelling of asynchronour request
       
   149         * @since S60  v3.1
       
   150         * @param None
       
   151         * @return None
       
   152         */ 
       
   153         void DoCancel();
       
   154 
       
   155         /**
       
   156         * Performs RunL
       
   157         * @since S60  v3.1
       
   158         * @param None
       
   159         * @return None
       
   160         */ 
       
   161         void RunL();  
       
   162         
       
   163         /**
       
   164         * Performs RunError
       
   165         * @since S60  v3.1
       
   166         * @param aError, Error code containing leave reason
       
   167         * @return TInt , informs to activescheduler about handling of leave.
       
   168         */ 
       
   169         TInt RunError(TInt aError);  
       
   170         
       
   171        
       
   172     private:    // Data
       
   173   
       
   174       	//For access to a mobile phone
       
   175         RMobilePhone iPhone; 
       
   176         
       
   177         // Etel Server
       
   178 		RTelServer iTelServer;
       
   179 		
       
   180 		//TSYName
       
   181 		TFileName iTsyName; 
       
   182         
       
   183         // For Network information 
       
   184         RMobilePhone::TMobilePhoneNetworkInfoV1 	iNetworkInfo;
       
   185         
       
   186         //for network information
       
   187         RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iNetworkInfoPkg;
       
   188         
       
   189      	 // For location information
       
   190         RMobilePhone::TMobilePhoneLocationAreaV1 iLocationInfo;
       
   191 
       
   192         //Observer for request completion
       
   193         MBasicCellIDListener& iObserver;
       
   194 
       
   195 		TNetworkTypeInfo iNetworkType;
       
   196 						
       
   197 		TBool iIsInitilized;
       
   198 		
       
   199 		TCellIdInfo* iCellIdInfo;
       
   200     };
       
   201 
       
   202 #endif      // SUPLPSYCELLIDHANDLER_H
       
   203             
       
   204 // End of File