|
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 : sipprofileregistry.h |
|
16 * Part of : SIP Profile Client |
|
17 * Interface : SDK API, SIP Profile API |
|
18 * The class for using SIP profiles |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CSIPPROFILEREGISTRY_H |
|
26 #define CSIPPROFILEREGISTRY_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> |
|
30 #include <e32std.h> |
|
31 #include <badesca.h> |
|
32 #include "sipprofileregistrybase.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CSIP; |
|
36 class CSIPConnection; |
|
37 class CSIPProfile; |
|
38 class MSIPProfileRegistryObserver; |
|
39 class MSIPConnectionObserver; |
|
40 |
|
41 |
|
42 // CLASS DECLARATION |
|
43 /** |
|
44 * @publishedAll |
|
45 * @released |
|
46 * |
|
47 * The class for retrieving SIP profiles from permanent storage. |
|
48 * This class provides services for retreiving SIP profiles |
|
49 * and enabling/disabling them for the usage. |
|
50 * |
|
51 * The user can create only one instance of this class (a singleton class). |
|
52 * |
|
53 * @lib sipprofilecli.lib |
|
54 */ |
|
55 class CSIPProfileRegistry: public CSIPProfileRegistryBase |
|
56 { |
|
57 public: // Constructors and destructor |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 * This constructor should be used if the client intends |
|
61 * to use SIP services with profiles. |
|
62 * @param aSip a SIP client providing connection to SIP stack. |
|
63 * @param aObserver a observer for SIP profile change events. |
|
64 */ |
|
65 IMPORT_C static CSIPProfileRegistry* NewL( |
|
66 CSIP& aSip, |
|
67 MSIPProfileRegistryObserver& aObserver); |
|
68 |
|
69 /** |
|
70 * Two-phased constructor. |
|
71 * This constructor should be used if the client intends |
|
72 * to use SIP services with profiles. |
|
73 * Constructs an object and adds the pointer to the cleanup stack; |
|
74 * @param aSip a SIP client providing connection to SIP stack. |
|
75 * @param aObserver a observer for SIP profile change events. |
|
76 */ |
|
77 IMPORT_C static CSIPProfileRegistry* NewLC( |
|
78 CSIP& aSip, |
|
79 MSIPProfileRegistryObserver& aObserver); |
|
80 |
|
81 /** |
|
82 * Destructor |
|
83 */ |
|
84 IMPORT_C ~CSIPProfileRegistry(); |
|
85 |
|
86 public: // New functions |
|
87 /** |
|
88 * Gets handle to the SIP server |
|
89 * @return handle to the SIP server |
|
90 */ |
|
91 IMPORT_C CSIP& SIP() const; |
|
92 |
|
93 /** |
|
94 * Gets the SIP connection to be used with this SIP profile. |
|
95 * @pre IsEnabled() == ETrue |
|
96 * @param aProfile a sip profile |
|
97 * @return a SIP connection to be used; the owneship is transfered |
|
98 * @leave KErrNoMemory if out of memory |
|
99 * @capability NetworkServices |
|
100 */ |
|
101 IMPORT_C CSIPConnection* ConnectionL( |
|
102 CSIPProfile& aProfile); |
|
103 |
|
104 /** |
|
105 * Enables the SIP profile for use. |
|
106 * Enabling the SIP profile will cause the SIP profile to |
|
107 * be registered if its status was unregistered. |
|
108 * The user must check the profile status after calling this |
|
109 * function. In case the profile is not registered the user must |
|
110 * wait until the it is notified about profile registration |
|
111 * on MSIPProfileRegistryObserver-callback interface. |
|
112 * @param aProfile a sip profile to enable |
|
113 * @param aObserver a observer for SIP connection events |
|
114 * @leave KErrNotFound if non-existing profile is provided |
|
115 * @capability NetworkServices |
|
116 */ |
|
117 IMPORT_C void EnableL( |
|
118 CSIPProfile& aProfile, |
|
119 MSIPConnectionObserver &aObserver); |
|
120 |
|
121 /** |
|
122 * Disables the usage of SIP profile |
|
123 * @param aProfile a sip profile to disable |
|
124 * @return KErrNone if SIP profile was successfully disabled; |
|
125 * system wide error otherwise |
|
126 * @capability NetworkServices |
|
127 */ |
|
128 IMPORT_C TInt Disable(CSIPProfile& aProfile); |
|
129 |
|
130 /** |
|
131 * Tests is the SIP profile enabled for the use |
|
132 * @param aProfile a SIP profile to be checked |
|
133 * @return ETrue if SIP profile is enabled; EFalse otherwise |
|
134 */ |
|
135 IMPORT_C TBool IsEnabled(const CSIPProfile& aProfile) const; |
|
136 |
|
137 /** |
|
138 * Force disables the usage of SIP profile |
|
139 * All Profile related activities will be stopped ungracefully |
|
140 * @param aProfile a sip profile to disable |
|
141 * @return KErrNone if SIP profile was successfully disabled; |
|
142 * system wide error otherwise |
|
143 * @capability NetworkControl |
|
144 */ |
|
145 IMPORT_C TInt ForceDisable(CSIPProfile& aProfile); |
|
146 |
|
147 /** |
|
148 * Refreshes the Enabled SIP profile for use. |
|
149 * Refreshing the Enabled Profile will cause the SIP Profile to |
|
150 * get Registered if its status was not registered. |
|
151 * This function has to be used when the profile is in Enabled state and |
|
152 * might be unregistered due to a connection loss. |
|
153 * @param aProfile a sip profile to enable |
|
154 * @leave KErrNotFound if non-existing profile is provided |
|
155 * @leave KErrArgument if the profile is not previously Enabled and in Unregistered state. |
|
156 * @capability NetworkServices |
|
157 */ |
|
158 |
|
159 IMPORT_C void RefreshEnableL(CSIPProfile& aProfile); |
|
160 |
|
161 public: |
|
162 |
|
163 /** |
|
164 * @internalComponent |
|
165 */ |
|
166 CSIPProfile* NewInstanceL(); |
|
167 |
|
168 private: |
|
169 |
|
170 CSIPProfileRegistry(); |
|
171 CSIPProfileRegistry(CSIP& aSip, MSIPProfileRegistryObserver& aObserver); |
|
172 void ConstructL(); |
|
173 |
|
174 private: |
|
175 |
|
176 CSIP& iSip; |
|
177 MSIPConnectionObserver* iConnectionObserver; |
|
178 }; |
|
179 |
|
180 #endif // CSIPPROFILEREGISTRY_H |