obex/obexprotocol/obex/test/tobex/serverhandlerbase.h
changeset 57 f6055a57ae18
parent 0 d0791faffa3f
equal deleted inserted replaced
54:4dc88a4ac6f4 57:f6055a57ae18
       
     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 _SERVERHANDLERBASE_H
       
    17 #define _SERVERHANDLERBASE_H
       
    18 
       
    19 
       
    20 #include <es_sock.h>
       
    21 #include <e32test.h>
       
    22 #include <es_prot.h>
       
    23 #include <e32cons.h>
       
    24 #include <obex.h>
       
    25 #include <btmanclient.h>
       
    26 #include <obex/internal/obexinternalheader.h>
       
    27 #include <obex/internal/obexinternalconstants.h>
       
    28 #include <btsdp.h>
       
    29 #include <obexfinalpacketobserver.h>
       
    30 #include <obexreadactivityobserver.h>
       
    31 #include "constants.h"
       
    32 
       
    33 class CServerAsyncAO;
       
    34 class CActiveConsole;
       
    35 class CObexServerPacketAccessUi;
       
    36 
       
    37 
       
    38 class CObexServerHandlerBase : public CBase,
       
    39 #ifdef ASYNC_INDICATION
       
    40 							   private MObexServerNotifyAsync, 
       
    41 #else
       
    42 							   private MObexServerNotify,
       
    43 #endif						   							   
       
    44 							   public MObexAuthChallengeHandler,
       
    45 							   
       
    46 							   public MObexReadActivityObserver
       
    47 //-----------------------------------------------------------
       
    48 	{
       
    49 public:
       
    50 	// Construction
       
    51 	void BaseConstructL(TTransport aTransport);
       
    52 
       
    53 	void Start();
       
    54 	void Stop();
       
    55 	// Destruction
       
    56 	virtual ~CObexServerHandlerBase();
       
    57 
       
    58 	void EnableAuthentication();
       
    59 	void DisableAuthentication();
       
    60 	void EnablePassword();
       
    61 	void ChangeChallengePassword(TDesC* aPassword = NULL);
       
    62 	void ChangeResponsePassword();
       
    63 	void SetLocalWho();
       
    64     void SetTargetChecking(CObexServer::TTargetChecking aValue);
       
    65 	void GetUserPasswordL(const TDesC& aUserID);
       
    66 	void RemoteAddress();
       
    67 #ifdef PACKET_ACCESS_EXTENSION
       
    68 	void PacketAccessUiL(TBool aEnable);
       
    69 #endif // PACKET_ACCESS_EXTENSION
       
    70 	
       
    71 protected:
       
    72 	CObexServerHandlerBase(CActiveConsole* aParent);
       
    73 
       
    74 private:
       
    75 	// Implementation of MObexServerNotify interface
       
    76 	virtual void ErrorIndication (TInt aError);
       
    77 	virtual void TransportUpIndication ();
       
    78 	virtual void TransportDownIndication ();
       
    79 	
       
    80 	virtual void ObexDisconnectIndication (const TDesC8& aInfo);
       
    81 	virtual TInt PutPacketIndication ();
       
    82 	virtual TInt GetPacketIndication ();
       
    83 	virtual void AbortIndication ();
       
    84 
       
    85 	
       
    86 #ifdef ASYNC_INDICATION
       
    87 	void GetCompleteIndication ();
       
    88 	void PutCompleteIndication ();
       
    89 	void SetPathIndication (const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo);
       
    90 	void CancelIndicationCallback();
       
    91 	void ObexConnectIndication  (const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo);
       
    92 	void PutRequestIndication ();
       
    93 	void GetRequestIndication (CObexBaseObject *aRequestedObject);
       
    94 #else
       
    95 	TInt ObexConnectIndication  (const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo);
       
    96 	TInt GetCompleteIndication ();
       
    97 	TInt PutCompleteIndication ();
       
    98 	TInt SetPathIndication (const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo);
       
    99 	CObexBufObject* PutRequestIndication ();
       
   100 	CObexBufObject* GetRequestIndication (CObexBaseObject *aRequestedObject);
       
   101 #endif
       
   102 
       
   103 	// Implementation of MObexReadActivityObserver interface
       
   104 	void MoraoReadActivity();
       
   105 	void SetUpGetObjectL(CObexBaseObject *aRequestedObject);
       
   106 	void HandleGetReferenceObjL(CObexBaseObject* aRequiredObject);
       
   107 	
       
   108 	void InitBluetoothL();
       
   109 
       
   110 public:
       
   111 	TBuf<16> iChallengePassword;
       
   112 	TBuf<16> iResponsePassword;
       
   113 	TBool iAcceptPuts;
       
   114 
       
   115 protected:
       
   116 	CObexBufObject*  iObject;
       
   117 	CBufFlat* iBuf;
       
   118 	CActiveConsole* iParent;
       
   119 
       
   120 private:
       
   121 	CObexServer*  iServer;
       
   122 	TBool iIsAuthenticationEnabled;
       
   123 	TTransport iTransportLayer;
       
   124 	CSdpAttrValueDES* iProtDescList;
       
   125 	RSdp iSdp;
       
   126 	RSdpDatabase iSdpdb;
       
   127 #ifdef ASYNC_INDICATION
       
   128 	CServerAsyncAO* iServerAsyncAO;
       
   129 #endif
       
   130 #ifdef PACKET_ACCESS_EXTENSION	
       
   131 	CObexServerPacketAccessUi* iPacketAccessUi;
       
   132 #endif // PACKET_ACCESS_EXTENSION
       
   133 
       
   134 	TTime iStartTime;
       
   135 	};
       
   136 
       
   137 #endif // _SERVERHANDLERBASE_H