williamr@2: /* williamr@2: * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Name : sipmanagedprofileregistry.h williamr@2: * Part of : SIP Profile Client williamr@2: * Interface : SDK API, SIP Profile API williamr@2: * The class for managing SIP profiles williamr@2: * Version : 1.0 williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CSIPMANAGEDPROFILEREGISTRY_H williamr@2: #define CSIPMANAGEDPROFILEREGISTRY_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include "sipprofileregistrybase.h" williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSIPProfile; williamr@2: class CSIPManagedProfile; williamr@2: class MSIPProfileRegistryObserver; williamr@2: williamr@2: williamr@2: // CLASS DECLARATION williamr@2: /** williamr@2: * @publishedAll williamr@2: * @released williamr@2: * williamr@2: * The class for managing SIP profiles. williamr@2: * This class provides the functions for williamr@2: * adding/updating/removing profiles. williamr@2: * williamr@2: * @lib sipprofilecli.lib williamr@2: */ williamr@2: class CSIPManagedProfileRegistry: public CSIPProfileRegistryBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * @param aObserver a observer for SIP profile change events. williamr@2: */ williamr@2: IMPORT_C static CSIPManagedProfileRegistry* NewL( williamr@2: MSIPProfileRegistryObserver& aObserver); williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * Constructs an object and adds the pointer to the cleanup stack; williamr@2: * @param aObserver a observer for SIP profile change events. williamr@2: */ williamr@2: IMPORT_C static CSIPManagedProfileRegistry* NewLC( williamr@2: MSIPProfileRegistryObserver& aObserver); williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~CSIPManagedProfileRegistry(); williamr@2: public: //new functions williamr@2: williamr@2: /** williamr@2: * Instantiates new profile with default values williamr@2: * for given type. williamr@2: * @param aType a SIP profile type to be created williamr@2: * @return pre-filled instance of given type profile type; williamr@2: * the ownership is transferred williamr@2: */ williamr@2: IMPORT_C CSIPManagedProfile* CreateL(const TSIPProfileTypeInfo& aType); williamr@2: williamr@2: /** williamr@2: * Checks if profile is not used by other applications. williamr@2: * If no other application is using the profile, profile williamr@2: * can be updated. williamr@2: * @param aSIPProfile a SIP profile williamr@2: * @return ETrue if available for update, EFalse otherwise williamr@2: * @capability ReadUserData williamr@2: */ williamr@2: IMPORT_C TBool IsInUseL(const CSIPProfile& aSIPProfile) const; williamr@2: williamr@2: /** williamr@2: * Saves new profile or changes to a profile to the persistent storage. williamr@2: * This function must be called after desired values are set or updated williamr@2: * in the SIP profile. williamr@2: * If the profile is marked for auto-registration and the profile is williamr@2: * updated the profile will be re-registered. williamr@2: * Function leaves on failure. williamr@2: * @pre IsInUse(aSIPProfile)==EFalse williamr@2: * @param aSIPProfile a sip profile to save williamr@2: * @capability WriteDeviceData williamr@2: * @capability NetworkServices williamr@2: */ williamr@2: IMPORT_C void SaveL(CSIPProfile& aSIPProfile); williamr@2: williamr@2: /** williamr@2: * Removes and deletes SIP profile from the persistent storage. williamr@2: * Function leaves on failure. williamr@2: * If the profile is registered it will be de-registered before the williamr@2: * removal from the persistent storage. williamr@2: * @param aSIPProfile a sip profile to delete williamr@2: * @capability WriteDeviceData williamr@2: * @capability NetworkServices williamr@2: */ williamr@2: IMPORT_C void DestroyL(CSIPProfile& aSIPProfile); williamr@2: williamr@2: private: williamr@2: williamr@2: CSIPManagedProfileRegistry(MSIPProfileRegistryObserver& aObserver); williamr@2: williamr@2: void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Creates a new instance of type CSIPManagedProfile williamr@2: * @return new instance williamr@2: */ williamr@2: CSIPProfile* NewInstanceL(); williamr@2: }; williamr@2: williamr@2: #endif // CSIPMANAGEDPROFILEREGISTRY_H