1 sipmanagedprofileregistry.h |
1 /* |
|
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * 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 |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : sipmanagedprofileregistry.h |
|
16 * Part of : SIP Profile Client |
|
17 * Interface : SDK API, SIP Profile API |
|
18 * The class for managing SIP profiles |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CSIPMANAGEDPROFILEREGISTRY_H |
|
26 #define CSIPMANAGEDPROFILEREGISTRY_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> |
|
30 #include <e32std.h> |
|
31 #include "sipprofileregistrybase.h" |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CSIPProfile; |
|
35 class CSIPManagedProfile; |
|
36 class MSIPProfileRegistryObserver; |
|
37 |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * @publishedAll |
|
42 * @released |
|
43 * |
|
44 * The class for managing SIP profiles. |
|
45 * This class provides the functions for |
|
46 * adding/updating/removing profiles. |
|
47 * |
|
48 * @lib sipprofilecli.lib |
|
49 */ |
|
50 class CSIPManagedProfileRegistry: public CSIPProfileRegistryBase |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * @param aObserver a observer for SIP profile change events. |
|
56 */ |
|
57 IMPORT_C static CSIPManagedProfileRegistry* NewL( |
|
58 MSIPProfileRegistryObserver& aObserver); |
|
59 |
|
60 /** |
|
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. |
|
64 */ |
|
65 IMPORT_C static CSIPManagedProfileRegistry* NewLC( |
|
66 MSIPProfileRegistryObserver& aObserver); |
|
67 |
|
68 /** |
|
69 * Destructor |
|
70 */ |
|
71 IMPORT_C ~CSIPManagedProfileRegistry(); |
|
72 public: //new functions |
|
73 |
|
74 /** |
|
75 * Instantiates new profile with default values |
|
76 * for given type. |
|
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 |
|
80 */ |
|
81 IMPORT_C CSIPManagedProfile* CreateL(const TSIPProfileTypeInfo& aType); |
|
82 |
|
83 /** |
|
84 * Checks if profile is not used by other applications. |
|
85 * If no other application is using the profile, profile |
|
86 * can be updated. |
|
87 * @param aSIPProfile a SIP profile |
|
88 * @return ETrue if available for update, EFalse otherwise |
|
89 * @capability ReadUserData |
|
90 */ |
|
91 IMPORT_C TBool IsInUseL(const CSIPProfile& aSIPProfile) const; |
|
92 |
|
93 /** |
|
94 * Saves new profile or changes to a profile to the persistent storage. |
|
95 * This function must be called after desired values are set or updated |
|
96 * in the SIP profile. |
|
97 * If the profile is marked for auto-registration and the profile is |
|
98 * updated the profile will be re-registered. |
|
99 * Function leaves on failure. |
|
100 * @pre IsInUse(aSIPProfile)==EFalse |
|
101 * @param aSIPProfile a sip profile to save |
|
102 * @capability WriteDeviceData |
|
103 * @capability NetworkServices |
|
104 */ |
|
105 IMPORT_C void SaveL(CSIPProfile& aSIPProfile); |
|
106 |
|
107 /** |
|
108 * Removes and deletes SIP profile from the persistent storage. |
|
109 * Function leaves on failure. |
|
110 * If the profile is registered it will be de-registered before the |
|
111 * removal from the persistent storage. |
|
112 * @param aSIPProfile a sip profile to delete |
|
113 * @capability WriteDeviceData |
|
114 * @capability NetworkServices |
|
115 */ |
|
116 IMPORT_C void DestroyL(CSIPProfile& aSIPProfile); |
|
117 |
|
118 private: |
|
119 |
|
120 CSIPManagedProfileRegistry(MSIPProfileRegistryObserver& aObserver); |
|
121 |
|
122 void ConstructL(); |
|
123 |
|
124 /** |
|
125 * Creates a new instance of type CSIPManagedProfile |
|
126 * @return new instance |
|
127 */ |
|
128 CSIPProfile* NewInstanceL(); |
|
129 }; |
|
130 |
|
131 #endif // CSIPMANAGEDPROFILEREGISTRY_H |