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