williamr@2: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: /** williamr@2: @file CProtTransaction.h williamr@2: @warning : This file contains Rose Model ID comments - please do not delete williamr@2: */ williamr@2: williamr@2: #ifndef __CPROTTRANSACTION_H__ williamr@2: #define __CPROTTRANSACTION_H__ williamr@2: williamr@2: // System includes williamr@2: #include williamr@2: #include williamr@2: williamr@2: // Forward declarations williamr@2: class CTxData; williamr@2: class CRxData; williamr@2: class MRxDataObserver; williamr@2: williamr@2: williamr@2: //##ModelId=3B1E52B30382 williamr@2: class CProtTransaction : public CBase williamr@2: /** williamr@2: A representation of a transaction used by protocol handlers. williamr@2: This class is lower-level than the RHTTPTransaction class, williamr@2: since it owns objects that represent the request and response data as williamr@2: transmitted and received over a transport medium. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: // Enums williamr@2: williamr@2: /** The TTransactionState type defines the states of a transaction. williamr@2: */ williamr@2: enum TTransactionState williamr@2: { williamr@2: /** Specifies that the transaction is pending servicing. williamr@2: */ williamr@2: EPending = 0, williamr@2: /** Specifies that the transaction is being serviced - active. williamr@2: */ williamr@2: EActive, williamr@2: /** Specifies that the transaction has been cancelled. williamr@2: */ williamr@2: ECancelled, williamr@2: /** Specifies that the transaction has completed. williamr@2: */ williamr@2: ECompleted williamr@2: }; williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: Intended Usage: Destructor - cleans up and releases resources to the system williamr@2: */ williamr@2: //##ModelId=3B1E52B40031 williamr@2: IMPORT_C virtual ~CProtTransaction(); williamr@2: williamr@2: public: // accessors williamr@2: williamr@2: /** williamr@2: Provides the state of the transaction, e.g. pending, williamr@2: active, etc. williamr@2: @return A enum specifying the state of the transaction. williamr@2: */ williamr@2: //##ModelId=3C4C37E50306 williamr@2: TTransactionState TransactionState() const; williamr@2: williamr@2: /** williamr@2: Sets the state of the transaction. williamr@2: @param aState The state that the transaction is in. williamr@2: @post The state of the transaction has been updated. williamr@2: */ williamr@2: //##ModelId=3C4C37E502D4 williamr@2: void SetTransactionState(TTransactionState aState); williamr@2: williamr@2: /** williamr@2: Resets the Rx data object. The Rx data object must be williamr@2: created again to be used. williamr@2: @post The Rx data objects has been reset. williamr@2: */ williamr@2: //##ModelId=3C4C37E502CA williamr@2: IMPORT_C void ResetRxData(); williamr@2: williamr@2: /** williamr@2: Resets the Tx data object. The Tx data object must be williamr@2: created again to be used. williamr@2: @post The Tx data objects has been reset. williamr@2: */ williamr@2: //##ModelId=3C4C37E502C0 williamr@2: IMPORT_C void ResetTxData(); williamr@2: williamr@2: /** williamr@2: Obtain the API-level transaction to which this object williamr@2: corresponds to. williamr@2: @return The API-level transaction that this object corresponds to. williamr@2: */ williamr@2: //##ModelId=3B1E52B40013 williamr@2: IMPORT_C RHTTPTransaction Transaction() const; williamr@2: williamr@2: /** williamr@2: Obtain the Transmit Data portion of the transaction. williamr@2: @return A reference to the Tx data object of the transaction. williamr@2: */ williamr@2: //##ModelId=3B1E52B40012 williamr@2: IMPORT_C CTxData& TxData() const; williamr@2: williamr@2: /** williamr@2: Obtain the Receive Data portion of the transaction. williamr@2: @return A reference to the Rx data object of the transaction. williamr@2: */ williamr@2: //##ModelId=3B1E52B40009 williamr@2: IMPORT_C CRxData& RxData() const; williamr@2: williamr@2: public: // Methods to be implemented by derived classes williamr@2: williamr@2: /** williamr@2: Intended Usage: Creates the appropriate CTxData object. williamr@2: @leave KErrNoMemory if there is not enough memory available to williamr@2: create the object. williamr@2: */ williamr@2: //##ModelId=3C4C37E502AC williamr@2: virtual void CreateTxDataL() =0; williamr@2: williamr@2: /** williamr@2: Intended Usage: Creates the appropriate CRxData object. williamr@2: @leave KErrNoMemory if there is not enough memory available to williamr@2: create the object. williamr@2: @param aObserver A reference to the observer for the Rx data object. williamr@2: */ williamr@2: //##ModelId=3C4C37E50284 williamr@2: virtual void CreateRxDataL(MRxDataObserver& aObserver) =0; williamr@2: williamr@2: protected: // Methods williamr@2: williamr@2: /** williamr@2: Default constructor williamr@2: */ williamr@2: //##ModelId=3B1E52B303E6 williamr@2: CProtTransaction(); williamr@2: williamr@2: /** williamr@2: Normal constructor, of a CProtTransaction that corresponds to the williamr@2: supplied client transaction handle. williamr@2: @param aTrans (in) The client transaction handle. williamr@2: */ williamr@2: //##ModelId=3B1E52B303E7 williamr@2: IMPORT_C CProtTransaction(RHTTPTransaction aTrans); williamr@2: williamr@2: protected: // Attributes williamr@2: williamr@2: /** The client transaction williamr@2: */ williamr@2: //##ModelId=3B1E52B303D4 williamr@2: RHTTPTransaction iTrans; williamr@2: williamr@2: /** The transmission data williamr@2: */ williamr@2: //##ModelId=3B1E52B303CA williamr@2: CTxData* iTxData; williamr@2: williamr@2: /** The received data williamr@2: */ williamr@2: //##ModelId=3B1E52B303C0 williamr@2: CRxData* iRxData; williamr@2: williamr@2: /** Transaction state indicator. williamr@2: */ williamr@2: //##ModelId=3C4C37E50247 williamr@2: TTransactionState iTransactionState; williamr@2: williamr@2: private: // methods williamr@2: williamr@2: /** williamr@2: Intended Usage: Reserve a slot in the v-table to preserve future BC williamr@2: */ williamr@2: //##ModelId=3C4C37E5026F williamr@2: inline virtual void Reserved1(); williamr@2: williamr@2: /** williamr@2: Intended Usage: Reserve a slot in the v-table to preserve future BC williamr@2: */ williamr@2: //##ModelId=3C4C37E50251 williamr@2: inline virtual void Reserved2(); williamr@2: }; williamr@2: williamr@2: williamr@2: inline void CProtTransaction::Reserved1() williamr@2: {} williamr@2: inline void CProtTransaction::Reserved2() williamr@2: {} williamr@2: williamr@2: williamr@2: #endif // __CPROTTRANSACTION_H__ williamr@4: