lbs/lbstestutils/inc/ctlbsagpshandler.h
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 // Copyright (c) 2007-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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Definition of Test Harness request handler component.
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalTechnology
       
    23  @test
       
    24 */
       
    25 
       
    26 #ifndef CTLBSAGPSHANDLER_H
       
    27 #define CTLBSAGPSHANDLER_H
       
    28 
       
    29 #include <e32hashtab.h>
       
    30 #include <lbs/test/tlbschannel.h>
       
    31 
       
    32 
       
    33 ///////////////////////////////////////////////////////////////////////////////
       
    34 // Test Harness Request Handler Channel
       
    35 ///////////////////////////////////////////////////////////////////////////////
       
    36 
       
    37 /** Observer for TH Request Handler interface
       
    38 */
       
    39 class MT_ResponseObserver
       
    40 	{
       
    41 public:
       
    42 	virtual void ProcessAGpsResponseMessage(const TT_LbsAGpsResponseMsg::TModuleResponseType aResponse) = 0;
       
    43 	};
       
    44 
       
    45 /** Manager for the TH channel.
       
    46 
       
    47 This class handles sending and receiving messages on the Test Harness channel.
       
    48 It is implemented as an active object to allow it to asnychronously wait for 
       
    49 messages to arrive. Sending is synchronous.
       
    50 */
       
    51 class CT_LbsAGpsHandler : public CActive, 
       
    52 						  public MT_LbsChannelObserver
       
    53 	{
       
    54 public:
       
    55 	IMPORT_C static CT_LbsAGpsHandler* NewL(MT_ResponseObserver* aObserver);
       
    56 	~CT_LbsAGpsHandler();
       
    57 
       
    58 	IMPORT_C void SendRequestUpdateInitMsg(const TDesC& aConfigFileName, 
       
    59 								  const TDesC& aConfigSection);
       
    60 	IMPORT_C void SendRequestTimeOutMsg(const TTimeIntervalMicroSeconds& aTimeOut);
       
    61 	IMPORT_C void SendRequestSetAllModuleOptions();
       
    62 	IMPORT_C void SendRequestClearAllModuleOptions();
       
    63 	IMPORT_C void SendRequestModuleOption(TLbsHybridModuleOptions aOption, TBool aValue);
       
    64 	IMPORT_C void SendRequestForcedUpdate();
       
    65 	IMPORT_C void SendRequestError(TInt aError);
       
    66 
       
    67 			
       
    68 private:
       
    69 	CT_LbsAGpsHandler(MT_ResponseObserver* aObserver);
       
    70 	void ConstructL();
       
    71 	
       
    72 	// from CActive
       
    73 	void RunL();
       
    74 	void DoCancel();
       
    75 	TInt RunError(TInt aError);
       
    76 	
       
    77 	// Send a message.
       
    78 	void SendRequestMessage(const TT_LbsMsgBase* aMessage);
       
    79 
       
    80 	// Buffer a message.
       
    81 	void BufferMessage(const TT_LbsMsgBase* aMessage);
       
    82 	
       
    83 	// from MT_LbsChannelObserver
       
    84 	void ProcessChannelMessage(RT_LbsChannel::TT_LbsChannelId aChannelId, const TT_LbsMsgBase& aMessage);
       
    85 
       
    86 private:
       
    87 	MT_ResponseObserver* iObserver;
       
    88 	RT_LbsChannel iTHChannel;
       
    89 	RPointerArray<TT_LbsMsgBase> iMsgBuffer;
       
    90 	};
       
    91 
       
    92 
       
    93 #endif // CTLBSAGPSHANDLER_H