|
1 // Copyright (c) 2001-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 // $Workfile: sendopn.h $ |
|
15 // $Author: Stevep $ |
|
16 // $Revision: 10 $ |
|
17 // $Date: 25/03/02 9:25 $ |
|
18 // |
|
19 // |
|
20 |
|
21 |
|
22 #ifndef __SENDOPN_H__ |
|
23 #define __SENDOPN_H__ |
|
24 |
|
25 #include <obexsendop.h> |
|
26 |
|
27 #include <msvapi.h> |
|
28 #include <badesca.h> // CDesCArray |
|
29 #include <obex.h> |
|
30 |
|
31 |
|
32 //Panics possible during and IR send operation |
|
33 enum TIrSendOperationPanic |
|
34 { |
|
35 EIrSendOperationAlreadyActive, //< The current Obex send operation is already active |
|
36 EIrSendOperationUnknownJob, //< |
|
37 EIrSendOperationUnknownSendState, //< The current value of the send state of the send operation is not found in TObexMtmProgress::TSendState |
|
38 EIrSendOperationUnexpectedTimeout //< //< Panic if send via IR has timeout unexpectedly |
|
39 }; |
|
40 |
|
41 GLDEF_C void Panic(TIrSendOperationPanic aPanic); |
|
42 class CIrTimeoutTimer; |
|
43 |
|
44 |
|
45 // |
|
46 // CIrSendOperation |
|
47 // |
|
48 class CIrServerSendOperation : public CObexServerSendOperation |
|
49 /** |
|
50 * @class |
|
51 * |
|
52 * Infrared Send Operation: |
|
53 * |
|
54 * Thin implementation over the top of CObexSendOperation. Implements InitialiseObexClientL to initialise a |
|
55 * Obex client using Infrared as the transport mechanism. Runs on the server side. |
|
56 */ |
|
57 { |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Second phase constructor. |
|
62 * |
|
63 * @param aSendObj Reference to the object to send. |
|
64 * @param aIrProtocolInfo Protocol info to initialise the CObexCleint |
|
65 * @param aConnectTimeoutMicroSeconds Timeout period for Connect operation in microseconds. |
|
66 * @param aPutTimeoutMicroseconds Timeout period for Put operation in microseconds. |
|
67 * @param aConnectPassword Pointer to the password for Bluetooth validation. |
|
68 * @param aObserverRequestStatus Canonical TRequestStatus for control of active object. |
|
69 * @param aLastSendAttempt TBool flag to check for the second send attempt and also control header sending . EFalse sends full headers, ETrue only sends name and size. |
|
70 * @leave Leaves if insufficient memory. |
|
71 */ |
|
72 |
|
73 static CIrServerSendOperation* NewL(CMsvServerEntry& aSendObj, const TObexIrProtocolInfo& aIrProtocolInfo, TInt aConnectTimeoutMicroSeconds, TInt aPutTimeoutMicroseconds, |
|
74 const TDesC* aConnectPassword, TRequestStatus& aObserverRequestStatus, TBool aLastSendAttempt); |
|
75 |
|
76 public: // from CObexSendOperation |
|
77 |
|
78 /** |
|
79 * Initialises the Obex client to use Bluetooth as the transport mechanism with the parameters as specified in the |
|
80 * constructor. |
|
81 * |
|
82 * @leave KErrXXX system wide error codes |
|
83 */ |
|
84 |
|
85 virtual void InitialiseObexClientL(); |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * Constructor. |
|
91 * |
|
92 * @param aSendObj Reference to the object to send. |
|
93 * @param aIrProtocolInfo Protocol info to initialise the CObexCleint |
|
94 * @param aConnectTimeoutMicroSeconds Timeout period for Connect operation in microseconds. |
|
95 * @param aPutTimeoutMicroseconds Timeout period for Put operation in microseconds. |
|
96 * @param aConnectPassword Pointer to the password for Bluetooth validation. |
|
97 * @param aObserverRequestStatus Canonical TRequestStatus for control of active object. |
|
98 */ |
|
99 |
|
100 CIrServerSendOperation(CMsvServerEntry& aSendObj, const TObexIrProtocolInfo& aIrProtocolInfo, TInt aConnectTimeoutMicroSeconds, TInt aPutTimeoutMicroSeconds, TRequestStatus& aObserverRequestStatus, TBool aLastSendAttempt); |
|
101 |
|
102 /** |
|
103 * Called by the base class just before the observer is completed. |
|
104 * |
|
105 * @param aErrorCode thie code that the observer will be completed with |
|
106 * @return TBool ETrue Allow the base class to delete the message. |
|
107 * @return TBool EFalse Do NOT allow the base class to delete the message. |
|
108 * |
|
109 **/ |
|
110 TBool CompletingObserver(TInt aErrorCode); |
|
111 |
|
112 private: |
|
113 TObexIrProtocolInfo iIrProtocolInfo; //< Protocol info to initialise the CObexClient. Non-const because the CObexClient's NewL() takes a non-const reference |
|
114 }; |
|
115 |
|
116 |
|
117 #endif // __SENDOPN_H__ |