2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : sipmanagedprofileregistry.h
16 * Part of : SIP Profile Client
17 * Interface : SDK API, SIP Profile API
18 * The class for managing SIP profiles
25 #ifndef CSIPMANAGEDPROFILEREGISTRY_H
26 #define CSIPMANAGEDPROFILEREGISTRY_H
31 #include "sipprofileregistrybase.h"
33 // FORWARD DECLARATIONS
35 class CSIPManagedProfile;
36 class MSIPProfileRegistryObserver;
44 * The class for managing SIP profiles.
45 * This class provides the functions for
46 * adding/updating/removing profiles.
48 * @lib sipprofilecli.lib
50 class CSIPManagedProfileRegistry: public CSIPProfileRegistryBase
52 public: // Constructors and destructor
54 * Two-phased constructor.
55 * @param aObserver a observer for SIP profile change events.
57 IMPORT_C static CSIPManagedProfileRegistry* NewL(
58 MSIPProfileRegistryObserver& aObserver);
61 * Two-phased constructor.
62 * Constructs an object and adds the pointer to the cleanup stack;
63 * @param aObserver a observer for SIP profile change events.
65 IMPORT_C static CSIPManagedProfileRegistry* NewLC(
66 MSIPProfileRegistryObserver& aObserver);
71 IMPORT_C ~CSIPManagedProfileRegistry();
72 public: //new functions
75 * Instantiates new profile with default values
77 * @param aType a SIP profile type to be created
78 * @return pre-filled instance of given type profile type;
79 * the ownership is transferred
81 IMPORT_C CSIPManagedProfile* CreateL(const TSIPProfileTypeInfo& aType);
84 * Checks if profile is not used by other applications.
85 * @param aSIPProfile a SIP profile
86 * @return ETrue if its being used by other applications, EFalse otherwise
87 * @capability ReadUserData
89 IMPORT_C TBool IsInUseL(const CSIPProfile& aSIPProfile) const;
92 * Saves new profile or changes to a profile to the persistent storage.
93 * This function must be called after desired values are set or updated
95 * If the profile is marked for auto-registration and the profile is
96 * updated the profile will be re-registered.
97 * Function leaves on failure.
98 * @param aSIPProfile a sip profile to save
99 * @capability WriteDeviceData
100 * @capability NetworkServices
102 IMPORT_C void SaveL(CSIPProfile& aSIPProfile);
105 * Removes and deletes SIP profile from the persistent storage.
106 * Function leaves on failure.
107 * If the profile is registered it will be de-registered before the
108 * removal from the persistent storage.
109 * @param aSIPProfile a sip profile to delete
110 * @capability WriteDeviceData
111 * @capability NetworkServices
113 IMPORT_C void DestroyL(CSIPProfile& aSIPProfile);
117 CSIPManagedProfileRegistry(MSIPProfileRegistryObserver& aObserver);
122 * Creates a new instance of type CSIPManagedProfile
123 * @return new instance
125 CSIPProfile* NewInstanceL();
128 #endif // CSIPMANAGEDPROFILEREGISTRY_H