obex/obexprotocol/obex/test/tobex/clienthandler.h
changeset 54 4dc88a4ac6f4
parent 52 866b4af7ffbe
child 57 f6055a57ae18
equal deleted inserted replaced
52:866b4af7ffbe 54:4dc88a4ac6f4
     1 // Copyright (c) 2005-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 //
       
    15 
       
    16 #ifndef _CLIENTHANDLER_H
       
    17 #define _CLIENTHANDLER_H
       
    18 
       
    19 #include <es_sock.h>
       
    20 #include <e32test.h>
       
    21 #include <es_prot.h>
       
    22 #include <e32cons.h>
       
    23 #include <obex.h>
       
    24 #include <btmanclient.h>
       
    25 #include <obex/internal/obexinternalheader.h>
       
    26 #include <obex/internal/obexinternalconstants.h>
       
    27 #include <btsdp.h>
       
    28 #include <obexfinalpacketobserver.h>
       
    29 
       
    30 #ifdef ERROR_RESOLUTION_EXTENSION
       
    31 #include <obex/extensionapis/obexclienterrorresolver.h>
       
    32 #endif // ERROR_RESOLUTION_EXTENSION
       
    33 
       
    34 #ifdef EMPTY_HEADERS_TEST
       
    35 #include "emptyheaderstest.h"
       
    36 #endif //EMPTY_HEADERS_TEST
       
    37 
       
    38 #include "btutils.h"
       
    39 #include "constants.h"
       
    40 
       
    41 
       
    42 class CActiveConsole;
       
    43 
       
    44 class CObexClientHandler : public CActive, public MObexAuthChallengeHandler,
       
    45 							private MRFCOMMServiceSeeker,
       
    46 							public MObexFinalPacketObserver
       
    47 //-----------------------------------------------------------
       
    48 	{
       
    49 public:
       
    50 	// Construction
       
    51 	CObexClientHandler(CActiveConsole* aParent);
       
    52 	static CObexClientHandler* NewL(CActiveConsole* aParent, TTransport aTransport);
       
    53 	void ConstructL(TTransport aTransport);
       
    54 
       
    55 	// Destruction
       
    56 	~CObexClientHandler();
       
    57 
       
    58 	void SetMode(TUint mode);
       
    59 
       
    60 	void Abort();
       
    61 	void Connect();
       
    62 	void Disconnect();
       
    63 	void GetByNameL();
       
    64 	void GetByTypeL();
       
    65 	void Put(TDes& filename);
       
    66 	void SetName(TDes& aName);
       
    67 	void SetObexName();
       
    68 	void SetPath();
       
    69 	void SetType();
       
    70 	void GetReferenceL(TInt aReferenceId);
       
    71 	void PutReferenceL(TInt aReferenceId);
       
    72 	void ChangeAuthenticationChallengeHeaders(TChar aChar);
       
    73 
       
    74 	void ConnectWithAuthenticationL();
       
    75 	void ConnectWithTarget();
       
    76 	void ConnectWithAuthenticationAndTargetL();
       
    77 	void EnablePassword();
       
    78 	void ChangeChallengePassword();
       
    79 	void SetCommandTimeout();
       
    80 	void ChangeResponsePassword();
       
    81 	void RemoteAddress();
       
    82 	void GetUserPasswordL(const TDesC& aUserID);
       
    83 	void SearchResult(TInt aError, TUint8 aPort, TInt aProfileVersion);
       
    84 	void HTTPTest1L();
       
    85 	void HTTPTest2L();
       
    86 	void HTTPTest3L();
       
    87 	void HTTPTest4L();
       
    88 	void AppParamsTestL();
       
    89 	void SetCurrentTestNumber();
       
    90 	void ResetCurrentTestNumber();
       
    91 	
       
    92 	void MofpoFinalPacketStarted();
       
    93 	void MofpoFinalPacketFinished();
       
    94 #ifdef ERROR_RESOLUTION_EXTENSION
       
    95 	void LastError();
       
    96 #endif // ERROR_RESOLUTION_EXTENSION
       
    97 
       
    98 #ifdef EMPTY_HEADERS_TEST
       
    99 	void EmptyHeaderTestL(TPtrC aName, TPtrC8 aType, TPtrC aDesc, TPtrC8 aTarget, TPtrC8 aAppParam);
       
   100 #endif //EMPTY_HEADERS_TEST
       
   101 
       
   102 private:
       
   103 	void RunL ();
       
   104 	void DoCancel ();
       
   105 	TInt SetUpObject (TDes& filename);
       
   106 	void DisplayObjectL();
       
   107 	void SaveObject();
       
   108 
       
   109 public:
       
   110 	TBuf<64> iObexName;
       
   111 	TBuf<64> iFilename1;
       
   112 	TBuf<64> iFilename2;
       
   113 	TBuf<64> iFilename3;
       
   114 	TBuf<16> iChallengePassword;
       
   115 	TBuf<16> iResponsePassword;
       
   116 	TBuf<32> iGetType;
       
   117 	TPath iInboxRoot;
       
   118 	
       
   119 private:
       
   120 	enum TSendState
       
   121 		{
       
   122 		EIdle,
       
   123 		EConnecting,
       
   124 		EConnected,
       
   125 		EPutting,
       
   126 		EGetting,
       
   127 		EDisconnecting,
       
   128 		ESettingPath,
       
   129 		EGettingReference,
       
   130 		EPuttingReference
       
   131 		};
       
   132 
       
   133 	CActiveConsole* iParent;
       
   134 	CObexClient* iClient;
       
   135 #ifdef ERROR_RESOLUTION_EXTENSION
       
   136 	CObexClientErrorResolver* iClientErrorResolver;
       
   137 #endif // ERROR_RESOLUTION_EXTENSION
       
   138 
       
   139 #ifdef EMPTY_HEADERS_TEST
       
   140 	CObexEmptyHeaderTest* iObexEmptyHeaderTest;
       
   141 #endif //EMPTY_HEADERS_TEST
       
   142 	
       
   143 	CObexFileObject* iFileObject;
       
   144 	CObexBufObject* iObject;
       
   145 	CBufFlat* iObjectBuffer;
       
   146 	TSendState iState;
       
   147 	CObexNullObject* iTargetHeaderObject;
       
   148 	CRFCOMMServiceFinder* iSdpServiceFinder;
       
   149 	TBTDevAddr iDevAddr;
       
   150 	TInt iCurrentTestNumber;
       
   151 
       
   152 	TTime iStartTime;
       
   153 	};
       
   154 
       
   155 
       
   156 #endif // _CLIENTHANDLER_H