realtimenetprots/sipfw/ProfileAgent/Client/Api/sipprofile.h
changeset 0 307788aac0a8
child 9 1e1cc61f56c3
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2003-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        : sipprofile.h
       
    16 * Part of     : SIP Profile Client
       
    17 * Interface   : SDK API, SIP Profile API
       
    18 * The class providing profile data of SIP service provider
       
    19 * Version     : 1.0
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CSIPPROFILE_H
       
    26 #define CSIPPROFILE_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include <e32base.h>
       
    30 #include <e32std.h>
       
    31 #include <badesca.h>
       
    32 #include "sipregistrationcontext.h"
       
    33 #include "sipprofiletypeinfo.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CSIPConcreteProfile;
       
    37 class CSIPProfileRegistry;
       
    38 class CSIPProfileRegistryBase;
       
    39 
       
    40 /** 
       
    41 * SIP Profile ID which value is type of TUint32
       
    42 */
       
    43 const TUint32 KSIPProfileId = 1;
       
    44 
       
    45 /** 
       
    46 * SIP Provider Name which value is type of TDesC8
       
    47 */
       
    48 const TUint32 KSIPProviderName = 2;
       
    49 
       
    50 /** 
       
    51 * Access Point ID which value is type of TUint32
       
    52 */
       
    53 const TUint32 KSIPAccessPointId = 3;
       
    54 
       
    55 /** 
       
    56 * Signaling compression (SigComp) which value is type of TBool. 
       
    57 * ETrue indicates that SigComp is enabled
       
    58 */
       
    59 const TUint32 KSIPSigComp = 4;
       
    60 
       
    61 /** 
       
    62 * Security Negotiation which value is type of TBool. ETrue indicates that
       
    63 * Security Negotiation is enabled
       
    64 */
       
    65 const TUint32 KSIPSecurityNegotiation = 5;
       
    66 
       
    67 /** 
       
    68 * Auto Registration which value is type of TBool. ETrue indicates that 
       
    69 * profile is enabled for auto registration
       
    70 */
       
    71 const TUint32 KSIPAutoRegistration = 6;
       
    72 
       
    73 /** 
       
    74 * Defined user's address-of-record which value is type of TDesC8 
       
    75 */
       
    76 const TUint32 KSIPUserAor = 7;
       
    77 
       
    78 /** 
       
    79 * Registration which value is type of TBool. ETrue indicates that
       
    80 * profile is registered 
       
    81 */
       
    82 const TUint32 KSIPProfileRegistered = 8;
       
    83 
       
    84 /** 
       
    85 * Users's registered address-of-records which value is of type MDesC8Array.
       
    86 * Note that array will contain AORs only in case the profile is registered.
       
    87 */
       
    88 const TUint32 KSIPRegisteredAors = 9;
       
    89 
       
    90 /** 
       
    91 * Negotiated security mechanism during registration procedure which value
       
    92 * is of type TDesC8.
       
    93 * Note that descriptor will contain value only in case the profile is 
       
    94 * registered.
       
    95 */
       
    96 const TUint32 KSIPNegotiatedSecurityMechanism = 10;
       
    97 
       
    98 /** 
       
    99 * Default profile which value is type of TBool. 
       
   100 * ETrue indicates that profile is default  
       
   101 */
       
   102 const TUint32 KSIPDefaultProfile = 11;
       
   103 
       
   104 /** 
       
   105 * "Contact" header parameters used during registration which value
       
   106 * is of type MDesC8Array. Each array element contains one "Contact"-header
       
   107 * parameter.
       
   108 */
       
   109 const TUint32 KSIPContactHeaderParams = 12;
       
   110 
       
   111 /** 
       
   112 * The user's registered "Contact"-header including the whole value of the header
       
   113 * except for the header's name ("Contact:"). 
       
   114 * The value is of type TDesC8.
       
   115 * Note that the value is available only in case the profile is registered.
       
   116 */
       
   117 const TUint32 KSIPRegisteredContact = 13;
       
   118 
       
   119 /** 
       
   120 * SNAP (Service Network Access Point) ID which value is type of TUint32.
       
   121 * This is an optional parameter. When this parameter is configured, 
       
   122 * KSIPAccessPointId has a meaningful value only when the profile is registered.
       
   123 * The value of KSIPSnapId must be greater than zero.
       
   124 */
       
   125 const TUint32 KSIPSnapId = 14;
       
   126 
       
   127 /** 
       
   128 * A unique Contact-header's user-part 
       
   129 * generated automatically by the SIP implementation.
       
   130 * The value is of type TDesC8.
       
   131 * This parameter is read-only and 
       
   132 * trying to set it will fail with KErrAccessDenied.
       
   133 */
       
   134 const TUint32 KSIPContactHeaderUser = 15;
       
   135 
       
   136 /** 
       
   137 * Sets the KSoIpTOS socket option (see in_sock.h) for 
       
   138 * all SIP signalling related to this profile.
       
   139 * The value is of type TUint32.
       
   140 */
       
   141 const TUint32 KSIPSoIpTOS = 16;
       
   142 
       
   143 /**
       
   144 * Sets the Access Point Name.
       
   145 * This is an Optional Parameter. 
       
   146 * Access Point Name which value is type of TDesC8,
       
   147 */
       
   148 const TUint32 KSIPAccessPointName = 17;
       
   149 
       
   150 /**
       
   151  * Sets the SNAP Name.
       
   152  * This is an Optional Parameter. 
       
   153  * SNAP Name which value is type of TDesC8,
       
   154 */
       
   155 const TUint32 KSIPSnapName = 18;
       
   156 
       
   157 /** 
       
   158 * Proxy Resolving Feature which is type TBool. 
       
   159 * ETrue indicates that Proxy Resolving is enabled
       
   160 */
       
   161 const TUint32 KSIPResolveProxy = 19;
       
   162 
       
   163 /** 
       
   164 * SIP Registrar  
       
   165 */
       
   166 const TUint32 KSIPRegistrar = 130;
       
   167 
       
   168 /** 
       
   169 * SIP Outbound Proxy
       
   170 */
       
   171 const TUint32 KSIPOutboundProxy = 131;
       
   172 
       
   173 /** 
       
   174 * HTTP Digest user name which value is type of TDesC8 
       
   175 */
       
   176 const TUint32 KSIPDigestUserName = 150;
       
   177 
       
   178 /** 
       
   179 * HTTP Digest realm which value is type of TDesC8
       
   180 */
       
   181 const TUint32 KSIPDigestRealm = 151;
       
   182 
       
   183 /** 
       
   184 * SIP server's address which value is of type TDesC8
       
   185 */
       
   186 const TUint32 KSIPServerAddress = 152;
       
   187 
       
   188 // CLASS DECLARATION
       
   189 /**
       
   190 * @publishedAll
       
   191 * @released
       
   192 *
       
   193 * Class contains profile information of particular SIP service
       
   194 * provider. Class provides functions for quering profile parameter
       
   195 * values.
       
   196 *  @lib sipprofilecli.lib
       
   197 */
       
   198 class CSIPProfile: public CBase, public MSIPRegistrationContext
       
   199     {    
       
   200     public:  // Constructors and destructor
       
   201         /**
       
   202         * Destructor.
       
   203         * @capability NetworkServices
       
   204         */
       
   205         IMPORT_C ~CSIPProfile();
       
   206 
       
   207     public: // New functions
       
   208         /**
       
   209         * Gets profile type information
       
   210         * @return profile type information
       
   211         */
       
   212         IMPORT_C const TSIPProfileTypeInfo& Type() const;
       
   213 
       
   214         /** 
       
   215         * Gets profile parameter
       
   216         * @param aParam a parameter to get
       
   217         * @param aVal on return will contain parameter value
       
   218         * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   219         */
       
   220         IMPORT_C TInt GetParameter(TUint32 aParam, TDesC8 const *& aVal) const; 
       
   221 
       
   222         /** 
       
   223         * Gets profile parameter
       
   224         * @param aParam a parameter to get
       
   225         * @param aVal on return will contain parameter value
       
   226         * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   227         */
       
   228         IMPORT_C TInt GetParameter(TUint32 aParam, TUint32& aVal) const;
       
   229 
       
   230         /** 
       
   231         * Gets profile parameter
       
   232         * @param aParam a parameter to get
       
   233         * @param aVal on return will contain parameter value
       
   234         * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   235         */
       
   236         IMPORT_C TInt GetParameter(TUint32 aParam, TBool& aVal) const;
       
   237 
       
   238         /** 
       
   239         * Gets profile parameter
       
   240         * @param aParam a parameter to get
       
   241         * @param aVal on return will contain parameter value
       
   242         * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   243         */
       
   244         IMPORT_C TInt GetParameter(TUint32 aParam, MDesC8Array const *& aVal) const;
       
   245 
       
   246         /** 
       
   247         * Gets profile parameter that is defined for a particular SIP server
       
   248         * @param aServer a SIP server type
       
   249         * @param aParam a parameter to get
       
   250         * @param aVal on return will contain parameter value
       
   251         * @return KErrNotFound if parameter was not found, KErrNone otherwise
       
   252         */
       
   253         IMPORT_C TInt GetParameter(TUint32 aServerType, TUint32 aParam, TDesC8 const *& aVal) const;
       
   254 
       
   255     public: //Functions from base class
       
   256         /**
       
   257         * Tests if the registration context can be
       
   258         * used for creating SIP messages/dialogs
       
   259         * Profile can be used, when CSIPProfileRegistry::IsEnabled() == ETrue
       
   260         * and Status() == ERegistered.
       
   261         * @return ETrue if can be used, EFalse otherwise
       
   262         * @internalComponent       
       
   263         */
       
   264         TBool IsContextActive() const;
       
   265 
       
   266         /**
       
   267         * 
       
   268         * For internal use only
       
   269         * @return context id
       
   270         * @internalComponent        
       
   271         */
       
   272         TUint32 ContextId() const;
       
   273         
       
   274 
       
   275     public: //New functions
       
   276 
       
   277         /**
       
   278         * Two-phased constructor.
       
   279         * @param aSIPRegistry a SIP profile client providing connection to SIP 
       
   280         *         profile server.
       
   281         */
       
   282 
       
   283         static CSIPProfile* NewL(CSIPProfileRegistry* aSIPRegistry);
       
   284 
       
   285         /**
       
   286         * Two-phased constructor.
       
   287         * @param aSIPRegistry a SIP profile client providing connection to SIP 
       
   288         *         profile server.
       
   289         * Constructs an object and adds the pointer to the cleanup stack;
       
   290         */
       
   291 
       
   292         static CSIPProfile* NewLC(CSIPProfileRegistry* aSIPRegistry);
       
   293 
       
   294         /**
       
   295         * Sets profiles enabled state
       
   296         * @param aEnabled ETrue if enabled
       
   297         */
       
   298 
       
   299         void SetEnabled(TBool aEnabled);
       
   300 
       
   301         /**
       
   302         * Sets concrete profile that holds actual data 
       
   303         * @param aProfile profile instance containing data
       
   304         */
       
   305 
       
   306         void SetConcreteProfile(CSIPConcreteProfile* aProfile);
       
   307 
       
   308         /**
       
   309         * Clears concrete profile that holds actual data 
       
   310         */
       
   311 
       
   312         void ClearConcreteProfile();
       
   313 
       
   314         /**
       
   315         * Gets concrete profile that holds actual data
       
   316         * @return concrete profile holding data
       
   317         */
       
   318 
       
   319         CSIPConcreteProfile& ConcreteProfile();
       
   320 
       
   321         /**
       
   322         * Gets concrete profile that holds actual data
       
   323         * @return concrete profile holding data
       
   324         */
       
   325 
       
   326         const CSIPConcreteProfile& ConcreteProfile() const;
       
   327 
       
   328         /**
       
   329         * Checks if the profile is enabled
       
   330         * @return ETrue if enabled, EFalse otherwise
       
   331         */
       
   332 
       
   333         TBool IsEnabled() const;
       
   334 
       
   335         /**
       
   336         * Gets last occurred error during registration
       
   337         * @return last occurred error code, KErrNone if no error
       
   338         */
       
   339         TInt LastRegistrationError() const;
       
   340 
       
   341         /**
       
   342         * sets pointer to registry for profile
       
   343         */
       
   344         void SetRegistry(CSIPProfileRegistryBase* aRegistry);
       
   345         
       
   346         /**
       
   347         * Clears pointer to registry from profile
       
   348         */
       
   349         void ClearRegistry();
       
   350 		
       
   351 	/**
       
   352 	* gets the Default SNAP ID from the Connectivity Settings
       
   353 	*/
       
   354 
       
   355 	    void DefaultSNAPL(TUint32& aSnapId) const;
       
   356         
       
   357     protected:
       
   358 
       
   359         /**
       
   360         * Constructor. 
       
   361         */                
       
   362         CSIPProfile(CSIPProfileRegistryBase* aRegistry);
       
   363         
       
   364         /**
       
   365         * 2nd phase constructor. 
       
   366         */                
       
   367         void ConstructL();
       
   368 
       
   369     protected:
       
   370     
       
   371         /**
       
   372         * @internalComponent
       
   373         */    
       
   374         CSIPConcreteProfile* iSIPProfile;
       
   375         
       
   376         /**
       
   377         * @internalComponent
       
   378         */        
       
   379         CSIPProfileRegistryBase* iSIPProfileRegistry;
       
   380 
       
   381     private:
       
   382     
       
   383         TBool iEnabled;
       
   384     };
       
   385 
       
   386 #endif // CSIPPROFILE_H