|
1 /* |
|
2 * ============================================================================ |
|
3 * Name : timeouttimer.h |
|
4 * Part of : ipsservice / profiletester |
|
5 * Description : timer implementation |
|
6 * Version : %version: 1 % << Don't touch! Updated by Synergy at check-out. |
|
7 * |
|
8 * Copyright ©2010-2010 Nokia and/or its subsidiary(-ies). All rights reserved. |
|
9 * This material, including documentation and any related computer |
|
10 * programs, is protected by copyright controlled by Nokia. All |
|
11 * rights are reserved. Copying, including reproducing, storing, |
|
12 * adapting or translating, any or all of this material requires the |
|
13 * prior written consent of Nokia. This material also contains |
|
14 * confidential information which may not be disclosed to others |
|
15 * without the prior written consent of Nokia. |
|
16 * ============================================================================ |
|
17 */ |
|
18 |
|
19 #ifndef C_TIMEOUTTIMER_H |
|
20 #define C_TIMEOUTTIMER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 class MTimeoutObserver; |
|
25 |
|
26 /** |
|
27 * TimeoutObserver |
|
28 * Api for timeout observers |
|
29 */ |
|
30 class MTimeoutObserver |
|
31 { |
|
32 |
|
33 public: |
|
34 virtual void TimeoutNotify() = 0; |
|
35 |
|
36 }; |
|
37 |
|
38 class CTimeoutTimer : protected CTimer |
|
39 { |
|
40 public: |
|
41 |
|
42 static CTimeoutTimer* NewL(MTimeoutObserver& aHandle); |
|
43 static CTimeoutTimer* NewLC(MTimeoutObserver& aHandle); |
|
44 void Start(TInt aTimePeriod); |
|
45 void Stop(); |
|
46 virtual ~CTimeoutTimer(); |
|
47 |
|
48 protected: |
|
49 |
|
50 // from CTimer |
|
51 void RunL(); |
|
52 TInt RunError(TInt aError); |
|
53 |
|
54 private: |
|
55 |
|
56 CTimeoutTimer(MTimeoutObserver& aHandle); |
|
57 void ConstructL(); |
|
58 |
|
59 private: |
|
60 |
|
61 // timetout notifier handle |
|
62 MTimeoutObserver& iNotifyHandle; |
|
63 }; |
|
64 |
|
65 #endif // C_TIMEOUTTIMER_H |