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