|
1 /* |
|
2 * Copyright (c) 2007-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CPOSFIXSTATETIMER_H |
|
21 #define CPOSFIXSTATETIMER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <lbs.h> |
|
25 |
|
26 class MPosFixStateTimerListener; |
|
27 |
|
28 /** |
|
29 * The CPosFixStateTimer is responsible of handle timeshift timer and |
|
30 * PSY state unknown timer. |
|
31 */ |
|
32 class CPosFixStateTimer : public CBase |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * Get an instance of CPosFixStateTimer. |
|
38 * |
|
39 * @return The new instance of this class. |
|
40 */ |
|
41 static CPosFixStateTimer* NewL( |
|
42 TPositionModuleId aModuleId, |
|
43 MPosFixStateTimerListener& aListener ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~CPosFixStateTimer(); |
|
49 |
|
50 /** |
|
51 * Get PSY ID. |
|
52 * |
|
53 * @return PSY ID |
|
54 */ |
|
55 TPositionModuleId ModuleId() const; |
|
56 |
|
57 /** |
|
58 * Start timeshift timer. If the timer is already |
|
59 * running, this function does nothing. |
|
60 */ |
|
61 void StartTimeshiftTimer( |
|
62 TTimeIntervalMicroSeconds aInterval ); |
|
63 |
|
64 /** |
|
65 * Cancel timeshift timer |
|
66 */ |
|
67 void CancelTimeshiftTimer(); |
|
68 |
|
69 /** |
|
70 * Start unknown timer |
|
71 */ |
|
72 void StartUnknownTimer( |
|
73 TTimeIntervalMicroSeconds aInterval ); |
|
74 |
|
75 /** |
|
76 * Cancel unknown timer |
|
77 */ |
|
78 void CancelUnknownTimer(); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 */ |
|
85 CPosFixStateTimer( |
|
86 TPositionModuleId aModuleId, |
|
87 MPosFixStateTimerListener& aListener ); |
|
88 |
|
89 /** |
|
90 * EPOC constructor. |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 //Timeshift timer timeout callback |
|
95 static TInt TimeshiftTimeoutCallback( TAny* aAny ); |
|
96 |
|
97 //Timeshift timeout |
|
98 void TimeshiftTimeout(); |
|
99 |
|
100 //Unknown timer timeout callback |
|
101 static TInt UnknownTimeoutCallback( TAny* aAny ); |
|
102 |
|
103 //Uknown timeout |
|
104 void UnknownTimeout(); |
|
105 |
|
106 // By default, prohibit copy constructor |
|
107 CPosFixStateTimer(const CPosFixStateTimer&); |
|
108 // Prohibit assigment operator |
|
109 CPosFixStateTimer& operator= (const CPosFixStateTimer&); |
|
110 |
|
111 private: // Data |
|
112 //Module Id |
|
113 TPositionModuleId iModuleId; |
|
114 |
|
115 //Requestor listner |
|
116 MPosFixStateTimerListener& iListener; |
|
117 |
|
118 //Timeshift timer |
|
119 CPeriodic* iTimeshiftTimer; |
|
120 |
|
121 //Unknown timer |
|
122 CPeriodic* iUnknownTimer; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif // CPOSFIXSTATETIMER_H |
|
127 |
|
128 // End of File |