2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: implementation of setting list box
21 // Copyright (c) 1997-2001 Symbian Ltd. All rights reserved.
23 #if !defined(__EIKSLB_H__)
28 class MTextListBoxModel;
30 class CSettingsListBoxData;
31 class CSettingsListBoxView;
34 * Item drawer class for CEikSettingsListBox. This class is not intended for user derivation.
39 class CSettingsListBoxItemDrawer : public CFormattedCellListBoxItemDrawer
43 * Default constructor.
44 * @param aTextListBoxModel The model whose items will be drawn.
45 * @param aFont The font in which the items will be drawn. Usually overriden by layouts.
46 * @param aSettingsData The listbox data class to be used.
48 IMPORT_C CSettingsListBoxItemDrawer( MTextListBoxModel* aTextListBoxModel,
50 CSettingsListBoxData* aSettingsData );
55 IMPORT_C ~CSettingsListBoxItemDrawer();
58 * @return pointer to listbox data class
60 IMPORT_C CSettingsListBoxData* SettingsData() const;
63 * from CTextListItemDrawer
64 * @param aItemIndex Index of the item to draw.
65 * @param aItemTextRect Area to draw into.
66 * @param aItemIsCurrent ETrue if the item is current.
67 * @param aViewIsEmphasized ETrue if the view is emphasized.
68 * @param aItemIsSelected ETrue if the item is selected.
70 IMPORT_C void DrawItemText( TInt aItemIndex,
71 const TRect& aItemTextRect,
73 TBool aViewIsEmphasized,
74 TBool aItemIsSelected ) const;
76 IMPORT_C void CFormattedCellListBoxItemDrawer_Reserved();
83 * List box base class. Creates listbox view and item drawer classes. This class
84 * is used throughout @c AknListBoxLinesTemplate< T > class.
85 * The @c CEikSettingsListBox uses @c CSettingsListBoxView as a list box view
86 * class and a @c CSettingsListBoxItemDrawer as an item drawer.
90 class CEikSettingsListBox : public CEikFormattedCellListBox
95 * C++ default constructor.
97 IMPORT_C CEikSettingsListBox();
102 * Gets an item drawer of @c CEikSettingListBox which handles drawing of
103 * single list box items and manages their properties.
105 * @return Pointer to the item drawer instance.
107 IMPORT_C CSettingsListBoxItemDrawer* ItemDrawer() const;
112 * Creates an item drawer for @c CEikSettingsListBox.
114 IMPORT_C void CreateItemDrawerL();
116 public: // from CEikListBox
119 * From @c CEikListBox.
121 * Creates the list box view. The function is called
122 * by @c ConstructL() to create an instance of the appropriate list box
123 * view class for this list box. The returned instance is owned by this
124 * object, and does not have to have its second-phase constructor run.
125 * This function is called by @c CreateViewL().
127 * @return Pointer to a newly constructed list box view for this object.
129 IMPORT_C CListBoxView* MakeViewClassInstanceL();
131 public: // from CCoeControl
134 * From @c CCoeControl.
136 * Handles pointer events.
138 * @param aPointerEvent The pointer event.
140 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
145 * Gets a list box view class as @c CSettingsListBoxView.
147 * @return Pointer to the list box view class object.
149 CSettingsListBoxView* View() { return (CSettingsListBoxView*)iView; }
156 IMPORT_C void* ExtensionInterface( TUid aInterface );
158 private: // listbox use only
159 IMPORT_C virtual void CEikListBox_Reserved();
164 * View class for CEikSettingsListBox
166 * This class is not intended for user derivation.
169 class CSettingsListBoxView : public CFormattedCellListBoxView
171 public: // from CListBoxView
173 * Empty default constructor.
175 CSettingsListBoxView() {}
179 * @param aClipRect Area to draw.
181 IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
184 * Draws specified item.
185 * @param aItemIndex Item index to draw.
187 IMPORT_C void DrawItem(TInt aItemIndex) const;
190 * @return pointer to item drawer class.
192 inline CSettingsListBoxItemDrawer *ItemDrawer() const;
193 private: // overridden from CListBoxView
194 IMPORT_C virtual TAny* Reserved_1();
198 inline CSettingsListBoxItemDrawer* CSettingsListBoxView::ItemDrawer() const
199 { return (CSettingsListBoxItemDrawer*)iItemDrawer; }
202 #endif // __EIKSLB_H__