|
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: Provides Update Measurement Settings Value from Central |
|
15 * repository |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CBLIDMEASUREMENTSETTINGLISTENER_H |
|
21 #define CBLIDMEASUREMENTSETTINGLISTENER_H |
|
22 |
|
23 // System Includes |
|
24 #include <e32base.h> |
|
25 |
|
26 // User Includes |
|
27 #include "MBlidMeasurementSettings.h" |
|
28 |
|
29 // Forward Declarations |
|
30 class CRepository; |
|
31 |
|
32 // Constant Declarations |
|
33 |
|
34 // Class Definition |
|
35 /** |
|
36 * Listener for getting the System of Measurement settings |
|
37 */ |
|
38 NONSHARABLE_CLASS( CBlidMeasurementSettingListener ) : public CActive |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Creates new System of Measurement Listener |
|
43 * |
|
44 * @param aListenerObsrv Observer to the Settings Listener |
|
45 * @return CBlidMeasurementSettingListener* Pointer to the CBlidSettings |
|
46 */ |
|
47 static CBlidMeasurementSettingListener* NewL( |
|
48 MBlidMeasurementSettings& aListenerObsrv ); |
|
49 |
|
50 |
|
51 /** |
|
52 * Creates new System of Measurement Listener |
|
53 * Leaves the object on the Clean up stack |
|
54 * |
|
55 * @param aListenerObsrv Observer to the Settings adapter |
|
56 * @return CBlidMeasurementSettingListener* Pointer to the CBlidSettings |
|
57 */ |
|
58 static CBlidMeasurementSettingListener* NewLC( |
|
59 MBlidMeasurementSettings& aListenerObsrv ); |
|
60 |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 ~CBlidMeasurementSettingListener (); |
|
66 |
|
67 /** |
|
68 * Returns the current value of the System of measurements settings |
|
69 * |
|
70 * @return TReal32 Current value of the System of measurements settings |
|
71 */ |
|
72 TReal32 SysofMeasurementL(); |
|
73 |
|
74 protected: |
|
75 /** |
|
76 * Inherited from CActive |
|
77 */ |
|
78 void RunL(); |
|
79 |
|
80 /** |
|
81 * Inherited from CActive |
|
82 */ |
|
83 void DoCancel(); |
|
84 |
|
85 private: |
|
86 /** |
|
87 * Constructor |
|
88 */ |
|
89 CBlidMeasurementSettingListener( MBlidMeasurementSettings& aListenerObsrv ); |
|
90 |
|
91 /** |
|
92 * Second Phase Constructor |
|
93 */ |
|
94 void ConstructL(); |
|
95 |
|
96 /** |
|
97 * Start notification from the Central repository server for any changes in the |
|
98 * System of measurements key value |
|
99 */ |
|
100 void StartNotification(); |
|
101 |
|
102 private: |
|
103 /** |
|
104 * Reference to the Settings observer |
|
105 */ |
|
106 MBlidMeasurementSettings& iObserver; |
|
107 |
|
108 /** |
|
109 * Reference to the Central repository object |
|
110 * |
|
111 * Owns |
|
112 */ |
|
113 CRepository* iRepository; |
|
114 }; |
|
115 |
|
116 |
|
117 #endif //CBLIDMEASUREMENTSETTINGLISTENER_H |