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