equal
deleted
inserted
replaced
|
1 /* |
|
2 ============================================================================ |
|
3 Name : TimeAO.h |
|
4 Author : |
|
5 Version : 1.0 |
|
6 Copyright : Your copyright notice |
|
7 Description : CTimeAO declaration |
|
8 ============================================================================ |
|
9 */ |
|
10 |
|
11 #ifndef TIMEAO_H |
|
12 #define TIMEAO_H |
|
13 |
|
14 #include <e32base.h> // For CActive, link against: euser.lib |
|
15 #include <e32std.h> // For RTimer, link against: euser.lib |
|
16 |
|
17 class MCountTime; |
|
18 |
|
19 class CTimeAO : public CActive |
|
20 { |
|
21 public: |
|
22 // Cancel and destroy |
|
23 ~CTimeAO(); |
|
24 |
|
25 // Two-phased constructor. |
|
26 static CTimeAO* NewL(); |
|
27 |
|
28 // Two-phased constructor. |
|
29 static CTimeAO* NewLC(); |
|
30 |
|
31 public: |
|
32 // New functions |
|
33 // Function for making the initial request |
|
34 void StartL(); |
|
35 |
|
36 void SetObserver(MCountTime* aObserver); |
|
37 |
|
38 private: |
|
39 // C++ constructor |
|
40 CTimeAO(); |
|
41 |
|
42 // Second-phase constructor |
|
43 void ConstructL(); |
|
44 |
|
45 private: |
|
46 // From CActive |
|
47 // Handle completion |
|
48 void RunL(); |
|
49 |
|
50 // How to cancel me |
|
51 void DoCancel(); |
|
52 |
|
53 // Override to handle leaves from RunL(). Default implementation causes |
|
54 // the active scheduler to panic. |
|
55 TInt RunError(TInt aError); |
|
56 |
|
57 private: |
|
58 |
|
59 private: |
|
60 RTimer iTimer; // Provides async timing service |
|
61 MCountTime* iObserver; |
|
62 }; |
|
63 |
|
64 #endif // TIMEAO_H |