williamr@2: /* williamr@2: * Copyright (c) 2005-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@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: * Name : sipclienttransaction.h williamr@2: * Part of : SIP Client williamr@2: * Interface : williamr@2: * Version : 1.0 williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CSIPCLIENTTRANSACTION_H williamr@2: #define CSIPCLIENTTRANSACTION_H williamr@2: williamr@2: // INCLUDES williamr@2: #include "siptransactionbase.h" williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSIPRefresh; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * @publishedAll williamr@2: * @released williamr@2: * williamr@2: * Class for managing SIP client transactions. williamr@2: * It provides services for ending and getting the SIP client transaction williamr@2: * parameters. Some client transactions can also be canceled. williamr@2: * williamr@2: * The user of the class cannot instante this class. williamr@2: * @lib sipclient williamr@2: */ williamr@2: class CSIPClientTransaction: public CSIPTransactionBase williamr@2: { williamr@2: public: // Destructor williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~CSIPClientTransaction(); williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Gets response elements of the most recent response. williamr@2: * @return Response elements. Ownership isn't transferred. williamr@2: */ williamr@2: IMPORT_C const CSIPResponseElements* ResponseElements() const; williamr@2: williamr@2: /** williamr@2: * Cancels client transaction i.e. creates a CANCEL request and sends it williamr@2: * to the remote UA. williamr@2: * @pre State()==EProceeding williamr@2: * @pre CancelAllowed()==ETrue williamr@2: * @pre Connection().State()==EActive williamr@2: * @return SIP CANCEL transaction, ownership is transferred. williamr@2: * @leave KErrSIPInvalidTransactionState if canceling is not possible williamr@2: * at all, or because the transaction is not in a proper state or the williamr@2: * transaction is not related to a dialog. williamr@2: * @leave KErrSIPResourceNotAvailable if a required SIP Client API williamr@2: * object has been deleted williamr@2: * @capability NetworkServices williamr@2: */ williamr@2: IMPORT_C CSIPClientTransaction* CancelL(); williamr@2: williamr@2: /** williamr@2: * Gets the associated refresh with the transaction. williamr@2: * If the refresh is associated with the transaction, williamr@2: * transaction will be refreshed at defined interval. williamr@2: * @return associated refresh or 0-pointer if there's no williamr@2: * associated refresh. Ownership isn't transferred. williamr@2: */ williamr@2: IMPORT_C const CSIPRefresh* Refresh() const; williamr@2: williamr@2: /** williamr@2: * Checks if the client transaction is such that it can be cancelled. williamr@2: * This does no check whether the transaction is currently in such a williamr@2: * state that the canceling can be done now. williamr@2: * williamr@2: * @return ETrue if client transaction can be cancelled; williamr@2: * EFalse otherwise williamr@2: */ williamr@2: IMPORT_C virtual TBool CancelAllowed() const; williamr@2: williamr@2: public: // Constructors, for internal use williamr@2: williamr@2: /** williamr@2: * Instantiates a CSIPClientTransaction object, leaves on failure. williamr@2: * williamr@2: * @param aType Identifies the transaction type williamr@2: * @param aAssociation Object to which the transaction is associated williamr@2: * with. williamr@2: * @param aRefresh If transaction is refreshed, this points to a williamr@2: * CSIPRefresh, otherwise this is NULL. Ownership is not transferred. williamr@2: * @return SIP client transaction, ownership is transferred. williamr@2: */ williamr@2: static CSIPClientTransaction* williamr@2: NewL(RStringF aType, williamr@2: MTransactionAssociation& aAssociation, williamr@2: CSIPRefresh* aRefresh=0); williamr@2: williamr@2: /** williamr@2: * Instantiates a CSIPClientTransaction object and pushes it into williamr@2: * CleanupStack, leaves on failure. williamr@2: * williamr@2: * @param aType Identifies the transaction type williamr@2: * @param aAssociation Object to which the transaction is associated williamr@2: * with. williamr@2: * @param aRefresh If transaction is refreshed, this points to a williamr@2: * CSIPRefresh, otherwise this is NULL. Ownership is not transferred. williamr@2: * @return SIP client transaction, ownership is transferred. williamr@2: */ williamr@2: static CSIPClientTransaction* williamr@2: NewLC(RStringF aType, williamr@2: MTransactionAssociation& aAssociation, williamr@2: CSIPRefresh* aRefresh=0); williamr@2: williamr@2: public: // New functions, for internal use williamr@2: williamr@2: /** williamr@2: * Sets the RequestId. williamr@2: * williamr@2: * @pre iRequestId == 0 williamr@2: * @pre aRequestId != 0 williamr@2: * @param aRequestId RequestId obtained from SIP client williamr@2: */ williamr@2: void SetRequestId(TUint32 aRequestId); williamr@2: williamr@2: /** williamr@2: * Gets the associated refresh with the transaction and allows williamr@2: * modification fo the refresh. This method is for internal use only. williamr@2: * williamr@2: * @return associated refresh or 0-pointer if there's no williamr@2: * associated refresh. Ownership isn't transferred. williamr@2: */ williamr@2: CSIPRefresh* Refresh(); williamr@2: williamr@2: /** williamr@2: * Clears the association from ClientTransaction to CSIPRefresh williamr@2: */ williamr@2: void RemoveRefresh(); williamr@2: williamr@2: protected: // Constructor williamr@2: williamr@2: CSIPClientTransaction(MTransactionAssociation& aAssociation, williamr@2: CSIPRefresh* aRefresh); williamr@2: williamr@2: private: // Data williamr@2: williamr@2: //Points to the refresh object if this transaction is refreshed. williamr@2: //NULL if not refreshed. Not owned. williamr@2: CSIPRefresh* iRefresh; williamr@2: williamr@2: private: // For testing purposes williamr@2: williamr@2: UNIT_TEST(CSIP_Test) williamr@2: }; williamr@2: williamr@2: #endif