epoc32/include/sip.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000 (2010-03-16)
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     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
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * Name        : sip.h
    16 * Part of     : SIP Client
    17 * Interface   : SDK API, SIP Client API
    18 * Version     : 2.0
    19 *
    20 */
    21 
    22 
    23 
    24 #ifndef CSIP_H
    25 #define CSIP_H
    26 
    27 // INCLUDES
    28 #include <e32base.h>
    29 #include "_sipcodecdefs.h"
    30 
    31 // FORWARD DECLARATIONS
    32 class CDesC8Array;
    33 class MSIPObserver;
    34 class CSIPConnection;
    35 class CSIPImplementation;
    36 
    37 // CLASS DECLARATION
    38 
    39 /**
    40 *  @publishedAll
    41 *  @released
    42 *
    43 *  Class for connecting to SIP server.
    44 *
    45 *  This class provides the connection to the SIP server and
    46 *  provides functions for quering supported SIP security mechanisms and
    47 *  the support of signalling compression (SigComp).
    48 *
    49 *  Note that the implementation uses strings defined in the SIP Codec
    50 *  string pool. During instantiation the class will open SIP codec string pool 
    51 *  for getting static strings and getting and setting dynamic strings.
    52 * 
    53 *  The user can create only one instance of this class. (a singleton class).
    54 *
    55 *  @lib sipclient.lib
    56 */
    57 class CSIP : public CBase
    58 	{
    59     public: // Constructors and destructor
    60 
    61 	    /**
    62         * Two-phased constructor.
    63 		* @param aUid an unique id that identifies client
    64 		* @param aObserver a observer for asynchronous event
    65         * @return New object, ownership is transferred
    66         * @capability WriteDeviceData
    67         */
    68 		IMPORT_C static CSIP* NewL(const TUid& aUid,
    69                                    MSIPObserver& aObserver);
    70 
    71 	    /**
    72         * Two-phased constructor.
    73 		* Constructs an object and adds the pointer to the cleanup stack.
    74 		* @param aUid an unique id that identifies client
    75 		* @param aObserver a observer for asynchronous event
    76         * @return New object, ownership is transferred
    77         * @capability WriteDeviceData
    78         */
    79 		IMPORT_C static CSIP* NewLC(const TUid& aUid,
    80                                     MSIPObserver& aObserver);                                   
    81 
    82         /**
    83         * Destructor.               
    84         */
    85 		IMPORT_C ~CSIP();
    86 
    87     public: // New functions
    88 
    89 		/**
    90 		* Gets all supported security mechanisms
    91 		* @return supported SIP security mechanisms names (e.g. digest);
    92         *         the ownership is transferred
    93 		*/
    94 		IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
    95 
    96 		/**
    97 		* Checks if the signalling compression (SigComp) is supported.
    98         * Leaves on failure with a system wide error code.
    99 		* @return ETrue if supported, EFalse otherwise
   100 		*/
   101 		IMPORT_C TBool IsSigCompSupportedL() const;
   102 
   103 		/**
   104 		* Gets negotiated security mechanism with the next hop
   105 		* on the signaling path.
   106 		* @param aHop the next hop's FQDN or numeric IP address
   107 		* @return negotiated security mechanism or zero-pointer in case no
   108 		*		  security mechanism was negotiated with the next hop;
   109 		*		  the ownership is transferred
   110 		*/
   111 		IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
   112 
   113 		/**
   114 		* Checks if the user has a connection created for given IAP-id
   115 		* @param aIapId IAP-id
   116  		* @return sip connection or 0-pointer if connection does not exist.
   117         *         Ownership is not transferred.
   118 		*/
   119 		IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
   120 		
   121         /*
   122         * By default the SIP built-in security mechanisms are enabled.
   123         * @param aEnabled if set to EFalse the build-in SIP security handling 
   124         *        mechanism is disabled.
   125         */
   126         IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
   127 
   128         /*
   129         * Tests if SIP security handling mechanism is enabled/disabled
   130         * @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
   131         */
   132         IMPORT_C TBool IsSecurityHandlingEnabled() const;		
   133 
   134 	public: // New functions, for internal use
   135 
   136 		/**
   137 		* Returns the CSIPImplementation.
   138 		*
   139  		* @return CSIPImplementation
   140 		*/
   141 		CSIPImplementation& Implementation();
   142 		
   143     private: // Constructors
   144         CSIP();
   145 
   146         void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
   147 
   148 	private: // Data
   149 		CSIPImplementation* iImplementation;
   150 
   151 	private: // For testing purposes
   152 
   153 	    UNIT_TEST(CSIP_Test)
   154         UNIT_TEST(CSIPRegistrationBinding_Test)
   155         UNIT_TEST(CSIPInviteDialogAssoc_Test)
   156         UNIT_TEST(CSIPSubscribeDialogAssoc_Test)
   157         UNIT_TEST(CSIPReferDialogAssoc_Test)
   158 
   159 		__DECLARE_TEST;
   160 		};
   161 
   162 #endif