williamr@2
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// 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
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
|
williamr@2
|
17 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file
|
williamr@2
|
20 |
@publishedAll
|
williamr@2
|
21 |
@released
|
williamr@2
|
22 |
*/
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#ifndef __OBEXCLIENT_H
|
williamr@2
|
25 |
#define __OBEXCLIENT_H
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#include <obextypes.h>
|
williamr@2
|
28 |
#include <obex/internal/obextransportconstants.h>
|
williamr@2
|
29 |
#include <obexbase.h>
|
williamr@2
|
30 |
|
williamr@2
|
31 |
class CObexPacket;
|
williamr@2
|
32 |
class MObexFinalPacketObserver;
|
williamr@2
|
33 |
class CObexPacketSignaller;
|
williamr@2
|
34 |
class CObexPacketTimer;
|
williamr@2
|
35 |
class CObexErrorEngine;
|
williamr@2
|
36 |
|
williamr@2
|
37 |
/**
|
williamr@2
|
38 |
Client side functionality. Connection based.
|
williamr@2
|
39 |
Supports ...
|
williamr@2
|
40 |
- Opening IrDA TTP sockets for the OBEX session.
|
williamr@2
|
41 |
- Opening an OBEX session over a connected socket
|
williamr@2
|
42 |
- Standard OBEX (spec. version 1.2) operations.
|
williamr@2
|
43 |
|
williamr@2
|
44 |
This class is not designed for user derivation.
|
williamr@2
|
45 |
|
williamr@2
|
46 |
@publishedAll
|
williamr@2
|
47 |
@released
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
NONSHARABLE_CLASS(CObexClient) : public CObex
|
williamr@2
|
50 |
{
|
williamr@2
|
51 |
public:
|
williamr@2
|
52 |
IMPORT_C ~CObexClient();
|
williamr@2
|
53 |
IMPORT_C static CObexClient* NewL(TObexProtocolInfo& aObexProtocolInfoPtr);
|
williamr@2
|
54 |
IMPORT_C static CObexClient* NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy);
|
williamr@2
|
55 |
IMPORT_C static CObexClient* NewL(TObexTransportInfo& aObexTransportInfo);
|
williamr@2
|
56 |
IMPORT_C void Connect(TRequestStatus& aStatus);
|
williamr@2
|
57 |
IMPORT_C void Connect(CObexBaseObject& aObject, TRequestStatus& aStatus);
|
williamr@2
|
58 |
IMPORT_C void ConnectL(CObexBaseObject& aObject, const TDesC& aPassword,
|
williamr@2
|
59 |
TRequestStatus& aStatus);
|
williamr@2
|
60 |
IMPORT_C void ConnectL(const TDesC& aPassword, TRequestStatus& aStatus);
|
williamr@2
|
61 |
IMPORT_C void Disconnect(TRequestStatus& aStatus);
|
williamr@2
|
62 |
IMPORT_C void Put(CObexBaseObject& aObject, TRequestStatus& aStatus);
|
williamr@2
|
63 |
IMPORT_C void Get(CObexBaseObject& aObject, TRequestStatus& aStatus);
|
williamr@2
|
64 |
IMPORT_C void SetPath(TSetPathInfo& aPathInfo, TRequestStatus& aStatus);
|
williamr@2
|
65 |
IMPORT_C void Abort();
|
williamr@2
|
66 |
IMPORT_C void UserPasswordL( const TDesC& aPassword);
|
williamr@2
|
67 |
IMPORT_C const CObexHeaderSet& GetPutFinalResponseHeaders();
|
williamr@2
|
68 |
IMPORT_C void SetFinalPacketObserver(MObexFinalPacketObserver* aObserver);
|
williamr@2
|
69 |
IMPORT_C TObexResponse LastServerResponseCode() const;
|
williamr@2
|
70 |
IMPORT_C void SetCommandTimeOut(TTimeIntervalMicroSeconds32 aTimeOut);
|
williamr@2
|
71 |
IMPORT_C TAny* ExtensionInterface(TUid aUid);
|
williamr@2
|
72 |
|
williamr@2
|
73 |
public: // Called from CObexNotifyExtendClient
|
williamr@2
|
74 |
void SignalPacketProcessEvent(TObexPacketProcessEvent aEvent);
|
williamr@2
|
75 |
void TimeOutCompletion();
|
williamr@2
|
76 |
|
williamr@2
|
77 |
private:
|
williamr@2
|
78 |
CObexClient();
|
williamr@2
|
79 |
void ConstructL(TObexTransportInfo& aObexTransportInfo);
|
williamr@2
|
80 |
TBool AlreadyActive(TRequestStatus& aStatus);
|
williamr@2
|
81 |
void ClientCommandL(TOperation aOp, TAny* aParam, TRequestStatus& aStatus);
|
williamr@2
|
82 |
// Implementation of CObex Events
|
williamr@2
|
83 |
virtual void OnPacketReceive(CObexPacket& aPacket);
|
williamr@2
|
84 |
virtual void OnError(TInt aError);
|
williamr@2
|
85 |
virtual void OnTransportUp();
|
williamr@2
|
86 |
virtual void OnTransportDown();
|
williamr@2
|
87 |
void SetRequest(TRequestStatus& aStatus, TOperation aOperation);
|
williamr@2
|
88 |
void CompleteRequest(const TInt aCompletion);
|
williamr@2
|
89 |
TInt PrepareConnectPacket(CObexPacket& aPacket); // Should be members of TConnectInfo
|
williamr@2
|
90 |
TInt ParseConnectPacket(CObexPacket& aPacket);
|
williamr@2
|
91 |
void ResetConnectionID();
|
williamr@2
|
92 |
void SetConnectionID(TUint32 aConnectionID);
|
williamr@2
|
93 |
void EmptyHeaderSet();
|
williamr@2
|
94 |
void SendRequestPacket();
|
williamr@2
|
95 |
void SendRequestPacket(TObexOpcode aObexOpcode);
|
williamr@2
|
96 |
|
williamr@2
|
97 |
private:
|
williamr@2
|
98 |
TRequestStatus* iPendingRequest;
|
williamr@2
|
99 |
CObexBaseObject* iCurrentObject;
|
williamr@2
|
100 |
TUint32 iConnectionID;
|
williamr@2
|
101 |
TBool iConnectionIdSet;
|
williamr@2
|
102 |
CObexHeaderSet* iHeaderSet;
|
williamr@2
|
103 |
CObexHeader* iHeader;
|
williamr@2
|
104 |
CObexPacketSignaller* iPacketProcessSignaller;
|
williamr@2
|
105 |
TObexResponse iLastReceivedResponseOpcode;
|
williamr@2
|
106 |
CObexErrorEngine* iErrorEngine;
|
williamr@2
|
107 |
TBool iIsLastErrorSet;
|
williamr@2
|
108 |
TTimeIntervalMicroSeconds32 iCmdTimeOutDuration;
|
williamr@2
|
109 |
CObexPacketTimer* iPacketTimer;
|
williamr@2
|
110 |
};
|
williamr@2
|
111 |
|
williamr@2
|
112 |
#endif // __OBEXCLIENT_H
|