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