location_plat/location_data_harvester_api/inc/maptilegeocoderplugin.h
changeset 17 0f22fb80ebba
child 20 cd10d5b85554
equal deleted inserted replaced
15:13ae750350c9 17:0f22fb80ebba
       
     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      * @param aLatitude latitude value. 
       
    46      */
       
    47     virtual void GetLatitude( TReal& aLatitude ) = 0;
       
    48     
       
    49     
       
    50     /**
       
    51 	 * Gets the longitude information.
       
    52 	 * 
       
    53 	 * @param aLongitude longitude value. 
       
    54 	 */
       
    55     virtual void GetLongitude( TReal& aLongitude ) = 0;
       
    56       
       
    57 };
       
    58 
       
    59 
       
    60 
       
    61 /**
       
    62  * TMapTileParam
       
    63  * Data class containing the information required for  fetching the map tile. 
       
    64  *
       
    65  */
       
    66 class TMapTileParam
       
    67 {
       
    68 
       
    69 public:
       
    70 
       
    71     /**
       
    72      * Parameterized constructor.
       
    73      *
       
    74      * @param aLatitude latitude value
       
    75      * @param aLongitude longitude value
       
    76      * @param aZoom  maptile zoom level
       
    77      * @param aSize requested maptile size
       
    78      *
       
    79      */
       
    80     TMapTileParam( const TReal aLatitude, const TReal aLongitude, const TInt aZoom, const TInt aSize ):
       
    81         iLattitude( aLatitude ), iLongitude( aLongitude ), iZoomLevel( aZoom ), iSize( aSize )
       
    82     {
       
    83     }
       
    84 		
       
    85     
       
    86     /**
       
    87      * Default constructor
       
    88      */
       
    89     TMapTileParam()
       
    90     {
       
    91     }
       
    92 	
       
    93 
       
    94 public:
       
    95 
       
    96     // Latitude
       
    97     TReal iLattitude;
       
    98     //Longitude
       
    99     TReal iLongitude;
       
   100     //Zoom level
       
   101     TInt iZoomLevel;
       
   102     //Required image size
       
   103     TInt iSize;
       
   104 };
       
   105 
       
   106 
       
   107 /**
       
   108  * TConnectionOption
       
   109  * Data class containing the connection options.
       
   110  *
       
   111  */
       
   112 enum TConnectionOption
       
   113 {
       
   114     //Interactive connection
       
   115     EInteractive = 0,
       
   116     //Silent connection
       
   117     ESilent
       
   118 };
       
   119 
       
   120 
       
   121 /**
       
   122  * Observer class which exposes callbacks to notify the completion of geocoding 
       
   123  * and maptile fetching events.
       
   124  *
       
   125  */
       
   126 class MMaptileGeocoderObserver
       
   127 {
       
   128 public:
       
   129 
       
   130     /**
       
   131      * Callback function which notifys the completion of geocoding service. 
       
   132      * This signals the completion of the asynchronous function 
       
   133      * CMaptileGeocoderPlugin::GetCoordinateByAddressL.
       
   134      * 
       
   135      *  @param aErrorcode Error status KErrNone in case of success or other system 
       
   136      *                    specific errorcodes in case of failures.
       
   137      *                       
       
   138      *  @param aAddressInfo refrence to the address stucture, through which user can 
       
   139      *                      access the coordinate information. 
       
   140      */
       
   141     virtual void GeocodingCompleted( TInt aErrorcode, MAddressInfo& aAddressInfo ) = 0;
       
   142 
       
   143 
       
   144 	
       
   145     /**
       
   146      * Callback function which notifys the completion of Maptile fetching event. 
       
   147      * This signals the completion of the asynchronous function 
       
   148      * CMaptileGeocoderPlugin::GetMapTileByGeoCode.
       
   149      * 
       
   150      * @param aErrorcode Error status KErrNone in case of success or other system 
       
   151      *                   specific errorcodes in case of failures.
       
   152      *						
       
   153      * @param aMapImagePath Maptile image path
       
   154      *					   
       
   155      */
       
   156     virtual void MapTileFetchingCompleted( TInt aErrorcode, const TDesC& aMapImagePath ) = 0;
       
   157 	
       
   158 };
       
   159 
       
   160 
       
   161 
       
   162 
       
   163 
       
   164 /**
       
   165  * CMaptileGeocoderPlugin
       
   166  *
       
   167  * An interface of the CMaptileGeocoderPlugin encapsulates the goecoding  and 
       
   168  * maptile fetching functionality. It acts as a base, for a concrete implementation 
       
   169  * class to provide all the functionality that a client requires from a 
       
   170  * CMaptileGeocoderPlugin implementation.
       
   171  *
       
   172  */
       
   173  
       
   174 class CMaptileGeocoderPlugin : public CBase
       
   175 {
       
   176 public:
       
   177 	
       
   178     /**
       
   179 	 * Create instance of CMaptileGeocoderPlugin concrete implementation. 
       
   180 	 * @return: Instance of this class.
       
   181 	 */
       
   182     static CMaptileGeocoderPlugin* NewL();
       
   183 
       
   184     /**
       
   185 	 * Destructor.
       
   186   	 */
       
   187     virtual ~CMaptileGeocoderPlugin();
       
   188 
       
   189 
       
   190 public:
       
   191 	
       
   192     /**
       
   193 	 * Initializes the ReverseGeoCodeObserver
       
   194 	 * @param: aObserver The observer class instance that is to be notified when 
       
   195 	 *         geocoding and maptile fetching service completes.
       
   196 	 * 
       
   197 	 */
       
   198     virtual void SetMaptileGeocoderObserver( MMaptileGeocoderObserver& aObserver ) = 0;
       
   199 	
       
   200     /**
       
   201      * Gets the geo-coordinate information for the given address. This is an 
       
   202      * asynchronous function whose completion will be notified by the 
       
   203      * MMaptileGeocoderObserver::GeocodingCompleted callback.
       
   204      * 
       
   205      * @param aLandmark Landmark containing the address informations.
       
   206      * @param aOption  OCC setting option
       
   207      *
       
   208      */
       
   209 	virtual void GetCoordinateByAddressL( const CPosLandmark& aLandmark,  
       
   210                        const TConnectionOption aOption = EInteractive ) = 0;
       
   211          
       
   212     /**
       
   213      * Gets the geo-coordinate information for the given address. This is an 
       
   214      * asynchronous function whose completion will be notified by the 
       
   215      * MMaptileGeocoderObserver::GeocodingCompleted callback.
       
   216      * 
       
   217      * @param aAddressDetails , containing the address informations.
       
   218      * @param aOption  OCC setting option
       
   219      *
       
   220      */                   
       
   221     virtual void GetCoordinateByAddressL( const TDesC& aAddressDetails,  
       
   222 	                       const TConnectionOption aOption = EInteractive ) = 0;
       
   223 	
       
   224     /**
       
   225      * Gets the maptile image path for the given geocordinates. This is an 
       
   226      * asynchronous function whose completion will be notified by the 
       
   227      * MMaptileGeocoderObserver::MapTileFetchingCompleted callback.
       
   228      * 
       
   229      * @param aMapTileParam Object containing the geocoordinate, zoom level 
       
   230      *        informations.
       
   231      * @param aFilePath  Path where the maptile image should  be stored.
       
   232      *
       
   233      */
       
   234     virtual void GetMapTileByGeoCodeL( TMapTileParam& aMapTileParam,
       
   235                                        const TDesC& aFilePath ) = 0;
       
   236 
       
   237 private:
       
   238 	
       
   239     /**
       
   240 	 * iDtorKey
       
   241 	 * Identification of the plugin on cleanup
       
   242  	 */
       
   243     TUid iDtorKey;
       
   244 };
       
   245 
       
   246 #include "maptilegeocoderplugin.inl"
       
   247 
       
   248 #endif //__MAPTILEGEOCODERPLUGIN_H__
       
   249 
       
   250 //End of file
       
   251