|
1 /* |
|
2 * Copyright (c) 2008 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: An observer for change in System of Measurement |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_EVTMGMTUISYSOFMEASUREMENT_H_ |
|
19 #define C_EVTMGMTUISYSOFMEASUREMENT_H_ |
|
20 |
|
21 // System Includes |
|
22 #include <e32base.h> |
|
23 |
|
24 // User Includes |
|
25 #include "locnotprefplugindomaincrkeys.h" |
|
26 |
|
27 // Forward Declarations |
|
28 class CRepository; |
|
29 |
|
30 // Constant Declarations |
|
31 |
|
32 // Class Definition |
|
33 class MEvtMgmtUiSOMObserver |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * It will be used to notify observer that lbt operation |
|
38 * has be completed |
|
39 * @param aTriggerId trigger id of newly created trigger |
|
40 * @param aState It will contain the the operation type |
|
41 */ |
|
42 virtual void NotifySOMChangeL( )=0; |
|
43 |
|
44 }; |
|
45 |
|
46 |
|
47 /** |
|
48 * Adapter to the System of Measurement settings storage |
|
49 */ |
|
50 class CEvtMgmtUiSysOfMeasurement : public CActive |
|
51 { |
|
52 public: |
|
53 /** |
|
54 * Creates new System of Measurement adapter |
|
55 * |
|
56 * @param aAdapterObsrv Observer to the Settings adapter |
|
57 * @return CEvtMgmtUiSysOfMeasurement& Reference to the application view |
|
58 */ |
|
59 static CEvtMgmtUiSysOfMeasurement* NewL( |
|
60 MEvtMgmtUiSOMObserver& aAdapterObsrv ); |
|
61 |
|
62 |
|
63 /** |
|
64 * Creates new System of Measurement adapter |
|
65 * Leaves the object on the Clean up stack |
|
66 * |
|
67 * @param aAdapterObsrv Observer to the Settings adapter |
|
68 * @return CEvtMgmtUiSysOfMeasurement& Reference to the application view |
|
69 */ |
|
70 static CEvtMgmtUiSysOfMeasurement* NewLC( |
|
71 MEvtMgmtUiSOMObserver& aAdapterObsrv ); |
|
72 |
|
73 |
|
74 /** |
|
75 * Destructor |
|
76 */ |
|
77 ~CEvtMgmtUiSysOfMeasurement (); |
|
78 |
|
79 /** |
|
80 * Returns the current value of the System of measurements settings |
|
81 * |
|
82 * @return TLocSystemofMeasurementValues Current value of the System of measurements settings |
|
83 */ |
|
84 TLocSystemofMeasurementValues GetCurrentSysofMeasL(); |
|
85 |
|
86 protected: |
|
87 /** |
|
88 * Inherited from CActive |
|
89 */ |
|
90 void RunL(); |
|
91 |
|
92 /** |
|
93 * Inherited from CActive |
|
94 */ |
|
95 void DoCancel(); |
|
96 |
|
97 private: |
|
98 /** |
|
99 * Constructor |
|
100 */ |
|
101 CEvtMgmtUiSysOfMeasurement( MEvtMgmtUiSOMObserver& aAdapterObsrv ); |
|
102 |
|
103 /** |
|
104 * Second Phase Constructor |
|
105 */ |
|
106 void ConstructL(); |
|
107 |
|
108 /** |
|
109 * Start notification from the Central repository server for any changes in the |
|
110 * System of measurements key value |
|
111 */ |
|
112 void StartNotification(); |
|
113 |
|
114 private: |
|
115 /** |
|
116 * Reference to the Adapter observer |
|
117 */ |
|
118 MEvtMgmtUiSOMObserver& iObserver; |
|
119 |
|
120 /** |
|
121 * Reference to the Central repository object |
|
122 * |
|
123 * Owns |
|
124 */ |
|
125 CRepository* iRepository; |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // C_EVTMGMTUISYSOFMEASUREMENT_H_ |