|
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef IDWSF_SESSION_CONSUMER_H |
|
26 #define IDWSF_SESSION_CONSUMER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> |
|
30 #include <e32des8.h> // HBufC8 |
|
31 |
|
32 #include "msenremoteserviceconsumer.h" |
|
33 #include "senpointermap.h" |
|
34 |
|
35 #include "idwsfmessage.h" |
|
36 |
|
37 |
|
38 // DATA TYPES |
|
39 typedef RSenPointerMap<TDesC8, HBufC8> RSentMessagesPointerMap; |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CIdWsfMessage; |
|
43 class RFileLogger; |
|
44 |
|
45 //class CSenPolicy; // deprecated, not in use |
|
46 |
|
47 // CLASS DECLARATION |
|
48 class CIdWsfSessionConsumer : public CBase, public MSenRemoteServiceConsumer |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 static CIdWsfSessionConsumer* NewL(MSenRemoteServiceConsumer& aServiceConsumer, |
|
53 RFileLogger& aLogger); |
|
54 |
|
55 static CIdWsfSessionConsumer* NewLC(MSenRemoteServiceConsumer& aServiceConsumer, |
|
56 RFileLogger& aLogger); |
|
57 |
|
58 virtual ~CIdWsfSessionConsumer(); |
|
59 |
|
60 // New functions |
|
61 |
|
62 /** |
|
63 * Expects() is called by CIdWsfServiceSession to check |
|
64 * whether or not this consumer expects certain response |
|
65 */ |
|
66 virtual TBool Expects(const TDesC8& aRefToMessageID); |
|
67 |
|
68 const TDesC8& Id() const; |
|
69 TInt SetSessionL(MSenRemoteServiceSession& iServiceSession); |
|
70 |
|
71 TInt HandleIdWsfMessageL( CIdWsfMessage* apMessage, |
|
72 const TInt aTxnId, |
|
73 MSenProperties* aResponseTransportProperties, |
|
74 TBool aCompleteMessage ); |
|
75 |
|
76 TInt HandleMessageL( HBufC8* aMessage, |
|
77 const TInt aTxnId, |
|
78 MSenProperties* aResponseTransportProperties ); |
|
79 |
|
80 TInt HandleErrorL( HBufC8* aError, |
|
81 const TInt aErrorCode, |
|
82 const TInt aTxnId, |
|
83 MSenProperties* aResponseTransportProperties ); |
|
84 |
|
85 void SetStatusL(const TInt status); |
|
86 |
|
87 TInt MessageForSendingL(const TDesC8& aBody, |
|
88 const TDesC8& aReceivedMessageId, |
|
89 CIdWsfMessage*& aMessage); |
|
90 |
|
91 void SetSentMessageIdL(const TDesC8& aSentMessageId); |
|
92 TPtrC8 SentMessageId(); |
|
93 void SetReceivedMessageIdL(const TDesC8& aReceivedMessageId); |
|
94 TPtrC8 ReceivedMessageId(); |
|
95 CSenIdentifier& Identifier() const; |
|
96 TDesC8* BodyL(const TDesC8& aMessageID) const; |
|
97 MSenTransport& TransportL(); |
|
98 virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk); |
|
99 virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap, |
|
100 const TDesC8& aSoapOrCid, TInt aProgress); |
|
101 virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; |
|
102 protected: |
|
103 RFileLogger* Log() const; |
|
104 |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * C++ default constructor. |
|
110 */ |
|
111 CIdWsfSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer, |
|
112 RFileLogger& aLogger); |
|
113 |
|
114 /** |
|
115 * By default Symbian 2nd phase constructor is private. |
|
116 */ |
|
117 void ConstructL(); |
|
118 |
|
119 |
|
120 |
|
121 private: // Data |
|
122 MSenRemoteServiceConsumer& iConsumer; |
|
123 RFileLogger& iLogger; |
|
124 HBufC8* iSentMessageId; // owned |
|
125 HBufC8* iReceivedMessageId; // owned |
|
126 RSentMessagesPointerMap iSentMessages; // owned |
|
127 }; |
|
128 |
|
129 #endif // IDWSF_SESSION_CONSUMER_H |
|
130 |
|
131 // End of File |