diff -r 63c982fb92f2 -r b73252188534 locationmanager/server/inc/clocationmanagerserver.h --- a/locationmanager/server/inc/clocationmanagerserver.h Thu Jul 15 19:07:24 2010 +0300 +++ b/locationmanager/server/inc/clocationmanagerserver.h Thu Aug 19 10:20:41 2010 +0300 @@ -24,6 +24,9 @@ #include #include #include +#ifdef LOC_REVERSEGEOCODE +#include +#endif //LOC_REVERSEGEOCODE #include "rlocationtrail.h" #include "rlocationobjectmanipulator.h" @@ -35,9 +38,13 @@ #include "mdequery.h" #include "mderelationquery.h" #include "locationmanagerdefs.h" - +#include "clocationservertimerhandler.h" class CMdESession; +class CLocationGeoTagTimerAO; +class CGeoTagger; +class REComSession; +class CNwRegistrationStatusHandler; // Total number of ranges const TUint KLocationManagerRangeCount = 1; @@ -85,7 +92,9 @@ public MMdESessionObserver, public MMdEQueryObserver, public MMdEObjectObserver, - public MGpxConversionObserver + public MGpxConversionObserver, + public MGeoTaggerObserver, + public MLocationServerTimerObserver { private: struct TMessageQuery @@ -259,30 +268,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& 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& 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 +441,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 +497,11 @@ * 2nd phase constructor. */ void ConstructL(); - + + /** + * Copies the location + * @param aQuery The query + */ void CopyLocationL( CMdEQuery& aQuery ); /** @@ -359,7 +510,10 @@ */ void CancelRequests(RArray& aMessagesList); - + /** + * cancels the list of copy requests + * @param aMessageList the list of query + */ void CancelCopyRequests(RArray& aMessageList); /** @@ -396,21 +550,49 @@ * @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(); - void CompleteNotifyRequest( TEventTypes aEventType, TInt aError ); + /** + * Stop the server (if possible) + */ + void StopServer(); private: /** @@ -466,7 +648,7 @@ * A timer to stop location trail. * Own. */ - CPeriodic* iTimer; + CLocationServerTimerHandler* iTimer; TBool iClientSwitch; TInt iSessionCount; @@ -478,12 +660,28 @@ 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; + + CLocationGeoTagTimerAO* iGeoTagTimer; + +#ifdef LOC_REVERSEGEOCODE + CGeoTagger* iGeoTaggingPendingReqObj; + RMessage2 iTagPendingMessage; + RMessage2 iGeoTaggingMessage; + REComSession* iEcomSession; +#endif //LOC_REVERSEGEOCODE };