|
1 /* |
|
2 * Copyright (c) 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: helper class to handle location server tiimer related functionality |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CLOCATIONSERVERTIMERHANDLER_H__ |
|
19 #define __CLOCATIONSERVERTIMERHANDLER_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 /* |
|
28 * Timer Observer class |
|
29 */ |
|
30 |
|
31 class MLocationServerTimerObserver |
|
32 { |
|
33 public: |
|
34 typedef enum |
|
35 { |
|
36 EStopRecording = 0x1, // Stop recording |
|
37 EPositioningStopTimeout, // Stop positioning |
|
38 ELocGeneralPurpose // generic purpose |
|
39 }TLocationServerTimerType; |
|
40 /** |
|
41 * Timer call back |
|
42 * @param aLocationServerTimerType timer type |
|
43 * @param aErrorCode error code |
|
44 */ |
|
45 virtual void LocationServerTimerCallBackL |
|
46 (const TLocationServerTimerType aLocationServerTimerType, const TInt aErrorCode) = 0; |
|
47 }; |
|
48 |
|
49 /* |
|
50 * Helper class for location server related to timer functionality. |
|
51 */ |
|
52 class CLocationServerTimerHandler : public CTimer |
|
53 { |
|
54 |
|
55 public: |
|
56 /** |
|
57 * 1st phase constructor. |
|
58 * @param aLocationServerTimerObserver timer observer |
|
59 */ |
|
60 static CLocationServerTimerHandler* NewL(MLocationServerTimerObserver& aLocationServerTimerObserver); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 ~CLocationServerTimerHandler(); |
|
66 |
|
67 /** |
|
68 * start a timer for predefined period |
|
69 * @param anInterval timer value |
|
70 * @param aLocationServerTimerType timer type |
|
71 */ |
|
72 void StartTimer(const TTimeIntervalMicroSeconds32 anInterval, |
|
73 const MLocationServerTimerObserver::TLocationServerTimerType aLocationServerTimerType); |
|
74 |
|
75 |
|
76 protected: |
|
77 /* |
|
78 * @see CActive::RunL() |
|
79 */ |
|
80 void RunL(); |
|
81 private: |
|
82 /** |
|
83 * 2nd Phase constructor |
|
84 */ |
|
85 void ConstructL(); |
|
86 /** |
|
87 * CLocationServerTimerHandler |
|
88 * Constructor |
|
89 * @param aLocationServerTimerObserver timer observer |
|
90 * @return None. |
|
91 */ |
|
92 CLocationServerTimerHandler(MLocationServerTimerObserver& aLocationServerTimerObserver); |
|
93 |
|
94 |
|
95 |
|
96 private: |
|
97 MLocationServerTimerObserver& iLocationServerTimerObserver; |
|
98 MLocationServerTimerObserver::TLocationServerTimerType iLocationServerTimerType; |
|
99 }; |
|
100 |
|
101 |
|
102 #endif /*__CLOCATIONSERVERTIMERHANDLER_H__*/ |
|
103 |
|
104 // End of file |
|
105 |