|
1 /* |
|
2 * Copyright (c) 2008 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: Declares main application class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __TIMEOUTTIMER_H__ |
|
19 #define __TIMEOUTTIMER_H__ |
|
20 #include <e32base.h> |
|
21 // ---------------------------------------------------------------------- |
|
22 // Panics: |
|
23 // Category: |
|
24 _LIT(KTimeOutTimerPanic, "TimeOutTimer"); |
|
25 |
|
26 // Codes: |
|
27 enum TTimeOutTimerPanic |
|
28 { |
|
29 ETimerFailed = 1 |
|
30 }; |
|
31 |
|
32 // ---------------------------------------------------------------------- |
|
33 |
|
34 class MTimeOutNotifier; |
|
35 |
|
36 /*! |
|
37 This class will notify an object after a specified timeout. |
|
38 */ |
|
39 class CTimeOutTimer : public CTimer |
|
40 { |
|
41 public: |
|
42 /*! |
|
43 Create a CTimeOutTimer object |
|
44 @param aPriority priority to use for this timer |
|
45 @param aTimeOutNotify object to notify of timeout event |
|
46 @result A pointer to the created instance of CTimeOutTimer |
|
47 */ |
|
48 static CTimeOutTimer* NewL(const TInt aPriority, |
|
49 MTimeOutNotifier& aTimeOutNotify); |
|
50 |
|
51 /*! |
|
52 Create a CTimeOutTimer object |
|
53 @param aPriority priority to use for this timer |
|
54 @param aTimeOutNotify object to notify of timeout event |
|
55 @result A pointer to the created instance of CTimeOutTimer |
|
56 */ |
|
57 static CTimeOutTimer* NewLC(const TInt aPriority, |
|
58 MTimeOutNotifier& aTimeOutNotify); |
|
59 |
|
60 /*! |
|
61 Destroy the object and release all memory objects |
|
62 */ |
|
63 ~CTimeOutTimer(); |
|
64 |
|
65 protected: |
|
66 // From CTimer |
|
67 /*! |
|
68 Invoked when a timeout occurs |
|
69 */ |
|
70 virtual void RunL(); |
|
71 |
|
72 private: |
|
73 /*! |
|
74 Perform the first phase of two phase construction |
|
75 @param aPriority priority to use for this timer |
|
76 @param aTimeOutNotify An observer to notify |
|
77 */ |
|
78 CTimeOutTimer(const TInt aPriority, MTimeOutNotifier& aTimeOutNotify); |
|
79 |
|
80 /*! |
|
81 Perform the second phase construction of a CTimeOutTimer |
|
82 */ |
|
83 void ConstructL(); |
|
84 |
|
85 private: |
|
86 // Member variables |
|
87 |
|
88 /*! The observer for this objects events */ |
|
89 MTimeOutNotifier& iNotify; |
|
90 }; |
|
91 |
|
92 #endif // __TIMEOUTTIMER_H__ |