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