|
1 /* |
|
2 * Copyright (c) 2007-2010 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: Class for timer handling. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CSCENGTIMER_H |
|
21 #define C_CSCENGTIMER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class MCSCEngTimerObserver; |
|
26 |
|
27 /** |
|
28 * An instance of CCSCEngTimer |
|
29 * For timer handling. |
|
30 * |
|
31 * @lib cscengine.lib |
|
32 * @since Series 60 3.2 |
|
33 */ |
|
34 NONSHARABLE_CLASS( CCSCEngTimer ) : public CTimer |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Enumeration which indicates timer type |
|
40 */ |
|
41 enum TTimerType |
|
42 { |
|
43 EConnectionMonitoringTimer = 0, |
|
44 ENoteDelayTimer |
|
45 }; |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 IMPORT_C static CCSCEngTimer* NewL( |
|
51 MCSCEngTimerObserver& aObserver ); |
|
52 |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 IMPORT_C virtual ~CCSCEngTimer(); |
|
58 |
|
59 |
|
60 /** |
|
61 * Start timer. |
|
62 * |
|
63 * @since S60 v3.2 |
|
64 * @return KErrNone when timer started successfully |
|
65 */ |
|
66 IMPORT_C TInt StartTimer( TTimerType aType ); |
|
67 |
|
68 |
|
69 /** |
|
70 * Stop timer. |
|
71 * |
|
72 * @since S60 v3.2 |
|
73 */ |
|
74 IMPORT_C void StopTimer(); |
|
75 |
|
76 |
|
77 protected: |
|
78 |
|
79 // from base class CTimer |
|
80 |
|
81 /** |
|
82 * From CTimer. Called when timer expires. |
|
83 */ |
|
84 void RunL(); |
|
85 |
|
86 |
|
87 private: |
|
88 |
|
89 CCSCEngTimer( MCSCEngTimerObserver& aObserver ); |
|
90 |
|
91 void ConstructL(); |
|
92 |
|
93 |
|
94 private: // data |
|
95 |
|
96 /** |
|
97 * Reference for observer. |
|
98 */ |
|
99 MCSCEngTimerObserver& iObserver; |
|
100 |
|
101 #ifdef _DEBUG |
|
102 friend class UT_CSCEngTimer; |
|
103 #endif |
|
104 }; |
|
105 |
|
106 #endif // C_CSCENGTIMER_H |