1.1 --- a/epoc32/include/sipclienttransaction.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipclienttransaction.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,173 @@
1.4 -sipclienttransaction.h
1.5 +/*
1.6 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Name : sipclienttransaction.h
1.20 +* Part of : SIP Client
1.21 +* Interface :
1.22 +* Version : 1.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +#ifndef CSIPCLIENTTRANSACTION_H
1.30 +#define CSIPCLIENTTRANSACTION_H
1.31 +
1.32 +// INCLUDES
1.33 +#include "siptransactionbase.h"
1.34 +
1.35 +// FORWARD DECLARATIONS
1.36 +class CSIPRefresh;
1.37 +
1.38 +// CLASS DECLARATION
1.39 +
1.40 +/**
1.41 +* @publishedAll
1.42 +* @released
1.43 +*
1.44 +* Class for managing SIP client transactions.
1.45 +* It provides services for ending and getting the SIP client transaction
1.46 +* parameters. Some client transactions can also be canceled.
1.47 +*
1.48 +* The user of the class cannot instante this class.
1.49 +* @lib sipclient
1.50 +*/
1.51 +class CSIPClientTransaction: public CSIPTransactionBase
1.52 + {
1.53 + public: // Destructor
1.54 +
1.55 + /**
1.56 + * Destructor
1.57 + */
1.58 + IMPORT_C ~CSIPClientTransaction();
1.59 +
1.60 + public: // New functions
1.61 +
1.62 + /**
1.63 + * Gets response elements of the most recent response.
1.64 + * @return Response elements. Ownership isn't transferred.
1.65 + */
1.66 + IMPORT_C const CSIPResponseElements* ResponseElements() const;
1.67 +
1.68 + /**
1.69 + * Cancels client transaction i.e. creates a CANCEL request and sends it
1.70 + * to the remote UA.
1.71 + * @pre State()==EProceeding
1.72 + * @pre CancelAllowed()==ETrue
1.73 + * @pre Connection().State()==EActive
1.74 + * @return SIP CANCEL transaction, ownership is transferred.
1.75 + * @leave KErrSIPInvalidTransactionState if canceling is not possible
1.76 + * at all, or because the transaction is not in a proper state or the
1.77 + * transaction is not related to a dialog.
1.78 + * @leave KErrSIPResourceNotAvailable if a required SIP Client API
1.79 + * object has been deleted
1.80 + * @capability NetworkServices
1.81 + */
1.82 + IMPORT_C CSIPClientTransaction* CancelL();
1.83 +
1.84 + /**
1.85 + * Gets the associated refresh with the transaction.
1.86 + * If the refresh is associated with the transaction,
1.87 + * transaction will be refreshed at defined interval.
1.88 + * @return associated refresh or 0-pointer if there's no
1.89 + * associated refresh. Ownership isn't transferred.
1.90 + */
1.91 + IMPORT_C const CSIPRefresh* Refresh() const;
1.92 +
1.93 + /**
1.94 + * Checks if the client transaction is such that it can be cancelled.
1.95 + * This does no check whether the transaction is currently in such a
1.96 + * state that the canceling can be done now.
1.97 + *
1.98 + * @return ETrue if client transaction can be cancelled;
1.99 + * EFalse otherwise
1.100 + */
1.101 + IMPORT_C virtual TBool CancelAllowed() const;
1.102 +
1.103 + public: // Constructors, for internal use
1.104 +
1.105 + /**
1.106 + * Instantiates a CSIPClientTransaction object, leaves on failure.
1.107 + *
1.108 + * @param aType Identifies the transaction type
1.109 + * @param aAssociation Object to which the transaction is associated
1.110 + * with.
1.111 + * @param aRefresh If transaction is refreshed, this points to a
1.112 + * CSIPRefresh, otherwise this is NULL. Ownership is not transferred.
1.113 + * @return SIP client transaction, ownership is transferred.
1.114 + */
1.115 + static CSIPClientTransaction*
1.116 + NewL(RStringF aType,
1.117 + MTransactionAssociation& aAssociation,
1.118 + CSIPRefresh* aRefresh=0);
1.119 +
1.120 + /**
1.121 + * Instantiates a CSIPClientTransaction object and pushes it into
1.122 + * CleanupStack, leaves on failure.
1.123 + *
1.124 + * @param aType Identifies the transaction type
1.125 + * @param aAssociation Object to which the transaction is associated
1.126 + * with.
1.127 + * @param aRefresh If transaction is refreshed, this points to a
1.128 + * CSIPRefresh, otherwise this is NULL. Ownership is not transferred.
1.129 + * @return SIP client transaction, ownership is transferred.
1.130 + */
1.131 + static CSIPClientTransaction*
1.132 + NewLC(RStringF aType,
1.133 + MTransactionAssociation& aAssociation,
1.134 + CSIPRefresh* aRefresh=0);
1.135 +
1.136 + public: // New functions, for internal use
1.137 +
1.138 + /**
1.139 + * Sets the RequestId.
1.140 + *
1.141 + * @pre iRequestId == 0
1.142 + * @pre aRequestId != 0
1.143 + * @param aRequestId RequestId obtained from SIP client
1.144 + */
1.145 + void SetRequestId(TUint32 aRequestId);
1.146 +
1.147 + /**
1.148 + * Gets the associated refresh with the transaction and allows
1.149 + * modification fo the refresh. This method is for internal use only.
1.150 + *
1.151 + * @return associated refresh or 0-pointer if there's no
1.152 + * associated refresh. Ownership isn't transferred.
1.153 + */
1.154 + CSIPRefresh* Refresh();
1.155 +
1.156 + /**
1.157 + * Clears the association from ClientTransaction to CSIPRefresh
1.158 + */
1.159 + void RemoveRefresh();
1.160 +
1.161 + protected: // Constructor
1.162 +
1.163 + CSIPClientTransaction(MTransactionAssociation& aAssociation,
1.164 + CSIPRefresh* aRefresh);
1.165 +
1.166 + private: // Data
1.167 +
1.168 + //Points to the refresh object if this transaction is refreshed.
1.169 + //NULL if not refreshed. Not owned.
1.170 + CSIPRefresh* iRefresh;
1.171 +
1.172 + private: // For testing purposes
1.173 +
1.174 + UNIT_TEST(CSIP_Test)
1.175 + };
1.176 +
1.177 +#endif