1.1 --- a/epoc32/include/sipprofileregistrybase.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipprofileregistrybase.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,422 @@
1.4 -sipprofileregistrybase.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 : sipprofileregistrybase.h
1.20 +* Part of : SIP Profile Client
1.21 +* Interface : SDK API, SIP Profile API
1.22 +* The class for retrieving SIP profiles from permanent storage.
1.23 +* Version : 1.0
1.24 +*
1.25 +*/
1.26 +
1.27 +
1.28 +
1.29 +#ifndef CSIPPROFILEREGISTRYBASE_H
1.30 +#define CSIPPROFILEREGISTRYBASE_H
1.31 +
1.32 +// INCLUDES
1.33 +#include <e32base.h>
1.34 +#include <badesca.h>
1.35 +#include "sipconcreteprofileobserver.h"
1.36 +
1.37 +// FORWARD DECLARATIONS
1.38 +class CSIPProfile;
1.39 +class CSIPConcreteProfile;
1.40 +class TSIPProfileTypeInfo;
1.41 +class CSIPProfileCleanupItem;
1.42 +class CSIPProfileItem;
1.43 +class CSIPProfileITCReceiver;
1.44 +class CSIPProfileITC;
1.45 +class CSIPProfilePlugins;
1.46 +class MSIPProfileRegistryObserver;
1.47 +class RSIPProfile;
1.48 +class CSIPConcreteProfileHolder;
1.49 +
1.50 +// CLASS DECLARATION
1.51 +/**
1.52 +* @publishedAll
1.53 +* @released
1.54 +*
1.55 +* The class functions for retrieving SIP profiles from permanent storage.
1.56 +* It enables retrieval of single or more profiles from permanent
1.57 +* storage located in profile server.
1.58 +*
1.59 +* The class enables also the query of supported profile types.
1.60 +*
1.61 +* This class is an abstract class and cannot be instantiated.
1.62 +*
1.63 +* @lib sipprofilecli.lib
1.64 +*/
1.65 +class CSIPProfileRegistryBase: public CBase, public MSIPConcreteProfileObserver
1.66 + {
1.67 + public: // Constructors and destructor
1.68 +
1.69 + IMPORT_C ~CSIPProfileRegistryBase();
1.70 +
1.71 + public: //new functions
1.72 + /**
1.73 + * Gets all SIP profiles
1.74 + * @pre aProfiles.Count() == 0
1.75 + * @param aProfiles a reference to a client-owned array, which
1.76 + * on return is filled with all existing SIP profiles
1.77 + * @leave KErrNoMemory if out of memory
1.78 + * @capability ReadUserData
1.79 + */
1.80 + IMPORT_C void ProfilesL(RPointerArray<CSIPProfile>& aProfiles);
1.81 +
1.82 + /**
1.83 + * Gets all SIP profiles of particular type
1.84 + * The owneship of profiles are transferred.
1.85 + * @pre aProfiles.Count() == 0
1.86 + * @param aType a SIP profile type that is used for a query
1.87 + * @param aProfiles a reference to a client-owned array, which
1.88 + * on return is filled with profiles of the given type.
1.89 + * @leave KErrNoMemory if out of memory
1.90 + * @capability ReadUserData
1.91 + */
1.92 + IMPORT_C void ProfilesL(
1.93 + const TSIPProfileTypeInfo& aType,
1.94 + RPointerArray<CSIPProfile>& aProfiles);
1.95 +
1.96 + /**
1.97 + * Gets SIP profile for a particular SIP AOR
1.98 + * The owneship of profiles are transferred.
1.99 + * @pre aProfiles.Count() == 0
1.100 + * @param aAOR a SIP AOR e.g. user@domain.com
1.101 + * @param aProfiles a reference to a client-owned array, which
1.102 + * on return is filled with profiles of the given type.
1.103 + * @leave KErrNoMemory if out memory
1.104 + * @capability ReadUserData
1.105 + */
1.106 + IMPORT_C void ProfilesL(
1.107 + const TDesC8& aAOR,
1.108 + RPointerArray<CSIPProfile>& aProfiles);
1.109 +
1.110 + /**
1.111 + * Gets SIP profile identified by the Id
1.112 + * The owneship of profile is transferred.
1.113 + * @param aId a SIP profile Id
1.114 + * @return SIP profile
1.115 + * @leave KErrNotFound if profile is not found
1.116 + * @capability ReadUserData
1.117 + */
1.118 + IMPORT_C CSIPProfile* ProfileL(TUint32 aId);
1.119 +
1.120 + /**
1.121 + * Gets the default profile
1.122 + * @return default profile; the owneship is transfered
1.123 + * @leave KErrNotFound if profile not found
1.124 + * @leave KErrNoMemory if out of memory
1.125 + * @capability ReadUserData
1.126 + */
1.127 + IMPORT_C CSIPProfile* DefaultProfileL();
1.128 +
1.129 + /**
1.130 + * Gets supported profile types
1.131 + * The owneship of returned objects are transferred.
1.132 + * @pre aSupportedProfileTypes.Count() == 0
1.133 + * @param aSupportedProfileTypes a reference to client-owned array,
1.134 + * which on return is filled with supported profile types.
1.135 + * Any existing data in the array is destroyed.
1.136 + * @leave KErrNoMemory if out of memory
1.137 + */
1.138 + IMPORT_C void SupportedProfileTypesL(
1.139 + RArray<TSIPProfileTypeInfo>& aSupportedProfileTypes);
1.140 +
1.141 + /**
1.142 + * Gets the last occurred error during registration
1.143 + * @param aProfile
1.144 + * @return last occurred registration error, KErrNone if no error
1.145 + */
1.146 + IMPORT_C TInt LastRegistrationError(const CSIPProfile& aProfile) const;
1.147 +
1.148 + public:
1.149 +
1.150 + /**
1.151 + * Enable profile
1.152 + * @param aProfile to be enabled
1.153 + * @internalComponent
1.154 + */
1.155 + void EnableProfileL(CSIPProfile& aProfile);
1.156 +
1.157 + /**
1.158 + * Gets count of clients that have a profile enabled
1.159 + * @param aProfile profile to be checked
1.160 + * @return number of clients that have the profile enabled
1.161 + * @internalComponent
1.162 + */
1.163 + TInt UsageL(const CSIPProfile& aProfile) const;
1.164 +
1.165 + /**
1.166 + * Disable profile
1.167 + * @param aProfile to be disabled
1.168 + * @internalComponent
1.169 + */
1.170 + void DisableProfileL(CSIPProfile& aProfile);
1.171 +
1.172 + /**
1.173 + * Force disable profile
1.174 + * All Profile related activities will be stopped ungracefully
1.175 + * @param aProfile to be disabled
1.176 + * @internalComponent
1.177 + */
1.178 + void ForceDisableProfileL(CSIPProfile& aProfile);
1.179 +
1.180 + /**
1.181 + * Add profile
1.182 + * @param aProfile to be added
1.183 + * @internalComponent
1.184 + */
1.185 + void AddProfileL(CSIPProfile& aProfile);
1.186 +
1.187 + /**
1.188 + * Update profile
1.189 + * @param aProfile to be updated
1.190 + * @internalComponent
1.191 + */
1.192 + void UpdateProfileL(CSIPProfile& aProfile);
1.193 +
1.194 + /**
1.195 + * Remove profile
1.196 + * @pre UsageL(aProfile) == 0
1.197 + * @param aProfile to be removed
1.198 + * @internalComponent
1.199 + */
1.200 + void RemoveProfileL(CSIPProfile& aProfile);
1.201 +
1.202 + /**
1.203 + * Informs destruction of local profile object instance
1.204 + * @param aProfile instance of deleted profile
1.205 + * @internalComponent
1.206 + */
1.207 + void ProfileDeleted(CSIPProfile& aProfile);
1.208 +
1.209 + /**
1.210 + * Checks whether profile is default or not
1.211 + * @param aProfile checked profile
1.212 + * @return ETrue if is default, otherwise EFalse
1.213 + * @internalComponent
1.214 + */
1.215 + TBool IsDefaultProfileL(const CSIPProfile& aProfile);
1.216 +
1.217 + /**
1.218 + * Updates SIP profile value for negotiated security mechanism; leaves on failure
1.219 + * @param aProfile a SIP profile
1.220 + * @internalComponent
1.221 + */
1.222 + void NegotiatedSecurityMechanismL(CSIPConcreteProfile& aProfile);
1.223 +
1.224 + /**
1.225 + * Updates SIP profile value for registered AORs; leaves on failure
1.226 + * @param aProfile a SIP profile
1.227 + * @internalComponent
1.228 + */
1.229 + void RegisteredAORsL(CSIPConcreteProfile& aProfile);
1.230 +
1.231 + /**
1.232 + * Gets new instance of either type CSIPProfile or CSIPManagedProfile
1.233 + * @return new instance
1.234 + * @internalComponent
1.235 + */
1.236 + virtual CSIPProfile* NewInstanceL() = 0;
1.237 +
1.238 + /**
1.239 + * Roll back in case of failure
1.240 + * @param aItem object to be cleaned
1.241 + * @internalComponent
1.242 + */
1.243 + static void CrashRevert (TAny* aItem);
1.244 +
1.245 + /**
1.246 + * Roll back in case of failure
1.247 + * @param aItem object to be cleaned
1.248 + * @internalComponent
1.249 + */
1.250 + static void LocalCrashRevert (TAny* aItem);
1.251 +
1.252 + /**
1.253 + * Gets the ITC member variable.
1.254 + * The owneship of ITC is not transferred.
1.255 + * @return Reference to ITC member variable.
1.256 + * @internalComponent
1.257 + */
1.258 + CSIPProfileITC& Itc();
1.259 +
1.260 + /**
1.261 + * Gets the ITC receiver member variable.
1.262 + * The owneship of ITC receiver is not transferred.
1.263 + * @return Reference to ITC receiver member variable.
1.264 + * @internalComponent
1.265 + */
1.266 + CSIPProfileITCReceiver& ItcReceiver();
1.267 +
1.268 +
1.269 + public: // From MSIPConcreteProfileObserver
1.270 +
1.271 + /**
1.272 + * SIP profile registration status changed event
1.273 + * @param aProfileId id of profile which registration
1.274 + * status has been changed.
1.275 + * @param aStatus new status of the profile
1.276 + * @param aStatusId id related to registration
1.277 + * @internalComponent
1.278 + */
1.279 + void RegistrationStatusChangedL(TUint32 aProfileId,
1.280 + TInt aStatus,
1.281 + TUint32 aStatusId);
1.282 +
1.283 + /**
1.284 + * SIP profile creation event.
1.285 + * @param aProfileId id of new SIP Profile
1.286 + * @internalComponent
1.287 + */
1.288 + void AddedL(TUint32 aProfileId);
1.289 +
1.290 + /**
1.291 + * SIP profile destruction event.
1.292 + * @param aProfileId id of profile which was destroyed
1.293 + * @internalComponent
1.294 + */
1.295 + void RemovedL(TUint32 aProfileId);
1.296 +
1.297 + /**
1.298 + * SIP profile information update event
1.299 + * @param aProfileId id of updated SIP Profile
1.300 + * @param aSize size of updated SIP Profile
1.301 + * @internalComponent
1.302 + */
1.303 + void UpdatedL(TUint32 aProfileId, TUint aSize);
1.304 +
1.305 + /**
1.306 + * An asynchronous error has occurred related to SIP profile
1.307 + * @param aProfileId the id of failed profile
1.308 + * @param aStatus
1.309 + * @param aError a error code
1.310 + * @internalComponent
1.311 + */
1.312 + void ErrorOccurredL(TUint32 aProfileId,
1.313 + TInt aStatus,
1.314 + TInt aError);
1.315 +
1.316 + protected:
1.317 +
1.318 + /**
1.319 + * Constructor
1.320 + * @param aObserver observer to send events to
1.321 + * @internalComponent
1.322 + */
1.323 + CSIPProfileRegistryBase(MSIPProfileRegistryObserver& aObserver);
1.324 +
1.325 + /**
1.326 + * Symbian 2nd phase base class constructor
1.327 + * @internalComponent
1.328 + */
1.329 + void BaseConstructL();
1.330 +
1.331 + /**
1.332 + * Store profile into client cache
1.333 + * @param aItem a cleanup item for roll back in case of failure
1.334 + * @internalComponent
1.335 + */
1.336 + void StoreProfileL(CSIPProfileCleanupItem* aItem);
1.337 +
1.338 + /**
1.339 + * Store array of profiles into client cache
1.340 + * @param aProfiles a array containing the profiles
1.341 + * @param aRetProfiles returned array containing profiles
1.342 + * @internalComponent
1.343 + */
1.344 + void StoreArrayL(
1.345 + RPointerArray<CSIPConcreteProfile>& aProfiles,
1.346 + RPointerArray<CSIPProfile>& aRetProfiles);
1.347 +
1.348 + /**
1.349 + * Gets profile cache item
1.350 + * @param aProfileId a profile id to be found
1.351 + * @return local cache item of the profile
1.352 + * @internalComponent
1.353 + */
1.354 + CSIPProfileItem* ProfileItemL(TUint aProfileId);
1.355 +
1.356 + /**
1.357 + * Gets profile cache item index
1.358 + * @param aProfileId a profile id to be found
1.359 + * @return local cache item index of the profile
1.360 + * @internalComponent
1.361 + */
1.362 + TInt ProfileIndex (TUint aProfileId);
1.363 +
1.364 + /**
1.365 + * Gets profile cache item by index
1.366 + * @param aIndex a index of the profile to be found
1.367 + * @return local cache item of the profile
1.368 + * @internalComponent
1.369 + */
1.370 + CSIPProfileItem* ProfileItemByIndex(TUint aIndex);
1.371 +
1.372 + /**
1.373 + * Gets SIP profile identified by the Id; leaves on failure
1.374 + * The owneship of profile is transferred.
1.375 + * @param aId a SIP profile Id
1.376 + * @param aSize of profile if known
1.377 + * @return SIP profile or 0 pointer if there's no such SIP profile
1.378 + * @internalComponent
1.379 + */
1.380 + CSIPProfile* SIPProfileL(TUint32 aId, TInt aSize = 0);
1.381 +
1.382 + protected: // Data
1.383 +
1.384 + /**
1.385 + * @internalComponent
1.386 + */
1.387 + RSIPProfile* iSipClient;
1.388 +
1.389 + /**
1.390 + * @internalComponent
1.391 + */
1.392 + CSIPProfileITCReceiver* iITCReceiver;
1.393 +
1.394 + /**
1.395 + * @internalComponent
1.396 + */
1.397 + CSIPProfileITC* iITC;
1.398 +
1.399 + /**
1.400 + * @internalComponent
1.401 + */
1.402 + MSIPProfileRegistryObserver& iObserver;
1.403 +
1.404 + /**
1.405 + * @internalComponent
1.406 + */
1.407 + RPointerArray<CSIPProfileItem> iProfiles;
1.408 +
1.409 + /**
1.410 + * @internalComponent
1.411 + */
1.412 + CSIPProfilePlugins* iProfilePlugins;
1.413 +
1.414 + /**
1.415 + * @internalComponent
1.416 + */
1.417 + CSIPProfileItem* iFindEntry;
1.418 +
1.419 + private:
1.420 +
1.421 + void ProfilesCommonL(RPointerArray<CSIPProfile>& aProfiles,
1.422 + CSIPConcreteProfileHolder* aHolder);
1.423 +
1.424 + };
1.425 +
1.426 +#endif // CSIPPROFILEREGISTRYBASE_H