locationrequestmgmt/locationserver/inc/EPos_CPosLastKnownPosAreaHandler.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 /*
       
     2 * Copyright (c) 2006 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:  	This class inherits the common functionalities for requests to the 
       
    15 *				Location Monitor from EPos_CPosLocMonitorReqHandlerBase.h and also
       
    16 *				implements the functions specific to Last Known Position Area request.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef CPOSLASTKNOWNPOSAREAHANDLER_H_
       
    23 #define CPOSLASTKNOWNPOSAREAHANDLER_H_
       
    24 
       
    25 //--------------------------------------------------------------------------------------
       
    26 // INCLUDES
       
    27 #include <e32base.h>
       
    28 #include <e32std.h>
       
    29 #include <e32def.h>
       
    30 #include <e32cmn.h>
       
    31 #include "LbsErrors.h" 
       
    32 #include "EPos_Global.h" 		// For DEBUG_TRACE
       
    33 #include "EPos_ServerPanic.h" 	// For EPosServerPanicPositionerNotInitialized
       
    34 
       
    35 #include "EPos_CPosLocMonitorReqHandlerBase.h"
       
    36 #include "rlbslocmonitorsession.h"
       
    37 #include "rlbslocmonitorareapositioner.h"
       
    38 
       
    39 
       
    40 //--------------------------------------------------------------------------------------
       
    41 // FORWARD DECLARATIONS
       
    42 class CPosCallbackTimer;	// Used for timeout
       
    43 
       
    44 
       
    45 //--------------------------------------------------------------------------------------
       
    46 // CONSTANT DEFINITIONS
       
    47 //  Index of the pointer to a container that holds pointer descriptors, needed to point
       
    48 //	to the clients request data during asynchronous requests */
       
    49 const TInt KParamLKPAreaReqPos   = 0;
       
    50 const TInt KParamLKPAreaReqArea  = 1;
       
    51 
       
    52 // The timeout value for get last known position area request is 10seconds
       
    53 const TTimeIntervalMicroSeconds KLastKnownPosAreaTimeOut(10000000);
       
    54 
       
    55 
       
    56 //--------------------------------------------------------------------------------------
       
    57 // CLASS DECLARATION
       
    58 /**
       
    59  The active object that handles requests for last known position with area info from 
       
    60  clients. Owns subsession with the location monitor and uses the sub-session handle to 
       
    61  forward the above requests to the location monitor. Inherits the basic functionalities from 
       
    62  CPosLocMonitorReqHandlerBase.
       
    63  */
       
    64 class CPosLastKnownPosAreaHandler : public CPosLocMonitorReqHandlerBase
       
    65 	{
       
    66 public: 
       
    67 	// Two-phased Constructors 
       
    68 	static CPosLastKnownPosAreaHandler* NewL(); 
       
    69     // Destructors
       
    70 	~CPosLastKnownPosAreaHandler();  
       
    71 	
       
    72 	// Functions to request last known position with area info from the Location Monitor
       
    73     void GetLastKnownPosAreaL(RLbsLocMonitorSession& aLocMonSession, const RMessage2& aMessage);
       
    74     void CancelGetLastKnownPosAreaL(const RMessage2& aMessage);
       
    75     void NotifyOnEmptyLastKnownPosStoreReq();
       
    76     
       
    77 private:
       
    78 	// C++ Default constructor
       
    79 	CPosLastKnownPosAreaHandler(); 
       
    80 	void ConstructL(); 	
       
    81 	static TInt HandleTimeOut(TAny* aRequestHandler);
       
    82 	
       
    83 protected:  
       
    84 	// From CActive
       
    85     void RunL();
       
    86     TInt RunError(TInt aError);
       
    87     void DoCancel();
       
    88     
       
    89 private:
       
    90 	RMessage2 		iMessage;
       
    91 	// Subsession with the location monitor
       
    92 	RLbsLocMonitorAreaPositioner 	iLocMonAreaPositioner; 
       
    93 	
       
    94 	TPositionInfo   			iPositionInfo;
       
    95 	TPositionAreaExtendedInfo 	iPositionAreaInfo;
       
    96 	TPosAreaReqParams 			iParameters;
       
    97 	CPosCallbackTimer* 			iTimeoutTimer; // The timeout value is hardcoded in the constant KLastKnownPosAreaTimeOut
       
    98 	};
       
    99 #endif /*CPOSLASTKNOWNPOSAREAHANDLER_H_*/
       
   100