|
1 /* |
|
2 * Copyright (c) 2002-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "AknSmallIndicator.h" |
|
19 #include <AknNotifyStd.h> |
|
20 #include <AknNotifySignature.h> |
|
21 |
|
22 const TInt KIndicatorTap = 0xFFFF; |
|
23 |
|
24 EXPORT_C CAknSmallIndicator* CAknSmallIndicator::NewL(TUid aIndicatorUid) |
|
25 { |
|
26 CAknSmallIndicator* self = NewLC(aIndicatorUid); |
|
27 CleanupStack::Pop(); // self |
|
28 return self; |
|
29 } |
|
30 |
|
31 EXPORT_C CAknSmallIndicator* CAknSmallIndicator::NewLC(TUid aIndicatorUid) |
|
32 { |
|
33 CAknSmallIndicator* self = new(ELeave) CAknSmallIndicator; |
|
34 CleanupStack::PushL(self); |
|
35 self->ConstructL(aIndicatorUid); |
|
36 return self; |
|
37 } |
|
38 |
|
39 EXPORT_C CAknSmallIndicator::~CAknSmallIndicator() |
|
40 { |
|
41 } |
|
42 |
|
43 CAknSmallIndicator::CAknSmallIndicator() : CAknNotifyBase(KAknSmallIndicatorUid) |
|
44 { |
|
45 } |
|
46 |
|
47 void CAknSmallIndicator::ConstructL(TUid aIndicatorUid) |
|
48 { |
|
49 CAknNotifyBase::ConstructL(); |
|
50 iIndicatorUid = aIndicatorUid; |
|
51 } |
|
52 |
|
53 EXPORT_C void CAknSmallIndicator::SetIndicatorStateL(TInt aState) |
|
54 { |
|
55 RThread thread; |
|
56 |
|
57 if ( thread.HasCapability( ECapabilityWriteDeviceData ) ) |
|
58 { |
|
59 TPckgBuf<SAknNotifierPackage<SAknSmallIndicatorParams> > pckg; |
|
60 pckg().iParamData.iSmallIndicatorUid = iIndicatorUid; |
|
61 pckg().iParamData.iValue = aState; |
|
62 TBuf8<1> resp; |
|
63 StartOrUpdateL(pckg, resp); |
|
64 } |
|
65 |
|
66 thread.Close(); |
|
67 } |
|
68 |
|
69 EXPORT_C void CAknSmallIndicator::CAknNotifyBase_Reserved() |
|
70 { |
|
71 } |
|
72 |
|
73 EXPORT_C void CAknSmallIndicator::HandleIndicatorTapL() |
|
74 { |
|
75 TPckgBuf<SAknNotifierPackage<SAknSmallIndicatorParams> > pckg; |
|
76 pckg().iParamData.iSmallIndicatorUid = iIndicatorUid; |
|
77 pckg().iParamData.iValue = KIndicatorTap; |
|
78 TBuf8<1> resp; |
|
79 StartOrUpdateL(pckg, resp); |
|
80 } |
|
81 |
|
82 // End of File |