epoc32/include/mw/eikslb.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 eikslb.h
     1 /*
       
     2 * Copyright (c) 2002-2006 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 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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  implementation of setting list box
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // EIKSLB.H
       
    20 //
       
    21 // Copyright (c) 1997-2001 Symbian Ltd.  All rights reserved.
       
    22 //
       
    23 #if !defined(__EIKSLB_H__)
       
    24 #define __EIKSLB_H__
       
    25 
       
    26 #include <eikfrlb.h>
       
    27 
       
    28 class MTextListBoxModel;
       
    29 class CFont;
       
    30 class CSettingsListBoxData;
       
    31 class CSettingsListBoxView;
       
    32 
       
    33 /**
       
    34 * Item drawer class for CEikSettingsListBox. This class is not intended for user derivation.
       
    35 * @since S60 1.0
       
    36 * @lib   Avkon.lib
       
    37 */
       
    38 
       
    39 class CSettingsListBoxItemDrawer : public CFormattedCellListBoxItemDrawer
       
    40     {
       
    41     public:
       
    42         /**
       
    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.
       
    47         */
       
    48         IMPORT_C CSettingsListBoxItemDrawer( MTextListBoxModel* aTextListBoxModel,
       
    49                                              const CFont* aFont,
       
    50                                              CSettingsListBoxData* aSettingsData );
       
    51 
       
    52         /**
       
    53         * destructor
       
    54         */
       
    55         IMPORT_C ~CSettingsListBoxItemDrawer();
       
    56 
       
    57         /**
       
    58         * @return pointer to listbox data class
       
    59         */
       
    60         IMPORT_C CSettingsListBoxData* SettingsData() const;
       
    61     public:
       
    62         /**
       
    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.
       
    69         */
       
    70         IMPORT_C void DrawItemText( TInt aItemIndex,
       
    71                                     const TRect& aItemTextRect,
       
    72                                     TBool aItemIsCurrent,
       
    73                                     TBool aViewIsEmphasized,
       
    74                                     TBool aItemIsSelected ) const;
       
    75     private:
       
    76         IMPORT_C void CFormattedCellListBoxItemDrawer_Reserved();
       
    77 
       
    78     };
       
    79 
       
    80 
       
    81 
       
    82 /**
       
    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.
       
    87 * @since S60 1.0
       
    88 * @lib   Avkon.lib
       
    89 */
       
    90 class CEikSettingsListBox : public CEikFormattedCellListBox
       
    91     {
       
    92     public:
       
    93 
       
    94         /**
       
    95         * C++ default constructor.
       
    96         */
       
    97         IMPORT_C CEikSettingsListBox();
       
    98 
       
    99     public:
       
   100 
       
   101         /**
       
   102         * Gets an item drawer of @c CEikSettingListBox which handles drawing of 
       
   103         * single list box items and manages their properties.
       
   104         * 
       
   105         * @return Pointer to the item drawer instance.
       
   106         */
       
   107         IMPORT_C CSettingsListBoxItemDrawer* ItemDrawer() const;
       
   108 
       
   109     protected:
       
   110 
       
   111         /**
       
   112         * Creates an item drawer for @c CEikSettingsListBox.
       
   113         */
       
   114         IMPORT_C void CreateItemDrawerL();
       
   115 
       
   116     public: // from CEikListBox
       
   117 
       
   118         /**
       
   119         * From @c CEikListBox. 
       
   120         *
       
   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().
       
   126         *
       
   127         * @return Pointer to a newly constructed list box view for this object.
       
   128         */
       
   129         IMPORT_C CListBoxView* MakeViewClassInstanceL();
       
   130 
       
   131     public: // from CCoeControl
       
   132 
       
   133         /**
       
   134         * From @c CCoeControl. 
       
   135         * 
       
   136         * Handles pointer events.
       
   137         *
       
   138         * @param aPointerEvent The pointer event.
       
   139         */
       
   140         IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   141 
       
   142     protected:
       
   143 
       
   144         /**
       
   145         * Gets a list box view class as @c CSettingsListBoxView.
       
   146         *
       
   147         * @return Pointer to the list box view class object.
       
   148         */
       
   149         CSettingsListBoxView* View() { return (CSettingsListBoxView*)iView; }
       
   150 
       
   151     private:
       
   152 
       
   153         /**
       
   154         * From CAknControl
       
   155         */
       
   156         IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   157 
       
   158     private: // listbox use only
       
   159         IMPORT_C virtual void CEikListBox_Reserved();
       
   160     
       
   161     };
       
   162 
       
   163 /**
       
   164 * View class for CEikSettingsListBox
       
   165 *
       
   166 * This class is not intended for user derivation.
       
   167 */
       
   168 
       
   169 class CSettingsListBoxView : public CFormattedCellListBoxView
       
   170     {
       
   171     public: // from CListBoxView
       
   172         /**
       
   173         * Empty default constructor.
       
   174         */
       
   175         CSettingsListBoxView() {}
       
   176 
       
   177         /**
       
   178         * Draws all items.
       
   179         * @param aClipRect Area to draw.
       
   180         */
       
   181         IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
       
   182 
       
   183         /**
       
   184         * Draws specified item.
       
   185         * @param aItemIndex Item index to draw.
       
   186         */
       
   187         IMPORT_C void DrawItem(TInt aItemIndex) const;
       
   188 
       
   189         /**
       
   190         * @return pointer to item drawer class.
       
   191         */
       
   192         inline CSettingsListBoxItemDrawer *ItemDrawer() const;
       
   193     private: // overridden from CListBoxView
       
   194         IMPORT_C virtual TAny* Reserved_1();
       
   195     };
       
   196 
       
   197 
       
   198 inline CSettingsListBoxItemDrawer* CSettingsListBoxView::ItemDrawer() const
       
   199     { return (CSettingsListBoxItemDrawer*)iItemDrawer; }
       
   200 
       
   201 
       
   202 #endif // __EIKSLB_H__
       
   203 
       
   204 
       
   205