epoc32/include/sip.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/sip.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/sip.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,162 @@
     1.4 -sip.h
     1.5 +/*
     1.6 +* Copyright (c) 2007-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        : sip.h
    1.20 +* Part of     : SIP Client
    1.21 +* Interface   : SDK API, SIP Client API
    1.22 +* Version     : 2.0
    1.23 +*
    1.24 +*/
    1.25 +
    1.26 +
    1.27 +
    1.28 +#ifndef CSIP_H
    1.29 +#define CSIP_H
    1.30 +
    1.31 +// INCLUDES
    1.32 +#include <e32base.h>
    1.33 +#include "_sipcodecdefs.h"
    1.34 +
    1.35 +// FORWARD DECLARATIONS
    1.36 +class CDesC8Array;
    1.37 +class MSIPObserver;
    1.38 +class CSIPConnection;
    1.39 +class CSIPImplementation;
    1.40 +
    1.41 +// CLASS DECLARATION
    1.42 +
    1.43 +/**
    1.44 +*  @publishedAll
    1.45 +*  @released
    1.46 +*
    1.47 +*  Class for connecting to SIP server.
    1.48 +*
    1.49 +*  This class provides the connection to the SIP server and
    1.50 +*  provides functions for quering supported SIP security mechanisms and
    1.51 +*  the support of signalling compression (SigComp).
    1.52 +*
    1.53 +*  Note that the implementation uses strings defined in the SIP Codec
    1.54 +*  string pool. During instantiation the class will open SIP codec string pool 
    1.55 +*  for getting static strings and getting and setting dynamic strings.
    1.56 +* 
    1.57 +*  The user can create only one instance of this class. (a singleton class).
    1.58 +*
    1.59 +*  @lib sipclient.lib
    1.60 +*/
    1.61 +class CSIP : public CBase
    1.62 +	{
    1.63 +    public: // Constructors and destructor
    1.64 +
    1.65 +	    /**
    1.66 +        * Two-phased constructor.
    1.67 +		* @param aUid an unique id that identifies client
    1.68 +		* @param aObserver a observer for asynchronous event
    1.69 +        * @return New object, ownership is transferred
    1.70 +        * @capability WriteDeviceData
    1.71 +        */
    1.72 +		IMPORT_C static CSIP* NewL(const TUid& aUid,
    1.73 +                                   MSIPObserver& aObserver);
    1.74 +
    1.75 +	    /**
    1.76 +        * Two-phased constructor.
    1.77 +		* Constructs an object and adds the pointer to the cleanup stack.
    1.78 +		* @param aUid an unique id that identifies client
    1.79 +		* @param aObserver a observer for asynchronous event
    1.80 +        * @return New object, ownership is transferred
    1.81 +        * @capability WriteDeviceData
    1.82 +        */
    1.83 +		IMPORT_C static CSIP* NewLC(const TUid& aUid,
    1.84 +                                    MSIPObserver& aObserver);                                   
    1.85 +
    1.86 +        /**
    1.87 +        * Destructor.               
    1.88 +        */
    1.89 +		IMPORT_C ~CSIP();
    1.90 +
    1.91 +    public: // New functions
    1.92 +
    1.93 +		/**
    1.94 +		* Gets all supported security mechanisms
    1.95 +		* @return supported SIP security mechanisms names (e.g. digest);
    1.96 +        *         the ownership is transferred
    1.97 +		*/
    1.98 +		IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
    1.99 +
   1.100 +		/**
   1.101 +		* Checks if the signalling compression (SigComp) is supported.
   1.102 +        * Leaves on failure with a system wide error code.
   1.103 +		* @return ETrue if supported, EFalse otherwise
   1.104 +		*/
   1.105 +		IMPORT_C TBool IsSigCompSupportedL() const;
   1.106 +
   1.107 +		/**
   1.108 +		* Gets negotiated security mechanism with the next hop
   1.109 +		* on the signaling path.
   1.110 +		* @param aHop the next hop's FQDN or numeric IP address
   1.111 +		* @return negotiated security mechanism or zero-pointer in case no
   1.112 +		*		  security mechanism was negotiated with the next hop;
   1.113 +		*		  the ownership is transferred
   1.114 +		*/
   1.115 +		IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
   1.116 +
   1.117 +		/**
   1.118 +		* Checks if the user has a connection created for given IAP-id
   1.119 +		* @param aIapId IAP-id
   1.120 + 		* @return sip connection or 0-pointer if connection does not exist.
   1.121 +        *         Ownership is not transferred.
   1.122 +		*/
   1.123 +		IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
   1.124 +		
   1.125 +        /*
   1.126 +        * By default the SIP built-in security mechanisms are enabled.
   1.127 +        * @param aEnabled if set to EFalse the build-in SIP security handling 
   1.128 +        *        mechanism is disabled.
   1.129 +        */
   1.130 +        IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
   1.131 +
   1.132 +        /*
   1.133 +        * Tests if SIP security handling mechanism is enabled/disabled
   1.134 +        * @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
   1.135 +        */
   1.136 +        IMPORT_C TBool IsSecurityHandlingEnabled() const;		
   1.137 +
   1.138 +	public: // New functions, for internal use
   1.139 +
   1.140 +		/**
   1.141 +		* Returns the CSIPImplementation.
   1.142 +		*
   1.143 + 		* @return CSIPImplementation
   1.144 +		*/
   1.145 +		CSIPImplementation& Implementation();
   1.146 +		
   1.147 +    private: // Constructors
   1.148 +        CSIP();
   1.149 +
   1.150 +        void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
   1.151 +
   1.152 +	private: // Data
   1.153 +		CSIPImplementation* iImplementation;
   1.154 +
   1.155 +	private: // For testing purposes
   1.156 +
   1.157 +	    UNIT_TEST(CSIP_Test)
   1.158 +        UNIT_TEST(CSIPRegistrationBinding_Test)
   1.159 +        UNIT_TEST(CSIPInviteDialogAssoc_Test)
   1.160 +        UNIT_TEST(CSIPSubscribeDialogAssoc_Test)
   1.161 +        UNIT_TEST(CSIPReferDialogAssoc_Test)
   1.162 +
   1.163 +		__DECLARE_TEST;
   1.164 +		};
   1.165 +
   1.166 +#endif