|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 #ifndef LBS_AUTO_CLOCK_ADJUST_H |
|
21 #define LBS_AUTO_CLOCK_ADJUST_H |
|
22 |
|
23 // System |
|
24 #include <e32std.h> |
|
25 #include <centralrepository.h> |
|
26 |
|
27 // Lbs |
|
28 #include <lbs/gpssetclockbase.h> |
|
29 #include <lbssatellite.h> |
|
30 #include <lbs/lbsadmin.h> |
|
31 #include <lbs.h> |
|
32 |
|
33 |
|
34 class CAutoClockAdjust : public CBase, public MLbsAdminObserver |
|
35 { |
|
36 public: |
|
37 static CAutoClockAdjust* NewL(); |
|
38 ~CAutoClockAdjust(); |
|
39 |
|
40 void LocationUpdate(TInt aStatus, TPositionSatelliteInfo& aPosInfo); |
|
41 |
|
42 protected: |
|
43 CAutoClockAdjust(); |
|
44 void ConstructL(); |
|
45 |
|
46 void ReadAdminSettingsL(); |
|
47 void ReadLocalSettingsL(); |
|
48 void WriteLastAutoAdjustTime(); |
|
49 TInt CalculateTimeCorrection(const TPositionSatelliteInfo &aSatInfo, TTimeIntervalMicroSeconds &aTimeCorr); |
|
50 |
|
51 private: |
|
52 // From MLbsAdminApiObserver |
|
53 virtual void OnSettingUpdateEvent(TInt aError, const TLbsAdminSetting& aSetting); |
|
54 |
|
55 CLbsAdmin::TClockAdjust iClockAdjustSetting; |
|
56 TLbsSetClockModuleId iSetClockModuleId; |
|
57 TLbsTimeIntervalMilliSeconds iAdjustInterval; |
|
58 TLbsTimeIntervalMilliSeconds iAdjustThreshold; |
|
59 |
|
60 TTime iLastAdjustment; |
|
61 |
|
62 CLbsAdmin* iAdmin; |
|
63 CRepository* iCenRep; |
|
64 CGPSSetClockBase* iSetClockImpl; |
|
65 }; |
|
66 |
|
67 #endif // LBS_AUTO_CLOCK_ADJUST_H |