epoc32/include/mw/sipdialogassocbase.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/sipdialogassocbase.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* 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
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:
williamr@2
    15
* Name        : sipdialogassocbase.h
williamr@2
    16
* Part of     : SIP Client
williamr@2
    17
* Interface   : SDK API, SIP Client API
williamr@2
    18
* Version     : 1.0
williamr@2
    19
*
williamr@2
    20
*/
williamr@2
    21
williamr@2
    22
williamr@2
    23
williamr@2
    24
#ifndef CSIPDIALOGASSOCBASE_H
williamr@2
    25
#define CSIPDIALOGASSOCBASE_H
williamr@2
    26
williamr@2
    27
// INCLUDES
williamr@2
    28
#include <stringpool.h>
williamr@2
    29
#include "_sipcodecdefs.h"
williamr@2
    30
williamr@2
    31
// FORWARD DECLARATIONS
williamr@2
    32
class CSIPMessageElements;
williamr@2
    33
class CSIPClientTransaction;
williamr@2
    34
class CSIPDialog;
williamr@2
    35
class CSIPRefresh;
williamr@2
    36
class CSIPServerTransaction;
williamr@2
    37
class CSIPDialogAssocImplementation;
williamr@2
    38
williamr@2
    39
// CLASS DECLARATION
williamr@2
    40
williamr@2
    41
/**
williamr@2
    42
*  @publishedAll
williamr@2
    43
*  @released
williamr@2
    44
*
williamr@2
    45
*  Base class for SIP dialog associations. It provides services for getting
williamr@2
    46
*  associated SIP dialog, actual dialog association type and for sending non
williamr@2
    47
*  target refresh requests within the dialog association.
williamr@2
    48
*  @lib sipclient
williamr@2
    49
*/
williamr@2
    50
