locationmanager/geotagger/inc/cinternalgeotagger.h
changeset 45 a93990e5815e
parent 36 aa5a574040a4
child 56 fd6cce931a8a
equal deleted inserted replaced
36:aa5a574040a4 45:a93990e5815e
    22 #include <e32property.h>
    22 #include <e32property.h>
    23 #include <lbs.h>
    23 #include <lbs.h>
    24 #include <locationdatatype.h>
    24 #include <locationdatatype.h>
    25 #include <geotagger.h>
    25 #include <geotagger.h>
    26 
    26 
    27 #include "reversegeocode.h"
       
    28 #include "mdccommon.h"
    27 #include "mdccommon.h"
    29 #include "mdesession.h"
    28 #include "mdesession.h"
    30 #include "mdenamespacedef.h"
    29 #include "mdenamespacedef.h"
    31 #include "mdeobjectdef.h"
    30 #include "mdeobjectdef.h"
    32 #include "mdepropertydef.h"
    31 #include "mdepropertydef.h"
    33 #include "mderelation.h"
    32 #include "mderelation.h"
    34 #include "mdequery.h"
    33 #include "mdequery.h"
    35 #include "ctagcreator.h"
       
    36 
    34 
    37 #ifdef LOC_GEOTAGGING_CELLID
    35 #ifdef LOC_GEOTAGGING_CELLID
    38 #include "cgeoconverter.h"
    36 #include "cgeoconverter.h"
    39 #endif
    37 #endif
    40 
    38 
       
    39 #ifdef LOC_REVERSEGEOCODE
       
    40 #include "ctagcreator.h"
       
    41 #include "reversegeocode.h"
    41 class CReverseGeoCoderPlugin;
    42 class CReverseGeoCoderPlugin;
       
    43 #endif
       
    44 
    42 
    45 
    43 /**
    46 /**
    44  *  GeoTagger converts a given cell ID(CGI Info) to geo-coordinates.
    47  *  GeoTagger converts a given cell ID(CGI Info) to geo-coordinates.
    45  *  Does reverse geocoding to get country and city name.
    48  *  Does reverse geocoding to get country and city name.
    46  *  Creates country and city tag for image/video files.  
    49  *  Creates country and city tag for image/video files.  
    47  *  @since S60 9.2
    50  *  @since S60 9.2
    48  */
    51  */
    49  
    52  
    50 class CInternalGeoTagger : public CGeoTagger,
    53 class CInternalGeoTagger : public CGeoTagger,
    51                    public MMdESessionObserver,
    54                    public MMdESessionObserver,
    52                    public MMdEQueryObserver,
    55                    public MMdEQueryObserver
    53                    public MReverseGeocodeObserver
       
    54 #ifdef LOC_GEOTAGGING_CELLID	
    56 #ifdef LOC_GEOTAGGING_CELLID	
    55                    ,public MGeoConverterObserver
    57                    ,public MGeoConverterObserver
    56 #endif				   
    58 #endif				   
       
    59 #ifdef LOC_REVERSEGEOCODE
       
    60                    ,public MReverseGeocodeObserver
       
    61 #endif
    57     {
    62     {
    58 public:  
    63 public:  
    59     
    64     
    60     /**
    65     /**
    61      * 2-phased constructor.
    66      * 2-phased constructor.
   104       * @param aQuery the query type
   109       * @param aQuery the query type
   105       * @param aError  Error if any
   110       * @param aError  Error if any
   106       */    
   111       */    
   107       void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);
   112       void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);
   108     
   113     
       
   114 
       
   115 #ifdef LOC_REVERSEGEOCODE
       
   116     /**
       
   117        * Get location objects, where lat, long not populated.
       
   118       * @param  aCountryTagId The country tagId
       
   119       * @param aCityTagId  The city tagId
       
   120       */        
       
   121     void AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId );
       
   122 
       
   123     
   109     //MReverseGeocodeObserver
   124     //MReverseGeocodeObserver
   110 
       
   111     /**
   125     /**
   112       * This method is called when reverse geocoding is completed
   126       * This method is called when reverse geocoding is completed
   113       *@param  aErrorcode  Error if any
   127       *@param  aErrorcode  Error if any
   114       *@param aAddressInfo   the reverse geocoded address     
   128       *@param aAddressInfo   the reverse geocoded address     
   115       */
   129       */
   136     * @return user home n/w info
   150     * @return user home n/w info
   137     */
   151     */
   138     const RMobilePhone::TMobilePhoneNetworkInfoV1& 
   152     const RMobilePhone::TMobilePhoneNetworkInfoV1& 
   139         GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag);
   153         GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag);
   140     
   154     
       
   155 #endif //LOC_REVERSEGEOCODE
   141     
   156     
   142     // From MMdESessionObserver
   157     // From MMdESessionObserver
   143 
   158 
   144     /** 
   159     /** 
   145       * Handles session opening
   160       * Handles session opening
   153       *@param  aSession  A reference of the CMdESession
   168       *@param  aSession  A reference of the CMdESession
   154       *@param aError     error if any
   169       *@param aError     error if any
   155       */    
   170       */    
   156     void HandleSessionError(CMdESession& aSession, TInt aError);
   171     void HandleSessionError(CMdESession& aSession, TInt aError);
   157 
   172 
   158 #ifdef LOC_GEOTAGGING_CELLID	
   173 #ifdef LOC_GEOTAGGING_CELLID
   159 public:     // MGeoConverterObserver
   174 public:     // MGeoConverterObserver
   160         /**
   175         /**
   161          * This method is used for notifying completion of geotagging
   176          * This method is used for notifying completion of geotagging
   162          * @param aError error code
   177          * @param aError error code
   163          * @param aPosition position (lat/lon) for the correcponding n/w info
   178          * @param aPosition position (lat/lon) for the correcponding n/w info
   168 		/**
   183 		/**
   169 		* This method is used to handle the conversion error
   184 		* This method is used to handle the conversion error
   170 		* @param aError the error code
   185 		* @param aError the error code
   171 		*/
   186 		*/
   172 	 void HandleConversionError(TInt aError);
   187 	 void HandleConversionError(TInt aError);
   173 
   188         
   174 #endif    
   189 private:
       
   190        /**
       
   191        * Update media object with GPS info.
       
   192        */
       
   193     void UpdateGPSInfoL(const TLocality& aPosition);
       
   194     
       
   195 #endif //LOC_GEOTAGGING_CELLID
       
   196 
   175 private:    
   197 private:    
   176     
   198     
   177     /**
   199     /**
   178      * C++ constructor.
   200      * C++ constructor.
   179      * @param aMdeSession An instance of the CMdESession
   201      * @param aMdeSession An instance of the CMdESession
   202        * Get location objects, where lat, long not populated.
   224        * Get location objects, where lat, long not populated.
   203       */    
   225       */    
   204     void GetAllLocationsL( );
   226     void GetAllLocationsL( );
   205 
   227 
   206     /**
   228     /**
   207        * Get location objects, where lat, long not populated.
       
   208       * @param  aCountryTagId The country tagId
       
   209       * @param aCityTagId  The city tagId
       
   210       */        
       
   211     void AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId );
       
   212 
       
   213     /**
       
   214        * checks if the session is ready
   229        * checks if the session is ready
   215       * @return ETrue If the session is ready
   230       * @return ETrue If the session is ready
   216       */        
   231       */        
   217     TBool IsSessionReady();
   232     TBool IsSessionReady();
   218 
   233 
   265     
   280     
   266     TItemId iLocationId;
   281     TItemId iLocationId;
   267     
   282     
   268     TConnectionOption iConnectionOption;
   283     TConnectionOption iConnectionOption;
   269     
   284     
   270     CTagCreator* iTagCreator;
       
   271     
   285     
   272     /**
   286     /**
   273      * An active scheduler wait loop for waiting a session to MdE to open.
   287      * An active scheduler wait loop for waiting a session to MdE to open.
   274      */
   288      */
   275     CActiveSchedulerWait* iASW;
   289     CActiveSchedulerWait* iASW;
   276     TBool iMdeSessionOwnFlag;
   290     TBool iMdeSessionOwnFlag;
   277     TBool iTagPendingHandlerFlag;
   291     TBool iTagPendingHandlerFlag;
   278     CReverseGeoCoderPlugin* iRevGeocoderPlugin;
       
   279     TUid iDtorKey;
       
   280 #ifdef LOC_GEOTAGGING_CELLID	
   292 #ifdef LOC_GEOTAGGING_CELLID	
   281     /*
   293     /*
   282        * Geo converter
   294        * Geo converter
   283        */
   295        */
   284 	CGeoConverter* iGeoConverter;
   296 	CGeoConverter* iGeoConverter;
   285 #endif
   297 #endif
       
   298 #ifdef LOC_REVERSEGEOCODE
       
   299         CTagCreator* iTagCreator;
       
   300         CReverseGeoCoderPlugin* iRevGeocoderPlugin;
       
   301         TUid iDtorKey;
       
   302 #endif //LOC_REVERSEGEOCODE
   286     };
   303     };
   287 
   304 
   288 #endif // C_CGEOTAGGER_H 
   305 #endif // C_CGEOTAGGER_H 
   289 
   306 
   290 // End of file.
   307 // End of file.