epoc32/include/mw/sipprofile.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/sipprofile.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,374 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +* Name        : sipprofile.h
    1.19 +* Part of     : SIP Profile Client
    1.20 +* Interface   : SDK API, SIP Profile API
    1.21 +* The class providing profile data of SIP service provider
    1.22 +* Version     : 1.0
    1.23 +*
    1.24 +*/
    1.25 +
    1.26 +
    1.27 +
    1.28 +#ifndef CSIPPROFILE_H
    1.29 +#define CSIPPROFILE_H
    1.30 +
    1.31 +//  INCLUDES
    1.32 +#include <e32base.h>
    1.33 +#include <e32std.h>
    1.34 +#include <badesca.h>
    1.35 +#include "sipregistrationcontext.h"
    1.36 +#include "sipprofiletypeinfo.h"
    1.37 +
    1.38 +// FORWARD DECLARATIONS
    1.39 +class CSIPConcreteProfile;
    1.40 +class CSIPProfileRegistry;
    1.41 +class CSIPProfileRegistryBase;
    1.42 +
    1.43 +/** 
    1.44 +* SIP Profile ID which value is type of TUint32
    1.45 +*/
    1.46 +const TUint32 KSIPProfileId = 1;
    1.47 +
    1.48 +/** 
    1.49 +* SIP Provider Name which value is type of TDesC8
    1.50 +*/
    1.51 +const TUint32 KSIPProviderName = 2;
    1.52 +
    1.53 +/** 
    1.54 +* Access Point ID which value is type of TUint32
    1.55 +*/
    1.56 +const TUint32 KSIPAccessPointId = 3;
    1.57 +
    1.58 +/** 
    1.59 +* Signaling compression (SigComp) which value is type of TBool. 
    1.60 +* ETrue indicates that SigComp is enabled
    1.61 +*/
    1.62 +const TUint32 KSIPSigComp = 4;
    1.63 +
    1.64 +/** 
    1.65 +* Security Negotiation which value is type of TBool. ETrue indicates that
    1.66 +* Security Negotiation is enabled
    1.67 +*/
    1.68 +const TUint32 KSIPSecurityNegotiation = 5;
    1.69 +
    1.70 +/** 
    1.71 +* Auto Registration which value is type of TBool. ETrue indicates that 
    1.72 +* profile is enabled for auto registration
    1.73 +*/
    1.74 +const TUint32 KSIPAutoRegistration = 6;
    1.75 +
    1.76 +/** 
    1.77 +* Defined user's address-of-record which value is type of TDesC8 
    1.78 +*/
    1.79 +const TUint32 KSIPUserAor = 7;
    1.80 +
    1.81 +/** 
    1.82 +* Registration which value is type of TBool. ETrue indicates that
    1.83 +* profile is registered 
    1.84 +*/
    1.85 +const TUint32 KSIPProfileRegistered = 8;
    1.86 +
    1.87 +/** 
    1.88 +* Users's registered address-of-records which value is of type MDesC8Array.
    1.89 +* Note that array will contain AORs only in case the profile is registered.
    1.90 +*/
    1.91 +const TUint32 KSIPRegisteredAors = 9;
    1.92 +
    1.93 +/** 
    1.94 +* Negotiated security mechanism during registration procedure which value
    1.95 +* is of type TDesC8.
    1.96 +* Note that descriptor will contain value only in case the profile is 
    1.97 +* registered.
    1.98 +*/
    1.99 +const TUint32 KSIPNegotiatedSecurityMechanism = 10;
   1.100 +
   1.101 +/** 
   1.102 +* Default profile which value is type of TBool. 
   1.103 +* ETrue indicates that profile is default  
   1.104 +*/
   1.105 +const TUint32 KSIPDefaultProfile = 11;
   1.106 +
   1.107 +/** 
   1.108 +* "Contact" header parameters used during registration which value
   1.109 +* is of type MDesC8Array. Each array element contains one "Contact"-header
   1.110 +* parameter.
   1.111 +*/
   1.112 +const TUint32 KSIPContactHeaderParams = 12;
   1.113 +
   1.114 +/** 
   1.115 +* The user's registered "Contact"-header including the whole value of the header
   1.116 +* except for the header's name ("Contact:"). 
   1.117 +* The value is of type TDesC8.
   1.118 +* Note that the value is available only in case the profile is registered.
   1.119 +*/
   1.120 +const TUint32 KSIPRegisteredContact = 13;
   1.121 +
   1.122 +/** 
   1.123 +* SNAP (Service Network Access Point) ID which value is type of TUint32.
   1.124 +* This is an optional parameter. When this parameter is configured, 
   1.125 +* KSIPAccessPointId has a meaningful value only when the profile is registered.
   1.126 +* The value of KSIPSnapId must be greater than zero.
   1.127 +*/
   1.128 +const TUint32 KSIPSnapId = 14;
   1.129 +
   1.130 +/** 
   1.131 +* A unique Contact-header's user-part 
   1.132 +* generated automatically by the SIP implementation.
   1.133 +* The value is of type TDesC8.
   1.134 +* This parameter is read-only and 
   1.135 +* trying to set it will fail with KErrAccessDenied.
   1.136 +*/
   1.137 +const TUint32 KSIPContactHeaderUser = 15;
   1.138 +
   1.139 +/** 
   1.140 +* Sets the KSoIpTOS socket option (see in_sock.h) for 
   1.141 +* all SIP signalling related to this profile.
   1.142 +* The value is of type TUint32.
   1.143 +*/
   1.144 +const TUint32 KSIPSoIpTOS = 16;
   1.145 +
   1.146 +/**
   1.147 +* Sets the Access Point Name.
   1.148 +* This is an Optional Parameter. 
   1.149 +* Access Point Name which value is type of TDesC8,
   1.150 +*/
   1.151 +const TUint32 KSIPAccessPointName = 17;
   1.152 +
   1.153 +/**
   1.154 + * Sets the SNAP Name.
   1.155 + * This is an Optional Parameter. 
   1.156 + * SNAP Name which value is type of TDesC8,
   1.157 +*/
   1.158 +const TUint32 KSIPSnapName = 18;
   1.159 +
   1.160 +/** 
   1.161 +* SIP Registrar  
   1.162 +*/
   1.163 +const TUint32 KSIPRegistrar = 130;
   1.164 +
   1.165 +/** 
   1.166 +* SIP Outbound Proxy
   1.167 +*/
   1.168 +const TUint32 KSIPOutboundProxy = 131;
   1.169 +
   1.170 +/** 
   1.171 +* HTTP Digest user name which value is type of TDesC8 
   1.172 +*/
   1.173 +const TUint32 KSIPDigestUserName = 150;
   1.174 +
   1.175 +/** 
   1.176 +* HTTP Digest realm which value is type of TDesC8
   1.177 +*/
   1.178 +const TUint32 KSIPDigestRealm = 151;
   1.179 +
   1.180 +/** 
   1.181 +* SIP server's address which value is of type TDesC8
   1.182 +*/
   1.183 +const TUint32 KSIPServerAddress = 152;
   1.184 +
   1.185 +// CLASS DECLARATION
   1.186 +/**
   1.187 +* @publishedAll
   1.188 +* @released
   1.189 +*
   1.190 +* Class contains profile information of particular SIP service
   1.191 +* provider. Class provides functions for quering profile parameter
   1.192 +* values.
   1.193 +*  @lib sipprofilecli.lib
   1.194 +*/
   1.195 +class CSIPProfile: public CBase, public MSIPRegistrationContext
   1.196 +    {    
   1.197 +    public:  // Constructors and destructor
   1.198 +        /**
   1.199 +        * Destructor.
   1.200 +        * @capability NetworkServices
   1.201 +        */
   1.202 +        IMPORT_C ~CSIPProfile();
   1.203 +
   1.204 +    public: // New functions
   1.205 +        /**
   1.206 +        * Gets profile type information
   1.207 +        * @return profile type information
   1.208 +        */
   1.209 +        IMPORT_C const TSIPProfileTypeInfo& Type() const;
   1.210 +
   1.211 +        /** 
   1.212 +        * Gets profile parameter
   1.213 +        * @param aParam a parameter to get
   1.214 +        * @param aVal on return will contain parameter value
   1.215 +        * @return KErrNotFound if parameter was not found, KErrNone otherwise
   1.216 +        */
   1.217 +        IMPORT_C TInt GetParameter(TUint32 aParam, TDesC8 const *& aVal) const; 
   1.218 +
   1.219 +        /** 
   1.220 +        * Gets profile parameter
   1.221 +        * @param aParam a parameter to get
   1.222 +        * @param aVal on return will contain parameter value
   1.223 +        * @return KErrNotFound if parameter was not found, KErrNone otherwise
   1.224 +        */
   1.225 +        IMPORT_C TInt GetParameter(TUint32 aParam, TUint32& aVal) const;
   1.226 +
   1.227 +        /** 
   1.228 +        * Gets profile parameter
   1.229 +        * @param aParam a parameter to get
   1.230 +        * @param aVal on return will contain parameter value
   1.231 +        * @return KErrNotFound if parameter was not found, KErrNone otherwise
   1.232 +        */
   1.233 +        IMPORT_C TInt GetParameter(TUint32 aParam, TBool& aVal) const;
   1.234 +
   1.235 +        /** 
   1.236 +        * Gets profile parameter
   1.237 +        * @param aParam a parameter to get
   1.238 +        * @param aVal on return will contain parameter value
   1.239 +        * @return KErrNotFound if parameter was not found, KErrNone otherwise
   1.240 +        */
   1.241 +        IMPORT_C TInt GetParameter(TUint32 aParam, MDesC8Array const *& aVal) const;
   1.242 +
   1.243 +        /** 
   1.244 +        * Gets profile parameter that is defined for a particular SIP server
   1.245 +        * @param aServer a SIP server type
   1.246 +        * @param aParam a parameter to get
   1.247 +        * @param aVal on return will contain parameter value
   1.248 +        * @return KErrNotFound if parameter was not found, KErrNone otherwise
   1.249 +        */
   1.250 +        IMPORT_C TInt GetParameter(TUint32 aServerType, TUint32 aParam, TDesC8 const *& aVal) const;
   1.251 +
   1.252 +    public: //Functions from base class
   1.253 +        /**
   1.254 +        * Tests if the registration context can be
   1.255 +        * used for creating SIP messages/dialogs
   1.256 +        * Profile can be used, when CSIPProfileRegistry::IsEnabled() == ETrue
   1.257 +        * and Status() == ERegistered.
   1.258 +        * @return ETrue if can be used, EFalse otherwise
   1.259 +        * @internalComponent       
   1.260 +        */
   1.261 +        TBool IsContextActive() const;
   1.262 +
   1.263 +        /**
   1.264 +        * 
   1.265 +        * For internal use only
   1.266 +        * @return context id
   1.267 +        * @internalComponent        
   1.268 +        */
   1.269 +        TUint32 ContextId() const;
   1.270 +        
   1.271 +
   1.272 +    public: //New functions
   1.273 +
   1.274 +        /**
   1.275 +        * Two-phased constructor.
   1.276 +        * @param aSIPRegistry a SIP profile client providing connection to SIP 
   1.277 +        *         profile server.
   1.278 +        */
   1.279 +
   1.280 +        static CSIPProfile* NewL(CSIPProfileRegistry* aSIPRegistry);
   1.281 +
   1.282 +        /**
   1.283 +        * Two-phased constructor.
   1.284 +        * @param aSIPRegistry a SIP profile client providing connection to SIP 
   1.285 +        *         profile server.
   1.286 +        * Constructs an object and adds the pointer to the cleanup stack;
   1.287 +        */
   1.288 +
   1.289 +        static CSIPProfile* NewLC(CSIPProfileRegistry* aSIPRegistry);
   1.290 +
   1.291 +        /**
   1.292 +        * Sets profiles enabled state
   1.293 +        * @param aEnabled ETrue if enabled
   1.294 +        */
   1.295 +
   1.296 +        void SetEnabled(TBool aEnabled);
   1.297 +
   1.298 +        /**
   1.299 +        * Sets concrete profile that holds actual data 
   1.300 +        * @param aProfile profile instance containing data
   1.301 +        */
   1.302 +
   1.303 +        void SetConcreteProfile(CSIPConcreteProfile* aProfile);
   1.304 +
   1.305 +        /**
   1.306 +        * Clears concrete profile that holds actual data 
   1.307 +        */
   1.308 +
   1.309 +        void ClearConcreteProfile();
   1.310 +
   1.311 +        /**
   1.312 +        * Gets concrete profile that holds actual data
   1.313 +        * @return concrete profile holding data
   1.314 +        */
   1.315 +
   1.316 +        CSIPConcreteProfile& ConcreteProfile();
   1.317 +
   1.318 +        /**
   1.319 +        * Gets concrete profile that holds actual data
   1.320 +        * @return concrete profile holding data
   1.321 +        */
   1.322 +
   1.323 +        const CSIPConcreteProfile& ConcreteProfile() const;
   1.324 +
   1.325 +        /**
   1.326 +        * Checks if the profile is enabled
   1.327 +        * @return ETrue if enabled, EFalse otherwise
   1.328 +        */
   1.329 +
   1.330 +        TBool IsEnabled() const;
   1.331 +
   1.332 +        /**
   1.333 +        * Gets last occurred error during registration
   1.334 +        * @return last occurred error code, KErrNone if no error
   1.335 +        */
   1.336 +        TInt LastRegistrationError() const;
   1.337 +
   1.338 +        /**
   1.339 +        * sets pointer to registry for profile
   1.340 +        */
   1.341 +        void SetRegistry(CSIPProfileRegistryBase* aRegistry);
   1.342 +        
   1.343 +        /**
   1.344 +        * Clears pointer to registry from profile
   1.345 +        */
   1.346 +        void ClearRegistry();
   1.347 +        
   1.348 +    protected:
   1.349 +
   1.350 +        /**
   1.351 +        * Constructor. 
   1.352 +        */                
   1.353 +        CSIPProfile(CSIPProfileRegistryBase* aRegistry);
   1.354 +        
   1.355 +        /**
   1.356 +        * 2nd phase constructor. 
   1.357 +        */                
   1.358 +        void ConstructL();
   1.359 +
   1.360 +    protected:
   1.361 +    
   1.362 +        /**
   1.363 +        * @internalComponent
   1.364 +        */    
   1.365 +        CSIPConcreteProfile* iSIPProfile;
   1.366 +        
   1.367 +        /**
   1.368 +        * @internalComponent
   1.369 +        */        
   1.370 +        CSIPProfileRegistryBase* iSIPProfileRegistry;
   1.371 +
   1.372 +    private:
   1.373 +    
   1.374 +        TBool iEnabled;
   1.375 +    };
   1.376 +
   1.377 +#endif // CSIPPROFILE_H