Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 1998-1999 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #if !defined(__EIKLBD_H__)
28 class TListItemProperties;
29 class CListBoxDataExtension;
30 class MAknsControlContext;
33 * The data container class @c TListFontBoundValues class holds size
34 * properties of the fonts used in list boxes.
38 class TListFontBoundValues
40 public: // Constructors and destructor
43 * Default C++ constructor
45 IMPORT_C TListFontBoundValues();
50 * The maximum permitted width of list box characters in pixels.
52 TInt iMaxNormalCharWidthInPixels;
55 * The list box height in pixels.
61 * The @c CListBoxData class is the base class for list box data classes.
62 * It stores one or more instances of fonts in normal, bold and italic styles.
66 class CListBoxData : public CBase
70 friend class CListItemDrawer;
72 public: // Constructors and destructor
75 * C++ default constructor.
77 IMPORT_C CListBoxData();
82 IMPORT_C ~CListBoxData();
84 public: // New functions
87 * By default Symbian 2nd phase constructor is private.
90 * @param aBaseFont Parameter not used in the code.
92 IMPORT_C void ConstructL(const CFont* aBaseFont);
95 * Returns a pointer to the type of font wanted.
97 * @param aItemProperties Definition of font type wanted.
98 * @return CFont* Handle to the font or NULL.
100 IMPORT_C virtual CFont*
101 Font(const TListItemProperties& aItemProperties) const;
104 * Sets properties (underlining on / off, pen colorm and font) of
107 * @param aItemProperties Contains properties to set.
108 * @param aGc Target of settings.
110 IMPORT_C void SetupGc(const TListItemProperties& aItemProperties,
111 CWindowGc& aGc) const;
114 * Queries boundary values of font size.
116 * @retun TListFontBoundValues& Reference to boundary value object.
118 IMPORT_C const TListFontBoundValues& FontBoundValues() const;
121 * Sets a new height of fonts
123 * @param aFontHeightInTwips New height for fonts.
124 * @return TInt Symbian error code, @c KErrNone if success.
126 IMPORT_C TInt SetFontHeight(TInt aFontHeightInTwips);
129 * Setter for a search string used for viewing search results
131 * @param aSearchString The search string.
133 IMPORT_C void SetSearchStringL(const TDesC* aSearchString);
136 * Query is search string set
138 * @return TBool @c ETrue if search string set and has non zero length.
139 * @c EFalse if no search string set or length is 0.
141 IMPORT_C TBool IsSearchString() const;
144 * Draws list item text. Supports different drawing for the search string.
146 * @param aGc Graphics context used.
147 * @param aItemTextRect The item's text rectangle.
148 * @param aItemText Text of the item.
149 * @param aItemFont Used font.
150 * @param aBaseLineOffset Item's base line offset.
151 * @param aAlign Text alignment.
152 * Default alignment is @c CGraphicsContext::ELeft
154 IMPORT_C void DrawItem(CWindowGc& aGc,
155 const TRect& aItemTextRect,
156 const TDesC& aItemText,
157 const CFont& aItemFont,
158 const TInt aBaseLineOffset,
159 const CGraphicsContext::TTextAlign aAlign =
160 CGraphicsContext::ELeft) const;
163 * Sets list item's text alignment.
165 * @param aAlign Text alignment to use.
167 inline void SetAlignmentL(CGraphicsContext::TTextAlign aAlign);
170 * Queries used text alignment.
172 * @return CGraphicsContext::TTextAlign The text alignment.
174 inline CGraphicsContext::TTextAlign Alignment() const;
177 * Access to skin contexts from plain listboxes.
179 * @since Series 60 2.0
180 * @return MAknsControlContext* Used skin context
182 IMPORT_C MAknsControlContext* SkinBackgroundControlContext() const;
187 * Sets a background skinning context. Set @c NULL to disable background
190 * @since Series 60 2.0
191 * @param aContext Background skinning context.
194 SetSkinBackgroundControlContextL(MAknsControlContext* aContext);
197 * Sets whether skins are enabled.
199 * @param aEnabled @c EFalse disable skinning, @c ETrue enable
201 IMPORT_C void SetSkinEnabledL(TBool aEnabled);
205 NONSHARABLE_CLASS(CFontsWithStyle) : public CBase
208 public: // Constructors and destructor
211 * C++ default constructor.
220 public: // new functions
223 * Releases fonts when they are no longer required.
225 IMPORT_C void ReleaseFonts();
228 * Getter for used font style
230 * @return TFontStyle Used font style
232 IMPORT_C TFontStyle FontStyle();
235 * Setter for used font style
237 * @return aFontStyle Font style to use.
239 IMPORT_C void SetFontStyle(TFontStyle aFontStyle);
244 * @c CArrayPtrFlat<CFont> is used instead of @c CFont*,
245 * because in some subclasses this structure
246 * can contain more than 1 font.
248 CArrayPtrFlat<CFont>* iFonts;
255 TFontStyle iFontStyle;
259 * Constructs a new font based on the base font and font style given.
260 * Constructed font is added to @c CFontsWithStyle.
262 * @param aBaseFont Base fontused in construction
263 * @param aFontStyle A new font's style
264 * @param aFonts New font is added to this font container.
266 IMPORT_C void ConstructFontL(const CFont* aBaseFont,
267 TFontStyle aFontStyle,
268 CFontsWithStyle& aFonts);
271 * Updates width and heigh information. Used when font is changed.
273 * @param aFont A font from which bound values are taken.
275 IMPORT_C void UpdateFontBoundValues(const CFont& aFont);
278 * Changes fonts' height. Takes new height as argument and regenerates
279 * font set so that height is modified.
281 * @param aFonts Font set to modify
282 * @param aFontHeightInTwips New font height
284 IMPORT_C TInt RegenerateFonts(CFontsWithStyle& aFonts,
285 TInt aFontHeightInTwips);
292 CFontsWithStyle iNormalFont;
297 CFontsWithStyle iBoldFont;
302 CFontsWithStyle iItalicFont;
305 * Font with normal and italic styles
307 CFontsWithStyle iBoldItalicFont;
310 * String used in list box search field.
312 HBufC* iSearchString;
316 IMPORT_C virtual void Reserved_1();
317 IMPORT_C virtual void Reserved_2();
321 TListFontBoundValues iFontBoundValues;
322 CGraphicsContext::TTextAlign iAlign;
326 CListBoxDataExtension* iLBDExtension;
330 inline void CListBoxData::SetAlignmentL(CGraphicsContext::TTextAlign aAlign)
333 inline CGraphicsContext::TTextAlign CListBoxData::Alignment() const