locationdataharvester/mylocationsengine/inc/maptileinterface.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: Maptile interface header implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MAPTILEINTERFACE_H__
       
    19 #define __MAPTIlEINTERFACE_H__
       
    20 
       
    21 #include <e32std.h> 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include <maptilegeocoderplugin.h>
       
    25 
       
    26 
       
    27  
       
    28 /**
       
    29  * MMapTileObserver class.
       
    30  * Observer class for notifying the maptile related events 
       
    31  *
       
    32  */
       
    33 class MMapTileObserver
       
    34     {
       
    35 public:   
       
    36     
       
    37    /** Informs once maptile is retrived from the REST server
       
    38     * 
       
    39     * @param[in] aErrCode Error code
       
    40     * @param[in] aMapTilePath Path where the maptile image staroed
       
    41     * 
       
    42     */    
       
    43     virtual void MapTilefetchingCompleted( TInt aErrCode,const TDesC& aMapTilePath ) = 0;
       
    44     
       
    45     /** Informs once geocoding completed 
       
    46      * 
       
    47      * @param[in] aLatitude converted latitude value
       
    48      * @param[in] aLongitude converted longitude value
       
    49      * 
       
    50      */       
       
    51     virtual void RestGeoCodeCompleted( TReal aLatitude,TReal aLongitude ) = 0;
       
    52     
       
    53     };
       
    54 
       
    55 
       
    56 
       
    57 /** 
       
    58  * Class used for interacting with maptile and geocoder components .
       
    59  * This class raises the request for geocoding service and maptile
       
    60  * fetching service.
       
    61  */
       
    62 class CMapTileInterface : public CBase, MMaptileGeocoderObserver
       
    63 {
       
    64 public:
       
    65 
       
    66    /**
       
    67     * Factory method
       
    68     */
       
    69     static CMapTileInterface* NewL(); 
       
    70     
       
    71     /**
       
    72      * Interface for requesting maptile image for a landmark object
       
    73      * 
       
    74      * @param[in] aLandmark Landmark containing address details
       
    75      * @param[in] aFilePath Path where the maptile image to be stored
       
    76      * @param[in] aObserver Observer for callback notification
       
    77      */
       
    78     void GetMapTileImageL(  CPosLandmark*  aLandmark , 
       
    79             const TDesC& aFilePath,   MMapTileObserver* aObserver  );
       
    80     
       
    81     /**
       
    82      * Interface for requesting maptile image for a landmark object
       
    83      * 
       
    84      * @param[in] aAddressDetails containing address details
       
    85      * @param[in] aFilePath Path where the maptile image to be stored
       
    86      * @param[in] aObserver Observer for callback notification
       
    87      */
       
    88     void GetMapTileImageL(const TDesC& aAddressDetails,
       
    89             const TDesC& aFilePath, MMapTileObserver* aObserver);
       
    90     
       
    91     /**
       
    92      * Constructor
       
    93      */
       
    94     CMapTileInterface();
       
    95     
       
    96     /**
       
    97      * Destructor
       
    98      */
       
    99     ~CMapTileInterface();
       
   100 
       
   101 private:
       
   102 
       
   103     /**
       
   104      * Function for Retrieving latitude & longitude information
       
   105      * 
       
   106      * @param[in] aLatitude latitude value
       
   107      * @param[in] aLongitude Longitude value
       
   108      */
       
   109 	void GetMapTileL( TReal aLatitude, TReal aLongitude	);
       
   110     
       
   111 protected: 
       
   112 	
       
   113     /**
       
   114      * Derived from MMaptileGeocoderObserver
       
   115      */
       
   116     void GeocodingCompleted( TInt aErrorcode, MAddressInfo& aAddressInfo );
       
   117     
       
   118     /**
       
   119      * Derived from MMaptileGeocoderObserver
       
   120      */
       
   121     void MapTileFetchingCompleted( TInt aErrorcode, const TDesC& aMapImagePath );
       
   122     
       
   123 private:
       
   124     
       
   125     /**
       
   126      * Two phase construction
       
   127      */
       
   128     void ConstructL();
       
   129     
       
   130 private:
       
   131 	
       
   132     //MaptileGeocode plugin interface instance
       
   133     CMaptileGeocoderPlugin* iMaptileGeocoder;
       
   134     //Flag to check street availability
       
   135     TBool iStreetAvailable;
       
   136     //Maptile image path
       
   137 	HBufC* iFilePath;
       
   138 	//Maptile observer
       
   139 	MMapTileObserver* iObserver ;
       
   140 
       
   141     };
       
   142 #endif // MAPTILEINTERFACE_H
       
   143