locationsystemui/locationsysui/posindicator/posindicatorhelperserver/inc/posindicatorlocationrequestor.h
branchRCL_3
changeset 44 2b4ea9893b66
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
       
     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 location requestor class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef POSINDICATORLOCATIONREQUESTOR_H
       
    19 #define POSINDICATORLOCATIONREQUESTOR_H
       
    20 
       
    21 #include <lbs.h>
       
    22 #include <lbssatellite.h>
       
    23 #include <EPos_CPosLandmark.h>
       
    24 #include "posreversegeocodeinterface.h"
       
    25 
       
    26 class CPosIndicatorLocationRequestor : public CActive,
       
    27                                        public MPosReverseGeocodeObserver
       
    28     {
       
    29     /**
       
    30      * This defines the different states of location requestor
       
    31      */
       
    32     enum TOperation
       
    33         {
       
    34         /**
       
    35          * Idle state
       
    36          */
       
    37         ENone,
       
    38         
       
    39         /**
       
    40          * Acquiring last known position
       
    41          */
       
    42         ELastKnownPosition,
       
    43         
       
    44         /**
       
    45          * During acquiring location
       
    46          */
       
    47         ECurrentPosition,
       
    48         
       
    49         /**
       
    50          * During acquiring address.
       
    51          */
       
    52         ECurrentAddress
       
    53         };
       
    54 public: 
       
    55     /**
       
    56      * Factory function that instantiates an object 
       
    57      * of CPosIndicatorLocationRequestor
       
    58      */
       
    59     static CPosIndicatorLocationRequestor* NewL();
       
    60 
       
    61     /**
       
    62      * Destructor
       
    63      */
       
    64     ~CPosIndicatorLocationRequestor();
       
    65     
       
    66     /**
       
    67      * Gets current position
       
    68      */
       
    69     void GetCurrentPosition( const RMessage2& aMessage );
       
    70     
       
    71     /**
       
    72      * Gets current address info size.
       
    73      */
       
    74     void GetCurrentAddressInfoSizeL( const RMessage2& aMessage );
       
    75     
       
    76     /**
       
    77      * Gets current address info.
       
    78      */
       
    79     void GetCurrentAddressInfoL( const RMessage2& aMessage );
       
    80     
       
    81     /**
       
    82      * Cancels outstanding request 
       
    83      */
       
    84     void CancelRequest( const RMessage2& aMessage );
       
    85     
       
    86 
       
    87 public: // From MPosReverseGeocodeObserver
       
    88     virtual void ReverseGeocodeComplete( TInt aErrorcode );
       
    89     
       
    90 protected: // From CActive
       
    91     void RunL();
       
    92     
       
    93     void DoCancel();
       
    94 
       
    95 private:
       
    96     /**
       
    97      * Default constructor.
       
    98      */
       
    99     CPosIndicatorLocationRequestor();
       
   100     
       
   101     /**
       
   102      * 2nd phase constructor for instantiating member variables     
       
   103      */
       
   104     void ConstructL();
       
   105     
       
   106     
       
   107 private: // Data members
       
   108     /**
       
   109      * Queue of position request
       
   110      */
       
   111     RArray<RMessage2>   iPositionRequestQueue;
       
   112     
       
   113     /**
       
   114      * Queue of address request
       
   115      */
       
   116     RArray<RMessage2>   iAddressRequestQueue;
       
   117     /**
       
   118      * Handle to the location server interface
       
   119      */
       
   120     RPositionServer     iPosServer;
       
   121     
       
   122     /**
       
   123      * Handle to create a subsession with the location sever
       
   124      */
       
   125     RPositioner         iPositioner;
       
   126     
       
   127     /**
       
   128      * Pointer to reverse geo-coding plugin object
       
   129      * Own
       
   130      */
       
   131     CPosReverseGeocodeInterface* iReverseGeoCodeInterface;
       
   132     
       
   133     /**
       
   134      * Pointer to landmark object
       
   135      * Own
       
   136      */
       
   137     CPosLandmark* iLandmark;
       
   138     
       
   139     /**
       
   140      * Pointer to landmarks package.
       
   141      * Own 
       
   142      */
       
   143     HBufC8* iLandmarkPackage;
       
   144     
       
   145     /**
       
   146      * Last known position 
       
   147      */
       
   148     TPositionInfo iLastKnownInfo;
       
   149     
       
   150     /**
       
   151      * Requested satellite info.
       
   152      */
       
   153     TPositionSatelliteInfo     iPositionInfo;
       
   154    
       
   155     /**
       
   156      * Current operation that is progress.
       
   157      */
       
   158     TOperation          iOperation;
       
   159     };
       
   160 
       
   161 #endif /* POSINDICATORLOCATIONREQUESTOR_H */