epoc32/include/obexclient.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/obexclient.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/obexclient.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,112 @@
     1.4 -obexclient.h
     1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @publishedAll
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +#ifndef __OBEXCLIENT_H
    1.29 +#define __OBEXCLIENT_H
    1.30 +
    1.31 +#include <obextypes.h>
    1.32 +#include <obex/internal/obextransportconstants.h>
    1.33 +#include <obexbase.h>
    1.34 +
    1.35 +class CObexPacket;
    1.36 +class MObexFinalPacketObserver;
    1.37 +class CObexPacketSignaller;
    1.38 +class CObexPacketTimer;
    1.39 +class CObexErrorEngine;
    1.40 +
    1.41 +/**
    1.42 +Client side functionality. Connection based.
    1.43 +Supports ...
    1.44 +- Opening IrDA TTP sockets for the OBEX session.
    1.45 +- Opening an OBEX session over a connected socket
    1.46 +- Standard OBEX (spec. version 1.2) operations.
    1.47 + 
    1.48 +This class is not designed for user derivation.
    1.49 +
    1.50 +@publishedAll
    1.51 +@released
    1.52 +*/
    1.53 +NONSHARABLE_CLASS(CObexClient) : public CObex
    1.54 +	{
    1.55 +public:
    1.56 +	IMPORT_C ~CObexClient();
    1.57 +	IMPORT_C static CObexClient* NewL(TObexProtocolInfo& aObexProtocolInfoPtr);
    1.58 +	IMPORT_C static CObexClient* NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy);
    1.59 +	IMPORT_C static CObexClient* NewL(TObexTransportInfo& aObexTransportInfo);
    1.60 +	IMPORT_C void Connect(TRequestStatus& aStatus);
    1.61 +	IMPORT_C void Connect(CObexBaseObject& aObject, TRequestStatus& aStatus);	
    1.62 +	IMPORT_C void ConnectL(CObexBaseObject& aObject, const TDesC& aPassword, 
    1.63 +													TRequestStatus& aStatus);
    1.64 +	IMPORT_C void ConnectL(const TDesC& aPassword, TRequestStatus& aStatus);
    1.65 +	IMPORT_C void Disconnect(TRequestStatus& aStatus);						
    1.66 +	IMPORT_C void Put(CObexBaseObject& aObject, TRequestStatus& aStatus);
    1.67 +	IMPORT_C void Get(CObexBaseObject& aObject, TRequestStatus& aStatus);		
    1.68 +	IMPORT_C void SetPath(TSetPathInfo& aPathInfo, TRequestStatus& aStatus);
    1.69 +	IMPORT_C void Abort();					
    1.70 +	IMPORT_C void UserPasswordL( const TDesC& aPassword);
    1.71 +	IMPORT_C const CObexHeaderSet& GetPutFinalResponseHeaders();
    1.72 +	IMPORT_C void SetFinalPacketObserver(MObexFinalPacketObserver* aObserver);
    1.73 +	IMPORT_C TObexResponse LastServerResponseCode() const;
    1.74 +	IMPORT_C void SetCommandTimeOut(TTimeIntervalMicroSeconds32 aTimeOut);
    1.75 +	IMPORT_C TAny* ExtensionInterface(TUid aUid);
    1.76 +
    1.77 +public:	// Called from CObexNotifyExtendClient
    1.78 +	void SignalPacketProcessEvent(TObexPacketProcessEvent aEvent);
    1.79 +	void TimeOutCompletion();
    1.80 +	
    1.81 +private:
    1.82 +	CObexClient();
    1.83 +	void ConstructL(TObexTransportInfo& aObexTransportInfo);
    1.84 +	TBool AlreadyActive(TRequestStatus& aStatus);
    1.85 +	void ClientCommandL(TOperation aOp, TAny* aParam, TRequestStatus& aStatus);
    1.86 +	// Implementation of CObex Events
    1.87 +	virtual void OnPacketReceive(CObexPacket& aPacket);
    1.88 +	virtual void OnError(TInt aError);
    1.89 +	virtual void OnTransportUp();
    1.90 +	virtual void OnTransportDown();
    1.91 +	void SetRequest(TRequestStatus& aStatus, TOperation aOperation);
    1.92 +	void CompleteRequest(const TInt aCompletion);
    1.93 +	TInt PrepareConnectPacket(CObexPacket& aPacket);	// Should be members of TConnectInfo
    1.94 +	TInt ParseConnectPacket(CObexPacket& aPacket);	
    1.95 +	void ResetConnectionID();
    1.96 +	void SetConnectionID(TUint32 aConnectionID);
    1.97 +	void EmptyHeaderSet();
    1.98 +	void SendRequestPacket();
    1.99 +	void SendRequestPacket(TObexOpcode aObexOpcode);
   1.100 +
   1.101 +private: 
   1.102 +	TRequestStatus* iPendingRequest;
   1.103 +	CObexBaseObject* iCurrentObject;
   1.104 +	TUint32 iConnectionID; 
   1.105 +	TBool iConnectionIdSet;
   1.106 +	CObexHeaderSet* iHeaderSet;
   1.107 +	CObexHeader* iHeader;
   1.108 +	CObexPacketSignaller* iPacketProcessSignaller;
   1.109 +	TObexResponse iLastReceivedResponseOpcode;
   1.110 +	CObexErrorEngine* iErrorEngine;
   1.111 +	TBool iIsLastErrorSet;
   1.112 +	TTimeIntervalMicroSeconds32 iCmdTimeOutDuration;
   1.113 +	CObexPacketTimer* iPacketTimer;
   1.114 +	};
   1.115 +
   1.116 +#endif // __OBEXCLIENT_H