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