|
1 /* |
|
2 * Copyright (c) 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 #ifndef __TIMEOUT_H__ |
|
19 #define __TIMEOUT_H__ |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 // CLASS DECLARATION |
|
26 |
|
27 /** |
|
28 * Timeout timer. |
|
29 */ |
|
30 NONSHARABLE_CLASS( CTimeout ): public CTimer |
|
31 { |
|
32 public: // Construct / destruct |
|
33 |
|
34 /** |
|
35 * Two phase constructor. Leaves on failure. |
|
36 * @param aPriority Active object priority. |
|
37 * @param aCallback Callback to be called when timer expires. |
|
38 * This callback must return EFalse - it will NOT be called only again. |
|
39 * @return The constructed timeout timer. |
|
40 */ |
|
41 static CTimeout* NewL( TInt aPriority, TCallBack aCallBack ); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CTimeout(); |
|
47 |
|
48 protected: // from CActive |
|
49 |
|
50 /** |
|
51 * Outstanding request completed (timed out). |
|
52 */ |
|
53 void RunL(); |
|
54 |
|
55 /** |
|
56 * Error handling: ignore error. |
|
57 * @param aErr Error code. |
|
58 */ |
|
59 TInt RunError( TInt aError ); |
|
60 |
|
61 protected: // Construct / destruct |
|
62 |
|
63 /** |
|
64 * Constructor. |
|
65 * @param aPriority Active object priority. |
|
66 * @param aCallback Callback to be called when timer expires. |
|
67 */ |
|
68 CTimeout( TInt aPriority, TCallBack aCallBack ); |
|
69 |
|
70 private: // data |
|
71 |
|
72 TCallBack iCallBack; ///< Callback. |
|
73 }; |
|
74 |
|
75 #endif // __TIMEOUT_H__ |
|
76 |
|
77 // End of File |