|
1 /* |
|
2 * Copyright (c) 2005-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: Key handler timer for Active Idle WS Plug-in. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 #include "keyhandlertimer.h" |
|
22 #include "sindlaunchhandler.h" |
|
23 |
|
24 namespace AiWsPlugin { |
|
25 |
|
26 CKeyHandlerTimer::CKeyHandlerTimer( MHandlerTimer* aHandler ) |
|
27 : CTimer( CTimer::EPriorityStandard ) |
|
28 { |
|
29 iHandler = aHandler; |
|
30 } |
|
31 |
|
32 void CKeyHandlerTimer::ConstructL() |
|
33 { |
|
34 CTimer::ConstructL(); |
|
35 CActiveScheduler::Add( this ); |
|
36 } |
|
37 |
|
38 CKeyHandlerTimer* CKeyHandlerTimer::NewL( MHandlerTimer* aHandler ) |
|
39 { |
|
40 CKeyHandlerTimer* self = CKeyHandlerTimer::NewLC( aHandler ); |
|
41 CleanupStack::Pop( self ); |
|
42 return self; |
|
43 } |
|
44 |
|
45 |
|
46 CKeyHandlerTimer* CKeyHandlerTimer::NewLC( MHandlerTimer* aHandler ) |
|
47 { |
|
48 CKeyHandlerTimer* self = new(ELeave) CKeyHandlerTimer( aHandler ); |
|
49 CleanupStack::PushL( self ); |
|
50 self->ConstructL(); |
|
51 return self; |
|
52 } |
|
53 |
|
54 CKeyHandlerTimer::~CKeyHandlerTimer() |
|
55 { |
|
56 Cancel(); |
|
57 } |
|
58 |
|
59 void CKeyHandlerTimer::RunL() |
|
60 { |
|
61 if( iHandler ) |
|
62 { |
|
63 iHandler->TimerDone(); |
|
64 } |
|
65 } |
|
66 |
|
67 TInt CKeyHandlerTimer::RunError( TInt /*aError*/ ) |
|
68 { |
|
69 return 0; |
|
70 } |
|
71 |
|
72 TBool CKeyHandlerTimer::IsActive() |
|
73 { |
|
74 return CActive::IsActive(); |
|
75 } |
|
76 |
|
77 } // namespace AiWsPlugin |