epoc32/include/mw/sip.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.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 
    30 // FORWARD DECLARATIONS
    31 class CDesC8Array;
    32 class MSIPObserver;
    33 class CSIPConnection;
    34 class CSIPImplementation;
    35 
    36 // CLASS DECLARATION
    37 
    38 /**
    39 *  @publishedAll
    40 *  @released
    41 *
    42 *  Class for connecting to SIP server.
    43 *
    44 *  This class provides the connection to the SIP server and
    45 *  provides functions for quering supported SIP security mechanisms and
    46 *  the support of signalling compression (SigComp).
    47 *
    48 *  Note that the implementation uses strings defined in the SIP Codec
    49 *  string pool. During instantiation the class will open SIP codec string pool 
    50 *  for getting static strings and getting and setting dynamic strings.
    51 * 
    52 *  The user can create only one instance of this class. (a singleton class).
    53 *
    54 *  @lib sipclient.lib
    55 */
    56 class CSIP : public CBase
    57 	{
    58     public: // Constructors and destructor
    59 
    60 	    /**
    61         * Two-phased constructor.
    62 		* @param aUid an unique id that identifies client
    63 		* @param aObserver a observer for asynchronous event
    64         * @return New object, ownership is transferred
    65         * @capability WriteDeviceData
    66         */
    67 		IMPORT_C static CSIP* NewL(const TUid& aUid,
    68                                    MSIPObserver& aObserver);
    69 
    70 	    /**
    71         * Two-phased constructor.
    72 		* Constructs an object and adds the pointer to the cleanup stack.
    73 		* @param aUid an unique id that identifies client
    74 		* @param aObserver a observer for asynchronous event
    75         * @return New object, ownership is transferred
    76         * @capability WriteDeviceData
    77         */
    78 		IMPORT_C static CSIP* NewLC(const TUid& aUid,
    79                                     MSIPObserver& aObserver);                                   
    80 
    81         /**
    82         * Destructor.               
    83         */
    84 		IMPORT_C ~CSIP();
    85 
    86     public: // New functions
    87 
    88 		/**
    89 		* Gets all supported security mechanisms
    90 		* @return supported SIP security mechanisms names (e.g. digest);
    91         *         the ownership is transferred
    92 		*/
    93 		IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
    94 
    95 		/**
    96 		* Checks if the signalling compression (SigComp) is supported.
    97         * Leaves on failure with a system wide error code.
    98 		* @return ETrue if supported, EFalse otherwise
    99 		*/
   100 		IMPORT_C TBool IsSigCompSupportedL() const;
   101 
   102 		/**
   103 		* Gets negotiated security mechanism with the next hop
   104 		* on the signaling path.
   105 		* @param aHop the next hop's FQDN or numeric IP address
   106 		* @return negotiated security mechanism or zero-pointer in case no
   107 		*		  security mechanism was negotiated with the next hop;
   108 		*		  the ownership is transferred
   109 		*/
   110 		IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
   111 
   112 		/**
   113 		* Checks if the user has a connection created for given IAP-id
   114 		* @param aIapId IAP-id
   115  		* @return sip connection or 0-pointer if connection does not exist.
   116         *         Ownership is not transferred.
   117 		*/
   118 		IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
   119 		
   120         /*
   121         * By default the SIP built-in security mechanisms are enabled.
   122         * @param aEnabled if set to EFalse the build-in SIP security handling 
   123         *        mechanism is disabled.
   124         */
   125         IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
   126 
   127         /*
   128         * Tests if SIP security handling mechanism is enabled/disabled
   129         * @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
   130         */
   131         IMPORT_C TBool IsSecurityHandlingEnabled() const;		
   132 
   133 	public: // New functions, for internal use
   134 
   135 		/**
   136 		* Returns the CSIPImplementation.
   137 		*
   138  		* @return CSIPImplementation
   139 		*/
   140 		CSIPImplementation& Implementation();
   141 		
   142     private: // Constructors
   143         CSIP();
   144 
   145         void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
   146 
   147 	private: // Data
   148 		CSIPImplementation* iImplementation;
   149 
   150 	private: // For testing purposes
   151 #ifdef CPPUNIT_TEST
   152 	    friend class CSIP_Test;
   153         friend class CSIPRegistrationBinding_Test;
   154         friend class CSIPInviteDialogAssoc_Test;
   155         friend class CSIPSubscribeDialogAssoc_Test;
   156         friend class CSIPReferDialogAssoc_Test;
   157 #endif
   158 		void __DbgTestInvariant() const;
   159 	
   160 		};
   161 
   162 #endif