27 #include "hnservicehandler.h" |
27 #include "hnservicehandler.h" |
28 #include "hnsuiteobserver.h" |
28 #include "hnsuiteobserver.h" |
29 |
29 |
30 /** |
30 /** |
31 * Repository Observer base class. |
31 * Repository Observer base class. |
32 * |
32 * |
33 * It is used to be derived by repository observers. |
33 * It is used to be derived by repository observers. |
34 * |
34 * |
35 * @lib hnmetadatamodel |
35 * @lib hnmetadatamodel |
36 * @since S60 5.0 |
36 * @since S60 5.0 |
37 * @ingroup group_hnmetadatamodel |
37 * @ingroup group_hnmetadatamodel |
38 */ |
38 */ |
39 NONSHARABLE_CLASS( CHnRepositoryObserver ): |
39 NONSHARABLE_CLASS( CHnRepositoryObserver ): |
40 public CBase, |
40 public CBase, |
41 public MCenRepNotifyHandlerCallback |
41 public MCenRepNotifyHandlerCallback |
42 { |
42 { |
43 public: |
43 public: |
44 |
44 |
45 /** |
45 /** |
46 * Default C++ Destructor. |
46 * Default C++ Destructor. |
47 * |
47 * |
48 * @since S60 v5.0 |
48 * @since S60 v5.0 |
49 */ |
49 */ |
50 virtual ~CHnRepositoryObserver(); |
50 virtual ~CHnRepositoryObserver(); |
51 |
51 |
52 |
52 |
53 protected: |
53 protected: |
54 |
54 |
55 /** |
55 /** |
56 * Defautlt C++ Constructor. |
56 * Defautlt C++ Constructor. |
57 * |
57 * |
58 * @param aCmnPtrs Common pointers. |
58 * @param aCmnPtrs Common pointers. |
59 * @since S60 v5.0 |
59 * @since S60 v5.0 |
60 */ |
60 */ |
61 CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs ); |
61 CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs ); |
62 |
62 |
63 |
63 |
64 /** |
64 /** |
65 * Defautlt C++ Constructor. |
65 * Defautlt C++ Constructor. |
66 * |
66 * |
67 * @param aCmnPtrs Common pointers. |
67 * @param aCmnPtrs Common pointers. |
68 * @since S60 v5.0 |
68 * @since S60 v5.0 |
69 */ |
69 */ |
70 CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); |
70 CHnRepositoryObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); |
71 |
71 |
72 /** |
72 /** |
73 * Second stage constructor. |
73 * Second stage constructor. |
74 * |
74 * |
75 * @since S60 v5.0 |
75 * @since S60 v5.0 |
76 */ |
76 */ |
77 void ConstructL( const TUid aRepositoryUid ); |
77 void ConstructL( const TUid aRepositoryUid ); |
78 |
78 |
79 protected: |
79 protected: |
80 |
80 |
81 /** |
81 /** |
82 * Own - Central Repository access class. |
82 * Own - Central Repository access class. |
83 */ |
83 */ |
84 CRepository *iRepository; |
84 CRepository *iRepository; |
85 |
85 |
86 /** |
86 /** |
87 * Id of the CR entry to be watched. |
87 * Id of the CR entry to be watched. |
88 */ |
88 */ |
89 TUint32 iId; |
89 TUint32 iId; |
90 |
90 |
91 /** |
91 /** |
92 * Common pointers. |
92 * Common pointers. |
93 */ |
93 */ |
94 THnMdCommonPointers* iCmnPtrs; |
94 THnMdCommonPointers* iCmnPtrs; |
95 |
95 |
96 /** |
96 /** |
97 * Own - Central repository notification handler. |
97 * Own - Central repository notification handler. |
98 */ |
98 */ |
99 CCenRepNotifyHandler* iNotifyHandler; |
99 CCenRepNotifyHandler* iNotifyHandler; |
100 |
100 |
101 }; |
101 }; |
102 |
102 |
103 /** |
103 /** |
104 * Widget Type Repository Observer. |
104 * Widget Type Repository Observer. |
105 * |
105 * |
106 * It is used to inform hierarchy navigator of changes in the suites repository. |
106 * It is used to inform hierarchy navigator of changes in the suites repository. |
107 * |
107 * |
108 * @lib hnmetadatamodel |
108 * @lib hnmetadatamodel |
109 * @since S60 5.0 |
109 * @since S60 5.0 |
110 * @ingroup group_hnmetadatamodel |
110 * @ingroup group_hnmetadatamodel |
111 */ |
111 */ |
112 NONSHARABLE_CLASS( CHnRepositoryWidgetTypeObserver ): public CHnRepositoryObserver |
112 NONSHARABLE_CLASS( CHnRepositoryWidgetTypeObserver ): public CHnRepositoryObserver |
113 { |
113 { |
114 public: |
114 public: |
115 |
115 |
116 /** |
116 /** |
117 * Default C++ Destructor. |
117 * Default C++ Destructor. |
118 * |
118 * |
119 * @since S60 v5.0 |
119 * @since S60 v5.0 |
120 */ |
120 */ |
121 virtual ~CHnRepositoryWidgetTypeObserver(); |
121 virtual ~CHnRepositoryWidgetTypeObserver(); |
122 |
122 |
123 /** |
123 /** |
124 * Factory function. |
124 * Factory function. |
125 * |
125 * |
126 * @param aCmnPtrs Common pointers. |
126 * @param aCmnPtrs Common pointers. |
127 * @return Repository Observer. |
127 * @return Repository Observer. |
128 * @since S60 v5.0 |
128 * @since S60 v5.0 |
129 */ |
129 */ |
130 static CHnRepositoryWidgetTypeObserver* NewL( THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ); |
130 static CHnRepositoryWidgetTypeObserver* NewL( THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ); |
131 |
131 |
132 /** |
132 /** |
133 * Factory function. |
133 * Factory function. |
134 * |
134 * |
135 * @param aCmnPtrs Common pointers. |
135 * @param aCmnPtrs Common pointers. |
136 * @return Repository Observer. |
136 * @return Repository Observer. |
137 * @since S60 v5.0 |
137 * @since S60 v5.0 |
138 */ |
138 */ |
139 static CHnRepositoryWidgetTypeObserver* NewLC( THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ); |
139 static CHnRepositoryWidgetTypeObserver* NewLC( THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid ); |
140 |
140 |
141 /** |
141 /** |
142 * Change handler method. |
142 * Change handler method. |
143 * It is invoked whenever notifier detects a change in the CR. |
143 * It is invoked whenever notifier detects a change in the CR. |
144 * |
144 * |
145 * @param aId Id of the entry in CR. |
145 * @param aId Id of the entry in CR. |
146 * @since S60 v5.0 |
146 * @since S60 v5.0 |
147 */ |
147 */ |
148 void HandleNotifyGeneric(TUint32 aId); |
148 void HandleNotifyGeneric(TUint32 aId); |
149 |
149 |
150 /** |
150 /** |
151 * Change handler method. |
151 * Change handler method. |
152 * It is invoked whenever notifier detects a change in the CR. |
152 * It is invoked whenever notifier detects a change in the CR. |
153 * |
153 * |
154 * @param aId Id of the entry in CR. |
154 * @param aId Id of the entry in CR. |
155 * @since S60 v5.0 |
155 * @since S60 v5.0 |
156 */ |
156 */ |
157 void HandleNotifyGenericL(TUint32 aId); |
157 void HandleNotifyGenericL(TUint32 aId); |
158 |
158 |
159 private: |
159 private: |
160 |
160 |
161 /** |
161 /** |
162 * Defautlt C++ Constructor. |
162 * Defautlt C++ Constructor. |
163 * |
163 * |
164 * @param aCmnPtrs Common pointers. |
164 * @param aCmnPtrs Common pointers. |
165 * @since S60 v5.0 |
165 * @since S60 v5.0 |
166 */ |
166 */ |
167 CHnRepositoryWidgetTypeObserver( THnMdCommonPointers* aCmnPtrs ); |
167 CHnRepositoryWidgetTypeObserver( THnMdCommonPointers* aCmnPtrs ); |
168 |
168 |
169 private: |
169 private: |
170 |
170 |
171 /** |
171 /** |
172 * Second stage constructor. |
172 * Second stage constructor. |
173 * |
173 * |
174 * @since S60 v5.0 |
174 * @since S60 v5.0 |
175 */ |
175 */ |
176 void ConstructL( const TUid aRepositoryUid ); |
176 void ConstructL( const TUid aRepositoryUid ); |
177 |
177 |
178 private: |
178 private: |
179 |
179 |
180 /** |
180 /** |
181 * Array holding ids of widgets being switched. |
181 * Array holding ids of widgets being switched. |
182 * It is used to eliminate double refresh for such suites. |
182 * It is used to eliminate double refresh for such suites. |
183 */ |
183 */ |
184 RArray<TUint32> iWidgetSwitches; |
184 RArray<TUint32> iWidgetSwitches; |
185 |
185 |
186 }; |
186 }; |
187 |
187 |
188 |
188 |
189 |
189 |
190 NONSHARABLE_CLASS( CHnRepositoryShowFolderObserver ): public CHnRepositoryObserver, |
190 NONSHARABLE_CLASS( CHnRepositoryShowFolderObserver ): public CHnRepositoryObserver, |
191 public MLiwNotifyCallback, |
191 public MLiwNotifyCallback, |
192 public MHnSuiteObserver |
192 public MHnSuiteObserver |
193 { |
193 { |
194 public: |
194 public: |
195 |
195 |
196 /** |
196 /** |
197 * Default C++ Destructor. |
197 * Default C++ Destructor. |
198 * |
198 * |
199 * @since S60 v5.0 |
199 * @since S60 v5.0 |
200 */ |
200 */ |
201 virtual ~CHnRepositoryShowFolderObserver(); |
201 virtual ~CHnRepositoryShowFolderObserver(); |
202 |
202 |
203 /** |
203 /** |
204 * Factory function. |
204 * Factory function. |
205 * |
205 * |
206 * @param aCmnPtrs Common pointers. |
206 * @param aCmnPtrs Common pointers. |
207 * @return Repository Observer. |
207 * @return Repository Observer. |
208 * @since S60 v5.0 |
208 * @since S60 v5.0 |
209 */ |
209 */ |
210 static CHnRepositoryShowFolderObserver* NewL( |
210 static CHnRepositoryShowFolderObserver* NewL( |
211 THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, |
211 THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, |
212 const TUint32 aId); |
212 const TUint32 aId); |
213 |
213 |
214 /** |
214 /** |
215 * Factory function. |
215 * Factory function. |
216 * |
216 * |
217 * @param aCmnPtrs Common pointers. |
217 * @param aCmnPtrs Common pointers. |
218 * @return Repository Observer. |
218 * @return Repository Observer. |
219 * @since S60 v5.0 |
219 * @since S60 v5.0 |
220 */ |
220 */ |
221 static CHnRepositoryShowFolderObserver* NewLC( |
221 static CHnRepositoryShowFolderObserver* NewLC( |
222 THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, |
222 THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, |
223 const TUint32 aId); |
223 const TUint32 aId); |
224 |
224 |
225 /** |
225 /** |
226 * Change handler method. |
226 * Change handler method. |
227 * It is invoked whenever notifier detects a change in the CR. |
227 * It is invoked whenever notifier detects a change in the CR. |
228 * |
228 * |
229 * @param aId Id of the entry in CR. |
229 * @param aId Id of the entry in CR. |
230 * @since S60 v5.0 |
230 * @since S60 v5.0 |
231 */ |
231 */ |
232 void HandleNotifyString(TUint32 aId, const TDesC16& aNewValue ); |
232 void HandleNotifyString(TUint32 aId, const TDesC16& aNewValue ); |
233 |
233 |
234 /** |
234 /** |
235 * Change handler method. |
235 * Change handler method. |
236 * It is invoked whenever notifier detects a change in the CR. |
236 * It is invoked whenever notifier detects a change in the CR. |
237 * |
237 * |
238 * @param aId Id of the entry in CR. |
238 * @param aId Id of the entry in CR. |
239 * @since S60 v5.0 |
239 * @since S60 v5.0 |
240 */ |
240 */ |
241 void HandleNotifyStringL(TUint32 aId, const TDesC16& aNewValue ); |
241 void HandleNotifyStringL(TUint32 aId, const TDesC16& aNewValue ); |
242 |
242 |
243 |
243 |
244 /** |
244 /** |
245 * From MLiwNotifyCallback |
245 * From MLiwNotifyCallback |
246 */ |
246 */ |
247 TInt HandleNotifyL( |
247 TInt HandleNotifyL( |
248 TInt aCmdId, |
248 TInt aCmdId, |
249 TInt aEventId, |
249 TInt aEventId, |
250 CLiwGenericParamList& aEventParamList, |
250 CLiwGenericParamList& aEventParamList, |
251 const CLiwGenericParamList& aInParamList); |
251 const CLiwGenericParamList& aInParamList); |
252 |
252 |
253 /** |
253 /** |
254 * From MHnSuiteObserver |
254 * From MHnSuiteObserver |
255 */ |
255 */ |
256 virtual void HandleSuiteEventL ( THnCustomSuiteEvent aCustomSuiteEvent, |
256 virtual void HandleSuiteEventL ( THnCustomSuiteEvent aCustomSuiteEvent, |
257 CHnSuiteModel *aModel ); |
257 CHnSuiteModel *aModel ); |
258 |
258 |
259 |
259 |
260 |
260 |
261 private: |
261 private: |
262 |
262 |
263 /** |
263 /** |
264 * Defautlt C++ Constructor. |
264 * Defautlt C++ Constructor. |
265 * |
265 * |
266 * @param aCmnPtrs Common pointers. |
266 * @param aCmnPtrs Common pointers. |
267 * @since S60 v5.0 |
267 * @since S60 v5.0 |
268 */ |
268 */ |
269 CHnRepositoryShowFolderObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); |
269 CHnRepositoryShowFolderObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); |
270 |
270 |
271 /** |
271 /** |
272 * Extracts the folder name from the CR key. |
272 * Extracts the folder name from the CR key. |
273 * |
273 * |
274 * @param aNewValue The CR key. |
274 * @param aNewValue The CR key. |
275 * @since S60 v5.0 |
275 * @since S60 v5.0 |
276 */ |
276 */ |
277 void ExtractCRKeyShowFolderName( const TDesC& aNewValue ); |
277 void ExtractCRKeyShowFolderName( const TDesC& aNewValue ); |
278 |
278 |
279 /** |
279 /** |
280 * Request get list for parent folder of an application. |
280 * Request get list for parent folder of an application. |
281 * |
281 * |
282 * @param aFolderId A parent folder id |
282 * @param aFolderId A parent folder id |
283 * @since S60 v5.0 |
283 * @since S60 v5.0 |
284 */ |
284 */ |
285 void GetShowFolderL( TUint32 aFolderId ); |
285 void GetShowFolderL( TUint32 aFolderId ); |
286 |
286 |
287 /** |
287 /** |
288 * Request get list for a folder with given application group name |
288 * Request get list for a folder with given application group name |
289 * contained in iCRKeyFolderName. |
289 * contained in iCRKeyFolderName. |
290 * |
290 * |
291 * @since S60 v5.0 |
291 * @since S60 v5.0 |
292 */ |
292 */ |
293 void GetShowFolderGroupNameL(); |
293 void GetShowFolderGroupNameL(); |
294 |
294 |
295 private: |
295 private: |
296 /** |
296 /** |
297 * Type of a flag describing the type of notification. |
297 * Type of a flag describing the type of notification. |
298 * APP_ID - MCS id is given |
298 * APP_ID - MCS id is given |
299 * APP_UID - Application UID is given |
299 * APP_UID - Application UID is given |
300 * SECOND_NOTIFY - handled notify caused by the second get list |
300 * SECOND_NOTIFY - handled notify caused by the second get list |
301 */ |
301 */ |
302 enum TNotifyType { EAPP_ID=1, EAPP_UID=2, ESECOND_NOTIFY=4 }; |
302 enum TNotifyType { EAPP_ID=1, EAPP_UID=2, ESECOND_NOTIFY=4 }; |
303 |
303 |
304 private: |
304 private: |
305 |
305 |
306 /** |
306 /** |
307 * Second stage constructor. |
307 * Second stage constructor. |
308 * |
308 * |
309 * @since S60 v5.0 |
309 * @since S60 v5.0 |
310 */ |
310 */ |
311 void ConstructL( const TUid aRepositoryUid ); |
311 void ConstructL( const TUid aRepositoryUid ); |
312 |
312 |
313 private: |
313 private: |
314 |
314 |
315 /** |
315 /** |
316 * Folder application group name. |
316 * Folder application group name. |
317 */ |
317 */ |
318 TBuf8<KApaMaxAppGroupName> iCRKeyFolderName; |
318 TBuf8<KApaMaxAppGroupName> iCRKeyFolderName; |
319 |
319 |
320 /** |
320 /** |
321 * Mcs id for an application item in a folder with a given app group name. |
321 * Mcs id for an application item in a folder with a given app group name. |
322 */ |
322 */ |
323 TBuf8<KUidStringLength> iCRKeyFolderItemUid; |
323 TBuf8<KUidStringLength> iCRKeyFolderItemUid; |
324 |
324 |
325 /** |
325 /** |
326 * Own. |
326 * Own. |
327 * Intance of the service handler. |
327 * Intance of the service handler. |
328 */ |
328 */ |
329 CHnServiceHandler* iServiceHandler; |
329 CHnServiceHandler* iServiceHandler; |
330 |
330 |
331 /** |
331 /** |
332 * Flag describing the type of notification. |
332 * Flag describing the type of notification. |
333 */ |
333 */ |
334 TInt iNotifyType; |
334 TInt iNotifyType; |
335 }; |
335 }; |
336 |
336 |
337 |
|
338 NONSHARABLE_CLASS( CHnRepositoryZoomObserver ): public CHnRepositoryObserver |
|
339 { |
|
340 public: |
|
341 |
|
342 /** |
|
343 * Default C++ Destructor. |
|
344 * |
|
345 * @since S60 v5.0 |
|
346 */ |
|
347 virtual ~CHnRepositoryZoomObserver(); |
|
348 |
|
349 /** |
|
350 * Factory function. |
|
351 * |
|
352 * @param aCmnPtrs Common pointers. |
|
353 * @return Repository Observer. |
|
354 * @since S60 v5.0 |
|
355 */ |
|
356 static CHnRepositoryZoomObserver* NewL( |
|
357 THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, |
|
358 const TUint32 aId); |
|
359 |
|
360 /** |
|
361 * Factory function. |
|
362 * |
|
363 * @param aCmnPtrs Common pointers. |
|
364 * @return Repository Observer. |
|
365 * @since S60 v5.0 |
|
366 */ |
|
367 static CHnRepositoryZoomObserver* NewLC( |
|
368 THnMdCommonPointers* aCmnPtrs, const TUid aRepositoryUid, |
|
369 const TUint32 aId); |
|
370 |
|
371 /** |
|
372 * Change handler method. |
|
373 * It is invoked whenever notifier detects a change in the CR. |
|
374 * |
|
375 * @param aId Id of the entry in CR. |
|
376 * @since S60 v5.0 |
|
377 */ |
|
378 void HandleNotifyInt(TUint32 aId, TInt aNewValue ); |
|
379 |
|
380 /** |
|
381 * Change handler method. |
|
382 * It is invoked whenever notifier detects a change in the CR. |
|
383 * |
|
384 * @param aId Id of the entry in CR. |
|
385 * @since S60 v5.0 |
|
386 */ |
|
387 void HandleNotifyIntL(TUint32 aId, TInt aNewValue ); |
|
388 |
|
389 private: |
|
390 |
|
391 /** |
|
392 * Defautlt C++ Constructor. |
|
393 * |
|
394 * @param aCmnPtrs Common pointers. |
|
395 * @since S60 v5.0 |
|
396 */ |
|
397 CHnRepositoryZoomObserver( THnMdCommonPointers* aCmnPtrs, TUint32 iId ); |
|
398 |
|
399 private: |
|
400 |
|
401 /** |
|
402 * Second stage constructor. |
|
403 * |
|
404 * @since S60 v5.0 |
|
405 */ |
|
406 void ConstructL( const TUid aRepositoryUid ); |
|
407 |
|
408 /** |
|
409 * Setup initial value of zoom at startup; |
|
410 * |
|
411 * @since S60 v5.0 |
|
412 */ |
|
413 void InitializeL(); |
|
414 }; |
|
415 |
|
416 #endif /*HNREPOSITORYOBSERVER_H_*/ |
337 #endif /*HNREPOSITORYOBSERVER_H_*/ |
417 |
338 |
418 //End of file |
339 //End of file |
419 |
340 |