locationmgmt/agpslocationmgr/inc/lbsnetworkgatewayhandler.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Definition of assistance data handler sub-component of agps manager
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21 */
       
    22 
       
    23 #ifndef LBSNETWORKREQUESTHANDLER_H
       
    24 #define LBSNETWORKREQUESTHANDLER_H
       
    25 
       
    26 #include <e32base.h>
       
    27 #include "lbscommoninternaldatatypes.h"
       
    28 #include <lbs/lbsnetcommon.h>
       
    29 #include "lbsnetinternalapi.h"
       
    30 
       
    31 #include "LbsInternalInterface.h"
       
    32 #include "lbsassistancedatacacheapi.h"
       
    33 #include "lbsnetinternalmsgfifo.h"
       
    34 
       
    35 class MNetworkGatewayHandlerObserver
       
    36     {
       
    37 public:
       
    38     virtual void OnAssistanceDataResponse(TInt aError, TLbsAsistanceDataGroup aMask) = 0;
       
    39     virtual void OnSessionComplete(TInt aReason, const TLbsNetSessionIdInt& aSessionId) = 0;
       
    40     };
       
    41 
       
    42 class CNetworkGatewayHandler : public CActive, private MLbsNetChannelObserver
       
    43 	{
       
    44 public:
       
    45 	static CNetworkGatewayHandler* NewL(MNetworkGatewayHandlerObserver* aObserver);
       
    46 	~CNetworkGatewayHandler();
       
    47 	
       
    48 	TInt GetAssistanceDataItem(TLbsAssistanceDataItem aItem,RDataReaderRootBase& aDataRoot,	TTime& aTimeStamp);
       
    49 	TInt GetAssistanceDataItemTimeStamp(TLbsAssistanceDataItem aItem, TTime& aTimeStamp);
       
    50 	void SendAssistanceDataRequest(TLbsAsistanceDataGroup aDataItemMask);
       
    51 	void SendSelfLocationRequest(const TLbsNetSessionIdInt& aSessionId, const TLbsNetPosRequestOptionsAssistanceInt& aOptions);
       
    52 	void SendSelfLocationCancel(const TLbsNetSessionIdInt& aSessionId, TInt aReason);
       
    53 	void SendSystemStatusAdvice(TBool aTracking);
       
    54 		
       
    55 private:
       
    56 	CNetworkGatewayHandler(MNetworkGatewayHandlerObserver* aObserver); 
       
    57 	void ConstructL();
       
    58 	
       
    59 	//from MLbsNetChannelObserver
       
    60 	void ProcessNetChannelMessage(RLbsNetChannel::TLbsNetChannelId aChannelId, const TLbsNetInternalMsgBase& aMessage);
       
    61 	
       
    62 	//from CActive
       
    63 	void RunL();
       
    64 	void DoCancel();
       
    65 	TInt RunError(TInt aError);
       
    66 	
       
    67 	// Helpers
       
    68 	void SendOrQueueMessage(TLbsNetInternalMsgBase& aMsg);
       
    69 	void QueueMessage(TLbsNetInternalMsgBase& aMsg);
       
    70 	
       
    71 private:
       
    72 	MNetworkGatewayHandlerObserver* iObserver;
       
    73 	RAssistanceDataCache	 		 iAssistanceDataCache;
       
    74 	RLbsNetChannel					 iNGChannel;
       
    75 	RLbsNetMsgFifo					 iQ;
       
    76 	};
       
    77 
       
    78 #endif // LBSNETWORKREQUESTHANDLER_H
       
    79