1 /* |
|
2 * Copyright (c) 2003 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: CScreensaverRepositoryWatcher declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_SCREENSAVERREPOSITORYWATCHER_H |
|
21 #define C_SCREENSAVERREPOSITORYWATCHER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <cenrepnotifyhandler.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 class CRepository; |
|
28 /** |
|
29 * The class used to monitor the change of register value |
|
30 */ |
|
31 class CScreensaverRepositoryWatcher : public CBase, |
|
32 public MCenRepNotifyHandlerCallback |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phased constructor |
|
38 */ |
|
39 static CScreensaverRepositoryWatcher* NewL(const TUid aUid, |
|
40 const TUint32 aKey, CCenRepNotifyHandler::TCenRepKeyType aKeyType, |
|
41 TCallBack aCallBack, CRepository* aRepository); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor |
|
45 */ |
|
46 static CScreensaverRepositoryWatcher* NewL(const TUid aUid, |
|
47 TCallBack aCallBack, CRepository* aRepository); |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 */ |
|
52 ~CScreensaverRepositoryWatcher(); |
|
53 |
|
54 /** |
|
55 * Returns the changed key |
|
56 */ |
|
57 TUint32 ChangedKey(); |
|
58 |
|
59 public: |
|
60 // from MCenRepNotifyHandlerCallback |
|
61 void HandleNotifyInt(TUint32 aKey, TInt aNewValue); |
|
62 void HandleNotifyString(TUint32 aKey, const TDesC16& aNewValue); |
|
63 void HandleNotifyGeneric(TUint32 aKey); |
|
64 void HandleNotifyError(TUint32 aKey, TInt aError, |
|
65 CCenRepNotifyHandler* aHandler); |
|
66 |
|
67 private: |
|
68 |
|
69 /** |
|
70 * C++ default constructor |
|
71 */ |
|
72 CScreensaverRepositoryWatcher(const TUid aUid, const TUint32 aKey, |
|
73 TCallBack aCallBack, CRepository* aRepository); |
|
74 |
|
75 /** |
|
76 * Two-phased constructor |
|
77 */ |
|
78 void ConstructL(CCenRepNotifyHandler::TCenRepKeyType aKeyType); |
|
79 |
|
80 /** |
|
81 * Two-phased constructor |
|
82 */ |
|
83 void ConstructL(); |
|
84 |
|
85 private: |
|
86 TUid iUid; |
|
87 TUint32 iKey; |
|
88 TUint32 iChangedKey; |
|
89 TCallBack iCallBack; |
|
90 CRepository* iRepository; |
|
91 CCenRepNotifyHandler* iNotifyHandler; |
|
92 |
|
93 }; |
|
94 |
|
95 #endif // C_SCREENSAVERREPOSITORYWATCHER_H |
|