|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Hardware Resource Manager stub plugins timer definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __PLUGINTIMER_H_ |
|
21 #define __PLUGINTIMER_H_ |
|
22 |
|
23 #include <hwrmpluginservice.h> |
|
24 |
|
25 /** |
|
26 * An interface for handling timer expiration events. |
|
27 */ |
|
28 class MPluginTimerCallback |
|
29 { |
|
30 public: |
|
31 /** |
|
32 * Called when the timer fires |
|
33 */ |
|
34 virtual void GenericTimerFired(MHWRMPluginCallback* aService, |
|
35 TInt aCommandId, |
|
36 TUint8 aTransId, |
|
37 TInt aRetVal) = 0; |
|
38 }; |
|
39 |
|
40 |
|
41 class CPluginTimer : public CTimer |
|
42 { |
|
43 public: |
|
44 CPluginTimer(TInt aPriority, |
|
45 MHWRMPluginCallback* aService, |
|
46 TInt aCommandId, |
|
47 TUint8 aTransId, |
|
48 TInt aRetVal, |
|
49 MPluginTimerCallback* aCallback |
|
50 ); |
|
51 |
|
52 ~CPluginTimer(); |
|
53 |
|
54 CPluginTimer(TInt aPriority); |
|
55 |
|
56 static CPluginTimer* NewL(const TTimeIntervalMicroSeconds32& anInterval, |
|
57 MHWRMPluginCallback* aService, |
|
58 TInt aCommandId, |
|
59 TUint8 aTransId, |
|
60 TInt aRetVal, |
|
61 MPluginTimerCallback* aCallback); |
|
62 |
|
63 void ConstructL(); |
|
64 |
|
65 void RunL(); |
|
66 |
|
67 inline TUint8 TransId() const |
|
68 { |
|
69 return iTransId; |
|
70 }; |
|
71 |
|
72 private: |
|
73 |
|
74 MHWRMPluginCallback* iService; // Not owned |
|
75 |
|
76 TInt iCommandId; |
|
77 TUint8 iTransId; |
|
78 TInt iRetVal; |
|
79 |
|
80 MPluginTimerCallback* iCallback; // Not owned |
|
81 |
|
82 }; |
|
83 |
|
84 |
|
85 #endif // __PLUGINTIMER_H_ |