class CSIPDialogAssocBase : public CBase
williamr@2
    51
	{
williamr@2
    52
	public: // Destructor
williamr@2
    53
williamr@2
    54
		/**
williamr@2
    55
		* Destructor
williamr@2
    56
        * @internalComponent		
williamr@2
    57
		*/
williamr@2
    58
		virtual ~CSIPDialogAssocBase();    
williamr@2
    59
williamr@2
    60
	public: // New functions
williamr@2
    61
williamr@2
    62
		/**
williamr@2
    63
		* Gets the dialog this dialog association belongs to
williamr@2
    64
		* @return associated dialog
williamr@2
    65
		*/
williamr@2
    66
		IMPORT_C const CSIPDialog& Dialog() const;
williamr@2
    67
williamr@2
    68
		/**
williamr@2
    69
		* Gets dialog this dialog association belongs to
williamr@2
    70
		* @return associated dialog
williamr@2
    71
		*/
williamr@2
    72
		IMPORT_C CSIPDialog& Dialog();
williamr@2
    73
williamr@2
    74
		/**
williamr@2
    75
		* Creates SIP request and sends it to the remote target.
williamr@2
    76
		* This function should be used for sending SIP extension
williamr@2
    77
		* requests within dialog assocation that do not cause 
williamr@2
    78
		* sip dialog associations to be created. In SIP terms
williamr@2
    79
		* this request is non target refresh request.
williamr@2
    80
		* @pre SIPDialog().State() != CSIPDialog::EInit &&
williamr@2
    81
		*      SIPDialog().State() != CSIPDialog::ETerminated
williamr@2
    82
        * @pre Dialog().Connection().State() == EActive
williamr@2
    83
		* @pre aMethod != "REGISTER" |"INVITE" | "BYE" | "CANCEL" | "ACK" |
williamr@2
    84
        *   "SUBSCRIBE" | "NOTIFY" | "UPDATE" | "PRACK" | "REFER"
williamr@2
    85
		* @param aElements contains optional SIP message headers and body.
williamr@2
    86
        *   Ownership is transferred.
williamr@2
    87
		* @return SIP extension client transaction. Ownership is transferred.
williamr@2
    88
		* @leave KErrSIPInvalidDialogState If dialog's state is not correct
williamr@2
    89
		* @leave KErrArgument if invalid value has been set to aMethod		
williamr@2
    90
		* @leave KErrSIPResourceNotAvailable if a required SIP Client API
williamr@2
    91
		*	object has been deleted
williamr@2
    92
		* @capability NetworkServices
williamr@2
    93
		*/
williamr@2
    94
		IMPORT_C virtual CSIPClientTransaction*
williamr@2
    95
            SendNonTargetRefreshRequestL(RStringF aMethod,
williamr@2
    96
                                         CSIPMessageElements* aElements);
williamr@2
    97
williamr@2
    98
        /**
williamr@2
    99
        * Gets dialog association type.
williamr@2
   100
        *
williamr@2
   101
        * @return dialog association type e.g. "INVITE", "SUBSCRIBE" etc...
williamr@2
   102
        */
williamr@2
   103
        IMPORT_C RStringF Type() const;
williamr@2
   104
williamr@2
   105
		/**
williamr@2
   106
        * Tests if the request is a non target refresh request
williamr@2
   107
        * @param aMethod a method to test
williamr@2
   108
        * @return ETrue if is non target refresh request; EFalse otherwise
williamr@2
   109
        */        
williamr@2
   110
        IMPORT_C TBool IsNonTargetRefreshRequest(RStringF aMethod) const;
williamr@2
   111
williamr@2
   112
	public: // New functions, for internal use
williamr@2
   113
williamr@2
   114
		/**
williamr@2
   115
		* Returns the implementation instance.
williamr@2
   116
 		* @return CSIPDialogAssocImplementation
williamr@2
   117
		*/
williamr@2
   118
		CSIPDialogAssocImplementation& Implementation();
williamr@2
   119
williamr@2
   120
		/**
williamr@2
   121
        * Searches for a refresh with the matching id. Default implementation
williamr@2
   122
        * returns NULL. Those classes derived from CSIPDialogAssocBase, which
williamr@2
   123
        * can contain refreshes must implement this function for searching the
williamr@2
   124
        * correct refresh.
williamr@2
   125
        *
williamr@2
   126
        * @return CSIPRefresh if found, NULL otherwise. 
williamr@2
   127
        *         The ownership is not transferred.
williamr@2
   128
        * @internalComponent
williamr@2
   129
        */
williamr@2
   130
        virtual CSIPRefresh* FindRefresh(TUint32 aRefreshId);
williamr@2
   131
williamr@2
   132
        /**
williamr@2
   133
        * @internalComponent
williamr@2
   134
        */
williamr@2
   135
		virtual void DeletingRefresh(CSIPRefresh& aRefresh, TUint32 aRefreshId);
williamr@2
   136
		
williamr@2
   137
	protected: // Constructors, for internal use
williamr@2
   138
williamr@2
   139
        /*
williamr@2
   140
		* Constructor
williamr@2
   141
		*/
williamr@2
   142
        CSIPDialogAssocBase();
williamr@2
   143
williamr@2
   144
        void ConstructL(RStringF aType, CSIPDialog& aDialog);
williamr@2
   145
        void ConstructL(RStringF aType,
williamr@2
   146
        				CSIPDialog& aDialog,
williamr@2
   147
        				CSIPServerTransaction& aTransaction);
williamr@2
   148
williamr@2
   149
    protected: // Data
williamr@2
   150
williamr@2
   151
        /**
williamr@2
   152
        * Implementation instance, CSIPDialogAssocBase owns it
williamr@2
   153
        * @internalComponent
williamr@2
   154
        */
williamr@2
   155
		CSIPDialogAssocImplementation* iImplementation;
williamr@2
   156
williamr@2
   157
	private: // For testing purposes
williamr@2
   158
williamr@2
   159
        UNIT_TEST(CSIPInviteDialogAssoc_Test)
williamr@2
   160
        
williamr@2
   161
        __DECLARE_TEST;
williamr@2
   162
	};
williamr@2
   163
williamr@2
   164
#endif