locationmanager/server/inc/clocationmanagerserver.h
changeset 36 aa5a574040a4
parent 21 50bf9db68373
child 40 910a23996aa0
--- a/locationmanager/server/inc/clocationmanagerserver.h	Wed Jun 23 18:41:19 2010 +0300
+++ b/locationmanager/server/inc/clocationmanagerserver.h	Tue Jul 06 14:44:37 2010 +0300
@@ -24,6 +24,9 @@
 #include <centralrepository.h>
 #include <locationdatatype.h>
 #include <locationeventdef.h>
+#ifdef LOC_REVERSEGEOCODE
+#include <geotagger.h>
+#endif //LOC_REVERSEGEOCODE
 
 #include "rlocationtrail.h"
 #include "rlocationobjectmanipulator.h"
@@ -35,9 +38,15 @@
 #include "mdequery.h"
 #include "mderelationquery.h"
 #include "locationmanagerdefs.h"
-
+#include "clocationservertimerhandler.h"
 
 class CMdESession;
+#ifdef LOC_REVERSEGEOCODE
+class CLocationGeoTagTimerAO;
+#endif
+class CGeoTagger;
+class REComSession;
+class CNwRegistrationStatusHandler;
 
 // Total number of ranges
 const TUint KLocationManagerRangeCount = 1;
@@ -85,7 +94,9 @@
                                public MMdESessionObserver,
                                public MMdEQueryObserver,
                                public MMdEObjectObserver,
-                               public MGpxConversionObserver
+                               public MGpxConversionObserver,
+                               public MGeoTaggerObserver,
+                               public MLocationServerTimerObserver
     {
 private:
 	struct TMessageQuery
@@ -259,30 +270,122 @@
 	 * @return None.
 	 */ 
 	void RemoveLocationObjectL(TUint& aObjectId);
+
+	/**
+	  * Copies the location object
+	  * @param aSource source location object
+	  *	@param aTargets target location object
+	  * @param aQuery message query type
+
+	  */	
 	void CopyLocationObjectL( TItemId aSource, const RArray<TItemId>& aTargets, TMessageQuery& aQuery );
+
+	/**
+	  * Copies the location object
+	  * @param aSource The source location object
+	  *	@param aTargets target location object
+	  * @param aQuery message query type
+	  */
 	void CopyLocationObjectL( const TDesC& aSource, const RArray<TPtrC>& aTargets, TMessageQuery& aQuery );
-	
+
+	/**
+	  * checks if the session is ready
+	  * @return ETrue if Session is ready
+	  */	
 	TBool IsSessionReady();
-	
+
+	/**
+	  * Start track log
+	  *
+	  * @return The itemId
+	  */	
 	TItemId StartTrackLogL();
-	
+
+	/** 
+	  * Stop track log
+	  *
+	  */	
 	void StopTrackLogL();
-	
+
+	/**
+	  * IsTrackLogRecording
+	  *
+	  * @param aRec
+	  */	
 	void IsTrackLogRecording( TBool &aRec );
 	
+	/**
+	  * Retrieve track log status
+	  *
+	  * @param aRecording 
+	  * @param aFixQuality
+	  */
 	TInt GetTrackLogStatus( TBool& aRecording, TPositionSatelliteInfo& aFixQuality);
-	
+
+	/**
+	  * Delete track log
+	  *
+	  * @param aUri 
+	  */	
 	TInt DeleteTrackLogL(const TDesC& aUri);
-	
+
+	/**
+	  * Track log name
+	  *
+	  * @param aFileName name of file used to track log
+	  */	
 	TInt TrackLogName(TFileName& aFileName);
 	
+	/**
+	  * Gets the location trail capture settings
+	  * @param aCaptureSetting The location trail capture settings
+	  */	
 	void GetCaptureSetting( RLocationTrail::TTrailCaptureSetting& aCaptureSetting );
-	
+
+	/**
+	  * Adds an observer  for Gpx conversion
+	  * @param aObserver the observer for Gpx conversion
+	  */
 	void AddGpxObserver( MGpxConversionObserver* aObserver );
 	
+	/**
+	  * Copy location by Id
+	  * @param aMessage
+	  */	
 	void InitCopyLocationByIdL( const RMessage2& aMessage );
+	
+	/**
+	  * Copy Location by Uri
+	  * @param aMessage
+	  */
 	void InitCopyLocationByURIL( const RMessage2& aMessage );
 
+	/**
+	  * Handles tag pending request
+	  *
+	  * @param aMessage IPC message
+	  */	
+    void TagPendingRequestL( const RMessage2& aMessage );
+
+	/**
+	  * Cancels the tag pending request
+	  * @param aMessage IPC message
+	  */	
+    void CancelTagPendingRequest( const RMessage2& aMessage );
+
+	/**
+	  * Cancels the geotagging request
+	  * @param aMessage IPC message
+	  */
+	void CancelGeoTaggingRequest( const RMessage2& aMessage );
+
+
+	/**
+	  * Handle starts geotagging request
+	  * @param aMessage IPC message
+	  */
+    void StartGeoTaggingL( const RMessage2& aMessage );
+    
 public: // from MLocationTrailObserver.
     /**
      * Callback method to get notification about trail state change.
@@ -340,6 +443,52 @@
 	void GpxFileCreated( const TDesC& aFileName, TItemId aTagId, TReal32 aLength,
 			TTime aStart, TTime aEnd );
 
+protected:  //From MGeoTaggerObserver
+
+	/**
+	  * This method is called on completion of geotagging
+	  * and also completes start geotagging IPC message
+	  * @param aError The err code for geotagging if any
+	  */
+     void GeoTaggingCompleted( const TInt aError );   
+     /**
+      * This method is used for notifying completion of query for pending geo tags
+	  * @param aError The err code for geotagging if any           
+      */
+     void PendingGeoTagReqComplete( const TInt aError );
+
+    /*
+    * Get registrer network country code
+    *
+    * @return current register n/w info
+    */
+    RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw();
+
+
+    /*
+    * Get home network country code
+    * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse
+    * @return user home n/w info
+    */
+    const RMobilePhone::TMobilePhoneNetworkInfoV1& 
+        GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag);
+
+    
+    /*
+    * UE is registered to home network?
+    *
+    * @return ETrue if UE is registered at home network else EFalse
+    */
+    TBool IsRegisteredAtHomeNetwork();
+
+public: //MLocationServerTimerObserver
+    /**
+        * Timer call back
+        * @param aLocationServerTimerType timer type
+        * @param aErrorCode error code
+        */
+    void LocationServerTimerCallBackL
+        (const TLocationServerTimerType aLocationServerTimerType, const TInt aErrorCode);
 private:    
     /**
     * C++ constructor.
@@ -350,7 +499,11 @@
     * 2nd phase constructor.
     */
     void ConstructL();
