|
1 /* |
|
2 * Copyright (c) 2007 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: Timer services for SVP |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SVPTIMER_H |
|
21 #define SVPTIMER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "svputdefs.h" |
|
25 |
|
26 class MSVPTimerObserver; |
|
27 |
|
28 /** |
|
29 * SVP timer |
|
30 * |
|
31 * Provides timer service for SVP |
|
32 * |
|
33 * @lib |
|
34 * @since S60 3.2 |
|
35 */ |
|
36 class CSVPTimer : public CTimer |
|
37 { |
|
38 |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 static CSVPTimer* NewL( MSVPTimerObserver& aObserver, |
|
45 TInt aTimerId ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CSVPTimer(); |
|
51 |
|
52 public: // new methods |
|
53 |
|
54 /** |
|
55 * Sets the timer to be fired after given number of milliseconds. |
|
56 * @since Series 60 3.2 |
|
57 * @param aMilliSeconds Time in milliseconds |
|
58 * @return |
|
59 */ |
|
60 void SetTime( TInt aMilliSeconds ); |
|
61 |
|
62 /** |
|
63 * Stops the timer. |
|
64 * @since Series 60 3.2 |
|
65 * @return |
|
66 */ |
|
67 void Stop(); |
|
68 |
|
69 /** |
|
70 * Returns the Timer ID |
|
71 * @since Series 60 3.2 |
|
72 * @return TInt The timer ID. |
|
73 */ |
|
74 TInt Id() const; |
|
75 |
|
76 public: // methods from base classes |
|
77 |
|
78 /** |
|
79 * From CActive Called when an aychronic request is completed. |
|
80 * @since Series 60 3.0 |
|
81 * @param None |
|
82 * @return None |
|
83 */ |
|
84 void RunL(); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CSVPTimer( MSVPTimerObserver& aObserver, TInt aTimerId ); |
|
92 |
|
93 /** |
|
94 * By default Symbian 2nd phase constructor is private. |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 private: // data |
|
99 |
|
100 /** |
|
101 * Reference to the observer. |
|
102 */ |
|
103 MSVPTimerObserver& iObserver; |
|
104 |
|
105 /** |
|
106 * The timer ID, given to observer when the timer fires. |
|
107 * Timers can be identifies with this ID. |
|
108 */ |
|
109 TInt iId; |
|
110 |
|
111 private: |
|
112 |
|
113 // For testing |
|
114 SVP_UT_DEFS |
|
115 |
|
116 }; |
|
117 |
|
118 #endif // SVPTIMER_H |