|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 #include <hwrmpluginservice.h> |
|
19 #include <hwrmvibracommands.h> |
|
20 #include "hwrmfmtxplugintimer.h" |
|
21 #include "trace.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // CHWRMFmtxPluginTimer::NewL |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 CHWRMFmtxPluginTimer* CHWRMFmtxPluginTimer::NewL( TInt aCommandId, |
|
28 TUint8 aTransId, |
|
29 TInt aRetVal, |
|
30 MHWRMFmtxPluginTimerCallback& aCallback ) |
|
31 { |
|
32 FUNC_LOG; |
|
33 |
|
34 CHWRMFmtxPluginTimer* self = new( ELeave )CHWRMFmtxPluginTimer( aCommandId, |
|
35 aTransId, |
|
36 aRetVal, |
|
37 aCallback ); |
|
38 |
|
39 CleanupStack::PushL( self ); |
|
40 self->ConstructL(); |
|
41 CleanupStack::Pop( self ); |
|
42 return self; |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CHWRMFmtxPluginTimer::TransId |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 TUint8 CHWRMFmtxPluginTimer::TransId() const |
|
50 { |
|
51 FUNC_LOG; |
|
52 |
|
53 return iTransId; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CHWRMFmtxPluginTimer::~CHWRMFmtxPluginTimer |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 CHWRMFmtxPluginTimer::~CHWRMFmtxPluginTimer() |
|
61 { |
|
62 FUNC_LOG; |
|
63 |
|
64 Cancel(); |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CHWRMFmtxPluginTimer::CHWRMFmtxPluginTimer |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CHWRMFmtxPluginTimer::CHWRMFmtxPluginTimer( TInt aCommandId, TUint8 aTransId, |
|
72 TInt aRetVal, MHWRMFmtxPluginTimerCallback& aCallback) |
|
73 : CTimer( EPriorityStandard ), |
|
74 iCommandId(aCommandId), |
|
75 iTransId(aTransId), |
|
76 iRetVal(aRetVal), |
|
77 iCallback(aCallback) |
|
78 { |
|
79 FUNC_LOG; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CHWRMFmtxPluginTimer::ConstructL |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 void CHWRMFmtxPluginTimer::ConstructL() |
|
87 { |
|
88 FUNC_LOG; |
|
89 |
|
90 CTimer::ConstructL(); |
|
91 |
|
92 CActiveScheduler::Add( this ); |
|
93 |
|
94 After(0); |
|
95 } |
|
96 |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CHWRMFmtxPluginTimer::RunL |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 void CHWRMFmtxPluginTimer::RunL() |
|
103 { |
|
104 FUNC_LOG; |
|
105 |
|
106 iCallback.GenericTimerFired( iCommandId, iTransId, iRetVal ); |
|
107 } |
|
108 |