1 /* |
|
2 * Copyright (c) 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: Definition of the class CPbkxRclResultInfoListBox. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "emailtrace.h" |
|
20 #include <AknsUtils.h> |
|
21 #include <eikfrlbd.h> |
|
22 |
|
23 #include "cpbkxrclresultinfolistbox.h" |
|
24 |
|
25 //////////////////////////////////////////////////////////////////////////// |
|
26 // CPbkxRclResultInfoListBox |
|
27 //////////////////////////////////////////////////////////////////////////// |
|
28 |
|
29 |
|
30 // ======== MEMBER FUNCTIONS ======== |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // CPbkxRclResultInfoListBox::CPbkxRclResultInfoListBox |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 CPbkxRclResultInfoListBox::CPbkxRclResultInfoListBox() : |
|
37 CAknDoubleStyleListBox() |
|
38 { |
|
39 FUNC_LOG; |
|
40 } |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // CPbkxRclResultInfoListBox::~CPbkxRclResultInfoListBox |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 CPbkxRclResultInfoListBox::~CPbkxRclResultInfoListBox() |
|
47 { |
|
48 FUNC_LOG; |
|
49 } |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 // CPbkxRclResultInfoListBox::CreateItemDrawerL |
|
53 // --------------------------------------------------------------------------- |
|
54 // |
|
55 void CPbkxRclResultInfoListBox::CreateItemDrawerL() |
|
56 { |
|
57 FUNC_LOG; |
|
58 CFormattedCellListBoxData* data = CFormattedCellListBoxData::NewL(); |
|
59 CleanupStack::PushL( data ); |
|
60 iItemDrawer = new ( ELeave ) CPbkxRclResultInfoItemDrawer( |
|
61 Model(), |
|
62 iEikonEnv->NormalFont(), |
|
63 data ); |
|
64 data->SetSkinEnabledL( ETrue ); |
|
65 CleanupStack::Pop( data ); |
|
66 } |
|
67 |
|
68 |
|
69 //////////////////////////////////////////////////////////////////////////// |
|
70 // CPbkxRclResultInfoItemDrawer |
|
71 //////////////////////////////////////////////////////////////////////////// |
|
72 |
|
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // CPbkxRclResultInfoItemDrawer::CPbkxRclResultInfoItemDrawer |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
|
78 CPbkxRclResultInfoItemDrawer::CPbkxRclResultInfoItemDrawer( |
|
79 MTextListBoxModel* aTextListBoxModel, |
|
80 const CFont* aFont, |
|
81 CFormattedCellListBoxData* aFormattedCellData ) : |
|
82 CFormattedCellListBoxItemDrawer( |
|
83 aTextListBoxModel, |
|
84 aFont, |
|
85 aFormattedCellData ) |
|
86 { |
|
87 FUNC_LOG; |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // CPbkxRclResultInfoItemDrawer::~CPbkxRclResultInfoItemDrawer |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 CPbkxRclResultInfoItemDrawer::~CPbkxRclResultInfoItemDrawer() |
|
95 { |
|
96 FUNC_LOG; |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // CPbkxRclResultInfoItemDrawer::SetHighlightColor |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 void CPbkxRclResultInfoItemDrawer::SetHighlightColor( TRgb aColor ) |
|
104 { |
|
105 FUNC_LOG; |
|
106 iHighlightColor = aColor; |
|
107 iColorsSet = iColorsSet | EHighlighColorSet; |
|
108 } |
|
109 |
|
110 // --------------------------------------------------------------------------- |
|
111 // CPbkxRclResultInfoItemDrawer::SetColor |
|
112 // --------------------------------------------------------------------------- |
|
113 // |
|
114 void CPbkxRclResultInfoItemDrawer::SetColor( TRgb aColor ) |
|
115 { |
|
116 FUNC_LOG; |
|
117 iColor = aColor; |
|
118 iColorsSet = iColorsSet | EColorSet; |
|
119 } |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // CPbkxRclResultInfoItemDrawer::ResetColors |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 void CPbkxRclResultInfoItemDrawer::ResetColors( TBool aHighlightColor ) |
|
126 { |
|
127 FUNC_LOG; |
|
128 if ( aHighlightColor ) |
|
129 { |
|
130 iColorsSet = iColorsSet & ( ~EHighlighColorSet ); |
|
131 } |
|
132 else |
|
133 { |
|
134 iColorsSet = iColorsSet & ( ~EColorSet ); |
|
135 } |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // CPbkxRclResultInfoItemDrawer::DrawItemText |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 void CPbkxRclResultInfoItemDrawer::DrawItemText( |
|
143 TInt aItemIndex, |
|
144 const TRect& aItemTextRect, |
|
145 TBool aItemIsCurrent, |
|
146 TBool aViewIsEmphasized, |
|
147 TBool aItemIsSelected ) const |
|
148 { |
|
149 FUNC_LOG; |
|
150 |
|
151 // force our own colors to itemdrawer |
|
152 CPbkxRclResultInfoItemDrawer* ptr = |
|
153 const_cast<CPbkxRclResultInfoItemDrawer*>( this ); |
|
154 |
|
155 if ( iColorsSet & EColorSet ) |
|
156 { |
|
157 ptr->iTextColor = iColor; |
|
158 } |
|
159 |
|
160 if ( iColorsSet & EHighlighColorSet ) |
|
161 { |
|
162 ptr->iHighlightedTextColor = iHighlightColor; |
|
163 } |
|
164 |
|
165 // Disable AVKON skinning so that our own color definitions apply |
|
166 TBool skinEnabled = AknsUtils::AvkonSkinEnabled(); |
|
167 // Safe to ignore error |
|
168 TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( EFalse ) ); |
|
169 CFormattedCellListBoxItemDrawer::DrawItemText( |
|
170 aItemIndex, |
|
171 aItemTextRect, |
|
172 aItemIsCurrent, |
|
173 aViewIsEmphasized, |
|
174 aItemIsSelected ); |
|
175 // Safe to ignore error |
|
176 TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( skinEnabled ) ); |
|
177 |
|
178 } |
|
179 |
|