|
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: Responsible for settings and retreiving all location |
|
15 * triggering settings |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef LBTSETTINGSMANAGER_H |
|
21 #define LBTSETTINGSMANAGER_H |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include <e32base.h> |
|
25 #include <lbscommon.h> |
|
26 #include <lbtcommon.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CRepository; |
|
30 |
|
31 /** |
|
32 * Class declaration for location triggering settings manager |
|
33 * All reads and write to the Central Repository keys of |
|
34 * location triggering settings has to be done through this |
|
35 * interface. This is a singelton class |
|
36 * |
|
37 * @since S60 v4.0 |
|
38 */ |
|
39 class CLbtSettingsManager : public CBase |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Instantiates a new object of |
|
44 * CLbtSettingsManager |
|
45 * |
|
46 * @return NULL when there isn't enough memory otherwise |
|
47 * pointer to an object of type CLbtSettingsManager |
|
48 * |
|
49 */ |
|
50 static CLbtSettingsManager* NewL( ); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 * |
|
55 */ |
|
56 ~CLbtSettingsManager(); |
|
57 |
|
58 private: |
|
59 /** |
|
60 * 2nd phase constuctor for instantiating member variables |
|
61 * |
|
62 */ |
|
63 void ConstructL(); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * Sets the optimization |
|
69 * |
|
70 * @param[in] aOptimizationLevel the optimization level which |
|
71 * is the balance between accuracy and optimization level |
|
72 */ |
|
73 void SetOptimizationLevel(TInt aOptimizationLevel); |
|
74 |
|
75 /** |
|
76 * Get the optimization settings which is the balance |
|
77 * between accuracy and optimization level |
|
78 * |
|
79 * @return interger optimization level |
|
80 */ |
|
81 TInt GetOptimizationLevel(); |
|
82 |
|
83 /** |
|
84 * Sets the module id that the trigger server has to |
|
85 * use to obtain location fixes |
|
86 * |
|
87 * @param[in] aModuleId position module id |
|
88 */ |
|
89 void SetModuleId(TPositionModuleId aModuleId); |
|
90 |
|
91 /** |
|
92 * Gets the module id which has to used to get |
|
93 * position fixes |
|
94 * |
|
95 * @return the module id used |
|
96 */ |
|
97 TPositionModuleId GetModuleId(); |
|
98 |
|
99 /** |
|
100 * Gets the module id of NPP PSY which has to used to get |
|
101 * network based position fixes |
|
102 * |
|
103 * @return the module id of NPP PSY |
|
104 */ |
|
105 TPositionModuleId GetNppModuleId(); |
|
106 |
|
107 /** |
|
108 * Sets the minumum update interal that has to be set |
|
109 * to get position updates |
|
110 * |
|
111 * @param[in] aUpdateInterval the minimum update interval |
|
112 */ |
|
113 void SetMinimumUpdateInterval(TInt aUpdateInterval); |
|
114 |
|
115 /** |
|
116 * Gets the minumum update interal that has to be set |
|
117 * to get position updates |
|
118 * |
|
119 * @return the minimum update interval |
|
120 */ |
|
121 TInt GetMinimumUpdateInterval(); |
|
122 |
|
123 /** |
|
124 * Sets the minimum update interavl when |
|
125 * GPS fails |
|
126 * |
|
127 * @param[in] aUpdateInterval the minimum update interval |
|
128 */ |
|
129 void SetMinimumUpdateIntervalOnGpsFailure(TInt aUpdateInterval); |
|
130 |
|
131 /** |
|
132 * Gets the minimum update interavl when |
|
133 * GPS fails |
|
134 * |
|
135 * @return the minimum update interval |
|
136 */ |
|
137 TInt GetMinimumUpdateIntervalOnGpsFailure(); |
|
138 |
|
139 /** |
|
140 * Sets the maximum user speed used for update interval |
|
141 * calculations |
|
142 * |
|
143 * @param[in] aSpeed maximum user speed to be set |
|
144 */ |
|
145 void SetMaximumUserSpeed(TInt aSpeed); |
|
146 |
|
147 /** |
|
148 * Gets the maximum user speed used for update interval |
|
149 * calculations |
|
150 * |
|
151 * @return maximum user speed to be set |
|
152 */ |
|
153 TInt GetMaximumUserSpeed(); |
|
154 |
|
155 /** |
|
156 * Sets the triggering mechanism state |
|
157 * |
|
158 * @param[in] aState state of the triggering mechanism |
|
159 */ |
|
160 void SetTriggeringMechanismState(TLbtTriggeringMechanismState aState); |
|
161 |
|
162 /** |
|
163 * Gets the triggering mechanism state |
|
164 * |
|
165 * @return state of the triggering mechanism |
|
166 */ |
|
167 TInt GetTriggeringMechanismState(); |
|
168 |
|
169 public: // Getter routines for trigger configurable parameters |
|
170 |
|
171 /** |
|
172 * Gets the minimum area that a trigger entry should have |
|
173 * |
|
174 * @return the triggering area |
|
175 */ |
|
176 TInt MinimumTriggeringArea(); |
|
177 |
|
178 /** |
|
179 * Gets the tracking mode interval |
|
180 * |
|
181 * @return gets the tracking mode interval |
|
182 */ |
|
183 TInt TrackingModeInterval(); |
|
184 |
|
185 /** |
|
186 * Gets the location request time out value |
|
187 * |
|
188 * @return location request time out |
|
189 */ |
|
190 TInt GetLocationRequestTimeOut(); |
|
191 |
|
192 /** |
|
193 * Gets the minimum size of hysteresis area. This |
|
194 * is basically the radius of the hysteresis ring |
|
195 * |
|
196 * @return minimum size of hysteresis area |
|
197 */ |
|
198 TInt MinimumHysteresisArea(); |
|
199 |
|
200 /** |
|
201 * Get the number of days that start up triggers can |
|
202 * be preserved in the system when the owner application |
|
203 * is not present in the system. |
|
204 * |
|
205 * @return number of days |
|
206 */ |
|
207 TInt NumberOfDaysForCleanup(); |
|
208 |
|
209 /** |
|
210 * Gets the count of maximum enabled and valid triggers that |
|
211 * can be present in the system at any point in time. |
|
212 * |
|
213 * @return count of enabled and valid triggers |
|
214 */ |
|
215 TInt EnabledValidTriggerCount(); |
|
216 |
|
217 private: // Member variables |
|
218 |
|
219 // Optimization level |
|
220 TInt iOptimizationLevel; |
|
221 |
|
222 // Module id to be used to make update intervals |
|
223 TInt iModuleId; |
|
224 |
|
225 // Update interval for position requests |
|
226 TInt iMinUpdateInterval; |
|
227 |
|
228 // Minimum update interval on gps failure |
|
229 TInt iMinUpdateIntervalOnGpsFailure; |
|
230 |
|
231 // Maximum user speed setting |
|
232 TInt iMaxUserSpeed; |
|
233 |
|
234 // Triggering mechanism. i.e. on or off |
|
235 TInt iTriggeringMechanismState; |
|
236 |
|
237 // Minimum trigger area |
|
238 TInt iMinimumTriggerArea; |
|
239 |
|
240 // Track mode interval |
|
241 TInt iTrackModeInterval; |
|
242 |
|
243 // Location request time out |
|
244 TInt iLocRequestTimeOut; |
|
245 |
|
246 // Minimum hysteresis area |
|
247 TInt iMinHysteresisArea; |
|
248 |
|
249 // Number of days for cleanup of triggers in system |
|
250 TInt iDaysForCleanup; |
|
251 |
|
252 // Count of enabled and valid triggers that can be present in tht system |
|
253 TInt iEnabledValidTriggerCount; |
|
254 |
|
255 // Module ID of NPP (Network positioning) PSY |
|
256 TInt iNppModuleId; |
|
257 |
|
258 // Pointer an cenrep object |
|
259 CRepository* iRepository; |
|
260 }; |
|
261 |
|
262 #endif // LBTSETTINGSMANAGER_H |