63
|
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 CPbkxRclSearchResultListBox.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CPBKXRCLSEARCHRESULTLISTBOX_H
|
|
20 |
#define CPBKXRCLSEARCHRESULTLISTBOX_H
|
|
21 |
|
|
22 |
#include <aknlists.h>
|
|
23 |
#include <eikclb.h>
|
|
24 |
|
|
25 |
////////////////////////////////////////////////////////////////////////////
|
|
26 |
// CPbkxRclSearchResultListBox
|
|
27 |
////////////////////////////////////////////////////////////////////////////
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Listbox for search result dialog.
|
|
31 |
*/
|
|
32 |
class CPbkxRclSearchResultListBox : public CAknSingleStyleListBox
|
|
33 |
{
|
|
34 |
public: // constructor and destructor
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Constructor.
|
|
38 |
*/
|
|
39 |
CPbkxRclSearchResultListBox();
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Destructor.
|
|
43 |
*/
|
|
44 |
virtual ~CPbkxRclSearchResultListBox();
|
|
45 |
|
|
46 |
protected: // methods from base classes
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Creates item drawer for the listbox.
|
|
50 |
*/
|
|
51 |
virtual void CreateItemDrawerL();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Creates view for the listbox.
|
|
55 |
*/
|
|
56 |
virtual CListBoxView* MakeViewClassInstanceL();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Draws the listbox.
|
|
60 |
*
|
|
61 |
* @see CAknSingleGraphicStyleListBox::Draw
|
|
62 |
*/
|
|
63 |
void Draw( const TRect& aRect ) const;
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Observer callback for list scrolling event.
|
|
67 |
*
|
|
68 |
* @see CEikListBox::HandleScrollEventL and MEikScrollBarObserver
|
|
69 |
*/
|
|
70 |
void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType);
|
|
71 |
|
|
72 |
private:
|
|
73 |
/// navistrip - for handling of scroll bar popupcharacter
|
|
74 |
TBool iShowPopupChar;
|
|
75 |
|
|
76 |
};
|
|
77 |
|
|
78 |
////////////////////////////////////////////////////////////////////////////
|
|
79 |
// CPbkxRclSearchResultItemDrawer
|
|
80 |
////////////////////////////////////////////////////////////////////////////
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Item drawer for search result listbox.
|
|
84 |
*/
|
|
85 |
class CPbkxRclSearchResultItemDrawer : public CColumnListBoxItemDrawer
|
|
86 |
{
|
|
87 |
public: // constructor and destructor
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Constructor.
|
|
91 |
*
|
|
92 |
* @param aTextListBoxModel Listbox model.
|
|
93 |
* @param aFont Used font.
|
|
94 |
* @param aColumnData Data class.
|
|
95 |
*/
|
|
96 |
CPbkxRclSearchResultItemDrawer(
|
|
97 |
MTextListBoxModel* aTextListBoxModel,
|
|
98 |
const CFont* aFont,
|
|
99 |
CColumnListBoxData* aColumnData );
|
|
100 |
|
|
101 |
/**
|
|
102 |
* Destructor.
|
|
103 |
*/
|
|
104 |
virtual ~CPbkxRclSearchResultItemDrawer();
|
|
105 |
|
|
106 |
public: // new methods
|
|
107 |
|
|
108 |
/**
|
|
109 |
* Sets highlighted text color.
|
|
110 |
*
|
|
111 |
* @param aColor Color.
|
|
112 |
*/
|
|
113 |
void SetHighlightColor( TRgb aColor );
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Sets normal text color.
|
|
117 |
*
|
|
118 |
* @param aColor Color.
|
|
119 |
*/
|
|
120 |
void SetColor( TRgb aColor );
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Reset color settings.
|
|
124 |
*
|
|
125 |
* @param aHighlightColor ETrue if highlight is reset, EFalse for normal.
|
|
126 |
*/
|
|
127 |
void ResetColors( TBool aHighlightColor = EFalse );
|
|
128 |
|
|
129 |
public: // from base classes
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Draws item text.
|
|
133 |
*
|
|
134 |
* @param aItemIndex Item index.
|
|
135 |
* @param aItemTextRect Item text rect.
|
|
136 |
* @param aItemIsCurrent
|
|
137 |
* @param aViewIsEmphasized
|
|
138 |
* @param aItemIsSelected
|
|
139 |
*/
|
|
140 |
virtual void DrawItemText(
|
|
141 |
TInt aItemIndex,
|
|
142 |
const TRect& aItemTextRect,
|
|
143 |
TBool aItemIsCurrent,
|
|
144 |
TBool aViewIsEmphasized,
|
|
145 |
TBool aItemIsSelected ) const;
|
|
146 |
|
|
147 |
private: // data
|
|
148 |
|
|
149 |
enum TColors
|
|
150 |
{
|
|
151 |
EColorSet = 0x1,
|
|
152 |
EHighlighColorSet = 0x2
|
|
153 |
};
|
|
154 |
|
|
155 |
// Normal text color.
|
|
156 |
TRgb iColor;
|
|
157 |
|
|
158 |
// Highlighted text color.
|
|
159 |
TRgb iHighlightColor;
|
|
160 |
|
|
161 |
// Flag indicating that colors are set.
|
|
162 |
TInt iColorsSet;
|
|
163 |
|
|
164 |
};
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
//This strange old override below (class CPbkxRclSearchResultListView) causes on hardware empty
|
|
169 |
//list text not to draw. Most likely no need for this kind override at all.
|
|
170 |
//To fix draw this override is not used (however is part of pbk2rclengine api
|
|
171 |
//and therefore not removed completely)
|
|
172 |
////////////////////////////////////////////////////////////////////////////
|
|
173 |
// CPbkxRclSearchResultListView
|
|
174 |
////////////////////////////////////////////////////////////////////////////
|
|
175 |
|
|
176 |
/**
|
|
177 |
* View for search result listbox.
|
|
178 |
*/
|
|
179 |
class CPbkxRclSearchResultListView: public CAknColumnListBoxView
|
|
180 |
{
|
|
181 |
protected:
|
|
182 |
// From CListBoxView
|
|
183 |
|
|
184 |
/**
|
|
185 |
* Called when drawing empty list
|
|
186 |
*
|
|
187 |
* @param aClientRect Not used.
|
|
188 |
*/
|
|
189 |
void DrawEmptyList(const TRect &aClientRect) const;
|
|
190 |
};
|
|
191 |
#endif
|
|
192 |
|
|
193 |
|