author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:49:39 +0300 | |
changeset 54 | bb1b421e3b9e |
parent 51 | 58d624870d25 |
permissions | -rw-r--r-- |
22 | 1 |
/* |
2 |
* Copyright (c) 2002 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 |
* Alwaysonline manager declaration file |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
||
20 |
#ifndef __ALWAYSONLINEMANAGER_H__ |
|
21 |
#define __ALWAYSONLINEMANAGER_H__ |
|
22 |
||
23 |
// INCLUDES |
|
24 |
#include <e32base.h> |
|
25 |
#include <AlwaysOnlineManagerClient.h> |
|
26 |
#include <msvapi.h> |
|
27 |
#include <rconnmon.h> |
|
28 |
#include <MuiuMsvSingleOpWatcher.h> |
|
29 |
#include <centralrepository.h> |
|
30 |
#include <cenrepnotifyhandler.h> |
|
31 |
||
32 |
#include "AlwaysOnlineEComInterface.h" |
|
33 |
#include "AlwaysOnlineStatusQueryInterface.h" |
|
34 |
#include "AlwaysOnlineManagerDiskSpaceObserver.h" |
|
35 |
||
36 |
// CONSTANTS |
|
37 |
// MACROS |
|
38 |
// DATA TYPES |
|
39 |
// FUNCTION PROTOTYPES |
|
40 |
// FORWARD DECLARATIONS |
|
41 |
class CAlwaysOnlineManagerServer; |
|
42 |
class CAOCenRepControl; |
|
43 |
||
44 |
// CLASS DECLARATION |
|
45 |
||
46 |
/** |
|
47 |
* CAlwaysOnlineManager |
|
48 |
* |
|
49 |
* This class contains the plugin related logic in always online server |
|
50 |
* @since s60 2.1 |
|
51 |
*/ |
|
52 |
class CAlwaysOnlineManager : |
|
53 |
public CBase, |
|
54 |
public MAlwaysOnlineStatusQueryInterface, |
|
55 |
public MConnectionMonitorObserver, |
|
56 |
public MMsvSessionObserver, |
|
57 |
public MMsvSingleOpWatcher, |
|
58 |
public MCenRepNotifyHandlerCallback |
|
59 |
{ |
|
60 |
public: |
|
61 |
||
62 |
||
63 |
/** |
|
64 |
* NewL(); |
|
65 |
* @since Series60 2.6 |
|
66 |
* @param CAlwaysOnlineManagerServer*, pointer to server |
|
67 |
* @return CAlwaysOnlineManager*, self |
|
68 |
*/ |
|
69 |
static CAlwaysOnlineManager* NewL( CAlwaysOnlineManagerServer* aServer ); |
|
70 |
||
71 |
/** |
|
72 |
* Destructor |
|
73 |
* ~CAlwaysOnlineManager(); |
|
74 |
*/ |
|
75 |
~CAlwaysOnlineManager(); |
|
76 |
||
77 |
/** |
|
78 |
* DoStartL(); |
|
79 |
* @since Series60 2.6 |
|
80 |
*/ |
|
81 |
void DoStartL(); |
|
82 |
||
83 |
/** |
|
84 |
* RoamingStatus() |
|
85 |
* @since Series60 2.6 |
|
86 |
* @param TInt, query id |
|
87 |
* @return TAny*, returned value for a query. Real type depends on |
|
88 |
* the query. See documentation |
|
89 |
*/ |
|
90 |
TAny* QueryStatusL( TInt aQuery ); |
|
91 |
||
92 |
||
93 |
/** |
|
94 |
* HandleOfflineEventL |
|
95 |
* Sends event to plugins to inform them about changes between |
|
96 |
* offline/normal mode |
|
97 |
* @since Series60 2.6 |
|
98 |
* @param TInt event id |
|
99 |
*/ |
|
100 |
void HandleOfflineEventL( TInt aEvent ); |
|
101 |
||
102 |
||
103 |
/** |
|
104 |
* From connmon |
|
105 |
* @since Series60 2.6 |
|
106 |
* @param CConnMonEventBase |
|
107 |
*/ |
|
108 |
void EventL( const CConnMonEventBase &aConnMonEvent ); |
|
109 |
||
110 |
/** |
|
111 |
* HandleDiskSpaceEventL() |
|
112 |
* Handle event from disk space observer |
|
113 |
* @since Series60 2.6 |
|
114 |
* @param TInt, event id |
|
115 |
*/ |
|
116 |
void HandleDiskSpaceEventL( TInt aEvent ); |
|
117 |
||
118 |
private: // From base classes |
|
119 |
||
120 |
/** |
|
121 |
* From MCenRepNotifyHandlerCallback |
|
122 |
* Handles the incoming notifications of key changes |
|
123 |
* @since Series60 3.0 |
|
124 |
* @param aId, Key that has changed |
|
125 |
* @param aNewValue, New value of the key |
|
126 |
*/ |
|
127 |
void HandleNotifyInt( TUint32 aId, TInt aNewValue ); |
|
128 |
||
129 |
/** |
|
130 |
* From MCenRepNotifyHandlerCallback |
|
131 |
* Handles the notifier errors |
|
132 |
* @since Series60 3.0 |
|
133 |
* @param aId, Key that has changed |
|
134 |
* @param aNewValue, New value of the key |
|
135 |
*/ |
|
136 |
void HandleNotifyError( |
|
137 |
TUint32 aId, |
|
138 |
TInt aError, |
|
139 |
CCenRepNotifyHandler* aHandler ); |
|
140 |
||
141 |
/** |
|
142 |
* HandleSessionEventL |
|
143 |
* @since Series60 2.6 |
|
144 |
* @param TMsvSessionEvent, session event |
|
145 |
* @param TAny* parameter 1 |
|
146 |
* @param TAny* parameter 2 |
|
147 |
* @param TAny* parameter 3 |
|
148 |
*/ |
|
149 |
void HandleSessionEventL(TMsvSessionEvent aEvent, |
|
150 |
TAny* aArg1, |
|
151 |
TAny* /*aArg2*/, |
|
152 |
TAny* /*aArg3*/); |
|
153 |
||
154 |
public: |
|
155 |
||
156 |
/** |
|
157 |
* BroadcastClientCommandL |
|
158 |
* @since Series60 2.6 |
|
159 |
*/ |
|
160 |
void BroadcastClientCommandL( TAlwaysOnlineServerAPICommands aCommand, TDes8& aParameter ); |
|
161 |
||
162 |
/** |
|
163 |
* OpCompleted() |
|
164 |
* From MMsvSingleOpWatcher |
|
165 |
* @since Series60 2.6 |
|
166 |
* @param CMsvSingleOpWatcher& opwatcher which completed |
|
167 |
* @param TInt, completion code |
|
168 |
*/ |
|
169 |
virtual void OpCompleted( |
|
170 |
CMsvSingleOpWatcher& aOpWatcher, |
|
171 |
TInt aCompletionCode ); |
|
172 |
private: |
|
173 |
||
174 |
/** |
|
175 |
* C++ constructor |
|
176 |
* CAlwaysOnlineManager(); |
|
177 |
*/ |
|
178 |
CAlwaysOnlineManager(); |
|
179 |
||
180 |
/** |
|
181 |
* ConstructL() |
|
182 |
* @since Series60 2.6 |
|
183 |
* @param CAlwaysOnlineManagerServer*, server pointer |
|
184 |
*/ |
|
185 |
void ConstructL( CAlwaysOnlineManagerServer* aServer ); |
|
186 |
||
187 |
/** |
|
188 |
* LoadPluginsL(); |
|
189 |
* @since Series60 2.6 |
|
190 |
*/ |
|
191 |
void LoadPluginsL(); |
|
192 |
||
193 |
/** |
|
194 |
* StartPluginsL(); |
|
195 |
* @since Series60 2.6 |
|
196 |
*/ |
|
197 |
void StartPluginsL(); |
|
198 |
||
199 |
/** |
|
200 |
* Check network status and report it to plugins; |
|
201 |
* @since Series60 2.6 |
|
202 |
*/ |
|
203 |
void CheckNetworkStatusAndSetObserverL(); |
|
204 |
||
205 |
/** |
|
206 |
* Takes action based on registration status |
|
207 |
* @since Series60 2.6 |
|
208 |
* @param TInt, status id |
|
209 |
*/ |
|
210 |
void HandleRegistrationStatusL( TInt aStatus ); |
|
211 |
||
212 |
/** |
|
213 |
* Sends command to all plugins |
|
214 |
* @since Series60 3.2.3 |
|
215 |
* @param TManagerServerCommands, command for plugin |
|
216 |
* @param TDes8&, parameter |
|
217 |
*/ |
|
218 |
void BroadcastCommandDirectL( |
|
219 |
TManagerServerCommands aCommand, |
|
220 |
TDes8& aParameter ); |
|
221 |
||
222 |
/** |
|
223 |
* |
|
224 |
* @since Series60 2.6 |
|
225 |
*/ |
|
226 |
void InvokeCommandHandlerL( const TManagerServerCommands aCommand, |
|
227 |
TDes8& aParameter, |
|
228 |
TInt aIndex ); |
|
229 |
||
230 |
/** |
|
231 |
* Queries all the started plugins, whether they want to be shutdown or not. |
|
232 |
* @since Series60 3.1 |
|
233 |
*/ |
|
234 |
void QuerySuicideL(); |
|
235 |
||
236 |
/** |
|
237 |
* Handles starting of plugin, which UID is inside parameter. |
|
238 |
* @since Series60 3.1 |
|
239 |
* @param aParameter, UID of plugin |
|
240 |
*/ |
|
241 |
void HandleStartPluginL( const TDes8& aParameter ); |
|
242 |
||
243 |
/** |
|
244 |
* Handles stopping of plugin, which UID is inside parameter. |
|
245 |
* @since Series60 3.1 |
|
246 |
* @param aParameter, UID of plugin |
|
247 |
*/ |
|
248 |
void HandleStopPluginL( const TDes8& aParameter ); |
|
249 |
||
250 |
/** |
|
51
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
251 |
* Handles stopping of plugin with given implementation UID. |
22 | 252 |
* @since Series60 3.1 |
51
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
253 |
* @param aPluginImplementationUid, implementation UID of plugin |
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
254 |
* (implementation_uid in .rss). |
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
255 |
* NOTE: There can be multiple instances of same plugin |
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
256 |
* implementation. |
22 | 257 |
*/ |
51
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
258 |
void StopPluginL( const TUid& aPluginImplementationUid ); |
22 | 259 |
|
260 |
/** |
|
51
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
261 |
* Unloads the plugin with given instance UID and sets it as disabled. |
22 | 262 |
* @since Series60 3.1 |
51
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
263 |
* @param aPluginInstanceUid, UID of plugin instance |
22 | 264 |
*/ |
51
58d624870d25
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
265 |
void DisablePlugin( const TUid& aPluginInstanceUid ); |
22 | 266 |
|
267 |
/** |
|
268 |
* Handles the final progress of an operation. |
|
269 |
* @since Series60 3.1 |
|
270 |
* @param aProgress, progress from operation |
|
271 |
*/ |
|
272 |
void HandleOpCompletionL( const TDesC8& aProgress ); |
|
273 |
||
274 |
/** |
|
275 |
* Handles the parsing of final progress. |
|
276 |
* @since Series60 3.1 |
|
277 |
* @param aProgress, final progress of an operation |
|
278 |
* @param aUid, UID of plugin |
|
279 |
* @param aCommand, command executed in operation |
|
280 |
* @param aResult, final result of an operation |
|
281 |
*/ |
|
282 |
TBool ParseProgressL( |
|
283 |
const TDesC8& aProgress, |
|
284 |
TUid& aUid, |
|
285 |
TInt& aCommand, |
|
286 |
TDes8& aResult ); |
|
287 |
||
288 |
//data |
|
289 |
private: |
|
290 |
TBool iOffline; |
|
291 |
TInt iNetworkStatus; |
|
292 |
TBool iPluginsLoaded; |
|
293 |
CArrayFixFlat<CAlwaysOnlineEComInterface*>* iPluginArray; |
|
294 |
CArrayFixFlat<TUid>* iDisabledPluginUidsArray; |
|
295 |
CAlwaysOnlineManagerServer* iServer; |
|
296 |
CAlwaysOnlineDiskSpaceObserver* iDiskSpaceObserver; |
|
297 |
RFs iRfs; |
|
298 |
CMsvSession* iSession; |
|
299 |
// Array to store the operation |
|
300 |
CMsvSingleOpWatcherArray* iOperations; |
|
301 |
TInt iLastDiskEvent; |
|
302 |
// Used to listen network state changes |
|
303 |
RConnectionMonitor iConMon; |
|
304 |
// Handle all the cenrep actions |
|
305 |
CAOCenRepControl* iCenRepControl; |
|
306 |
}; |
|
307 |
||
308 |
#endif |
|
309 |
//EOF |