locationtriggering/ltstrategyengine/inc/lbtlocationrequestor.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2006, 2007 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:  Class definition of Status Manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_LBTLOCATIONREQUESTOR_H
       
    21 #define C_LBTLOCATIONREQUESTOR_H
       
    22 
       
    23 
       
    24 #include <lbs.h>
       
    25 #include "lbtpsychangeobserver.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CLbtPsyChangeListner;
       
    29 
       
    30 
       
    31 /**
       
    32  * This class defines the methods used by CLbtStrategyEngine to acquire 
       
    33  * location information. This is a wrapper class that establishes a session
       
    34  * to location server to obtain location information.
       
    35  */
       
    36 NONSHARABLE_CLASS( CLbtLocationRequestor ) : public CBase,
       
    37 											 public MLbtPsyChangeObserver
       
    38 
       
    39 	{
       
    40 
       
    41 public: // Methods
       
    42 
       
    43     /**
       
    44      * Factory function that instantiates an object of CLbtLocationRequestor
       
    45      *
       
    46      * @param aPosID - Identifies the module to be used by location server to 
       
    47      *                 obtain location information
       
    48      */
       
    49 	static CLbtLocationRequestor* NewL(  );
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      */
       
    54 	~CLbtLocationRequestor();
       
    55 
       
    56     /**
       
    57      * Requests location information from location server
       
    58      *
       
    59      * @param aPosInfo - Holds the current position of the device
       
    60      * @param aStatus - Holds the result of the asynchronous request
       
    61      * @aPosID - Identifies the module to be used by location server to obtain
       
    62      *           location information
       
    63      */
       
    64 	void CurrentLocation( TPositionInfo& aPosInfo, 
       
    65 	                        TRequestStatus& aStatus, TPositionModuleId aPosID,
       
    66 	                        TTimeIntervalMicroSeconds aTimeOut );
       
    67 	
       
    68 	/**
       
    69 	 * Request location information from NPP Psy
       
    70 	 */
       
    71 	void CurrentLocationFromNpp( TPositionInfo& aPosInfo, 
       
    72 	                             TRequestStatus& aStatus,
       
    73                                  TTimeIntervalMicroSeconds aTimeOut );
       
    74 	
       
    75 	/**
       
    76 	 * Retrieves information about the positioning technology being used
       
    77 	 */
       
    78 	void GetModuleInfo( TPositionModuleId aPosID );
       
    79 	
       
    80 	/**
       
    81 	 * Retrieves position module Id used to get location information
       
    82 	 */
       
    83 	TPositionModuleId GetPositionModuleId();
       
    84 	 
       
    85 	/**
       
    86 	 * Determines if GPS method is used to retrieve location information
       
    87 	 */
       
    88 	TBool GPSUsed() const;
       
    89 	
       
    90     /**
       
    91      * Cancels an outstanding request for obtaining location information
       
    92      */
       
    93     void Cancel();
       
    94     
       
    95     /**
       
    96      * Cancels an outstanding request for obtaining location information from NPP PSY
       
    97      */
       
    98     void CancelFixFromNpp();
       
    99 	
       
   100 private:
       
   101 
       
   102     /**
       
   103      * Default constructor
       
   104      */
       
   105 	CLbtLocationRequestor();
       
   106 
       
   107     /**
       
   108      * 2nd phase constuctor for instantiating member variables     
       
   109      * @param aPosID - Identifies the module to be used by location server to 
       
   110      *                 obtain location information
       
   111      */
       
   112 	void ConstructL( );
       
   113 	
       
   114     /**
       
   115      * Checks for changes 
       
   116      * @param aPosID - Identifies the module to be used by location server to 
       
   117      *                 obtain location information
       
   118      */
       
   119 	void OpenConnectionL( TPositionModuleId aPosID );
       
   120 
       
   121 private: // from MLbtPsyChangeObserver
       
   122 	void HandlePsyChangeEvent( TPositionModuleId aModuleId );
       
   123 	
       
   124 private:
       
   125 
       
   126 	/**
       
   127 	 * Handle to the location server interface
       
   128 	 */
       
   129 	RPositionServer	    iPosServer;
       
   130 	
       
   131 	/**
       
   132 	 * Handle to create a subsession with the location sever
       
   133 	 */
       
   134 	RPositioner		    iPositioner;
       
   135 	
       
   136 	/**
       
   137 	 * Handle to NPP psy
       
   138 	 */
       
   139 	RPositioner         iNppPositioner;
       
   140 	
       
   141 	/**
       
   142 	 * Identifies the module to be used by location server to obtain location 
       
   143 	 * information
       
   144 	 */
       
   145 	TPositionModuleId   iPosID;
       
   146 	
       
   147 	/**
       
   148 	 * Identifier to determine if GPS method is being used to obtain location
       
   149 	 * information
       
   150 	 */
       
   151 	TBool               iGPSUsed;
       
   152 	
       
   153 	/**
       
   154 	 * Identifier to determine if the handle to NPP psy is valid
       
   155 	 */
       
   156 	TBool              iValidNppHandle;
       
   157 	
       
   158 	/**
       
   159 	 * Object to listen to PSY Changes if NBP is not enabled
       
   160 	 */
       
   161 	CLbtPsyChangeListner*		iNbpChangeListener;
       
   162 	
       
   163 	};
       
   164 
       
   165 #endif	// C_LBTLOCATIONREQUESTOR_H