locationrequestmgmt/networkrequesthandler/inc/x3prequest.h
changeset 36 b47902b73a93
parent 0 9cfd9a3ee49c
equal deleted inserted replaced
35:a2efdd544abf 36:b47902b73a93
       
     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:
       
    15 *
       
    16 */
       
    17 /**
       
    18 @file
       
    19 @internalComponent
       
    20 @released
       
    21 */
       
    22 
       
    23 #ifndef _X3PREQUEST_H 
       
    24 #define _X3PREQUEST_H
       
    25 
       
    26 #include <lbs/lbsx3p.h>
       
    27 #include "lbscommoninternaldatatypes.h"
       
    28 #include "lbsnetinternalapi.h"
       
    29 
       
    30 
       
    31 // Panic Category
       
    32 _LIT(KX3pRequestFault,"Lbs-Nrh X3pRequest");
       
    33 
       
    34 
       
    35 /**
       
    36  *
       
    37  * Mixin class to report expiry of request timer.
       
    38  *
       
    39  */
       
    40 class MX3pRequestObserver
       
    41     {
       
    42 public:
       
    43     virtual void OnRequestTimeout(const TLbsNetSessionIdInt& aTimedOutRequestId) = 0;
       
    44     };
       
    45     
       
    46     
       
    47 class CX3pRequest : public CBase,
       
    48 					public MLbsCallbackTimerObserver
       
    49 
       
    50 	{
       
    51 enum TLbsNrhX3pRequestPanic
       
    52 	{
       
    53 	EPanicTimerError = 0x01
       
    54 	};	
       
    55 
       
    56 public:
       
    57 	static CX3pRequest* NewL(MX3pRequestObserver* aObserver, 
       
    58 							 const TLbsNetSessionIdInt& aSessionId,
       
    59 							 const TDesC& aDestinationID,
       
    60 							 TUint aTransmitPriority, 
       
    61 							 const TLbsTransmitPositionOptions& aTransmitOptions);
       
    62 
       
    63 	const TLbsNetSessionIdInt& SessionId();
       
    64 	const TDesC& DestinationId();
       
    65 	TUint TransmitPriority();
       
    66 	void SetRequestQuality(const TLbsNetPosRequestQualityInt& aRequestQuality);
       
    67 	TBool FixIsAccurate(const TPositionInfo& aPosInfo, TBool aHybridMode);
       
    68 	
       
    69 	void StartTimer();
       
    70 	void ReStartTimerOnce();
       
    71 	~CX3pRequest();
       
    72 
       
    73 protected:
       
    74 	CX3pRequest(MX3pRequestObserver* aObserver,
       
    75 				const TLbsNetSessionIdInt& aSessionId,
       
    76 				TUint aTransmitPriority);
       
    77 
       
    78 	void ConstructL(const TDesC& aDestinationId,
       
    79 					const TLbsTransmitPositionOptions& aTransmitOptions);
       
    80 
       
    81 protected:
       
    82 	void RunL();
       
    83 
       
    84 protected: // From MLbsCallbackTimerObserver
       
    85 	/** Called when the timer expires */
       
    86 	void OnTimerEventL(TInt aTimerId);
       
    87 	/** Called if OnTimerEventL leaves */
       
    88 	TInt OnTimerError(TInt aTimerId, TInt aError);
       
    89 
       
    90 
       
    91 private:
       
    92 	MX3pRequestObserver* iObserver;
       
    93 	TLbsNetSessionIdInt iSessionId;
       
    94 	TBuf<64> iDestinationId;
       
    95 	TUint iTransmitPriority; 
       
    96 	TLbsTransmitPositionOptions iTransmitOptions;
       
    97 	TLbsNetPosRequestQualityInt iRequestQuality;
       
    98 	TBool iQualityParametersReceived;
       
    99 	CLbsCallbackTimer* iTimer;
       
   100 	TBool iTimerReStarted;
       
   101     };
       
   102 #endif // _X3PREQUEST_H