mds_plat/location_manager_api/inc/reversegeocoderplugin.h
changeset 56 fd6cce931a8a
equal deleted inserted replaced
52:40db28bb26b8 56:fd6cce931a8a
       
     1 /*
       
     2 * Copyright (c) 2009 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 ReverseGeoCoderPlugin that creates the ReverseGeocoder
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __REVERSEGEOCODERPLUGIN_H__
       
    20 #define __REVERSEGEOCODERPLUGIN_H__
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h> 
       
    25 #include <lbsposition.h> 
       
    26 #include <etel.h>
       
    27 #include <etelmm.h>
       
    28 #include <geotagobserver.h>
       
    29 
       
    30 const TUid KReversegeocodeInterfaceUid = {0x2002DD13};
       
    31 
       
    32 
       
    33 /*
       
    34  * Data class to get the address details. An handle to this type will be given to the
       
    35  * user through MReverseGeocodeObserver::ReverseGeocodeComplete callback, through which
       
    36  * user can retrieve the address details using the following interfaces.
       
    37  *
       
    38  **/
       
    39 class MAddressInfo
       
    40     {
       
    41     public:
       
    42     /*
       
    43      * Gets the reference to the country name. Scope of this returned reference is limited to
       
    44      * this perticular call. User has to store it for their further processing.
       
    45      * 
       
    46      *  @return reference to the String which holds the Country Name. 
       
    47      */
       
    48     virtual TDesC& GetCountryName()= 0;
       
    49     
       
    50     /*
       
    51      * Gets the reference to the State. Scope of this returned reference is limited to
       
    52      * this perticular call. User has to store it for their further processing.
       
    53      * 
       
    54      *  @return reference to the String which holds the State name. 
       
    55      */
       
    56     virtual TDesC& GetState()= 0;
       
    57     
       
    58     /*
       
    59      * Gets the reference to the City. Scope of this returned reference is limited to
       
    60      * this perticular call. User has to store it for their further processing.
       
    61      * 
       
    62      *  @return reference to the String which holds the City Name. 
       
    63      */
       
    64     virtual TDesC& GetCity()= 0;
       
    65     
       
    66     /*
       
    67      * Gets the reference to the District name. Scope of this returned reference is limited to
       
    68      * this perticular call. User has to store it for their further processing.
       
    69      * 
       
    70      *  @return reference to the String which holds the District Name. 
       
    71      */
       
    72     virtual TDesC& GetDistrict()= 0;
       
    73     
       
    74     /*
       
    75      * Gets the reference to the postal code. Scope of this returned reference is limited to
       
    76      * this perticular call. User has to store it for their further processing.
       
    77      * 
       
    78      *  @return reference to the String which holds the postal code. 
       
    79      */
       
    80     virtual TDesC& GetPincode()= 0;
       
    81     
       
    82     /*
       
    83      * Gets the reference to the thoroughfare name. Scope of this returned reference is limited to
       
    84      * this perticular call. User has to store it for their further processing.
       
    85      * 
       
    86      *  @return reference to the String which holds the thoroughfare name. 
       
    87      */
       
    88     virtual TDesC& GetThoroughfareName()= 0;
       
    89     
       
    90     /*
       
    91      * Gets the reference to the thoroughfare number. Scope of this returned reference is limited to
       
    92      * this perticular call. User has to store it for their further processing.
       
    93      * 
       
    94      *  @return reference to the String which holds the thoroughfare number. 
       
    95      */
       
    96     virtual TDesC& GetThoroughfareNumber() = 0;
       
    97     };
       
    98 /*
       
    99  * Observer class which exposes callbacks to notify the completion of reversegeocoding event.
       
   100  *
       
   101  **/
       
   102 class MReverseGeocodeObserver
       
   103     {
       
   104     public:
       
   105     /*
       
   106      * Callback function which notifys the completion of reverse geocode event. This signals the completion
       
   107      * of the asynchronous function CReverseGeoCode::GetAddressByCoordinate.
       
   108      * 
       
   109      *  @param aErrorcode Error status KErrNone in case of success or other system specific errorcodes
       
   110      *                    in case of failures.
       
   111      *                       
       
   112      *  @param aAddressInfo refrence to the address stucture, through which user can access the
       
   113      *                      address information. 
       
   114      */
       
   115 
       
   116     virtual void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) =0;
       
   117 
       
   118     /*
       
   119     * Get registrer network country code
       
   120     *
       
   121     * @return current register n/w info
       
   122     */
       
   123     virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0;
       
   124 
       
   125     
       
   126     /*
       
   127     * UE is registered to home network?
       
   128     *
       
   129     * @return ETrue if UE is registered at home network else EFalse
       
   130     */
       
   131     virtual TBool IsRegisteredAtHomeNetwork() = 0;
       
   132 
       
   133     /*
       
   134     * Get home network country code
       
   135     * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse
       
   136     * @return user home n/w info
       
   137     */
       
   138     virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& 
       
   139         GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0;
       
   140     };
       
   141 
       
   142 
       
   143 /**
       
   144  * CReverseGeoCoderPlugin
       
   145  *
       
   146  * An implementation of the CReverseGeoCoderPlugin definition. 
       
   147  *              Encapsulates the reverse goecoding functionality
       
   148  *              This is concrete class, instance of which
       
   149  *              ECOM framework gives to ECOM clients.
       
   150  */
       
   151 class CReverseGeoCoderPlugin : public CBase
       
   152 	{
       
   153 public:
       
   154 	
       
   155 	/**
       
   156 	* Create instance of concrete implementation. 
       
   157 	* @return: Instance of this class.
       
   158 	*/
       
   159 	static CReverseGeoCoderPlugin* NewL();
       
   160 
       
   161 
       
   162 	/**
       
   163 	* Destructor.
       
   164 	*/
       
   165 	virtual ~CReverseGeoCoderPlugin();
       
   166 
       
   167 
       
   168 public:
       
   169 	
       
   170 	/**
       
   171 	 * Creates the instance of Reverse Geocoder
       
   172 	 * 
       
   173 	 */
       
   174 	virtual void CreateReverseGeoCoderL() = 0;
       
   175 
       
   176 	/**
       
   177 	 * Initializes the ReverseGeoCodeObserver
       
   178 	 * @param: aObserver The observer class instance that is to be notified when reverse geocoding completes
       
   179 	 * 
       
   180 	 */
       
   181     virtual void AddObserverL(MReverseGeocodeObserver& aObserver)=0;
       
   182 
       
   183 	/**
       
   184 	 * A wrapper API to fetch the address from geocoordinates
       
   185 	 * Internally calls the ReverseGeoCoder
       
   186 	 * @param aLocality A TLocality object that contains the geocoordinate information
       
   187 	 * @param aOption Indicates if the connection is silent connection or not
       
   188 	 * 
       
   189 	 */
       
   190     virtual void GetAddressByCoordinateL( TLocality aLocality,const TConnectionOption aOption )=0;
       
   191 
       
   192 	/**
       
   193 	 * Wrapper API to check if the ReverseGeoCoder allows a silent connection
       
   194 	 * @return:TBool Indicates if a silent connection is allowed
       
   195 	 * 
       
   196 	 */
       
   197 	  virtual TBool SilentConnectionAllowed() = 0;
       
   198 	
       
   199 private:
       
   200 	
       
   201 	TUid iDtorKey;
       
   202 
       
   203 	};
       
   204 #include "reversegeocoderplugin.inl"
       
   205 
       
   206 #endif //__REVERSEGEOCODERPLUGIN_H__
       
   207 
       
   208 //End of file
       
   209