1 /* |
|
2 * Copyright (c) 2006-2007 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IRDATAPROVIDERTIMER_H |
|
20 #define IRDATAPROVIDERTIMER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * Call for timer expiry |
|
26 */ |
|
27 class MIRDataProviderTimeoutNotifier |
|
28 { |
|
29 |
|
30 public: |
|
31 |
|
32 /** |
|
33 * Called when the timer raises an event. |
|
34 */ |
|
35 virtual void TimerExpired() = 0; |
|
36 |
|
37 }; |
|
38 |
|
39 /** |
|
40 * Timer class for response timerouts |
|
41 */ |
|
42 NONSHARABLE_CLASS ( CIRDataProviderTimer ): public CTimer |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * CIRDataProviderTimer::NewL( const TInt aPriority, |
|
48 * MIRDataProviderTimeoutNotifier &aNotify ) |
|
49 * Two phase constructor |
|
50 * @param aPriority Specifies the priority of the timer |
|
51 * @param aNotify Reference of the observer |
|
52 * @return CIRDataProviderTimer object |
|
53 */ |
|
54 |
|
55 static CIRDataProviderTimer *NewL( const TInt aPriority, |
|
56 MIRDataProviderTimeoutNotifier &aNotify ); |
|
57 |
|
58 /** |
|
59 * CIRDataProviderTimer::NewLC( const TInt aPriority, |
|
60 * MIRDataProviderTimeoutNotifier &aNotify ) |
|
61 * @param aPriority Specifies the priority of the timer |
|
62 * @param aNotify Reference of the observer |
|
63 * @return CIRDataProviderTimer object |
|
64 */ |
|
65 |
|
66 static CIRDataProviderTimer *NewLC( const TInt aPriority, |
|
67 MIRDataProviderTimeoutNotifier &aNotify ); |
|
68 |
|
69 /** |
|
70 * CIRDataProviderTimer::~CIRDataProviderTimer() |
|
71 * Default C++ destructor |
|
72 */ |
|
73 |
|
74 virtual ~CIRDataProviderTimer(); |
|
75 |
|
76 protected: |
|
77 |
|
78 /** |
|
79 * Derived from CTimer |
|
80 * CIRDataProviderTimer::RunL() |
|
81 */ |
|
82 void RunL(); |
|
83 |
|
84 /** |
|
85 * Derived from CTimer |
|
86 * CIRDataProviderTimer::RunError() |
|
87 */ |
|
88 TInt RunError( TInt aError ); |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * CIRDataProviderTimer::CIRDataProviderTimer( const TInt aPriority, |
|
94 * MIRDataProviderTimeoutNotifier &aNotify ): CTimer( aPriority ), |
|
95 * iNotify( aNotify ) |
|
96 */ |
|
97 |
|
98 CIRDataProviderTimer( const TInt aPriority, |
|
99 MIRDataProviderTimeoutNotifier &aNotify ); |
|
100 |
|
101 /** |
|
102 * CIRDataProviderTimer::ConstructL() |
|
103 * Second phase constructor |
|
104 */ |
|
105 void ConstructL(); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * Handle to the class to be notified of a timeout event. |
|
111 */ |
|
112 MIRDataProviderTimeoutNotifier &iNotify; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // IRDATAPROVIDERTIMER_H |
|
117 |
|
118 |
|