|
1 /* |
|
2 * Copyright (c) 2006-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 CRESPONSETIMER_H |
|
21 #define CRESPONSETIMER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "MmTsy_timeoutdefs.h" |
|
26 |
|
27 // this flag comes from CResponseTimerStore.h |
|
28 #ifdef REQHANDLE_TIMER |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CMmPhoneTsy; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CResponseTimer class. |
|
37 */ |
|
38 NONSHARABLE_CLASS( CResponseTimer ) : public CBase, public MBeating |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @param *aPhone pointer to phone object |
|
45 * return CResponseTimer* created timer object |
|
46 */ |
|
47 static CResponseTimer* NewL( CMmPhoneTsy *aPhone); |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 */ |
|
52 virtual ~CResponseTimer(); |
|
53 |
|
54 // New functions |
|
55 |
|
56 /** |
|
57 * Starts the timer counting |
|
58 * |
|
59 * |
|
60 */ |
|
61 void Start(); |
|
62 |
|
63 /** |
|
64 * Stops the timer counting |
|
65 * |
|
66 * |
|
67 */ |
|
68 void Stop(); |
|
69 |
|
70 /** |
|
71 * Returns the value of iBeatCounter |
|
72 * |
|
73 * |
|
74 * @return TUint32 value of iBeatCounter |
|
75 */ |
|
76 TUint32 GetBeatCounter(); |
|
77 |
|
78 /** |
|
79 * Sets iBeatCounter to 0 |
|
80 * |
|
81 * |
|
82 */ |
|
83 void ResetBeatCounter(); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * Default constructor |
|
89 */ |
|
90 CResponseTimer(); |
|
91 |
|
92 /** |
|
93 * 2nd phase of the construction |
|
94 */ |
|
95 void ConstructL(); |
|
96 |
|
97 /** |
|
98 * Checks and completes expired requests every second |
|
99 * |
|
100 * |
|
101 */ |
|
102 void Beat(); |
|
103 |
|
104 /** |
|
105 * Called when we need to synchronize |
|
106 * |
|
107 * |
|
108 */ |
|
109 void Synchronize(); |
|
110 |
|
111 private: // Data |
|
112 |
|
113 /** |
|
114 * Count of beats of the timer |
|
115 */ |
|
116 TUint32 iBeatCounter; |
|
117 |
|
118 /** |
|
119 * Pointer to the CHeartbeat type timer. |
|
120 * Own. |
|
121 */ |
|
122 CHeartbeat* iTimer; |
|
123 |
|
124 /** |
|
125 * Pointer to phone |
|
126 * Not own. |
|
127 */ |
|
128 CMmPhoneTsy *iPhone; |
|
129 |
|
130 }; |
|
131 #endif //REQHANDLE_TIMER |
|
132 |
|
133 #endif //CRESPONSETIMER_H |
|
134 |
|
135 // End of File |