location_plat/location_data_harvester_api/inc/maptilegeocoderplugin.h
branchRCL_3
changeset 17 1fc85118c3ae
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
       
     1 /*
       
     2 * Copyright (c) 2010 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:	The header file for MaptileGeocoderPlugin that provides the Geocoding
       
    15 *               and Maptile  interfaces.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __MAPTILEGEOCODERPLUGIN_H__
       
    21 #define __MAPTILEGEOCODERPLUGIN_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <lbsposition.h> 
       
    26 #include <EPos_CPosLandmark.h>
       
    27 
       
    28 //Maptile geocoder plugin uid
       
    29 const TUid KMaptileGeoCoderPluginUid = { 0x2002E6BE };
       
    30 
       
    31 
       
    32 /**
       
    33  * Data class to get the address details. An handle to this type will be given to the
       
    34  * user through MMaptileGeocoderObserver::GeocodingCompleted callback, through which
       
    35  * user can retrieve the address details using the following interfaces.
       
    36  *
       
    37  */
       
    38 class MAddressInfo
       
    39 {
       
    40 public:
       
    41 	
       
    42     /**
       
    43      * Gets the latitude information.
       
    44      * 
       
    45      * @return aLatitude latitude value. 
       
    46      */
       
    47     virtual const TReal& GetLatitude( ) = 0;
       
    48     
       
    49     
       
    50     /**
       
    51 	 * Gets the longitude information.
       
    52 	 * 
       
    53 	 * @return aLongitude longitude value. 
       
    54 	 */
       
    55     virtual const TReal& GetLongitude( ) = 0;
       
    56     
       
    57     /*
       
    58      * Gets the reference to the country name. Scope of this returned reference is limited to
       
    59      * this perticular call. User has to store it for their further processing.
       
    60      * 
       
    61      *  @return reference to the String which holds the Country Name. 
       
    62      */
       
    63     virtual const TDesC& GetCountryName()= 0;
       
    64     
       
    65     /*
       
    66      * Gets the reference to the State. Scope of this returned reference is limited to
       
    67      * this perticular call. User has to store it for their further processing.
       
    68      * 
       
    69      *  @return reference to the String which holds the State name. 
       
    70      */
       
    71     virtual const TDesC& GetState()= 0;
       
    72     
       
    73     /*
       
    74      * Gets the reference to the City. Scope of this returned reference is limited to
       
    75      * this perticular call. User has to store it for their further processing.
       
    76      * 
       
    77      *  @return reference to the String which holds the City Name. 
       
    78      */
       
    79     virtual const TDesC& GetCity()= 0;
       
    80     
       
    81     /*
       
    82      * Gets the reference to the District name. Scope of this returned reference is limited to
       
    83      * this perticular call. User has to store it for their further processing.
       
    84      * 
       
    85      *  @return reference to the String which holds the District Name. 
       
    86      */
       
    87     virtual const TDesC& GetDistrict()= 0;
       
    88     
       
    89     /*
       
    90      * Gets the reference to the postal code. Scope of this returned reference is limited to
       
    91      * this perticular call. User has to store it for their further processing.
       
    92      * 
       
    93      *  @return reference to the String which holds the postal code. 
       
    94      */
       
    95     virtual  const TDesC& GetPincode()= 0;
       
    96     
       
    97     /*
       
    98      * Gets the reference to the thoroughfare name. Scope of this returned reference is limited to
       
    99      * this perticular call. User has to store it for their further processing.
       
   100      * 
       
   101      *  @return reference to the String which holds the thoroughfare name. 
       
   102      */
       
   103     virtual const TDesC& GetThoroughfareName()= 0;
       
   104     
       
   105     /*
       
   106      * Gets the reference to the thoroughfare number. Scope of this returned reference is limited to
       
   107      * this perticular call. User has to store it for their further processing.
       
   108      * 
       
   109      *  @return reference to the String which holds the thoroughfare number. 
       
   110      */
       
   111     virtual const TDesC& GetThoroughfareNumber() = 0;
       
   112          
       
   113 };
       
   114 
       
   115 
       
   116 
       
   117 /**
       
   118  * TMapTileParam
       
   119  * Data class containing the information required for  fetching the map tile. 
       
   120  *
       
   121  */
       
   122 class TMapTileParam
       
   123 {
       
   124 
       
   125 public:
       
   126 
       
   127     /**
       
   128      * Parameterized constructor.
       
   129      *
       
   130      * @param aLatitude latitude value
       
   131      * @param aLongitude longitude value
       
   132      * @param aZoom  maptile zoom level
       
   133      * @param aSize requested maptile size
       
   134      *
       
   135      */
       
   136     TMapTileParam( const TReal aLatitude, const TReal aLongitude, 
       
   137             const TInt aZoom, const TInt aWidth, const TInt aHeight ): iLattitude( aLatitude ),
       
   138             iLongitude( aLongitude ), iZoomLevel( aZoom ), iWidth( aWidth ), iHeight( aHeight )
       
   139     {
       
   140     }
       
   141 		
       
   142     
       
   143     /**
       
   144      * Default constructor
       
   145      */
       
   146     TMapTileParam()
       
   147     {
       
   148     }
       
   149 	
       
   150 
       
   151 public:
       
   152 
       
   153     // Latitude
       
   154     TReal iLattitude;
       
   155     //Longitude
       
   156     TReal iLongitude;
       
   157     //Zoom level
       
   158     TInt iZoomLevel;
       
   159     //Required image width
       
   160     TInt iWidth;
       
   161     //Required image height
       
   162     TInt iHeight;
       
   163 };
       
   164 
       
   165 
       
   166 /**
       
   167  * TConnectionOption
       
   168  * Data class containing the connection options.
       
   169  *
       
   170  */
       
   171 enum TConnectionOption
       
   172 {
       
   173     //Interactive connection
       
   174     EInteractive = 0,
       
   175     //Silent connection
       
   176     ESilent
       
   177 };
       
   178 
       
   179 
       
   180 /**
       
   181  * Observer class which exposes callbacks to notify the completion of geocoding 
       
   182  * and maptile fetching events.
       
   183  *
       
   184  */
       
   185 class MMaptileGeocoderObserver
       
   186 {
       
   187 public:
       
   188 
       
   189     /**
       
   190      * Callback function which notifys the completion of geocoding service. 
       
   191      * This signals the completion of the asynchronous function 
       
   192      * CMaptileGeocoderPlugin::GetCoordinateByAddressL.
       
   193      * 
       
   194      *  @param aErrorcode Error status KErrNone in case of success or other system 
       
   195      *                    specific errorcodes in case of failures.
       
   196      *                       
       
   197      *  @param aAddressInfo refrence to the address stucture, through which user can 
       
   198      *                      access the coordinate information. 
       
   199      */
       
   200     virtual void GeocodingCompleted( TInt aErrorcode, MAddressInfo& aAddressInfo ) = 0;
       
   201 
       
   202 
       
   203 	
       
   204     /**
       
   205      * Callback function which notifys the completion of Maptile fetching event. 
       
   206      * This signals the completion of the asynchronous function 
       
   207      * CMaptileGeocoderPlugin::GetMapTileByGeoCode.
       
   208      * 
       
   209      * @param aErrorcode Error status KErrNone in case of success or other system 
       
   210      *                   specific errorcodes in case of failures.
       
   211      *						
       
   212      * @param aMapImagePath Maptile image path
       
   213      *					   
       
   214      */
       
   215     virtual void MapTileFetchingCompleted( TInt aErrorcode, const TDesC& aMapImagePath ) = 0;
       
   216 	
       
   217 };
       
   218 
       
   219 
       
   220 
       
   221 
       
   222 
       
   223 /**
       
   224  * CMaptileGeocoderPlugin
       
   225  *
       
   226  * An interface of the CMaptileGeocoderPlugin encapsulates the goecoding  and 
       
   227  * maptile fetching functionality. It acts as a base, for a concrete implementation 
       
   228  * class to provide all the functionality that a client requires from a 
       
   229  * CMaptileGeocoderPlugin implementation.
       
   230  *
       
   231  */
       
   232  
       
   233 class CMaptileGeocoderPlugin : public CBase
       
   234 {
       
   235 public:
       
   236 	
       
   237     /**
       
   238 	 * Create instance of CMaptileGeocoderPlugin concrete implementation. 
       
   239 	 * @return: Instance of this class.
       
   240 	 */
       
   241     static CMaptileGeocoderPlugin* NewL();
       
   242 
       
   243     /**
       
   244 	 * Destructor.
       
   245   	 */
       
   246     virtual ~CMaptileGeocoderPlugin();
       
   247 
       
   248 
       
   249 public:
       
   250 	
       
   251     /**
       
   252 	 * Initializes the ReverseGeoCodeObserver
       
   253 	 * @param: aObserver The observer class instance that is to be notified when 
       
   254 	 *         geocoding and maptile fetching service completes.
       
   255 	 * 
       
   256 	 */
       
   257     virtual void SetMaptileGeocoderObserver( MMaptileGeocoderObserver& aObserver ) = 0;
       
   258 	
       
   259     /**
       
   260      * Gets the geo-coordinate information for the given address. This is an 
       
   261      * asynchronous function whose completion will be notified by the 
       
   262      * MMaptileGeocoderObserver::GeocodingCompleted callback.
       
   263      * 
       
   264      * @param aLandmark Landmark containing the address informations.
       
   265      * @param aOption  OCC setting option
       
   266      *
       
   267      */
       
   268 	virtual void GetCoordinateByAddressL( const CPosLandmark& aLandmark,  
       
   269                        const TConnectionOption aOption = EInteractive ) = 0;
       
   270          
       
   271     /**
       
   272      * Gets the geo-coordinate information for the given address. This is an 
       
   273      * asynchronous function whose completion will be notified by the 
       
   274      * MMaptileGeocoderObserver::GeocodingCompleted callback.
       
   275      * 
       
   276      * @param aAddressDetails , containing the address informations.
       
   277      * @param aOption  OCC setting option
       
   278      *
       
   279      */                   
       
   280     virtual void GetCoordinateByAddressL( const TDesC& aAddressDetails,  
       
   281 	                       const TConnectionOption aOption = EInteractive ) = 0;
       
   282 	
       
   283     /**
       
   284      * Gets the maptile image path for the given geocordinates. This is an 
       
   285      * asynchronous function whose completion will be notified by the 
       
   286      * MMaptileGeocoderObserver::MapTileFetchingCompleted callback.
       
   287      * 
       
   288      * @param aMapTileParam Object containing the geocoordinate, zoom level 
       
   289      *        informations.
       
   290      * @param aFilePath  Path where the maptile image should  be stored.
       
   291      *
       
   292      */
       
   293     virtual void GetMapTileByGeoCodeL( TMapTileParam& aMapTileParam,
       
   294                                        const TDesC& aFilePath ) = 0;
       
   295 
       
   296 private:
       
   297 	
       
   298     /**
       
   299 	 * iDtorKey
       
   300 	 * Identification of the plugin on cleanup
       
   301  	 */
       
   302     TUid iDtorKey;
       
   303 };
       
   304 
       
   305 #include "maptilegeocoderplugin.inl"
       
   306 
       
   307 #endif //__MAPTILEGEOCODERPLUGIN_H__
       
   308 
       
   309 //End of file
       
   310