williamr@2
|
1 |
// Copyright (c) 2001-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 CProtTransaction.h
|
williamr@2
|
20 |
@warning : This file contains Rose Model ID comments - please do not delete
|
williamr@2
|
21 |
*/
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#ifndef __CPROTTRANSACTION_H__
|
williamr@2
|
24 |
#define __CPROTTRANSACTION_H__
|
williamr@2
|
25 |
|
williamr@2
|
26 |
// System includes
|
williamr@2
|
27 |
#include <e32base.h>
|
williamr@2
|
28 |
#include <http/rhttptransaction.h>
|
williamr@2
|
29 |
|
williamr@2
|
30 |
// Forward declarations
|
williamr@2
|
31 |
class CTxData;
|
williamr@2
|
32 |
class CRxData;
|
williamr@2
|
33 |
class MRxDataObserver;
|
williamr@2
|
34 |
|
williamr@2
|
35 |
|
williamr@2
|
36 |
//##ModelId=3B1E52B30382
|
williamr@2
|
37 |
class CProtTransaction : public CBase
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
A representation of a transaction used by protocol handlers.
|
williamr@2
|
40 |
This class is lower-level than the RHTTPTransaction class,
|
williamr@2
|
41 |
since it owns objects that represent the request and response data as
|
williamr@2
|
42 |
transmitted and received over a transport medium.
|
williamr@2
|
43 |
@publishedAll
|
williamr@2
|
44 |
@released
|
williamr@2
|
45 |
*/
|
williamr@2
|
46 |
{
|
williamr@2
|
47 |
public: // Enums
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/** The TTransactionState type defines the states of a transaction.
|
williamr@2
|
50 |
*/
|
williamr@2
|
51 |
enum TTransactionState
|
williamr@2
|
52 |
{
|
williamr@2
|
53 |
/** Specifies that the transaction is pending servicing.
|
williamr@2
|
54 |
*/
|
williamr@2
|
55 |
EPending = 0,
|
williamr@2
|
56 |
/** Specifies that the transaction is being serviced - active.
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
EActive,
|
williamr@2
|
59 |
/** Specifies that the transaction has been cancelled.
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
ECancelled,
|
williamr@2
|
62 |
/** Specifies that the transaction has completed.
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
ECompleted
|
williamr@2
|
65 |
};
|
williamr@2
|
66 |
|
williamr@2
|
67 |
public:
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/**
|
williamr@2
|
70 |
Intended Usage: Destructor - cleans up and releases resources to the system
|
williamr@2
|
71 |
*/
|
williamr@2
|
72 |
//##ModelId=3B1E52B40031
|
williamr@2
|
73 |
IMPORT_C virtual ~CProtTransaction();
|
williamr@2
|
74 |
|
williamr@2
|
75 |
public: // accessors
|
williamr@2
|
76 |
|
williamr@2
|
77 |
/**
|
williamr@2
|
78 |
Provides the state of the transaction, e.g. pending,
|
williamr@2
|
79 |
active, etc.
|
williamr@2
|
80 |
@return A enum specifying the state of the transaction.
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
//##ModelId=3C4C37E50306
|
williamr@2
|
83 |
TTransactionState TransactionState() const;
|
williamr@2
|
84 |
|
williamr@2
|
85 |
/**
|
williamr@2
|
86 |
Sets the state of the transaction.
|
williamr@2
|
87 |
@param aState The state that the transaction is in.
|
williamr@2
|
88 |
@post The state of the transaction has been updated.
|
williamr@2
|
89 |
*/
|
williamr@2
|
90 |
//##ModelId=3C4C37E502D4
|
williamr@2
|
91 |
void SetTransactionState(TTransactionState aState);
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
Resets the Rx data object. The Rx data object must be
|
williamr@2
|
95 |
created again to be used.
|
williamr@2
|
96 |
@post The Rx data objects has been reset.
|
williamr@2
|
97 |
*/
|
williamr@2
|
98 |
//##ModelId=3C4C37E502CA
|
williamr@2
|
99 |
IMPORT_C void ResetRxData();
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
Resets the Tx data object. The Tx data object must be
|
williamr@2
|
103 |
created again to be used.
|
williamr@2
|
104 |
@post The Tx data objects has been reset.
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
//##ModelId=3C4C37E502C0
|
williamr@2
|
107 |
IMPORT_C void ResetTxData();
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
Obtain the API-level transaction to which this object
|
williamr@2
|
111 |
corresponds to.
|
williamr@2
|
112 |
@return The API-level transaction that this object corresponds to.
|
williamr@2
|
113 |
*/
|
williamr@2
|
114 |
//##ModelId=3B1E52B40013
|
williamr@2
|
115 |
IMPORT_C RHTTPTransaction Transaction() const;
|
williamr@2
|
116 |
|
williamr@2
|
117 |
/**
|
williamr@2
|
118 |
Obtain the Transmit Data portion of the transaction.
|
williamr@2
|
119 |
@return A reference to the Tx data object of the transaction.
|
williamr@2
|
120 |
*/
|
williamr@2
|
121 |
//##ModelId=3B1E52B40012
|
williamr@2
|
122 |
IMPORT_C CTxData& TxData() const;
|
williamr@2
|
123 |
|
williamr@2
|
124 |
/**
|
williamr@2
|
125 |
Obtain the Receive Data portion of the transaction.
|
williamr@2
|
126 |
@return A reference to the Rx data object of the transaction.
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
//##ModelId=3B1E52B40009
|
williamr@2
|
129 |
IMPORT_C CRxData& RxData() const;
|
williamr@2
|
130 |
|
williamr@2
|
131 |
public: // Methods to be implemented by derived classes
|
williamr@2
|
132 |
|
williamr@2
|
133 |
/**
|
williamr@2
|
134 |
Intended Usage: Creates the appropriate CTxData object.
|
williamr@2
|
135 |
@leave KErrNoMemory if there is not enough memory available to
|
williamr@2
|
136 |
create the object.
|
williamr@2
|
137 |
*/
|
williamr@2
|
138 |
//##ModelId=3C4C37E502AC
|
williamr@2
|
139 |
virtual void CreateTxDataL() =0;
|
williamr@2
|
140 |
|
williamr@2
|
141 |
/**
|
williamr@2
|
142 |
Intended Usage: Creates the appropriate CRxData object.
|
williamr@2
|
143 |
@leave KErrNoMemory if there is not enough memory available to
|
williamr@2
|
144 |
create the object.
|
williamr@2
|
145 |
@param aObserver A reference to the observer for the Rx data object.
|
williamr@2
|
146 |
*/
|
williamr@2
|
147 |
//##ModelId=3C4C37E50284
|
williamr@2
|
148 |
virtual void CreateRxDataL(MRxDataObserver& aObserver) =0;
|
williamr@2
|
149 |
|
williamr@2
|
150 |
protected: // Methods
|
williamr@2
|
151 |
|
williamr@2
|
152 |
/**
|
williamr@2
|
153 |
Default constructor
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
//##ModelId=3B1E52B303E6
|
williamr@2
|
156 |
CProtTransaction();
|
williamr@2
|
157 |
|
williamr@2
|
158 |
/**
|
williamr@2
|
159 |
Normal constructor, of a CProtTransaction that corresponds to the
|
williamr@2
|
160 |
supplied client transaction handle.
|
williamr@2
|
161 |
@param aTrans (in) The client transaction handle.
|
williamr@2
|
162 |
*/
|
williamr@2
|
163 |
//##ModelId=3B1E52B303E7
|
williamr@2
|
164 |
IMPORT_C CProtTransaction(RHTTPTransaction aTrans);
|
williamr@2
|
165 |
|
williamr@2
|
166 |
protected: // Attributes
|
williamr@2
|
167 |
|
williamr@2
|
168 |
/** The client transaction
|
williamr@2
|
169 |
*/
|
williamr@2
|
170 |
//##ModelId=3B1E52B303D4
|
williamr@2
|
171 |
RHTTPTransaction iTrans;
|
williamr@2
|
172 |
|
williamr@2
|
173 |
/** The transmission data
|
williamr@2
|
174 |
*/
|
williamr@2
|
175 |
//##ModelId=3B1E52B303CA
|
williamr@2
|
176 |
CTxData* iTxData;
|
williamr@2
|
177 |
|
williamr@2
|
178 |
/** The received data
|
williamr@2
|
179 |
*/
|
williamr@2
|
180 |
//##ModelId=3B1E52B303C0
|
williamr@2
|
181 |
CRxData* iRxData;
|
williamr@2
|
182 |
|
williamr@2
|
183 |
/** Transaction state indicator.
|
williamr@2
|
184 |
*/
|
williamr@2
|
185 |
//##ModelId=3C4C37E50247
|
williamr@2
|
186 |
TTransactionState iTransactionState;
|
williamr@2
|
187 |
|
williamr@2
|
188 |
private: // methods
|
williamr@2
|
189 |
|
williamr@2
|
190 |
/**
|
williamr@2
|
191 |
Intended Usage: Reserve a slot in the v-table to preserve future BC
|
williamr@2
|
192 |
*/
|
williamr@2
|
193 |
//##ModelId=3C4C37E5026F
|
williamr@2
|
194 |
inline virtual void Reserved1();
|
williamr@2
|
195 |
|
williamr@2
|
196 |
/**
|
williamr@2
|
197 |
Intended Usage: Reserve a slot in the v-table to preserve future BC
|
williamr@2
|
198 |
*/
|
williamr@2
|
199 |
//##ModelId=3C4C37E50251
|
williamr@2
|
200 |
inline virtual void Reserved2();
|
williamr@2
|
201 |
};
|
williamr@2
|
202 |
|
williamr@2
|
203 |
|
williamr@2
|
204 |
inline void CProtTransaction::Reserved1()
|
williamr@2
|
205 |
{}
|
williamr@2
|
206 |
inline void CProtTransaction::Reserved2()
|
williamr@2
|
207 |
{}
|
williamr@2
|
208 |
|
williamr@2
|
209 |
|
williamr@2
|
210 |
#endif // __CPROTTRANSACTION_H__
|