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