-    
+
+	/**
+	  * Copies the location
+	  * @param aQuery The query
+	  */	
     void CopyLocationL( CMdEQuery& aQuery );
 
     /**
@@ -359,7 +512,10 @@
      */ 
     void CancelRequests(RArray<RMessage2>& aMessagesList);
     
-    
+    /**
+	  * cancels the list of copy requests
+	  * @param aMessageList  the list of query 
+	  */
     void CancelCopyRequests(RArray<TMessageQuery>& aMessageList);
     
     /**
@@ -396,22 +552,45 @@
      * @param aAny, a pointer to CLocationRecord object
      * @return Error code
      */
-    static TInt PositioningStopTimeout( TAny* aAny );
+   void PositioningStopTimeout();
     
     /**
      * Callback function to check if files were added to remapping queue with delay
      * @param aAny, a pointer to CLocationRecord object
      * @return Error code
      */
-    static TInt CheckForRemappingCallback( TAny* aAny );
+    void CheckForRemappingCallback();
+
     
     /**
      * Stops location trail and deletes the positioning stop timer.
      */
     void StopRecording();
-    
+
+	/**
+	  * Complete notify request
+	  *
+	  * @param aEventType, returns the event type
+	  * @param aError, return error type for this call.
+	  */	
     void CompleteNotifyRequest( TEventTypes aEventType, TInt aError );
 
+    /**
+      * Get supported TSY name
+      *@param aTsyName - buffer to store the supported tsy name
+      */  
+    void GetCommDbTSYnameL(TDes& aTsyName);
+
+    /**
+      * Initialize etel to access modem parameters
+      */  
+    void InitialisePhoneL();
+
+    /**
+      * Retrieve home network
+      */  
+    void RetrieveHomeNetwork();
+
 private:
     /**
      * A class for recording and storing locations.
@@ -466,7 +645,7 @@
      * A timer to stop location trail.
      * Own.
      */
-    CPeriodic* iTimer;
+    CLocationServerTimerHandler* iTimer;
     
     TBool iClientSwitch;    
     TInt iSessionCount;
@@ -478,12 +657,27 @@
     TInt iLocManStopRemapDelay;
     
     RLocationTrail::TTrailCaptureSetting iCaptureSetting;
-    TBool iRemoveLocation;   
+    TBool iRemoveLocation;    
     
     /**
      * A flag for state of waiting for position stop timeout.
      */
     TBool iWaitForPositioningStopTimeout;
+	RTelServer		iTelServer;
+	RMobilePhone	iPhone;	
+	TBool			iTelServerIsOpen;
+	TBool			iPhoneIsOpen;
+    CNwRegistrationStatusHandler *iNwRegistrationStatusHandler;
+    RMobilePhone::TMobilePhoneNetworkInfoV1 iHomeNetwork;
+    TBool iHomeNwInfoAvailableFlag;
+  
+#ifdef LOC_REVERSEGEOCODE
+    CLocationGeoTagTimerAO* iGeoTagTimer;
+    CGeoTagger* iGeoTaggingPendingReqObj;
+    RMessage2 iTagPendingMessage;
+    RMessage2 iGeoTaggingMessage;
+    REComSession* iEcomSession; 
+#endif //LOC_REVERSEGEOCODE
     };