|
1 /* |
|
2 * Copyright (c) 2009-2009 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: URL Parser ECom plugin entry point |
|
15 * |
|
16 */ |
|
17 #include "cmrlabel.h" |
|
18 |
|
19 #include <AknUtils.h> |
|
20 #include <AknsUtils.h> |
|
21 #include <AknsConstants.h> |
|
22 #include <aknsconstants.hrh> |
|
23 #include <gdi.h> |
|
24 |
|
25 // LOCAL DEFINITIONS |
|
26 namespace // codescanner::namespace |
|
27 { |
|
28 #define KDefaultTextColor TRgb( 0x000000 ); |
|
29 /// Get the text color from skin |
|
30 TRgb TextColor( TInt aSkinColorId ) |
|
31 { |
|
32 TRgb bgColor; |
|
33 TInt err; |
|
34 |
|
35 err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
|
36 bgColor, |
|
37 KAknsIIDQsnTextColors, |
|
38 aSkinColorId ); |
|
39 if( err != KErrNone ) |
|
40 { |
|
41 bgColor = KDefaultTextColor; |
|
42 } |
|
43 return bgColor; |
|
44 } |
|
45 |
|
46 } |
|
47 |
|
48 // --------------------------------------------------------------------------- |
|
49 // CMRLabel::NewL |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 EXPORT_C CMRLabel* CMRLabel::NewL() |
|
53 { |
|
54 CMRLabel* self = new (ELeave) CMRLabel(); |
|
55 CleanupStack::PushL( self ); |
|
56 self->ConstructL(); |
|
57 CleanupStack::Pop( self ); |
|
58 return self; |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CMRLabel::~CMRLabel |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 EXPORT_C CMRLabel::~CMRLabel() |
|
66 { |
|
67 // Do nothing |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // CMRLabel::FocusChanged |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 void CMRLabel::FocusChanged( TDrawNow /*aDrawNow*/ ) |
|
75 { |
|
76 // Focus received |
|
77 if ( IsFocused() ) |
|
78 { |
|
79 // If function leaves we continue w/o changing the color |
|
80 TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( |
|
81 *this, EColorLabelText, |
|
82 TextColor( EAknsCIQsnHighlightColorsCG2 ) ) ); |
|
83 } |
|
84 else |
|
85 { |
|
86 // If function leaves we continue w/o changing the color |
|
87 TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( |
|
88 *this, EColorLabelText, |
|
89 TextColor( EAknsCIQsnTextColorsCG6 ) ) ); |
|
90 } |
|
91 } |
|
92 |
|
93 // --------------------------------------------------------------------------- |
|
94 // CMRLabel::CMRLabel |
|
95 // --------------------------------------------------------------------------- |
|
96 // |
|
97 CMRLabel::CMRLabel() |
|
98 { |
|
99 // Do nothing |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------------------------- |
|
103 // CMRLabel::ConstructL |
|
104 // --------------------------------------------------------------------------- |
|
105 // |
|
106 void CMRLabel::ConstructL() |
|
107 { |
|
108 AknLayoutUtils::OverrideControlColorL( |
|
109 *this, EColorLabelText, |
|
110 TextColor( EAknsCIQsnTextColorsCG6 ) ); |
|
111 } |
|
112 |
|
113 |
|
114 // End of file |