|
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 "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". |
|
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 * @param aSIPProfile a SIP profile |
|
86 * @return ETrue if its being used by other applications, EFalse otherwise |
|
87 * @capability ReadUserData |
|
88 */ |
|
89 IMPORT_C TBool IsInUseL(const CSIPProfile& aSIPProfile) const; |
|
90 |
|
91 /** |
|
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 |
|
94 * in the SIP profile. |
|
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 |
|
101 */ |
|
102 IMPORT_C void SaveL(CSIPProfile& aSIPProfile); |
|
103 |
|
104 /** |
|
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 |
|
112 */ |
|
113 IMPORT_C void DestroyL(CSIPProfile& aSIPProfile); |
|
114 |
|
115 private: |
|
116 |
|
117 CSIPManagedProfileRegistry(MSIPProfileRegistryObserver& aObserver); |
|
118 |
|
119 void ConstructL(); |
|
120 |
|
121 /** |
|
122 * Creates a new instance of type CSIPManagedProfile |
|
123 * @return new instance |
|
124 */ |
|
125 CSIPProfile* NewInstanceL(); |
|
126 }; |
|
127 |
|
128 #endif // CSIPMANAGEDPROFILEREGISTRY_H |