applayerprotocols/httptransportfw/Test/T_HttpIntegration/HttpFrmwrk.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-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 // $Header$
       
    15 // The header file introducing the collection of HTTP command classes
       
    16 // of the Integration Harness framework.
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef __HTTPFRMWRK_H__
       
    21 #define __HTTPFRMWRK_H__
       
    22 
       
    23 //-----------------------------------------------------------------------------
       
    24 
       
    25 class CWspEventDispatcher;
       
    26 
       
    27 class CFrmwrkSession :	public CBase, 
       
    28 						public MHTTPSessionEventCallback,
       
    29 						public MHTTPAuthenticationCallback
       
    30 	{
       
    31 	public:
       
    32 
       
    33 	static CFrmwrkSession *NewL ( const TDesC& aName, 
       
    34 								  const TDesC& aFramework, 
       
    35 								  CTEngine *aTestMachine);
       
    36 
       
    37 	static CFrmwrkSession *NewLC( const TDesC& aName, 
       
    38 								  const TDesC& aFramework, 
       
    39 								  CTEngine *aTestMachine);
       
    40 
       
    41 	virtual ~CFrmwrkSession();
       
    42 
       
    43 	enum TFrmkSessionState
       
    44 		{
       
    45 		ENormal,
       
    46 		EWSPConnecting,
       
    47 		EWSPDisconnecting,
       
    48 		EWSPDisconnected
       
    49 		};
       
    50 
       
    51 	private:
       
    52 
       
    53 	void ConstructL( const TDesC& aName, 
       
    54 					 const TDesC& aFramework, 
       
    55 					 CTEngine *aTestMachine );
       
    56 	private:	
       
    57 		
       
    58 	inline CTEngine* Machine() ;
       
    59 
       
    60 	public:
       
    61 	virtual void MHFSessionRunL(const THTTPSessionEvent& aEvent);
       
    62 	virtual TInt MHFSessionRunError(TInt aError, const THTTPSessionEvent& aEvent);
       
    63 	//	from AuthentificationCallback
       
    64 	virtual TBool GetCredentialsL(const TUriC8 &aURI,
       
    65 																RString aRealm,
       
    66 																RStringF aAuthType,
       
    67 																RString &aUsername,
       
    68 																RString &aPassword);
       
    69 	// TInt id ;
       
    70 	inline TBool UseWSPProtocol () ;
       
    71 	CWspEventDispatcher *iEventDispatcher;
       
    72 	// Get Name.
       
    73 	TPtrC Name() const ;
       
    74 
       
    75 	//	simplify logging facility
       
    76 	void Log(TRefByValue<const TDesC> aFmt, ... );
       
    77 	inline const RHTTPSession& Session() ;
       
    78 
       
    79 	TInt OpenL();
       
    80 	TInt Close();
       
    81 	TInt SetPropertiesL();
       
    82 	TInt ConnectL();
       
    83 	TInt DisconnectL();
       
    84 	TFrmkSessionState	iState;
       
    85 
       
    86 	protected:
       
    87 	CTEngine* iEngine;
       
    88 	void SetWspProxyPropertiesL(RHTTPSession & aSession, RStringPool &aStrPool) ;
       
    89 	void SetWspCapabilityPropertiesL( RHTTPSession & aSession, RStringPool &aStrPool) ;
       
    90 
       
    91 	private:
       
    92 		TTime iStartTime;
       
    93 		TBool iuseWSPProtocol;
       
    94 		RHTTPSession iSession;	
       
    95 		RConnection iConnection;	
       
    96 		HBufC* iName;
       
    97 	};
       
    98 
       
    99 inline CTEngine* CFrmwrkSession::Machine()
       
   100 {
       
   101 	return iEngine ;
       
   102 }
       
   103 
       
   104 inline TBool CFrmwrkSession::UseWSPProtocol()
       
   105 {
       
   106 	return iuseWSPProtocol ;
       
   107 }
       
   108 
       
   109 inline const RHTTPSession& CFrmwrkSession::Session()
       
   110 {
       
   111 	return iSession ;
       
   112 }
       
   113 //-----------------------------------------------------------------------------
       
   114 
       
   115 #endif  // __HTTPFRMWRK_H__
       
   116 
       
   117 //-----------------------------------------------------------------------------
       
   118 // End of File
       
   119 //-----------------------------------------------------------------------------
       
   120