1.1 --- a/epoc32/include/mw/eikslb.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/eikslb.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,205 @@
1.4 -eikslb.h
1.5 +/*
1.6 +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: implementation of setting list box
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +// EIKSLB.H
1.24 +//
1.25 +// Copyright (c) 1997-2001 Symbian Ltd. All rights reserved.
1.26 +//
1.27 +#if !defined(__EIKSLB_H__)
1.28 +#define __EIKSLB_H__
1.29 +
1.30 +#include <eikfrlb.h>
1.31 +
1.32 +class MTextListBoxModel;
1.33 +class CFont;
1.34 +class CSettingsListBoxData;
1.35 +class CSettingsListBoxView;
1.36 +
1.37 +/**
1.38 +* Item drawer class for CEikSettingsListBox. This class is not intended for user derivation.
1.39 +* @since S60 1.0
1.40 +* @lib Avkon.lib
1.41 +*/
1.42 +
1.43 +class CSettingsListBoxItemDrawer : public CFormattedCellListBoxItemDrawer
1.44 + {
1.45 + public:
1.46 + /**
1.47 + * Default constructor.
1.48 + * @param aTextListBoxModel The model whose items will be drawn.
1.49 + * @param aFont The font in which the items will be drawn. Usually overriden by layouts.
1.50 + * @param aSettingsData The listbox data class to be used.
1.51 + */
1.52 + IMPORT_C CSettingsListBoxItemDrawer( MTextListBoxModel* aTextListBoxModel,
1.53 + const CFont* aFont,
1.54 + CSettingsListBoxData* aSettingsData );
1.55 +
1.56 + /**
1.57 + * destructor
1.58 + */
1.59 + IMPORT_C ~CSettingsListBoxItemDrawer();
1.60 +
1.61 + /**
1.62 + * @return pointer to listbox data class
1.63 + */
1.64 + IMPORT_C CSettingsListBoxData* SettingsData() const;
1.65 + public:
1.66 + /**
1.67 + * from CTextListItemDrawer
1.68 + * @param aItemIndex Index of the item to draw.
1.69 + * @param aItemTextRect Area to draw into.
1.70 + * @param aItemIsCurrent ETrue if the item is current.
1.71 + * @param aViewIsEmphasized ETrue if the view is emphasized.
1.72 + * @param aItemIsSelected ETrue if the item is selected.
1.73 + */
1.74 + IMPORT_C void DrawItemText( TInt aItemIndex,
1.75 + const TRect& aItemTextRect,
1.76 + TBool aItemIsCurrent,
1.77 + TBool aViewIsEmphasized,
1.78 + TBool aItemIsSelected ) const;
1.79 + private:
1.80 + IMPORT_C void CFormattedCellListBoxItemDrawer_Reserved();
1.81 +
1.82 + };
1.83 +
1.84 +
1.85 +
1.86 +/**
1.87 +* List box base class. Creates listbox view and item drawer classes. This class
1.88 +* is used throughout @c AknListBoxLinesTemplate< T > class.
1.89 +* The @c CEikSettingsListBox uses @c CSettingsListBoxView as a list box view
1.90 +* class and a @c CSettingsListBoxItemDrawer as an item drawer.
1.91 +* @since S60 1.0
1.92 +* @lib Avkon.lib
1.93 +*/
1.94 +class CEikSettingsListBox : public CEikFormattedCellListBox
1.95 + {
1.96 + public:
1.97 +
1.98 + /**
1.99 + * C++ default constructor.
1.100 + */
1.101 + IMPORT_C CEikSettingsListBox();
1.102 +
1.103 + public:
1.104 +
1.105 + /**
1.106 + * Gets an item drawer of @c CEikSettingListBox which handles drawing of
1.107 + * single list box items and manages their properties.
1.108 + *
1.109 + * @return Pointer to the item drawer instance.
1.110 + */
1.111 + IMPORT_C CSettingsListBoxItemDrawer* ItemDrawer() const;
1.112 +
1.113 + protected:
1.114 +
1.115 + /**
1.116 + * Creates an item drawer for @c CEikSettingsListBox.
1.117 + */
1.118 + IMPORT_C void CreateItemDrawerL();
1.119 +
1.120 + public: // from CEikListBox
1.121 +
1.122 + /**
1.123 + * From @c CEikListBox.
1.124 + *
1.125 + * Creates the list box view. The function is called
1.126 + * by @c ConstructL() to create an instance of the appropriate list box
1.127 + * view class for this list box. The returned instance is owned by this
1.128 + * object, and does not have to have its second-phase constructor run.
1.129 + * This function is called by @c CreateViewL().
1.130 + *
1.131 + * @return Pointer to a newly constructed list box view for this object.
1.132 + */
1.133 + IMPORT_C CListBoxView* MakeViewClassInstanceL();
1.134 +
1.135 + public: // from CCoeControl
1.136 +
1.137 + /**
1.138 + * From @c CCoeControl.
1.139 + *
1.140 + * Handles pointer events.
1.141 + *
1.142 + * @param aPointerEvent The pointer event.
1.143 + */
1.144 + IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1.145 +
1.146 + protected:
1.147 +
1.148 + /**
1.149 + * Gets a list box view class as @c CSettingsListBoxView.
1.150 + *
1.151 + * @return Pointer to the list box view class object.
1.152 + */
1.153 + CSettingsListBoxView* View() { return (CSettingsListBoxView*)iView; }
1.154 +
1.155 + private:
1.156 +
1.157 + /**
1.158 + * From CAknControl
1.159 + */
1.160 + IMPORT_C void* ExtensionInterface( TUid aInterface );
1.161 +
1.162 + private: // listbox use only
1.163 + IMPORT_C virtual void CEikListBox_Reserved();
1.164 +
1.165 + };
1.166 +
1.167 +/**
1.168 +* View class for CEikSettingsListBox
1.169 +*
1.170 +* This class is not intended for user derivation.
1.171 +*/
1.172 +
1.173 +class CSettingsListBoxView : public CFormattedCellListBoxView
1.174 + {
1.175 + public: // from CListBoxView
1.176 + /**
1.177 + * Empty default constructor.
1.178 + */
1.179 + CSettingsListBoxView() {}
1.180 +
1.181 + /**
1.182 + * Draws all items.
1.183 + * @param aClipRect Area to draw.
1.184 + */
1.185 + IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
1.186 +
1.187 + /**
1.188 + * Draws specified item.
1.189 + * @param aItemIndex Item index to draw.
1.190 + */
1.191 + IMPORT_C void DrawItem(TInt aItemIndex) const;
1.192 +
1.193 + /**
1.194 + * @return pointer to item drawer class.
1.195 + */
1.196 + inline CSettingsListBoxItemDrawer *ItemDrawer() const;
1.197 + private: // overridden from CListBoxView
1.198 + IMPORT_C virtual TAny* Reserved_1();
1.199 + };
1.200 +
1.201 +
1.202 +inline CSettingsListBoxItemDrawer* CSettingsListBoxView::ItemDrawer() const
1.203 + { return (CSettingsListBoxItemDrawer*)iItemDrawer; }
1.204 +
1.205 +
1.206 +#endif // __EIKSLB_H__
1.207 +
1.208 +
1.209 +