|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Internal class for catching notifications from bookmark repositories. |
|
15 // @internalComponent |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __BKMRKWATCHER_H__ |
|
20 #define __BKMRKWATCHER_H__ |
|
21 |
|
22 #include <centralrepository.h> |
|
23 |
|
24 enum TBkmrkWatcherType |
|
25 { |
|
26 EBkmrkWatcherDatabase, |
|
27 EBkmrkWatcherFolder, |
|
28 EBkmrkWatcherBookmark, |
|
29 EBkmrkWatcherIcon |
|
30 }; |
|
31 |
|
32 /** |
|
33 The interface for observers of the repository watchers. The repository watchers are active objects that |
|
34 get notified when changes occur in the central repository. The watcher sends a notification to its |
|
35 observer through this interface |
|
36 */ |
|
37 class MBkmrkWatcherObserver |
|
38 { |
|
39 public: |
|
40 virtual void BWONotify(TBkmrkWatcherType aType) = 0; |
|
41 }; |
|
42 |
|
43 |
|
44 /** |
|
45 This watcher class is responsible for propagating notifications from the central repository back to the |
|
46 bookmark database. |
|
47 */ |
|
48 class CBkmrkWatcher: public CActive |
|
49 { |
|
50 public: |
|
51 CBkmrkWatcher(TBkmrkWatcherType aType, MBkmrkWatcherObserver& aObserver, CRepository& aRepository); |
|
52 ~CBkmrkWatcher(); |
|
53 void WatchL(); |
|
54 protected: |
|
55 void RunL(); |
|
56 void DoCancel(); |
|
57 private: |
|
58 TBkmrkWatcherType iType; |
|
59 MBkmrkWatcherObserver& iObserver; |
|
60 CRepository& iRepository; |
|
61 }; |
|
62 |
|
63 #endif //__BKMRKWATCHER_H__ |