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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 @file CProtTransaction.h
18 @warning : This file contains Rose Model ID comments - please do not delete
21 #ifndef __CPROTTRANSACTION_H__
22 #define __CPROTTRANSACTION_H__
26 #include <http/rhttptransaction.h>
28 // Forward declarations
31 class MRxDataObserver;
34 //##ModelId=3B1E52B30382
35 class CProtTransaction : public CBase
37 A representation of a transaction used by protocol handlers.
38 This class is lower-level than the RHTTPTransaction class,
39 since it owns objects that represent the request and response data as
40 transmitted and received over a transport medium.
47 /** The TTransactionState type defines the states of a transaction.
49 enum TTransactionState
51 /** Specifies that the transaction is pending servicing.
54 /** Specifies that the transaction is being serviced - active.
57 /** Specifies that the transaction has been cancelled.
60 /** Specifies that the transaction has completed.
68 Intended Usage: Destructor - cleans up and releases resources to the system
70 //##ModelId=3B1E52B40031
71 IMPORT_C virtual ~CProtTransaction();
76 Provides the state of the transaction, e.g. pending,
78 @return A enum specifying the state of the transaction.
80 //##ModelId=3C4C37E50306
81 TTransactionState TransactionState() const;
84 Sets the state of the transaction.
85 @param aState The state that the transaction is in.
86 @post The state of the transaction has been updated.
88 //##ModelId=3C4C37E502D4
89 void SetTransactionState(TTransactionState aState);
92 Resets the Rx data object. The Rx data object must be
93 created again to be used.
94 @post The Rx data objects has been reset.
96 //##ModelId=3C4C37E502CA
97 IMPORT_C void ResetRxData();
100 Resets the Tx data object. The Tx data object must be
101 created again to be used.
102 @post The Tx data objects has been reset.
104 //##ModelId=3C4C37E502C0
105 IMPORT_C void ResetTxData();
108 Obtain the API-level transaction to which this object
110 @return The API-level transaction that this object corresponds to.
112 //##ModelId=3B1E52B40013
113 IMPORT_C RHTTPTransaction Transaction() const;
116 Obtain the Transmit Data portion of the transaction.
117 @return A reference to the Tx data object of the transaction.
119 //##ModelId=3B1E52B40012
120 IMPORT_C CTxData& TxData() const;
123 Obtain the Receive Data portion of the transaction.
124 @return A reference to the Rx data object of the transaction.
126 //##ModelId=3B1E52B40009
127 IMPORT_C CRxData& RxData() const;
129 public: // Methods to be implemented by derived classes
132 Intended Usage: Creates the appropriate CTxData object.
133 @leave KErrNoMemory if there is not enough memory available to
136 //##ModelId=3C4C37E502AC
137 virtual void CreateTxDataL() =0;
140 Intended Usage: Creates the appropriate CRxData object.
141 @leave KErrNoMemory if there is not enough memory available to
143 @param aObserver A reference to the observer for the Rx data object.
145 //##ModelId=3C4C37E50284
146 virtual void CreateRxDataL(MRxDataObserver& aObserver) =0;
148 protected: // Methods
153 //##ModelId=3B1E52B303E6
157 Normal constructor, of a CProtTransaction that corresponds to the
158 supplied client transaction handle.
159 @param aTrans (in) The client transaction handle.
161 //##ModelId=3B1E52B303E7
162 IMPORT_C CProtTransaction(RHTTPTransaction aTrans);
164 protected: // Attributes
166 /** The client transaction
168 //##ModelId=3B1E52B303D4
169 RHTTPTransaction iTrans;
171 /** The transmission data
173 //##ModelId=3B1E52B303CA
176 /** The received data
178 //##ModelId=3B1E52B303C0
181 /** Transaction state indicator.
183 //##ModelId=3C4C37E50247
184 TTransactionState iTransactionState;
189 Intended Usage: Reserve a slot in the v-table to preserve future BC
191 //##ModelId=3C4C37E5026F
192 inline virtual void Reserved1();
195 Intended Usage: Reserve a slot in the v-table to preserve future BC
197 //##ModelId=3C4C37E50251
198 inline virtual void Reserved2();
202 inline void CProtTransaction::Reserved1()
204 inline void CProtTransaction::Reserved2()
208 #endif // __CPROTTRANSACTION_H__