|
1 /* |
|
2 * Copyright (c) 2006 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: Class for observing changes in central repository values |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMMPXCENREPWATCHER_H |
|
20 #define CMMPXCENREPWATCHER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32cmn.h> |
|
25 #include <centralrepository.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MMPXCenRepObserver; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Class for observing changes in central repository values. |
|
34 * |
|
35 * @lib mpxcommon.lib |
|
36 */ |
|
37 class CMPXCenRepWatcher : public CActive |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * |
|
44 * @since S60 3.2.3 |
|
45 * @param aRepositoryUid uid of CenRep file |
|
46 * @param aId id of the key |
|
47 * @param aObserver obersver |
|
48 * @return contructed object |
|
49 */ |
|
50 IMPORT_C static CMPXCenRepWatcher* NewL(const TUid& aRepositoryUid, |
|
51 TUint32 aId, |
|
52 MMPXCenRepObserver* aObserver); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 * |
|
57 * @since S60 3.2.3 |
|
58 */ |
|
59 IMPORT_C virtual ~CMPXCenRepWatcher(); |
|
60 |
|
61 public: // New functions |
|
62 /** |
|
63 * Get current value as integer. |
|
64 * |
|
65 * @since S60 3.2.3 |
|
66 * @return Current value of the key as a TInt |
|
67 */ |
|
68 IMPORT_C TInt CurrentValueL(); |
|
69 |
|
70 /** |
|
71 * Set integer value. |
|
72 * |
|
73 * @since S60 3.2.3 |
|
74 * @param aNewValue New value for the key |
|
75 */ |
|
76 IMPORT_C void SetValueL(TInt aNewValue); |
|
77 |
|
78 private: // New functions |
|
79 /** |
|
80 * C++ constructor. |
|
81 * |
|
82 * @since S60 3.2.3 |
|
83 * @param aRepositoryUid uid of CenRep file |
|
84 * @param aId id of the key |
|
85 * @param aObserver obersver |
|
86 * @return contructed object |
|
87 */ |
|
88 CMPXCenRepWatcher(const TUid& aRepositoryUid, |
|
89 TUint32 aId, |
|
90 MMPXCenRepObserver* aObserver); |
|
91 |
|
92 /** |
|
93 * Symbian OS 2nd phase constructor. |
|
94 * |
|
95 * @since S60 3.2.3 |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 protected: // Functions from base classes |
|
100 /** |
|
101 * From CActive. |
|
102 * |
|
103 * @since S60 3.2.3 |
|
104 */ |
|
105 void RunL(); |
|
106 |
|
107 /** |
|
108 * From CActive. |
|
109 * |
|
110 * @since S60 3.2.3 |
|
111 */ |
|
112 void DoCancel(); |
|
113 |
|
114 private: // Data |
|
115 CRepository* iRepository; // owned |
|
116 TUid iRepositoryUid; |
|
117 TUint32 iId; |
|
118 MMPXCenRepObserver* iObserver; // not owned |
|
119 }; |
|
120 |
|
121 #endif // CMMPXCENREPWATCHER_H |
|
122 |
|
123 // End of File |