locationsystemui/locationsysui/posindicator/posreversegeocodeplugin/inc/posrevgeocodeplugin.h
changeset 33 834e27cad510
equal deleted inserted replaced
32:b12ea03c50a3 33:834e27cad510
       
     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: Declaration of CPosRevGeoCodePlugin class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef POSREVGEOCODEPLUGIN_H
       
    19 #define POSREVGEOCODEPLUGIN_H
       
    20 
       
    21 #include "posreversegeocodeinterface.h"
       
    22 #include "posrevgeocodehttpclientengine.h"
       
    23 #include "posrevgeocodeconnectiontimer.h"
       
    24 #include "posrevgeocodexmlparser.h"
       
    25 
       
    26 
       
    27 class CPosRevGeoCodePlugin : public CPosReverseGeocodeInterface,
       
    28                              public MPosRevGeoCodeXmlObserver,
       
    29                              public MPosRevGeoCodeHTTPClientObserver,
       
    30                              public MPosRevGeoCodeTimeoutObserver
       
    31     {
       
    32 public:
       
    33     /**
       
    34      * Factory function to create the instance of CPosRevGeoCodePlugin object.
       
    35      */
       
    36     static CPosRevGeoCodePlugin* NewL( MPosReverseGeocodeObserver& aObserver );
       
    37     
       
    38     /**
       
    39      * Destructor
       
    40      */
       
    41     ~CPosRevGeoCodePlugin();
       
    42     
       
    43     /**
       
    44      * Gets the address information for the given geo coordinates
       
    45      */
       
    46     virtual void GetAddressByCoordinateL( CPosLandmark& aLandmark );
       
    47     
       
    48     /**
       
    49      * Cancels the current operation.
       
    50      */
       
    51     virtual void Cancel();
       
    52     
       
    53     /**
       
    54      * Function to get the appropriate language for the request. 
       
    55      */
       
    56     void GetLanguageForTheRequest( TDes8& aLanguage );
       
    57 
       
    58 public: // From MPosRevGeoCodeXmlObserver
       
    59     virtual void OnParseCompletedL( TInt aError );
       
    60     
       
    61 public: // From MPosRevGeoCodeHTTPClientObserver
       
    62     virtual void ClientEvent( const THttpStatus& aEvent );
       
    63     
       
    64     virtual void ClientBodyReceived( const TDesC8& aBodyData );
       
    65 
       
    66 public: // From MPosRevGeoCodeTimeoutObserver
       
    67     virtual void HandleTimedoutEvent( TInt aErrorCode );
       
    68     
       
    69 private:
       
    70     /**
       
    71      * Symbian 2nd phase constructor.
       
    72      */
       
    73     void ConstructL();
       
    74     
       
    75     /**
       
    76      * Constructor
       
    77      */
       
    78     CPosRevGeoCodePlugin( MPosReverseGeocodeObserver& aObserver );
       
    79      
       
    80     /**
       
    81      * Starts the timer 
       
    82      */
       
    83     void StartTimer();
       
    84     
       
    85     /**
       
    86      * Closes connection
       
    87      */
       
    88     void CloseConnection();
       
    89 
       
    90 private: // Data members
       
    91     
       
    92     /**
       
    93      * Reference to reverse geocode observer.
       
    94      */
       
    95     MPosReverseGeocodeObserver&  iObserver;
       
    96     
       
    97     /**
       
    98      * Pointer to HTTP client engine
       
    99      * Own
       
   100      */
       
   101     CPosRevGeoCodeHTTPClientEngine* iHTTPClientEngine;
       
   102     
       
   103     /**
       
   104      * Pointer to XML parser
       
   105      * Own
       
   106      */
       
   107     CPosRevGeoCodeXmlParser* iXmlParser;
       
   108     
       
   109     /**
       
   110      * Pointer to connection timer
       
   111      * Own
       
   112      */
       
   113     CPosRevGeoCodeConnectionTimer* iConnectionTimer;
       
   114     
       
   115     /**
       
   116      * Pointer to client's landmarks object.
       
   117      * Not own.
       
   118      */
       
   119     CPosLandmark* iClientLandmark;
       
   120     
       
   121     HBufC8* iXMLBuf;
       
   122     
       
   123     TBuf8<KMaxFileName> iQueryString;
       
   124     
       
   125     TBuf8<KMaxFileName> iAuthCode;
       
   126     
       
   127     TBuf8<KMaxFileName> iRefURL;
       
   128     
       
   129     TBuf8<KMaxFileName> iLang;
       
   130     
       
   131     };
       
   132 
       
   133 #endif /* POSREVGEOCODEPLUGIN_H */