|
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: Plugin timer implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <hwrmpluginservice.h> |
|
20 #include <hwrmvibracommands.h> |
|
21 #include "hwrmfmtxplugintimer.h" |
|
22 #include "trace.h" |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CHWRMFmtxPluginTimer::NewL |
|
26 // ----------------------------------------------------------------------------- |
|
27 // |
|
28 CHWRMFmtxPluginTimer* CHWRMFmtxPluginTimer::NewL( TInt aCommandId, |
|
29 TUint8 aTransId, |
|
30 TInt aRetVal, |
|
31 MHWRMFmtxPluginTimerCallback& aCallback ) |
|
32 { |
|
33 FUNC_LOG; |
|
34 |
|
35 CHWRMFmtxPluginTimer* self = new( ELeave )CHWRMFmtxPluginTimer( aCommandId, |
|
36 aTransId, |
|
37 aRetVal, |
|
38 aCallback ); |
|
39 |
|
40 CleanupStack::PushL( self ); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop( self ); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CHWRMFmtxPluginTimer::TransId |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 TUint8 CHWRMFmtxPluginTimer::TransId() const |
|
51 { |
|
52 FUNC_LOG; |
|
53 |
|
54 return iTransId; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CHWRMFmtxPluginTimer::~CHWRMFmtxPluginTimer |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 CHWRMFmtxPluginTimer::~CHWRMFmtxPluginTimer() |
|
62 { |
|
63 FUNC_LOG; |
|
64 |
|
65 Cancel(); |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CHWRMFmtxPluginTimer::CHWRMFmtxPluginTimer |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 CHWRMFmtxPluginTimer::CHWRMFmtxPluginTimer( TInt aCommandId, TUint8 aTransId, |
|
73 TInt aRetVal, MHWRMFmtxPluginTimerCallback& aCallback) |
|
74 : CTimer( EPriorityStandard ), |
|
75 iCommandId(aCommandId), |
|
76 iTransId(aTransId), |
|
77 iRetVal(aRetVal), |
|
78 iCallback(aCallback) |
|
79 { |
|
80 FUNC_LOG; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CHWRMFmtxPluginTimer::ConstructL |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void CHWRMFmtxPluginTimer::ConstructL() |
|
88 { |
|
89 FUNC_LOG; |
|
90 |
|
91 CTimer::ConstructL(); |
|
92 |
|
93 CActiveScheduler::Add( this ); |
|
94 |
|
95 After(0); |
|
96 } |
|
97 |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CHWRMFmtxPluginTimer::RunL |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 void CHWRMFmtxPluginTimer::RunL() |
|
104 { |
|
105 FUNC_LOG; |
|
106 |
|
107 iCallback.GenericTimerFired( iCommandId, iTransId, iRetVal ); |
|
108 } |
|
109 |