equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2004 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: Implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "CTcBacklight.h" |
|
19 #include "TestClientConstants.h" |
|
20 |
|
21 CTcBacklight* CTcBacklight::NewL() |
|
22 { |
|
23 CTcBacklight* self = new( ELeave ) CTcBacklight; |
|
24 |
|
25 CleanupStack::PushL( self ); |
|
26 self->ConstructL(); |
|
27 CleanupStack::Pop(); |
|
28 |
|
29 return self; |
|
30 } |
|
31 |
|
32 CTcBacklight::~CTcBacklight() |
|
33 { |
|
34 Cancel(); |
|
35 iTimer.Close(); |
|
36 } |
|
37 |
|
38 CTcBacklight::CTcBacklight() |
|
39 : CActive( EPriorityStandard ) |
|
40 { |
|
41 CActiveScheduler::Add( this ); |
|
42 } |
|
43 |
|
44 void CTcBacklight::ConstructL() |
|
45 { |
|
46 User::LeaveIfError( iTimer.CreateLocal() ); |
|
47 Start(); |
|
48 } |
|
49 |
|
50 void CTcBacklight::DoCancel() |
|
51 { |
|
52 iTimer.Cancel(); |
|
53 } |
|
54 |
|
55 void CTcBacklight::RunL() |
|
56 { |
|
57 User::ResetInactivityTime(); |
|
58 Start(); |
|
59 } |
|
60 |
|
61 void CTcBacklight::Start() |
|
62 { |
|
63 iTimer.After( iStatus, KPeriod10Sec ); |
|
64 SetActive(); |
|
65 } |