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