classicui_pub/lists_api/inc/EIKLBX.H
changeset 0 2f259fa3e83a
child 4 8ca85d2f0db7
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 1997-2009 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:  Base class for an on-screen list box control from
       
    15 *               which one or more items can be selected.
       
    16 *
       
    17 */
       
    18    
       
    19 #ifndef __EIKLBX_H__
       
    20 #define __EIKLBX_H__
       
    21 
       
    22 //  INCLUDES 
       
    23 #include <gdi.h>
       
    24 #include <eikbctrl.h>
       
    25 #include <eiklbo.h>
       
    26 #include <eiksbfrm.h>
       
    27 #include <eiklbm.h>
       
    28 #include <eiklbv.h>
       
    29 #include <gulbordr.h>
       
    30 #include <eiklbed.h>
       
    31 #include <gulutil.h>
       
    32 #include <lafpublc.h>
       
    33 
       
    34 //  FORWARD DECLARATIONS
       
    35 enum TKeyCode;
       
    36 class RIncrMatcherBase;
       
    37 class CListItemDrawer;
       
    38 class CEikScrollBarFrame;
       
    39 class CEikButtonBase;
       
    40 class CMatchBuffer;
       
    41 class CListBoxExt;
       
    42 class CEikListBox;
       
    43 
       
    44 //  CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 * Item change observer will be notified when list box items have been added or
       
    48 * removed or the list box has been reset. Observers can be added and removed by
       
    49 * using @c CEikListBox methods @c AddItemChangeObserverL() and
       
    50 * @c RemoveItemChangeObserver().
       
    51 *
       
    52 * @since 3.0
       
    53 */
       
    54 class MListBoxItemChangeObserver
       
    55     {
       
    56     public:
       
    57         /**
       
    58          * Notification and handling of a list box item change.
       
    59          *
       
    60          * @param aListBox The source list box of this message.
       
    61          */
       
    62         virtual void ListBoxItemsChanged(CEikListBox* aListBox) = 0;
       
    63     };
       
    64 
       
    65 
       
    66 /**
       
    67 * Item selection (marking) observer is used to let application control item marking
       
    68 * (in markable lists). Observers can be added and removed by using
       
    69 * @c CEikListBox methods @c AddSelectionObserverL() and
       
    70 * @c RemoveSelectionObserver().
       
    71 *
       
    72 * @since 3.2
       
    73 */
       
    74 class MListBoxSelectionObserver
       
    75     {
       
    76     public:
       
    77         /**
       
    78          * Notification of entering and leaving marking mode. Marking mode
       
    79          * is enabled by long pressing shift, ctrl or hash keys (when hash key marking is enabled).
       
    80          *
       
    81          * @param aListBox The source list box of this message.
       
    82          * @param aSelectionModeEnabled ETrue, when entering selection (marking) mode.
       
    83          */
       
    84         virtual void SelectionModeChanged(CEikListBox* aListBox, TBool aSelectionModeEnabled) = 0;
       
    85     };
       
    86 
       
    87 
       
    88 // CLASS DECLARATION
       
    89     
       
    90 /**
       
    91  * Base class for an on-screen list box control from which one or more items 
       
    92  * can be selected.
       
    93  *
       
    94  * @c CEikListBox implements the basics of a list box. It has a scroll bar 
       
    95  * frame, an item drawer, and a model, and reports events to a list box 
       
    96  * observer.
       
    97  * 
       
    98  * List boxes display a number of items within a scrolling frame; the items 
       
    99  * in a list box which are visible at one time are represented by a list 
       
   100  * box view. 
       
   101  * 
       
   102  * Writing derived classes: 
       
   103  * 
       
   104  * This class may be derived from to provide specialisations of the basic 
       
   105  * list box behaviour. It is usual when subclassing CEikListBox to also 
       
   106  * provide specialisations of CListItemDrawer and CListBoxView for 
       
   107  * representing the data of such a list box effectively
       
   108  */
       
   109 class CEikListBox : public CEikBorderedControl, public MEikScrollBarObserver
       
   110     {
       
   111 
       
   112 public:
       
   113 
       
   114     friend class CListBoxExt;
       
   115 
       
   116 public:
       
   117 
       
   118     /**
       
   119     * Construction flags.
       
   120     */
       
   121     enum TFlags
       
   122         {
       
   123         
       
   124         /**
       
   125          * Construction flag for a list box from which the user can
       
   126          * select multiple items.
       
   127          */
       
   128         EMultipleSelection          = SLafListBox::EMultipleSelection,
       
   129         
       
   130         /**
       
   131          * Construction flag for disabling extended selection. 
       
   132          * If this is set the user cannot select multiple items by
       
   133          * using @c SHIFT button.
       
   134          */
       
   135         ENoExtendedSelection        = SLafListBox::ENoExtendedSelection,
       
   136         
       
   137         /**
       
   138          * Construction flag that sets the list box to match user?s keystrokes 
       
   139          * incrementally.
       
   140          */
       
   141         EIncrementalMatching        = SLafListBox::EIncrementalMatching,
       
   142         
       
   143         /**
       
   144          * Construction flag for setting the list box as a pop-out list box. 
       
   145          * Pop-out list boxes handle certain keystrokes and events differently.
       
   146          */
       
   147         EPopout                     = SLafListBox::EPopout,
       
   148 
       
   149         /**
       
   150          * Construction flag that enables the indication of pointer press 
       
   151          * inside the view of the list box.
       
   152          */
       
   153         ELeftDownInViewRect         = SLafListBox::ELeftDownInViewRect,
       
   154         
       
   155         /**
       
   156          * Construction flag for enabling @c CEiklist box item double click 
       
   157          * indication.
       
   158          */
       
   159         EItemDoubleClicked          = SLafListBox::EItemDoubleClicked,
       
   160                 
       
   161         /**
       
   162          * Construction flag for removing the ownership of the supplied list box
       
   163          * model from the @c CEikListBox so that the list box model will not be 
       
   164          * deleted with the @c CEikListBoxes destruction.
       
   165          */
       
   166         EKeepModel                  = SLafListBox::EKeepModel,
       
   167         
       
   168         /**
       
   169          * Construction flag for excluding the scroll bar.
       
   170          * If the flag is set the scroll bas is drawn ouside the window that 
       
   171          * describes the scroll bars extent.
       
   172          */
       
   173         EScrollBarSizeExcluded      = SLafListBox::EScrollBarSizeExcluded,
       
   174 
       
   175         /**
       
   176          * Construction flag for enabling @c CEikListBox change indication.
       
   177          */
       
   178         EStateChanged               = SLafListBox::EStateChanged,
       
   179 
       
   180         /**
       
   181          * Construction flag that indicates that the list box should be created 
       
   182          * to its own window.
       
   183          */
       
   184         ECreateOwnWindow            = SLafListBox::ECreateOwnWindow,
       
   185 
       
   186         /**
       
   187          * Construction flag for disabling key matching.
       
   188          */
       
   189         ENoFirstLetterMatching      = SLafListBox::ENoFirstLetterMatching,
       
   190 
       
   191         /**
       
   192          * Construction flag for enabling painting of selected items.
       
   193          */
       
   194         EPaintedSelection           = SLafListBox::EPaintedSelection ,
       
   195 
       
   196         /**
       
   197          * Construction flag for enabling loop scrolling in which the list box 
       
   198          * jumps from the last item to the first item.
       
   199          */
       
   200         ELoopScrolling = 0x1000,
       
   201 
       
   202         /**
       
   203          * Construction flag for enabling @c Avkon multiselection list.
       
   204          */
       
   205         EEnterMarks = 0x2000,       // Avkon multiselection list
       
   206 
       
   207         /**
       
   208          * Construction flag for enabling Avkon markable list which enables the 
       
   209          * marking of several items from the list. 
       
   210          */
       
   211         EShiftEnterMarks = 0x4000,  // Avkon markable list
       
   212 
       
   213         /**
       
   214          * Construction flag that combines @c EPageAtOnceScrolling and 
       
   215          * @c EDisableHighlight flags
       
   216          */
       
   217         EViewerFlag = 0x8000,       // combined the two flags to fit to WORD.
       
   218 
       
   219         /**
       
   220          * Construction flag for enabling scrolling at a page per time so that 
       
   221          * the whole list box page is scrolled to the next. 
       
   222          */
       
   223         EPageAtOnceScrolling = 0x8000, // Avkon viewers
       
   224 
       
   225         /**
       
   226          * Construction flag for disabling the highlighting of the selected item.
       
   227          */
       
   228         EDisableHighlight = 0x8000,  // Avkon viewers       
       
   229 
       
   230         /**
       
   231          * Construction flag for enabling S60 style selection of multiple items 
       
   232          * from the list box.
       
   233          */
       
   234         ES60StyleMultiselection     = SLafListBox::ES60StyleMultiselection,   
       
   235         
       
   236         /**
       
   237          * Construction flag for enabling S60 style markable items.
       
   238          */
       
   239         ES60StyleMarkable           = SLafListBox::ES60StyleMarkable,
       
   240 
       
   241         /**
       
   242          * Construction flag for disabling item specific stylus popup menu.
       
   243          */
       
   244         EDisableItemSpecificMenu    = 0x00040000
       
   245         };
       
   246     enum {KEikMaxMatchingBufferLength = 2};
       
   247 
       
   248     /** 
       
   249      * Indicates who owns the scroll bar.
       
   250      */ 
       
   251     enum TScrollBarOwnerShip
       
   252         {
       
   253         /**
       
   254          * Indicates that the scrollbar is not owned by an external class.
       
   255          */
       
   256         ENotOwnedExternally=0x0000,
       
   257         /**
       
   258          * Indicates that the scrollbar is owned by an external class.
       
   259          */
       
   260         EOwnedExternally   =0x0001
       
   261         };
       
   262 
       
   263 protected:
       
   264 
       
   265     /**
       
   266      * Used for indicating the reason why the item lost focus.
       
   267      */
       
   268     enum TReasonForFocusLost
       
   269         { 
       
   270         /**
       
   271          * Focus has been lost from the list box to an external control.
       
   272          */
       
   273         EFocusLostToExternalControl, 
       
   274         /**
       
   275          * Focus has been moved from the list box to an internal editor.
       
   276          */
       
   277         EFocusLostToInternalEditor 
       
   278         };
       
   279 
       
   280 public:
       
   281     /**
       
   282      * Destructor.
       
   283      */
       
   284     IMPORT_C ~CEikListBox();
       
   285 
       
   286     /**
       
   287      * C++ default constructor.
       
   288      */
       
   289     IMPORT_C CEikListBox();
       
   290     /**
       
   291      * Handles 2nd phase construction.
       
   292      * 
       
   293      * Sets list box model and list item drawer. Request another @c ConstructL 
       
   294      * to handle @c aParent and @c aFlags. 
       
   295      *
       
   296      * @param aListBoxModel List box model that is to be used with the list box.
       
   297      * @param aListItemDrawer List item drawer that is to be used with the 
       
   298      *        list box.
       
   299      * @param aParent Host @c CoeControl for the list box.
       
   300      * @param aFlags Construction flags (@c TFlags) for the list box.
       
   301      */
       
   302     IMPORT_C void ConstructL(MListBoxModel* aListBoxModel,
       
   303                              CListItemDrawer* aListItemDrawer,
       
   304                              const CCoeControl* aParent,
       
   305                              TInt aFlags = 0);
       
   306     
       
   307     /**
       
   308      * Handles 2nd phase construction.
       
   309      *
       
   310      *
       
   311      * Sets the border that is to be drawn outside the list box. Request another 
       
   312      * @c ConstructL to handle list box model, list item drawer, @c aParent 
       
   313      * and @c aFlags. 
       
   314      *
       
   315      * @param aListBoxModel List box model that is to be used with the list box.
       
   316      * @param aListItemDrawer List item drawer that is to be used with the 
       
   317      *        list box.
       
   318      * @param aParent Host @c CoeControl for the list box.
       
   319      * @param aBorder Border to be drawn outside the list box.
       
   320      * @param aFlags Construction flags (@c TFlags) for the list box.
       
   321      */
       
   322     IMPORT_C void ConstructL(MListBoxModel* aListBoxModel,
       
   323                              CListItemDrawer* aListItemDrawer,
       
   324                              const CCoeControl* aParent, 
       
   325                              TGulBorder aBorder, 
       
   326                              TInt aFlags = 0);
       
   327     /**
       
   328      * Informs the @c CEikListbox of a key press.
       
   329      *
       
   330      * @param aKeyEvent Details of the key event that is being handled.
       
   331      * @param aType Defines what kind of key event is being handled e.g. 
       
   332      *        @c EEventKeyUp.
       
   333      * @return @c EKeyWasConsumed if the key was handled by the method.
       
   334      *         @c EKeyWasNotConsumed if the key was not handled.
       
   335      */
       
   336     IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
       
   337                                                  TEventCode aType);
       
   338     
       
   339     /**
       
   340      * Handling of pointer event within the @c CEikListBox. 
       
   341      * Used for e.g. selecting an item from the list box.
       
   342      *
       
   343      * @param aPointerEvent Details of the pointer event that is being handled.
       
   344      */
       
   345     IMPORT_C virtual void HandlePointerEventL(
       
   346                             const TPointerEvent& aPointerEvent);
       
   347     
       
   348     /**
       
   349      * Creates an own window for the list box or draws the list box to an old 
       
   350      * window defined by the @c aContainer.
       
   351      *
       
   352      * @param aContainer Defines the container where the list box will be drawn.
       
   353      */
       
   354     IMPORT_C virtual void SetContainerWindowL(const CCoeControl& aContainer);
       
   355     
       
   356     /**
       
   357      * Checks the minimum size needed for the list box.
       
   358      *
       
   359      * @return The two dimensional minimum size for the list box.
       
   360      */
       
   361     IMPORT_C virtual TSize MinimumSize();
       
   362     
       
   363     /**
       
   364      * This function sets a flag within the control which indicates 
       
   365      * whether or not the control is dimmed (greyed out). 
       
   366      *
       
   367      * @param aDimmed @c ETrue dimmed. @c EFalse not dimmed.
       
   368      */
       
   369     IMPORT_C virtual void SetDimmed(TBool aDimmed);
       
   370 
       
   371     /**
       
   372      * Used for scrolling through the items in the list box. 
       
   373      *
       
   374      * @param aScrollBar Scroll bar for the list box.
       
   375      * @param aEventType Type of the event that occured.
       
   376      */
       
   377     IMPORT_C virtual void HandleScrollEventL(CEikScrollBar* aScrollBar, 
       
   378                                              TEikScrollEvent aEventType);
       
   379 
       
   380     // model/view access functions 
       
   381     /**
       
   382      * Gets the list box data model.
       
   383      *
       
   384      * @return Interface to the list box data model.
       
   385      */
       
   386     IMPORT_C MListBoxModel* Model() const;
       
   387 
       
   388     /**
       
   389      * Gets the list box view.
       
   390      *
       
   391      * @return Interface to the list box view.
       
   392      */
       
   393     IMPORT_C CListBoxView* View() const;
       
   394 
       
   395     // functions for accessing top/current/bottom item index
       
   396     /**
       
   397      * Gets the index number of the top item.
       
   398      *
       
   399      * @return Index number for the top item.
       
   400      */
       
   401     IMPORT_C TInt TopItemIndex() const;
       
   402     
       
   403     /**
       
   404      * Sets the selected item to be the top item.
       
   405      *
       
   406      * @param aItemIndex Index for the item to be set as the top item.
       
   407      */
       
   408     IMPORT_C virtual void SetTopItemIndex(TInt aItemIndex) const;
       
   409     
       
   410     /**
       
   411      * Gets for the bottom items index.
       
   412      *
       
   413      * @return Index for the bottom item.
       
   414      */
       
   415     IMPORT_C TInt BottomItemIndex() const;
       
   416     
       
   417     /**
       
   418      * Gets the index number of the selected item.
       
   419      *
       
   420      * @return Index of the selected item.
       
   421      */
       
   422     IMPORT_C TInt CurrentItemIndex() const;   
       
   423     
       
   424     /**
       
   425      * Changes the current item index to the selected item index. Does not
       
   426      * redraw the list. If the item was not previously visible it is set to the 
       
   427      * top item in the view.
       
   428      *
       
   429      * @param aItemIndex Defines the index of the selected item.
       
   430      */
       
   431     IMPORT_C void SetCurrentItemIndex(TInt aItemIndex) const;
       
   432     
       
   433     /**
       
   434      * Changes the current item index to the selected item index and 
       
   435      * redraws the view.
       
   436      *
       
   437      * @param aItemIndex Defines the index of the selected item.
       
   438      */
       
   439     IMPORT_C void SetCurrentItemIndexAndDraw(TInt aItemIndex) const;
       
   440 
       
   441     // functions for dealing with the selection state
       
   442     /**
       
   443      * Gets for list boxes selection indexes.
       
   444      *
       
   445      * @return Pointer to the list boxes in array of selection indexes.
       
   446      */
       
   447     IMPORT_C const CListBoxView::CSelectionIndexArray* SelectionIndexes() const;
       
   448     
       
   449     /**
       
   450      * Assigns a array of selection indexes for the list box.
       
   451      *
       
   452      * @param aArrayOfSelectionIndexes The index array that is to be assigned 
       
   453      *        to the list Box.
       
   454      */
       
   455     IMPORT_C void SetSelectionIndexesL(
       
   456                 CListBoxView::CSelectionIndexArray* aArrayOfSelectionIndexes);
       
   457     
       
   458     /**
       
   459      * Clears the selection from the view.
       
   460      */
       
   461     IMPORT_C void ClearSelection(); 
       
   462 
       
   463     // Functions for updating a list box's internal state after its model has
       
   464     // been updated, all of them will emit item change event to item change
       
   465     // observers.
       
   466     /**
       
   467      * Handles the addition of item to the list box.
       
   468      */
       
   469     IMPORT_C void HandleItemAdditionL();
       
   470     
       
   471     /**
       
   472      * Handles the removal of an item from the list box.
       
   473      */
       
   474     IMPORT_C void HandleItemRemovalL();
       
   475 
       
   476     /**
       
   477      * Handles the addition of new items to the list box and updates 
       
   478      * selection indexes array.
       
   479      *
       
   480      * NOTE. This algorithm can not handle position of the list highlight
       
   481      * nor can it update the top item index correctly.
       
   482      *
       
   483      * @param aArrayOfNewIndexesAfterAddition Array of new indexes to be added.
       
   484      */
       
   485     IMPORT_C void HandleItemAdditionL(
       
   486                     CArrayFix<TInt> &aArrayOfNewIndexesAfterAddition);
       
   487     
       
   488     /**
       
   489      * Handles the removal of items to the list box and updates 
       
   490      * selection indexes array.
       
   491      *
       
   492      * NOTE. This algorithm cannot handle position of the list highlight
       
   493      * nor can it update the top item index correctly.
       
   494      *
       
   495      * @param aArrayOfOldIndexesBeforeRemoval Array of indexes to be removed.
       
   496      */
       
   497     IMPORT_C void HandleItemRemovalL(
       
   498                     CArrayFix<TInt> &aArrayOfOldIndexesBeforeRemoval);
       
   499     
       
   500     /**
       
   501      * Deletes the item editor
       
   502      */
       
   503     IMPORT_C void Reset();
       
   504 
       
   505     /**
       
   506     * Adds an item change observer to the listbox. Duplicates are not checked
       
   507     * (i.e. adding the same observer multiple times is not prevented).
       
   508     *
       
   509     * @since 3.0
       
   510     * @param aObserver Must be non-NULL.
       
   511     */
       
   512     IMPORT_C void AddItemChangeObserverL( MListBoxItemChangeObserver* aObserver );
       
   513     /**
       
   514     * Removes an item change observer from the listbox.
       
   515     *
       
   516     * @since 3.0
       
   517     * @param aObserver The observer to be removed.
       
   518     * @return ETrue if removal ok, EFalse if observer was not removed (not
       
   519     *         found from the list of observers).
       
   520     */
       
   521     IMPORT_C TBool RemoveItemChangeObserver( MListBoxItemChangeObserver* aObserver );
       
   522 
       
   523     // functions for accessing the item height
       
   524     /**
       
   525      * Sets the height of the item to the selected value.
       
   526      * 
       
   527      * @param aHeight New height for the item.
       
   528      */
       
   529     IMPORT_C virtual void SetItemHeightL(TInt aHeight);
       
   530     
       
   531     /**
       
   532      * Gets height of the item.
       
   533      *
       
   534      * @return Height of the item.
       
   535      */
       
   536     IMPORT_C TInt ItemHeight() const;
       
   537 
       
   538     // functions for scrollbars
       
   539     /**
       
   540      * Creates a scrollbar frame.
       
   541      *
       
   542      * @param  aPreAlloc Boolean defining if there should be initial 
       
   543      *         memory allocations.
       
   544      * @return The new scroll bar frame.
       
   545      */
       
   546     IMPORT_C CEikScrollBarFrame* CreateScrollBarFrameL(TBool aPreAlloc=EFalse);
       
   547 
       
   548     /**
       
   549      * Sets the given scroll bar frame for the list box with the given 
       
   550      * ownership leve.
       
   551      *
       
   552      * @param aScrollBarFrame The new frame that is going to be used.
       
   553      * @param aOwnerShip Ownership level of the scroll bar frame.
       
   554      */
       
   555     IMPORT_C void SetScrollBarFrame(CEikScrollBarFrame* aScrollBarFrame, TScrollBarOwnerShip aOwnerShip);
       
   556 
       
   557     /**
       
   558      * Gets pointer for the scroll bar frame.
       
   559      *
       
   560      * @return Pointer to the scroll bar frame.
       
   561      */
       
   562     IMPORT_C CEikScrollBarFrame* const ScrollBarFrame();
       
   563 
       
   564     /**
       
   565      * Updates all scroll bars.
       
   566      */
       
   567     IMPORT_C virtual void UpdateScrollBarsL();
       
   568 
       
   569     // construction support functions
       
   570     /**
       
   571      * Gets the size of the rectangle required to display a pop out.
       
   572      * 
       
   573      * @param aTargetItemIndex The item from which the popout originates.
       
   574      * @param aTargetYPos Vertical position of the item from which the popout 
       
   575      *        originates.
       
   576      * @param aListBoxRect The list box rectangle.
       
   577      * @param aMinHeightInNumOfItems The minimum number of items for the popout.
       
   578      */
       
   579     IMPORT_C void CalculatePopoutRect( TInt aTargetItemIndex,
       
   580                                        TInt aTargetYPos,
       
   581                                        TRect& aListBoxRect,
       
   582                                        TInt aMinHeightInNumOfItems = 1 );
       
   583     /**
       
   584      * Gets the size of the list box in pixels based on the height of 
       
   585      * the list box in items and the length of the items in characters.
       
   586      *
       
   587      * Returns @c TSize element consisting of two elements, the height 
       
   588      * and the width. Height is the number of items times the height 
       
   589      * of the font in pixels. Width is the number of characters in a 
       
   590      * single line times the width of the font in pixels. 
       
   591      *
       
   592      * @param aWidthAsNumOfChars Width of list box in characters.
       
   593      * @param aHeightAsNumOfItems Height of list box in characters.
       
   594      * @return The size of the list box in pixels as TSize.
       
   595      */
       
   596     IMPORT_C TSize CalcSizeInPixels(TInt aWidthAsNumOfChars, 
       
   597                                     TInt aHeightAsNumOfItems) const;
       
   598 
       
   599     /**
       
   600      * Gets the width of the list box in pixels based on the width of the list 
       
   601      * box in characters.
       
   602      *
       
   603      * Returns the number of characters times the width of a character 
       
   604      * in pixels. 
       
   605      *
       
   606      * @param aNumOfChars The number of characters.
       
   607      * @return The width of the list box in pixels.
       
   608      */
       
   609     IMPORT_C TInt CalcWidthBasedOnNumOfChars(TInt aNumOfChars) const;
       
   610     
       
   611     /**
       
   612      * Gets the height of the list box in pixels based on the width of the 
       
   613      * list box in characters.
       
   614      *
       
   615      * Returns the number of items times the height of the font in pixels.
       
   616      *
       
   617      * @param aNumOfItems The number of items.
       
   618      * @return The height of the list box in pixels.
       
   619      */
       
   620     IMPORT_C TInt CalcHeightBasedOnNumOfItems(TInt aNumOfItems) const;
       
   621     
       
   622     /**
       
   623      * Gets the width of the list box in pixels based on the width of the 
       
   624      * list box text in pixels.
       
   625      *
       
   626      * returns the width of the whole list box in pixels, which includes 
       
   627      * the text width and the width of elements in the list box that have
       
   628      * an effect on the overall width.
       
   629      *
       
   630      * @param aTextWidthInPixels Width of list box text in pixels.
       
   631      * @return Required width of whole list box in pixels.
       
   632      */
       
   633     IMPORT_C TInt CalcWidthBasedOnRequiredItemWidth(
       
   634                                 TInt aTextWidthInPixels) const;
       
   635 
       
   636     // drawing/scrolling functions
       
   637     /**
       
   638      * Draws a list box item, first scrolling the list to make it visible 
       
   639      * if it is not already. 
       
   640      *
       
   641      * @c DrawItem() panics if there is no list box view currently set.
       
   642      * @param aItemIndex Index of the item to reveal.
       
   643      */
       
   644     IMPORT_C void DrawItem(TInt aItemIndex) const;
       
   645 
       
   646     /**
       
   647      * Makes an item visible in the list, scrolling it if necessary.
       
   648      *
       
   649      * @param aItemIndex Index of the item to reveal.
       
   650      */
       
   651     IMPORT_C void ScrollToMakeItemVisible(TInt aItemIndex) const;
       
   652 
       
   653     /**
       
   654     * Redraws list item.
       
   655     * @param aItemIndex index of item to be redrawn.
       
   656     * @since 3.2
       
   657     */
       
   658     IMPORT_C void RedrawItem( TInt aItemIndex );
       
   659 
       
   660     // observer support
       
   661     /**
       
   662      * Sets the observer for the list box.
       
   663      *
       
   664      * @param aObserver Wanted observer for the list box.
       
   665      */
       
   666     IMPORT_C void SetListBoxObserver(MEikListBoxObserver* aObserver);
       
   667 
       
   668     
       
   669     /**
       
   670      * Gets the size of the vertical gap between items. This space is used 
       
   671      * by the view to allow a box to be drawn around each item.
       
   672      *
       
   673      * @return Size of the vertical gap in pixels.
       
   674      */
       
   675     IMPORT_C TInt VerticalInterItemGap() const;
       
   676 
       
   677     // popouts only
       
   678     /**
       
   679      * Provides a call back mechanism to the button which just launched a 
       
   680      * popout menu.
       
   681      *
       
   682      * @param aButton The button which just launched a popout menu.
       
   683      */
       
   684     IMPORT_C void SetLaunchingButton(CEikButtonBase* aButton);
       
   685 
       
   686     // Editing support
       
   687     /**
       
   688      * Selects an item editor for the list box.
       
   689      *
       
   690      * @param aEditor The editor that has been selected for usage.
       
   691      */
       
   692     IMPORT_C void SetItemEditor(MEikListBoxEditor* aEditor);
       
   693     
       
   694     /**
       
   695      * Resets the list boxes item editor.
       
   696      */
       
   697     IMPORT_C void ResetItemEditor();
       
   698     /**
       
   699      * Gets item editor for the current class.
       
   700      *
       
   701      * @return The item editor used by the list box class.
       
   702      */
       
   703     IMPORT_C MEikListBoxEditor* ItemEditor();
       
   704     
       
   705     /**
       
   706      * Creates an item editor and starts editing the current item.
       
   707      *
       
   708      * The editor can edit the current item up to a maximum length of 
       
   709      * @c aMaxLength characters. Also reports an @c EEventEditingStarted event 
       
   710      * to any list box observer by default.
       
   711      *
       
   712      * The function only creates a new editor if one does not already exist.
       
   713      *
       
   714      * @param aMaxLength Maximum length of characters to edit.
       
   715      */
       
   716     IMPORT_C virtual void EditItemL(TInt aMaxLength);
       
   717     
       
   718     /**
       
   719      * Stops editing and deletes the item editor. 
       
   720      *
       
   721      * The function reports an @c EEventEditingStopped event to any list box 
       
   722      * observer, and updates the list box model if @c aUpdateModel is @c ETrue.
       
   723      *
       
   724      * @param aUpdateModel If @c ETrue the list box model is updated.
       
   725      */
       
   726     IMPORT_C void StopEditingL(TBool aUpdateModel);
       
   727 
       
   728     // functions needed for Avkon shortcuts, 
       
   729     // passing information from one list to another
       
   730 
       
   731     /**
       
   732      * No Implementation.
       
   733      *
       
   734      * @return Always returns 0.
       
   735      */
       
   736     IMPORT_C virtual TInt ShortcutValueForNextList();
       
   737     
       
   738     /**
       
   739      * No Implementation.
       
   740      *
       
   741      * @param aValue Not Used.
       
   742      */
       
   743     IMPORT_C virtual void SetShortcutValueFromPrevList(TInt aValue);
       
   744 
       
   745     // pop-up positioning support
       
   746     /**
       
   747      * Gets the position and the size of the list box.
       
   748      *
       
   749      * @return A rectangle with the correct position data as 
       
   750      *         well as size data for the list box.
       
   751      */
       
   752     IMPORT_C TRect HighlightRect() const;
       
   753     
       
   754     /**
       
   755      * Checks whether background drawing is suppressed on item level i.e. each
       
   756 	 *  list item doesn't draw its background.
       
   757 	 *
       
   758 	 * @since S60 5.0
       
   759 	 * @return ETrue if background drawing is suppressed.
       
   760      */
       
   761      IMPORT_C TBool BackgroundDrawingSuppressed() const;
       
   762 
       
   763 public: // from CCoeControl
       
   764 
       
   765     /**
       
   766      * From @c CCoeControl
       
   767      *
       
   768      * Gets the list of logical colours employed in the drawing of the control, 
       
   769      * paired with an explanation of how they are used. Appends the list to 
       
   770      * @c aColorUseList.
       
   771      *
       
   772      * @param aColorUseList List of logical colours.
       
   773      */
       
   774     IMPORT_C virtual void GetColorUseListL(
       
   775                         CArrayFix<TCoeColorUse>& aColorUseList) const; 
       
   776                         // not available before Release 005u
       
   777     
       
   778     /**
       
   779      * From @c CCoeControl
       
   780      *
       
   781      * Handles a change to the list box?s resources of type @c aType which are 
       
   782      * shared across the environment, colours or fonts for example.
       
   783      *
       
   784      * @param aType The type of resources that have changed.
       
   785      */
       
   786     IMPORT_C virtual void HandleResourceChange(TInt aType);         
       
   787                 // not available before Release 005u
       
   788     
       
   789     /**
       
   790      * From @c CCoeControl
       
   791      *
       
   792      * Sets the control as ready to be drawn.
       
   793      *
       
   794      * The application should call this function on all controls that are not 
       
   795      * components in a compound control.
       
   796      *
       
   797      * The purpose of this function is that controls are not always ready to 
       
   798      * be drawn as soon as they have been constructed. For example, it may 
       
   799      * not be possible to set the control's extent during construction, but 
       
   800      * its extent should always be set before it is drawn. Similarly, if a 
       
   801      * control is to be made  invisible, this should be done before it is 
       
   802      * activated.
       
   803      * 
       
   804      * The default implementation sets a flag in the control to indicate it is 
       
   805      * ready to be drawn. If the control is a compound control, the default 
       
   806      * implementation also calls @c ActivateL() for all the control's components. 
       
   807      * To get the control's components it uses @c CountComponentControls() and 
       
   808      * @c ComponentControl(), which should be implemented by the compound control.
       
   809      * 
       
   810      * @c ActivateL() is typically called from the control's @c ConstructL() 
       
   811      * function.
       
   812      *
       
   813      * Notes:
       
   814      *
       
   815      * This function can be overridden. This is useful for doing late 
       
   816      * initialisation of the control, using information that was not available 
       
   817      * at the time the control was created. For example, a text editor might 
       
   818      * override @c ActivateL() and use it to enquire whether it is focused: if 
       
   819      * it is, it makes the cursor and any highlighting visible. At the time when 
       
   820      * the editor is created, it doesn't know whether or not it has keyboard 
       
   821      * focus.
       
   822      *
       
   823      * If overriding @c ActivateL(), the implementation must include a base 
       
   824      * call to @c CCoeControl's @c ActivateL(). 
       
   825      */
       
   826     IMPORT_C virtual void ActivateL();
       
   827     
       
   828     /**
       
   829      * From @c CCoeControl.
       
   830      *
       
   831      * Gets the input capabilities of the control and all its components.
       
   832      *
       
   833      * @return The input capabilities of the control.
       
   834      */
       
   835     IMPORT_C TCoeInputCapabilities InputCapabilities() const;
       
   836 
       
   837 private:
       
   838     /**
       
   839     * From CAknControl
       
   840     */
       
   841     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   842 
       
   843 protected:
       
   844     // Shortcuts need access to Incremental matching
       
   845     // The shortcuts will be used inside OfferkeyEventL().
       
   846     friend class AknListBoxShortCutsImplementation;
       
   847     // Avkon layout uses SetVerticalMargin, which is protected.
       
   848     friend class AknListBoxLayouts;
       
   849 
       
   850     /**
       
   851      * Responds to a change in focus.
       
   852      *
       
   853      * This is called whenever the control gains or loses focus, 
       
   854      * as a result of a call to @c SetFocus(). A typical use of 
       
   855      * @c FocusChanged() is to change the appearance of the control, 
       
   856      * for example by drawing a focus rectangle around it.
       
   857      *
       
   858      * The default implementation is empty, and should be 
       
   859      * overridden by the @c CCoeControl-derived class.
       
   860      *
       
   861      * @param aDrawNow Contains the value that was passed to it 
       
   862      *        by @c SetFocus().
       
   863      */
       
   864     IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
       
   865     
       
   866     /**
       
   867      * Responds to changes to the size and position of the contents 
       
   868      * of this control.
       
   869      * 
       
   870      * For a simple control this might include text or graphics. 
       
   871      * For a compound control it sets the size and position of the 
       
   872      * components. It has an empty default implementation and should 
       
   873      * be implemented by the CCoeControl-derived class.
       
   874      *
       
   875      * The function is called whenever @c SetExtent(), @c SetSize(), 
       
   876      * @c SetRect(), @c SetCornerAndSize(), or @c SetExtentToWholeScreen() 
       
   877      * are called on the control. Note that the window server does not 
       
   878      * generate size-changed events: @c SizeChanged() gets called only as 
       
   879      * a result of calling the functions listed above. Therefore, if a 
       
   880      * resize of one control affects the size of other controls, it is 
       
   881      * up to the application to ensure that it handles the re-sizing 
       
   882      * of all affected controls. 
       
   883      */
       
   884     IMPORT_C virtual void SizeChanged();
       
   885 
       
   886     /**
       
   887      * Handles the change in case that the size of the view rectangle
       
   888      * for the list box changes.
       
   889      */
       
   890     IMPORT_C virtual void HandleViewRectSizeChangeL();
       
   891     
       
   892     /**
       
   893      * Gets the number of controls contained in a compound control.
       
   894      *
       
   895      * There are two ways to implement a compound control. One way is to
       
   896      * override this function. The other way is to use the @c CCoeControlArray
       
   897      * functionality (see the @c InitComponentArrayL method).
       
   898      *
       
   899      * @return The number of component controls contained by this control.
       
   900      */
       
   901     IMPORT_C virtual TInt CountComponentControls() const;
       
   902     
       
   903     /**
       
   904      * Gets an indexed component of a compound control.
       
   905      *
       
   906      * There are two ways to implement a compound control. One way is to 
       
   907      * override this function. The other way is to use the @c CCoeControlArray 
       
   908      * functionality (see the @c InitComponentArrayL method).
       
   909      *
       
   910      * Note: Within a compound control each component control is identified 
       
   911      * by an index, where the index depends on the order the controls were 
       
   912      * added: the first is given an index of 0, the next an index of 1, and
       
   913      * so on.
       
   914      *
       
   915      * @param aIndex The index of the control. 
       
   916      * @return The component control with an index of aIndex. 
       
   917      */
       
   918     IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
       
   919 
       
   920     // functions that implement first letter and incremental matching
       
   921     /**
       
   922      * Creates a buffer for checking how well two strings match up.
       
   923      */
       
   924     IMPORT_C void CreateMatchBufferL();  
       
   925 
       
   926     /**
       
   927      * Empties the match buffer .
       
   928      */
       
   929     IMPORT_C void ClearMatchBuffer() const;
       
   930 
       
   931     /**
       
   932      * Checks matching for the given character.
       
   933      *
       
   934      * @param aCode Character code.
       
   935      */
       
   936     IMPORT_C void MatchTypedCharL(TUint aCode);
       
   937 
       
   938     /**
       
   939      * Undoes changes from the match buffer that have been caused 
       
   940      * by the last match with a character.
       
   941      */
       
   942     IMPORT_C void UndoLastChar();
       
   943     /**
       
   944      * Checks if the last character matched with the string.
       
   945      *
       
   946      * @return @c ETrue if a match was found from the buffer with the character.
       
   947      */
       
   948     IMPORT_C TBool LastCharMatched() const;
       
   949 
       
   950     // functions needed for supporting scrollbars
       
   951     /**
       
   952      * Updates the position of this list box?s scroll bars? thumbs to reflect 
       
   953      * the horizontal and vertical position of the list view within the list.
       
   954      */
       
   955     IMPORT_C virtual void UpdateScrollBarThumbs() const;
       
   956     
       
   957     /**
       
   958      * Get horizontal scroll granularity in pixels.
       
   959      * The granularity is the minimum size of a horizontal move of the client 
       
   960      * area.
       
   961      *
       
   962      * @return Grain size for horizontal scrolling in pixels.
       
   963      */
       
   964     IMPORT_C virtual TInt HorizScrollGranularityInPixels() const;
       
   965     
       
   966     /**
       
   967      * Gets the number of grains to move horizontally when a nudge button is 
       
   968      * tapped. 
       
   969      * For simple list boxes, this value is a fraction of the width of the 
       
   970      * client area. 
       
   971      *
       
   972      * @return Number of grains to move left or right on each nudge
       
   973      */
       
   974     IMPORT_C virtual TInt HorizontalNudgeValue() const;
       
   975     
       
   976     /**
       
   977      * Called by various functions of this class to ensure that the top 
       
   978      * item index is always a sane value. The implementation in @c CEikListBox 
       
   979      * tries to ensure the minimum amount of white space at the bottom of 
       
   980      * the list box. Note that this function does not affect the 
       
   981      * current item index.
       
   982      */
       
   983     IMPORT_C virtual void AdjustTopItemIndex() const;
       
   984 
       
   985     // navigation support functions
       
   986     /**
       
   987      * Simulates an arrow key event. 
       
   988      * 
       
   989      * If the list box flags include @c EMultipleSelection, this has the effect 
       
   990      * of pressing @c SHIFT with the arrow key represented by @c aKeyCode. 
       
   991      * Calls @c CEikListBox::OfferKeyEventL() with aKeyCode translated into a 
       
   992      * key event.
       
   993      *
       
   994      * @param aKeyCode A key code.
       
   995      */
       
   996     IMPORT_C void SimulateArrowKeyEventL(TKeyCode aKeyCode);
       
   997     
       
   998     /**
       
   999      * Handles a left arrow key event.
       
  1000      *
       
  1001      * The method used to handle the event depends on the selection mode, e.g. 
       
  1002      * whether the user has pressed the @c SHIFT or @c CONTROL key. 
       
  1003      *
       
  1004      * @param aSelectionMode Not used
       
  1005      */
       
  1006     IMPORT_C virtual void HandleLeftArrowKeyL(CListBoxView::TSelectionMode aSelectionMode);
       
  1007     
       
  1008     /**
       
  1009      * Handles a right arrow key event.
       
  1010      *
       
  1011      * The method used to handle the event depends on the selection mode, 
       
  1012      * e.g. whether the user has pressed the @c SHIFT or @c CONTROL key. 
       
  1013      *
       
  1014      * @param aSelectionMode Not used.
       
  1015      */
       
  1016     IMPORT_C virtual void HandleRightArrowKeyL(CListBoxView::TSelectionMode aSelectionMode);
       
  1017 
       
  1018     // construction support functions
       
  1019     /**
       
  1020      * Restores the list box properties shared by all subclasses from a resource
       
  1021      * reader. This function is not called within @c CEikListBox itself, but is 
       
  1022      * used by subclasses which support construction from resources.
       
  1023      *
       
  1024      * @param aReader A resource reader.
       
  1025      */
       
  1026     IMPORT_C void RestoreCommonListBoxPropertiesL(TResourceReader& aReader); 
       
  1027 
       
  1028     /**
       
  1029      * Second-phase constructor.
       
  1030      *
       
  1031      * This protected form is overridden non-virtually by the second-phase 
       
  1032      * constructors of each subclass, and should be invoked by them using 
       
  1033      * @c CEikListBox::ConstructL().
       
  1034      *
       
  1035      * @param aParent The parent control. May be NULL. 
       
  1036      * @param aFlags Construction flags. 
       
  1037      */
       
  1038     IMPORT_C virtual void ConstructL(const CCoeControl* aParent, TInt aFlags = 0);
       
  1039     
       
  1040     /**
       
  1041      * Completes the list box view?s construction.
       
  1042      *
       
  1043      * This function is called by @c ConstructL() to complete construction 
       
  1044      * of the resource view, calling its @c ConstructL() with appropriate 
       
  1045      * arguments and assigning it to @c iView. Also prepares the view for use.
       
  1046      */
       
  1047     IMPORT_C virtual void CreateViewL();
       
  1048     
       
  1049     /**
       
  1050      * Creates the list box view.
       
  1051      *
       
  1052      * The function is called by @c ConstructL() to create an instance of 
       
  1053      * the appropriate list box view class for this list box. The returned 
       
  1054      * instance is owned by this object, and does not have to have its 
       
  1055      * second-phase constructor run. This function is called by @c CreateViewL().
       
  1056      *
       
  1057      * @return Pointer to a newly constructed list box view for this object.
       
  1058      */
       
  1059     IMPORT_C virtual CListBoxView* MakeViewClassInstanceL();
       
  1060     
       
  1061     /**
       
  1062      * Sets the view rectangle from the client rectangle making sure a whole 
       
  1063      * number of items is displayed.
       
  1064      * 
       
  1065      * @param aClientRect  The client rectangle
       
  1066      */
       
  1067     IMPORT_C void SetViewRectFromClientRect(const TRect& aClientRect);
       
  1068     
       
  1069     /**
       
  1070      * Calculates the client area.
       
  1071      *
       
  1072      * This method is called by various functions of this class to 
       
  1073      * recalculate the extent of the client area from @c iViewRect. This
       
  1074      * implementation takes into account any rounding of the viewing 
       
  1075      * rectangle made to fit a whole number of items.
       
  1076      *
       
  1077      * @param aClientRect On return contains a size for the client area 
       
  1078      *        in pixels.
       
  1079      */
       
  1080     IMPORT_C virtual void RestoreClientRectFromViewRect( TRect& aClientRect) const;
       
  1081 
       
  1082     /**
       
  1083      * Rounds down the height of the rectangle (if necessary) so that 
       
  1084      * only a whole number of items can be displayed inside the list box.
       
  1085      *
       
  1086      * @param aRect The rectangle to be modified. 
       
  1087      * @return The number of pixels reduced. 
       
  1088      */
       
  1089     IMPORT_C virtual TInt AdjustRectHeightToWholeNumberOfItems( TRect& aRect) const;
       
  1090 
       
  1091     // accessor for Laf members
       
  1092     /**
       
  1093      * Gets list box margins.
       
  1094      *
       
  1095      * @return The list box margins in pixels.
       
  1096      */
       
  1097     IMPORT_C TMargins8 ListBoxMargins() const;
       
  1098 
       
  1099     // various accessors for private data members
       
  1100     /**
       
  1101      * This function gets the horizontal margin. Use 
       
  1102      * @c CEikListBox::ListBoxMargins() instead, as this 
       
  1103      * provides a more accurate value due to the bit shifting involved.
       
  1104      *
       
  1105      * @deprecated Use @c CEikListBox::ListBoxMargins()
       
  1106      * @return The horizontal margin in pixels.
       
  1107      */
       
  1108     IMPORT_C TInt HorizontalMargin() const;
       
  1109     
       
  1110     /**
       
  1111      * This function gets the vertical margin. This function 
       
  1112      * is deprecated, use @c CEikListBox::ListBoxMargins() instead, 
       
  1113      * this provides a more accurate value due to the bit 
       
  1114      * shifting involved.
       
  1115      *
       
  1116      * @deprecated Use @c CEikListBox::ListBoxMargins()
       
  1117      * @return The vertical margin in pixels.
       
  1118      */
       
  1119     IMPORT_C TInt VerticalMargin() const;
       
  1120     
       
  1121     /**
       
  1122      * Sets the horizontal margin.
       
  1123      *
       
  1124      * @param aMargin The required horizontal margin.
       
  1125      */
       
  1126     IMPORT_C void SetHorizontalMargin(TInt aMargin);
       
  1127     
       
  1128     /**
       
  1129      * Sets the vertical margin.
       
  1130      *
       
  1131      * @param aMargin The required vertical margin.
       
  1132      */
       
  1133     IMPORT_C void SetVerticalMargin(TInt aMargin);
       
  1134     
       
  1135     /**
       
  1136      * Gets a pointer to the match buffer. Returns 
       
  1137      * NULL if the match buffer does not exist.
       
  1138      *
       
  1139      * @return Pointer to the match buffer.
       
  1140      */
       
  1141     IMPORT_C RIncrMatcherBase* MatchBuffer() const;
       
  1142     
       
  1143     /**
       
  1144      * Gets the view rectangle height adjustment. 
       
  1145      *
       
  1146      * These are the adjustments that were made to the 
       
  1147      * view rectangle when the @c SetViewRectFromClientRect() 
       
  1148      * function was called.
       
  1149      *
       
  1150      * @return Height adjustment.
       
  1151      */
       
  1152     IMPORT_C TInt ViewRectHeightAdjustment() const;
       
  1153     
       
  1154     /**
       
  1155      * Gets the background colour.
       
  1156      *
       
  1157      * @return The background colour.
       
  1158      */
       
  1159     IMPORT_C TRgb BackColor() const;
       
  1160     
       
  1161     /**
       
  1162      * Sets the view rectangle height adjustment. 
       
  1163      *
       
  1164      * @param aAdjustment New adjustment.
       
  1165      */
       
  1166     IMPORT_C void SetViewRectHeightAdjustment(TInt aAdjustment);
       
  1167 
       
  1168     // misc functions
       
  1169     
       
  1170     /**
       
  1171      * Reports a list box event to any observer of this list box. 
       
  1172      * This function returns immediately if no observer is set.
       
  1173      *
       
  1174      * @param aEvent The event to report.
       
  1175      */
       
  1176     IMPORT_C virtual void ReportListBoxEventL( MEikListBoxObserver::TListBoxEvent aEvent );
       
  1177     
       
  1178     /**
       
  1179      * Redraws the specified area of this list box into the specified rectangle.
       
  1180      *
       
  1181      * @param aRect Rectangle to be redrawn. Specified relative to the 
       
  1182      *        origin of this control.
       
  1183      */
       
  1184     IMPORT_C virtual void Draw(const TRect& aRect) const;
       
  1185     
       
  1186     /**
       
  1187      * Clears the list box margins. The list box is redrawn only if redraws 
       
  1188      * are enabled for the list box view.
       
  1189      */
       
  1190     IMPORT_C void ClearMargins() const;
       
  1191     
       
  1192     /**
       
  1193      * Sets an item as the current item, even if it is not currently 
       
  1194      * visible. Redraws the list box to reflect the change. This 
       
  1195      * should not be called from within another Draw function.
       
  1196      * 
       
  1197      * @param aItemIndex The index of the list box item to update.
       
  1198      */
       
  1199     IMPORT_C virtual void UpdateCurrentItem(TInt aItemIndex) const;
       
  1200     
       
  1201     /**
       
  1202      * Handles drag events.
       
  1203      *
       
  1204      * This function is called by @c HandlePointerEventL() to handle pointer 
       
  1205      * drag events appropriately.
       
  1206      *
       
  1207      * @param aPointerPos The position of the @c TPointerEvent for which this 
       
  1208      *        handler is invoked.
       
  1209      */
       
  1210     IMPORT_C virtual void HandleDragEventL(TPoint aPointerPos);
       
  1211     
       
  1212     /**
       
  1213      * Tests whether an item exists.
       
  1214      *
       
  1215      * @param aItemIndex Index to test. 
       
  1216      * @return @c ETrue if the specified item exists, EFalse otherwise.
       
  1217      */
       
  1218     IMPORT_C TBool ItemExists(TInt aItemIndex) const;
       
  1219     
       
  1220     /**
       
  1221      * Draws the matcher cursor in the correct location for the current match. 
       
  1222      * If there is no match buffer, this function returns immediately; 
       
  1223      * otherwise the cursor is drawn on the current item using 
       
  1224      * @c CListBoxView::DrawMatcherCursor() after scrolling to make the current 
       
  1225      * item visible.
       
  1226      * 
       
  1227      * A list box control?s matcher cursor is an on-screen cursor which is 
       
  1228      * drawn to indicate to the user the location of the current text. Whether 
       
  1229      * the cursor is drawn is dependent on the 
       
  1230      * @c CListBoxView::TFlags::EHasMatcherCursor flag, which may be set on the 
       
  1231      * list box?s view.
       
  1232      *
       
  1233      * Note, that CListBoxView::DrawMatcherCursor() is not implemented in S60. 
       
  1234      */
       
  1235     IMPORT_C void DrawMatcherCursor() const;
       
  1236 
       
  1237     /**
       
  1238      * Gets the vertical gap between elements in the list box. 
       
  1239      *
       
  1240      * @return The vertical gap between elements in the list box.
       
  1241      */
       
  1242     IMPORT_C static TInt InterItemGap();
       
  1243 
       
  1244     /**
       
  1245      * Updates the view colours in line with the colours in effect for the 
       
  1246      * Uikon environment. Has no effect if there is no view.
       
  1247      */
       
  1248     IMPORT_C void UpdateViewColors();
       
  1249 
       
  1250     /**
       
  1251      * Updates the item drawer colours in line with the colours in effect 
       
  1252      * for the Uikon environment. Has no effect if there is no item drawer.
       
  1253      */
       
  1254     IMPORT_C void UpdateItemDrawerColors();
       
  1255 
       
  1256     /**
       
  1257      * Notifies item change observers about item change. Subclasses must call
       
  1258      * this method if they have implemented item handling functions (e.g.
       
  1259      * @c HandleItemAdditionL or @c HandleItemRemovalL).
       
  1260      *
       
  1261      * @since S60 3.0
       
  1262      */
       
  1263     IMPORT_C void FireItemChange();
       
  1264 
       
  1265 
       
  1266 protected:	// functions which deal with extension
       
  1267     /**
       
  1268      * Sets the reason for the list box?s loss of focus.
       
  1269      *
       
  1270      * This is required so the list box can determine whether 
       
  1271      * loss of focus is due to an external control or an internal component.
       
  1272      *
       
  1273      * @param aReasonForFocusLost The reason for the loss of focus.
       
  1274      */
       
  1275     IMPORT_C void SetReasonForFocusLostL( TReasonForFocusLost aReasonForFocusLost );
       
  1276 
       
  1277     /**
       
  1278      * Gets the reason for the list box?s loss of focus.
       
  1279      *
       
  1280      * @return The reason for the loss of focus.
       
  1281      */
       
  1282     IMPORT_C TReasonForFocusLost ReasonForFocusLostL();
       
  1283 
       
  1284     /**
       
  1285      * Tests whether the list box match buffer exists.
       
  1286      *
       
  1287      * @return @c ETrue if the list box match buffer exists. 
       
  1288                @c EFalse if the list box match buffer does not exist.
       
  1289      */
       
  1290     IMPORT_C TBool IsMatchBuffer() const;
       
  1291 
       
  1292     /**
       
  1293      * Checks for a list box extension. Attempts to create one if not present. 
       
  1294      *
       
  1295      * This function leaves if an extension cannot be created.
       
  1296      */
       
  1297     void CheckCreateExtensionL();
       
  1298 
       
  1299     /**
       
  1300      * Checks for a list box extension. Creates one if not present. 
       
  1301      *
       
  1302      * @return @c ETrue if a list box extension already existed or 
       
  1303      *         if there was no previous extension and a new extension 
       
  1304      *         class was created successfully. 
       
  1305      *         @c EFalse if there was no previous extension and a new one 
       
  1306      *         could not be constructed.
       
  1307      */
       
  1308     TBool CheckCreateExtension();
       
  1309 
       
  1310     /**
       
  1311      * Checks the list box match buffer exists. If a buffer does not 
       
  1312      * exist, one is created.
       
  1313      */
       
  1314     void CheckCreateBufferL();
       
  1315 
       
  1316     /**
       
  1317      * Gets the list box match buffer.
       
  1318      *
       
  1319      * @return The list box match buffer.
       
  1320      */
       
  1321     CMatchBuffer* Buffer() const;
       
  1322 
       
  1323 protected:
       
  1324     /**
       
  1325      * Creates a scroll bar frame layout according to @c aLayout.
       
  1326      *
       
  1327      * @param aLayout Defines the layout.
       
  1328      */
       
  1329     IMPORT_C void CreateScrollBarFrameLayout(TEikScrollBarFrameLayout& aLayout) const;
       
  1330     
       
  1331     /**
       
  1332      * If MiddleSoftKey is either Mark or Unmark, this method sets MSK
       
  1333      * according to the current item selection state.
       
  1334      */
       
  1335     void UpdateMarkUnmarkMSKL() const;
       
  1336 
       
  1337 public:
       
  1338     /**
       
  1339      * @return Event modifiers for the @c CEikListBox.
       
  1340      */
       
  1341     IMPORT_C TInt EventModifiers();
       
  1342 
       
  1343     /* 
       
  1344     * Returns ETrue if list has ES60StyleMultiselection flag. 
       
  1345     */
       
  1346     IMPORT_C TBool IsMultiselection();
       
  1347 
       
  1348     /**
       
  1349     * Creates a scrollbar for the listbox. The caller may choose if the scrollbar is requested 
       
  1350     * remotely via the mop chain from parent control
       
  1351     *
       
  1352     * @param	aPreAlloc Is the scrollbar created immediately or when taking in to use
       
  1353     * @param	aRemote If True, the scrollbar is obtained via mop-chain from 
       
  1354     *           parent control. If used, the listbox only sets the scrollbar 
       
  1355     *           values. The scrollbar position and size must set in the parent
       
  1356     *           control's code.
       
  1357     *
       
  1358     * @return	CEikScrollBarFrame*	pointer to scrollbar frame object
       
  1359     */	
       
  1360     IMPORT_C CEikScrollBarFrame* CreateScrollBarFrameL(TBool aPreAlloc, TBool aRemote);
       
  1361 	
       
  1362     /**
       
  1363     * Creates a scrollbar for the listbox. The caller may choose if the scrollbar is requested 
       
  1364     * remotely via the mop chain from parent control
       
  1365     *
       
  1366     * @param    aPreAlloc Is the scrollbar created immediately or when taking in to use
       
  1367     * @param    aRemote If True, the scrollbar is obtained via mop-chain from 
       
  1368     *           parent control. If used, the listbox only sets the scrollbar 
       
  1369     *           values. The scrollbar position and size must set in the parent
       
  1370     *           control's code.
       
  1371     * @param    aWindowOwning Does the created scrollbar create own window or 
       
  1372     *           is it compound control. The listbox uses a window owning 
       
  1373     *           scrollbar by default.
       
  1374     *
       
  1375     * @return    CEikScrollBarFrame*    pointer to scrollbar frame object
       
  1376     */    
       
  1377     IMPORT_C CEikScrollBarFrame* CreateScrollBarFrameL(TBool aPreAlloc, TBool aRemote, TBool aWindowOwning);
       
  1378 
       
  1379     /**
       
  1380     * By default markable listbox has middle softkey observer, which handles
       
  1381     * Mark / Unmark functionality. By this method, the caller may disable default
       
  1382     * observer.
       
  1383     *
       
  1384     * @since S60 3.1
       
  1385     *
       
  1386     * @param    aEnable If EFalse, disables default middle softkey observer
       
  1387     *           for markable lists. ETrue enables observer again.
       
  1388     */    
       
  1389     IMPORT_C void EnableMSKObserver(TBool aEnable);
       
  1390     
       
  1391     /**
       
  1392     * Called from MSK observer when shift+MSK have been pressed
       
  1393     *
       
  1394     * @Since S60 3.1
       
  1395     */
       
  1396     void DoShiftMSKMarkingL();
       
  1397 
       
  1398     /**
       
  1399     * This method is only called by CEikButtonGroupContainer when MSK observer
       
  1400     * is enabled and CEikButtonGroupContainer is deleted.
       
  1401     *
       
  1402     * @Since S60 3.1
       
  1403     */
       
  1404     void InformMSKButtonGroupDeletion();
       
  1405     
       
  1406     /**
       
  1407     * Adds a selection (item marking) observer to the listbox. Duplicates are not checked
       
  1408     * (i.e. adding the same observer multiple times is not prevented).
       
  1409     *
       
  1410     * @since 3.2
       
  1411     * @param aObserver Must be non-NULL.
       
  1412     */
       
  1413     IMPORT_C void AddSelectionObserverL( MListBoxSelectionObserver* aObserver );
       
  1414     
       
  1415     /**
       
  1416     * Removes a selection (item marking) observer from the listbox.
       
  1417     *
       
  1418     * @since 3.2
       
  1419     * @param aObserver The observer to be removed.
       
  1420     */
       
  1421     IMPORT_C void RemoveSelectionObserver( MListBoxSelectionObserver* aObserver );
       
  1422 
       
  1423     /**
       
  1424     * This switches listbox into selection mode. Basicly only changes MSK and
       
  1425     * informs selection observers about the change.
       
  1426     *
       
  1427     * @since 3.2
       
  1428     * @param aEnable ETrue when entering into selection mode, EFalse when leaving
       
  1429     */
       
  1430     void ChangeSelectionMode(TBool aEnable);
       
  1431 
       
  1432     /**
       
  1433     * Sets the number of list items that form one grid line.
       
  1434 	*
       
  1435 	* @since S60 5.0
       
  1436 	* @param aItems Number of items in one grid line.
       
  1437 	*/
       
  1438     IMPORT_C void SetItemsInSingleLine(TInt aItems);
       
  1439 	
       
  1440     /**
       
  1441     * Removes pointer event filtering for list items.
       
  1442     *
       
  1443     * When there are two pointer up events on the same item at short interval, 
       
  1444     * listbox will only get the first one and drop the second one. This method forces listbox to handle all pointer up events.
       
  1445     *
       
  1446     * @since S60 5.0
       
  1447     *
       
  1448     * @param aItemIndexes Array of item indexes to be added.
       
  1449     **/
       
  1450     IMPORT_C void SetPointerEventFilterDisabledL( const CArrayFix<TInt>& aItemIndexes );
       
  1451 
       
  1452     /**
       
  1453      * Scrolls the view by the given amount of pixels while keeping the
       
  1454      * physics parameters up-to-date.
       
  1455      * This should be called when scrolling the list box view except for
       
  1456      * when it is done by list dragging (e.g. scrolling with scroll bar).
       
  1457      *
       
  1458      * @param  aDeltaPixels  Amount of pixels to scroll the view.
       
  1459      *
       
  1460      * @since 5.0
       
  1461      */
       
  1462     IMPORT_C void HandlePhysicsScrollEventL( TInt aDeltaPixels );
       
  1463 
       
  1464     /**
       
  1465      * Disables the kinetic scrolling functionality in the list.
       
  1466      * By default the feature is enabled.
       
  1467      * 
       
  1468      * @param  aDisabled  @c ETrue to disable kinetic scrolling,
       
  1469      *                    @c EFalse otherwise.
       
  1470      *
       
  1471      * @since 5.0
       
  1472      */
       
  1473     IMPORT_C void DisableScrolling( TBool aDisabled );
       
  1474     
       
  1475     /**
       
  1476      * Checks if the kinetic scrolling is currently enabled in the list.
       
  1477      *
       
  1478      * @return @c ETrue if kinetic scrolling is enabled, @c EFalse otherwise.
       
  1479      *
       
  1480      * @since 5.0
       
  1481      */
       
  1482     IMPORT_C TBool ScrollingDisabled();
       
  1483     
       
  1484     /**
       
  1485      * Suspends transitions effects.
       
  1486      *
       
  1487      * @since S60 5.0
       
  1488      *
       
  1489      * @param aSuspend ETrue to suspend effects, EFalse to re-enable them.
       
  1490      */
       
  1491     IMPORT_C void SuspendEffects( TBool aSuspend );
       
  1492 
       
  1493     /**
       
  1494      * Disables the single click functionality in the list.
       
  1495      * By default the feature is enabled.
       
  1496      *
       
  1497      * @since S60 5.2
       
  1498      * 
       
  1499      * @param  aDisabled @c ETrue to disable single click
       
  1500      *                   @c EFalse does currently nothing
       
  1501      */
       
  1502     IMPORT_C void DisableSingleClick( TBool aDisabled );
       
  1503     
       
  1504     /**
       
  1505      * Disables item specific menu from the list. This has the same effect as
       
  1506      * construction time flag @c EAknListBoxItemSpecificMenuDisabled and
       
  1507      * calling this method also turns that flag on.
       
  1508      *
       
  1509      * @since S60 5.2
       
  1510      */
       
  1511     IMPORT_C void DisableItemSpecificMenu();
       
  1512     
       
  1513 private:
       
  1514     IMPORT_C virtual void CEikListBox_Reserved(); // listbox use only
       
  1515     void HorizontalScroll(TInt aScrollAmountInPixels);
       
  1516     void DrawItemInView(TInt aItemIndex) const;
       
  1517     void ClearMargins(CWindowGc& aGc) const;
       
  1518     TKeyResponse DoOfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
  1519     void UpdateScrollBarColors(CEikScrollBar* aScrollBar);
       
  1520     void UpdateScrollBarsColors();
       
  1521 
       
  1522     void HandleItemRemovalWithoutSelectionsL();
       
  1523 
       
  1524     /**
       
  1525      * Scrolls the view by the given amount of pixels.
       
  1526      *
       
  1527      * @param  aOffset   Amount of offset in pixels.
       
  1528      * @param  aDrawNow  Whether or not the view is be drawn.
       
  1529      *                   If @c EFalse then only the logical state is updated.
       
  1530      *
       
  1531      * @internal
       
  1532      * @since 5.0
       
  1533      */
       
  1534     void ScrollView( const TInt aOffset, TBool aDrawNow );
       
  1535     
       
  1536     /**
       
  1537      * Handles pointer events if physics are enabled.
       
  1538      *
       
  1539      * @return @c ETrue if the event was consumed by kinetic scrolling.
       
  1540      *
       
  1541      * @internal
       
  1542      * @since 5.0
       
  1543      */
       
  1544     TBool HandlePhysicsPointerEventL( const TPointerEvent& aPointerEvent );
       
  1545     
       
  1546     /**
       
  1547      * Selects an item and draws highlight to it.
       
  1548      * 
       
  1549      * @param  aItemIndex  Index of the highlighted item. 
       
  1550      * 
       
  1551      * @internal
       
  1552      * @since 5.0
       
  1553      */
       
  1554     void UpdateHighlightL( TInt aItemIndex );
       
  1555 
       
  1556 public:
       
  1557     /**
       
  1558      * Sets this control as visible or invisible.
       
  1559      * 
       
  1560      * @param aVisible ETrue to make the control visible, EFalse to make
       
  1561      *                 it invisible.
       
  1562      * @since 5.2
       
  1563      */
       
  1564     IMPORT_C virtual void MakeVisible( TBool aVisible );
       
  1565 
       
  1566 protected:
       
  1567     /** Flags for this list box  */
       
  1568     TInt iListBoxFlags;
       
  1569     
       
  1570     /** This List box's view  */
       
  1571     CListBoxView* iView;
       
  1572     
       
  1573     /** Item drawer for this list box */
       
  1574     CListItemDrawer* iItemDrawer;
       
  1575     
       
  1576     /** Data model for this list box */
       
  1577     MListBoxModel* iModel;
       
  1578     
       
  1579     /** Height of each item in the list */
       
  1580     TInt iItemHeight;   
       
  1581     
       
  1582     /** The scroll bar used by this control */
       
  1583     CEikScrollBarFrame* iSBFrame;
       
  1584     
       
  1585     /** Identifies if the scroll bar is owned by this list */
       
  1586     TScrollBarOwnerShip iSBFrameOwned;
       
  1587     
       
  1588     /** The required height of this list box expressed in 
       
  1589      * terms of a number of items.
       
  1590      */
       
  1591     TInt iRequiredHeightInNumOfItems;
       
  1592     
       
  1593     /**
       
  1594      * Defines which button launched the popout.
       
  1595      */
       
  1596     CEikButtonBase* iLaunchingButton; // only used by popouts
       
  1597     
       
  1598     /** The button which just launched a popout menu. */
       
  1599     MEikListBoxObserver* iListBoxObserver;
       
  1600 
       
  1601 private:
       
  1602 
       
  1603     TRgb iBackColor;
       
  1604 //  TInt iHorizontalMargin;
       
  1605 //  TInt iVerticalMargin;
       
  1606     TMargins8 iMargins ;
       
  1607     CListBoxExt* iListBoxExt;
       
  1608     TInt iViewRectHeightAdjustment;
       
  1609     MEikListBoxEditor* iItemEditor;
       
  1610     TBool* iLbxDestroyed;
       
  1611     TBool iLastCharMatched;
       
  1612     TInt iSpare;
       
  1613     };
       
  1614 
       
  1615 
       
  1616 
       
  1617 /**
       
  1618 * This is a list box that scrolls horizontally, displaying its items 
       
  1619 * in as many vertical columns as needed. Columns are arranged across 
       
  1620 * the control from left to right; within columns, items are arranged 
       
  1621 * from top to bottom. The flow of items or text ?snakes? across the 
       
  1622 * face of the control.
       
  1623 *
       
  1624 * This is a flexible control class that makes good use of short, wide 
       
  1625 * display areas; for instance, subclasses of @c CEikSnakingListBox could 
       
  1626 * be used for file lists or for a control panel. A standard user 
       
  1627 * subclass, @c CEikSnakingTextListBox, also exists.
       
  1628 *
       
  1629 * @since Symbian 5.0
       
  1630 */     
       
  1631 class CEikSnakingListBox : public CEikListBox  
       
  1632     {
       
  1633 public:
       
  1634     /**
       
  1635      * C++ standard constructor
       
  1636      */
       
  1637     IMPORT_C CEikSnakingListBox();
       
  1638     
       
  1639     /**
       
  1640      * Destructor
       
  1641      */
       
  1642     IMPORT_C ~CEikSnakingListBox();
       
  1643     
       
  1644     /**
       
  1645      * Creates an instance of the view class.
       
  1646      *
       
  1647      * This function is called during construction to create 
       
  1648      * (but not second-phase construct) an instance of the correct view 
       
  1649      * class for this list box control. In the case of the snaking list 
       
  1650      * box, a @c CSnakingListBoxView is returned.
       
  1651      *
       
  1652      * This function overrides @c CEikListBox::MakeViewClassInstanceL().
       
  1653      *
       
  1654      * @return The view which will be used by the list box being created
       
  1655      */
       
  1656     IMPORT_C virtual CListBoxView* MakeViewClassInstanceL();
       
  1657     
       
  1658     /**
       
  1659      * Sets the top item?s index.
       
  1660      *
       
  1661      * @param aItemIndex Index of the item to set as the top item.
       
  1662      */
       
  1663     IMPORT_C virtual void SetTopItemIndex(TInt aItemIndex) const;
       
  1664     
       
  1665     /**
       
  1666      * Gets the width of this list box?s columns. 
       
  1667      *
       
  1668      * @return Width of each column.
       
  1669      */
       
  1670     IMPORT_C TInt ColumnWidth() const;
       
  1671     
       
  1672     /**
       
  1673      * Sets the width of all columns in the list box.
       
  1674      *
       
  1675      * @param aColumnWidth New column width.
       
  1676      */
       
  1677     IMPORT_C void SetColumnWidth(TInt aColumnWidth);
       
  1678 
       
  1679 public: //from CCoeControl
       
  1680     
       
  1681     /**
       
  1682      * From @c CCoeControl.
       
  1683      *
       
  1684      * Handles pointer events. 
       
  1685      *
       
  1686      * @param aPointerEvent The pointer event.
       
  1687      */
       
  1688     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
  1689 
       
  1690 protected:
       
  1691     
       
  1692     /**
       
  1693      * Handles a change in size of the viewing rectangle.
       
  1694      *
       
  1695      * This function is called by framework functions to update the content, 
       
  1696      * view, and scroll bars of this list box after the viewing rectangle has 
       
  1697      * changed size. This implementation ensures that the current item is 
       
  1698      * visible after a resize.
       
  1699      */
       
  1700     IMPORT_C virtual void HandleViewRectSizeChangeL();
       
  1701 
       
  1702     /**
       
  1703      * Handles a left arrow key event.
       
  1704      * 
       
  1705      * Moves the cursor into the correct column and clears any matcher buffer 
       
  1706      * that may have been built up.
       
  1707      *
       
  1708      * @param aSelectionMode Not used.
       
  1709      */
       
  1710     IMPORT_C virtual void HandleLeftArrowKeyL(
       
  1711                             CListBoxView::TSelectionMode aSelectionMode);
       
  1712     
       
  1713     /**
       
  1714      * Handles a right arrow key event.
       
  1715      * 
       
  1716      * Moves the cursor into the correct column and clears any matcher buffer 
       
  1717      * that may have been built up.
       
  1718      *
       
  1719      * @param aSelectionMode Not used.
       
  1720      */
       
  1721     IMPORT_C virtual void HandleRightArrowKeyL(
       
  1722                             CListBoxView::TSelectionMode aSelectionMode);
       
  1723     
       
  1724     /**
       
  1725      * Gets the number of grains to move horizontally when a nudge button 
       
  1726      * is tapped. 
       
  1727      *
       
  1728      * For simple list boxes, this value is a fraction of the width of the
       
  1729      * client area. 
       
  1730      *
       
  1731      * @return Number of grains to move left or right on each nudge.
       
  1732      */
       
  1733     IMPORT_C virtual TInt HorizontalNudgeValue() const;
       
  1734 
       
  1735     /**
       
  1736      * Gets the granularity for horizontal scrolls. 
       
  1737      *
       
  1738      * The granularity is the minimum size of a horizontal move of the 
       
  1739      * client area.
       
  1740      *
       
  1741      * @return Grain size for horizontal scrolling in pixels.
       
  1742      */
       
  1743     IMPORT_C virtual TInt HorizScrollGranularityInPixels() const;
       
  1744 
       
  1745     /**
       
  1746      * Called by various functions of this class to ensure that the top 
       
  1747      * item index is always a sane value. The implementation in @c CEikListBox 
       
  1748      * tries to ensure the minimum amount of white space at the bottom of 
       
  1749      * the list box. Note that this function does not affect the current 
       
  1750      * item index.
       
  1751      */
       
  1752     IMPORT_C virtual void AdjustTopItemIndex() const;
       
  1753 
       
  1754     /**
       
  1755      * Handles drag events.
       
  1756      *
       
  1757      * This function is called by @c HandlePointerEventL() to handle 
       
  1758      * pointer drag events appropriately.
       
  1759      *
       
  1760      * @param aPointerPos The position of the @c TPointerEvent for which this 
       
  1761      *        handler is invoked.
       
  1762      */
       
  1763     IMPORT_C virtual void HandleDragEventL(TPoint aPointerPos);
       
  1764 
       
  1765     /**
       
  1766      * Calculates the client area.
       
  1767      *
       
  1768      * This method is called by various functions of this class to recalculate 
       
  1769      * the extent of the client area from @c iViewRect. This implementation 
       
  1770      * takes into account any rounding of the viewing rectangle made to fit a 
       
  1771      * whole number of items.
       
  1772      *
       
  1773      * @param aClientRect On return contains a size for the client area in 
       
  1774      *        pixels.
       
  1775      */
       
  1776     IMPORT_C virtual void RestoreClientRectFromViewRect(
       
  1777                                                     TRect& aClientRect) const;
       
  1778 
       
  1779     /**
       
  1780      * Rounds down the height of the rectangle (if necessary) so that only a 
       
  1781      * whole number of items can be displayed inside the list box.
       
  1782      *
       
  1783      * @param aRect The rectangle to be modified. 
       
  1784      * @return The number of pixels reduced.
       
  1785      */
       
  1786     IMPORT_C virtual TInt AdjustRectHeightToWholeNumberOfItems(
       
  1787                                                         TRect& aRect) const;
       
  1788 
       
  1789     /**
       
  1790      * Move to next or previous item according to the given parameter.
       
  1791      *
       
  1792      * @param aPoint Position which defines the moving direction.
       
  1793      */
       
  1794     IMPORT_C void MoveToNextOrPreviousItemL(TPoint aPoint);
       
  1795 
       
  1796 protected: //from CCoeControl
       
  1797 
       
  1798     /**
       
  1799      * From @c CCoeControl
       
  1800      *
       
  1801      * Updates the viewing rectangle of this control appropriately. The function
       
  1802      * updates the viewing rectangle, and invokes @c HandleViewRectSizeChangeL().
       
  1803      */
       
  1804     IMPORT_C virtual void SizeChanged();
       
  1805     
       
  1806     /**
       
  1807      * From @c CCoeControl
       
  1808      *
       
  1809      * Gets the list of logical colours employed in the drawing of the control,
       
  1810      * paired with an explanation of how they are used. Appends the list to 
       
  1811      * @c aColorUseList.
       
  1812      *
       
  1813      * @param aColorUseList List of logical colours.
       
  1814      */
       
  1815     IMPORT_C virtual void GetColorUseListL(
       
  1816                     CArrayFix<TCoeColorUse>& aColorUseList) const; 
       
  1817                     // not available before Release 005u
       
  1818     /**
       
  1819      * From @c CCoeControl.
       
  1820      *
       
  1821      * Handles a change to the list box?s resources of type @c aType which are 
       
  1822      * shared across the environment, colours or fonts for example.
       
  1823      *
       
  1824      * @param aType The type of resources that have changed.
       
  1825      */
       
  1826     IMPORT_C virtual void HandleResourceChange(TInt aType);         
       
  1827                     // not available before Release 005u
       
  1828 
       
  1829 private: // from CCoeControl
       
  1830     IMPORT_C void Reserved_1();
       
  1831     
       
  1832     IMPORT_C void Reserved_2();
       
  1833 
       
  1834 private:
       
  1835     /**
       
  1836     * From CAknControl
       
  1837     */
       
  1838     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  1839 
       
  1840 private:
       
  1841     IMPORT_C virtual void CEikListBox_Reserved(); // listbox use only
       
  1842     };
       
  1843 
       
  1844 #endif  // __EIKLBX_H__