epoc32/include/mw/aknselectionlist.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 aknselectionlist.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:  Dialogs for selection service implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __AKNSELECTIONLIST_H__
       
    20 #define __AKNSELECTIONLIST_H__
       
    21 
       
    22 #include <aknform.h>
       
    23 #include <aknview.h>
       
    24 #include <aknutils.h>
       
    25 #include <aknpopup.h>
       
    26 #include <avkon.rsg>
       
    27 
       
    28 class CAknSelectionListDialogExtension;
       
    29 class CAknMarkableListDialogExtension;
       
    30 
       
    31 /** CAknSelectionListDialog is the actual interface to the applications.
       
    32 *
       
    33 * Use this class to get a full screen list.
       
    34 *
       
    35 * This class only works in whole main pane. Do not try to use
       
    36 * this directly for other places. 
       
    37 *
       
    38 * @lib Avkon.lib
       
    39 * @since S60 v1.0
       
    40 *  
       
    41 * resource definition for this class:
       
    42 * @code
       
    43 * RESOURCE DIALOG r_res_id_for_a_dialog
       
    44 *   {
       
    45 *   flags = EAknDialogSelectionList;
       
    46 *   buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
       
    47 *   items =
       
    48 *        {
       
    49 *        DLG_LINE
       
    50 *            {
       
    51 *            type = EAknCtSingleGraphicListBox;
       
    52 *            id = ESelectionListControl;
       
    53 *            control = LISTBOX
       
    54 *                {
       
    55 *                flags = EAknListBoxSelectionList;
       
    56 *                };
       
    57 *            }
       
    58 *     // the next dlg line is optional.
       
    59  *        ,
       
    60 *        DLG_LINE
       
    61 *            {
       
    62 *             itemflags = EEikDlgItemNonFocusing;
       
    63 *            id = EFindControl;
       
    64 *            type = EAknCtSelectionListFixedFind;
       
    65 *            }
       
    66 *        };
       
    67 *   }
       
    68 * @endcode
       
    69 * The listbox type can be one of the following (defined in avkon.hrh and aknlists.h):
       
    70  @verbatim
       
    71    EAknCtSingleListBox                (See CAknSingleStyleListBox)
       
    72    EAknCtSingleNumberListBox          (See CAknSingleNumberStyleListBox)
       
    73    EAknCtSingleHeadingListBox         (See CAknSingleHeadingStyleListBox)
       
    74    EAknCtSingleGraphicListBox         (See CAknSingleGraphicStyleListBox)
       
    75    EAknCtSingleGraphicHeadingListBox  (See CAknSingleGraphicHeadingStyleListBox)
       
    76    EAknCtSingleNumberHeadingListBox   (See CAknSingleNumberHeadingStyleListBox)
       
    77    EAknCtSingleLargeListBox           (See CAknSingleLargeStyleListBox)
       
    78    EAknCtDoubleListBox                (See CAknDoubleStyleListBox)
       
    79    EAknCtDoubleNumberListBox          (See CAknDoubleNumberStyleListBox)
       
    80    EAknCtDoubleTimeListBox            (See CAknDoubleTimeStyleListBox)
       
    81    EAknCtDoubleLargeListBox           (See CAknDoubleLargeStyleListBox)
       
    82    EAknCtDoubleGraphicListBox         (See CAknDoubleGraphicStyleListBox)
       
    83  @endverbatim
       
    84 * The type field while defining find can be one of the following:
       
    85 @verbatim
       
    86 EAknCtSelectionListFixedFind
       
    87 EAknCtSelectionListPopupFind
       
    88 EAknCtSelectionListAdaptiveFind
       
    89 @endverbatim
       
    90 *
       
    91 * The menubar you give for selection list dialog should have
       
    92 * one of the following as one of its menu panes (defined in avkon.hrh):
       
    93 @verbatim
       
    94 R_AVKON_MENUPANE_SELECTION_LIST
       
    95 R_AVKON_MENUPANE_SELECTION_LIST_WITH_FIND_POPUP
       
    96 @endverbatim
       
    97 * @code
       
    98 * RESOURCE MENU_BAR r_res_id_for_a_menubar
       
    99 * {
       
   100 * titles =
       
   101 *     {
       
   102 *     MENU_TITLE { menu_pane = R_AVKON_MENUPANE_SELECTION_LIST; } 
       
   103 *     };
       
   104 * };
       
   105 * @endcode
       
   106 * C++ Usage:
       
   107 * @code
       
   108 *    TInt openedItem = 0;
       
   109 *    MDesCArray *array = ...;
       
   110 *    CAknSelectionListDialog *dialog = CAknSelectionListDialog::NewL(openedItem, array, R_RES_ID_FOR_A_MENUBAR);
       
   111 *    TInt result = dialog->ExecuteLD(R_RES_ID_FOR_A_DIALOG);
       
   112 *    if (result)
       
   113 *        {
       
   114 *        ...use openeditem here...
       
   115 *        }
       
   116 *    else
       
   117 *        {
       
   118 *        ...canceled...
       
   119 *        }
       
   120 *
       
   121 * @endcode
       
   122 * Alternatively, you can use:
       
   123 * @code
       
   124 *    TInt openedItem = 0;
       
   125 *    MDesCArray *array = ...;
       
   126 *    CAknSelectionListDialog *dialog = CAknSelectionListDialog::NewL(openedItem, array, R_RES_ID_FOR_A_MENUBAR);
       
   127 *    dialog->PrepareLC(R_RES_ID_FOR_A_DIALOG);
       
   128 *    // do some operations here, for example fill icon array 
       
   129 *    TInt result = dialog->RunLD();
       
   130 *    if (result)
       
   131 *        {
       
   132 *        ...
       
   133 *        }
       
   134 *    else
       
   135 *        {
       
   136 *        ...
       
   137 *        }
       
   138 * @endcode
       
   139 *
       
   140 * Often it is also useful to derive from CAknSelectionListDialog and implement OkToExitL(), constructors and the NewL() methods.
       
   141 * OkToExitL() implementation helps with providing navigation with other dialogs; OkToExitL() is ideal place to launch
       
   142 * new dialogs when a list item is selected. This way when backstepping, the state of the first dialog is preserved...
       
   143 *
       
   144 *
       
   145 */
       
   146 class CAknSelectionListDialog : public CAknDialog, public MEikListBoxObserver
       
   147     {
       
   148 public:
       
   149     /** CAknSelectionListDialog::NewL()
       
   150     *
       
   151     * Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.
       
   152     * 
       
   153     * @param aOpenedItem   Variable to be modified when user selects a list item.
       
   154     * @param aArray        Content of list items; A tab-separated string with texts and indexes to icon array
       
   155     * @param aMenuBarResourceId Menu items to be shown in options menu
       
   156     * @param aCommand      Callback for state changes. EAknCmdOpen command is send by listbox. Options menu commands come here too.
       
   157     * @return A pointer to created object  
       
   158     */
       
   159     IMPORT_C static CAknSelectionListDialog *NewL( TInt &aOpenedItem, MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aCommand = 0 );
       
   160 
       
   161     /** CAknSelectionListDialog::NewLC()
       
   162     *
       
   163     * Static factory constructor. Uses two phase construction and leaves created object in CleanupStack.
       
   164     * 
       
   165     * @param aOpenedItem   Variable to be modified when user selects a list item.
       
   166     * @param aArray        Content of list items; A tab-separated string with texts and indexes to icon array
       
   167     * @param aMenuBarResourceId Menu items to be shown in options menu
       
   168     * @param aCommand      Callback for state changes. EAknCmdOpen command is send by listbox. Options menu commands come here too.
       
   169     * @return A pointer to created object  
       
   170     */
       
   171     IMPORT_C static CAknSelectionListDialog *NewLC( TInt &aOpenedItem, MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aCommand = 0 );
       
   172 
       
   173     /** ConstructL()
       
   174     * Second phase constructor.
       
   175     *
       
   176     * @param aMenuTitleResourceId Menu items to be shown in options menu. Same as aMenuBarResourceId of NewL(C).
       
   177     */
       
   178     IMPORT_C void ConstructL(TInt aMenuTitleResourceId);
       
   179 
       
   180 public:
       
   181     /** CAknSelectionListDialog::TFindType
       
   182     *   Determines what kind of findbox should be used. Note, that a fixed findbox is not
       
   183     *   available with all list types.
       
   184     */
       
   185     enum TFindType
       
   186         {
       
   187          /** no findbox should be used */
       
   188         ENoFind,
       
   189         /** fixed findbox should be used */
       
   190         EFixedFind,
       
   191         /** popup findbox should be used */
       
   192         EPopupFind,
       
   193 	   /** fixed findbox with adaptive search should be used */
       
   194         EAdaptiveFind
       
   195         };
       
   196         
       
   197     /** SetupFind()
       
   198     *
       
   199     * Provides a way to enable and disable find and find popup on runtime.
       
   200     * You still need entry with id EFindControl to resource file for the find, this is only for disabling
       
   201     * existing find element.
       
   202     *
       
   203     * @param aType type of findbox to be used.
       
   204     */
       
   205     IMPORT_C void SetupFind(TFindType aType);
       
   206 
       
   207     /** IconArray()
       
   208     *
       
   209     * Icons, images and thumbnails are in this array.
       
   210     *
       
   211     * The list items are tab separated strings with fixed format. Some of the numbers
       
   212     * in the list item strings are indexes to this array.
       
   213     *
       
   214     * This array can be modified by MDesCArray::MdcaPoint() method or at construction of
       
   215     * dialog; after PrepareLC() call.
       
   216     *
       
   217     * @return pointer to iconarray of the list
       
   218     */
       
   219     IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
       
   220 
       
   221     /**   SetIconArrayL()
       
   222     *
       
   223     * Icons, images and thumbnails are in this array.
       
   224     *
       
   225     * The list items are tab separated strings with fixed format. Some of the numbers
       
   226     * in the list item strings are indexes to this array.
       
   227     *
       
   228     * This array can be modified by MDesCArray::MdcaPoint() method or at construction of
       
   229     * dialog; after PrepareLC() call.
       
   230     *
       
   231     * @param aIcons a array containing icons.
       
   232     */
       
   233     IMPORT_C void SetIconArrayL(CArrayPtr<CGulIcon>* aIcons);
       
   234 
       
   235     /**
       
   236     * From CCoeControl.     
       
   237     * Handles pointer events
       
   238     * @param aPointerEvent     The pointer event.
       
   239     */
       
   240     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   241         
       
   242 protected:
       
   243     /** CAknSelectionListDialog()
       
   244     * Default constructor.
       
   245     */
       
   246     IMPORT_C CAknSelectionListDialog( TInt &aIndex, MDesCArray *aArray, MEikCommandObserver *aCommand );
       
   247     /** ~CAknSelectionListDialog()
       
   248     * Destructor.
       
   249     */        
       
   250     IMPORT_C ~CAknSelectionListDialog();
       
   251         
       
   252 protected: // Customisation from derived classes
       
   253     /** SelectionListProcessCommandL() handles selection list and markable list
       
   254      *  default commands.
       
   255      *
       
   256      *  For markable lists, this method handles EAknCmdMark, EAknCmdUnmark, EAknMarkAll, EAknUnmarkAll
       
   257      *  defined in options menu pane R_AVKON_MENUPANE_MARKABLE_LIST.
       
   258      */
       
   259     IMPORT_C virtual void SelectionListProcessCommandL(TInt aCommand);
       
   260 
       
   261     /** IsAcceptableListBoxType(): Detection of list and grid layouts
       
   262     *
       
   263     * The CAknSelectionList only works with certain list and grid
       
   264     * layouts.
       
   265     *
       
   266     * You will get Panic() if you use your own list/grid layouts and
       
   267     * you do not have this method implemented!
       
   268     *
       
   269     * If you add new list layouts, you should implement this method to
       
   270     * publish the type of the layout using this method. This is especially
       
   271     * the case where you use CAknSelectionGrid with your own grid layout.
       
   272     * (as there are no predefined grid layouts, you need to do this
       
   273     * every time you use a selection grid)
       
   274     *
       
   275     * The following aControlTypes are already implemented and requires
       
   276     * no action:
       
   277     * @verbatim
       
   278      EAknCtSingleListBox
       
   279      EAknCtSingleNumberListBox
       
   280      EAknCtSingleHeadingListBox
       
   281      EAknCtSingleGraphicListBox
       
   282      EAknCtSingleGraphicHeadingListBox
       
   283      EAknCtSingleNumberHeadingListBox
       
   284      EAknCtSingleLargeListBox
       
   285      EAknCtDoubleListBox
       
   286      EAknCtDoubleNumberListBox
       
   287      EAknCtDoubleTimeListBox
       
   288      EAknCtDoubleLargeListBox
       
   289      EAknCtDoubleGraphicListBox
       
   290      EAknCtSettingListBox
       
   291      EAknCtSettingNumberListBox
       
   292      @endverbatim
       
   293     *
       
   294     * Any other layout requires you to inherit from CAknSelectionList
       
   295     * and implement the following methods:
       
   296     * @code
       
   297     * TBool IsAcceptableListBoxType(TInt aControlType, TBool &aIsFormattedCellList)
       
   298     *     {
       
   299     *     if (aControlType == EMyCtGridLayout)
       
   300     *         {
       
   301     *         // CAknGrid is-a formattedcelllistbox.
       
   302     *         aIsFormattedCellList = ETrue;
       
   303     *         return ETrue;
       
   304     *         }
       
   305     *     else
       
   306     *        {
       
   307     *        return EFalse;
       
   308     *        }
       
   309     *     }
       
   310     *
       
   311     * @endcode
       
   312     * See also CreateCustomControlL(). IsAcceptableListBoxType() and CreateCustomControlL() forms a pair that should
       
   313     * be implemented together.
       
   314     *
       
   315     * @param aControlType type of the control. Ignored in current default implementation.
       
   316     * @param aIsFormattedCellList returns whetehr list is a formatted cell listbox or a column listbox.
       
   317     * Ignored in current default implementation. In derived implementations this must be set according to
       
   318     * dialog's listbox type.
       
   319     * @return whether layout can be used
       
   320     */
       
   321     IMPORT_C virtual TBool IsAcceptableListBoxType(TInt aControlType, TBool &aIsFormattedCellList) const;
       
   322 protected:
       
   323     /** ProcessCommandL()
       
   324     * From CAknDialog. Processes commands and passes commands to FindBox and ListBox as needed.
       
   325     * @param aCommandId id of the command.
       
   326     */
       
   327     IMPORT_C void ProcessCommandL( TInt aCommandId );
       
   328 
       
   329     /** PreLayoutDynInitL()
       
   330     * From CAknDialog.
       
   331     */
       
   332     IMPORT_C void PreLayoutDynInitL();
       
   333 
       
   334     /** PreLayoutDynInitL()
       
   335     * From CAknDialog.
       
   336     */
       
   337     IMPORT_C void PostLayoutDynInitL();
       
   338 
       
   339     /** SetSizeAndPosition()
       
   340     * From CAknDialog.
       
   341     * Sets dialog's size to whole main pane.
       
   342     * @param aSize ignored
       
   343     */
       
   344     IMPORT_C void SetSizeAndPosition(const TSize &aSize);
       
   345 
       
   346     /** OkToExitL()
       
   347     * From CAknDialog.
       
   348     * This is not called if the Cancel button is activated unless the EEikDialogFlagNotifyEsc flag has been set.
       
   349     * @param aButtonId The ID of the button that was activated.
       
   350     */
       
   351     IMPORT_C TBool OkToExitL( TInt aButtonId );
       
   352 
       
   353     /** HandleListBoxEventL()
       
   354     * From MEikListBoxObserver
       
   355     * Handles listbox events.
       
   356     * @param aListBox currently ignored
       
   357     * @param aEventType type of the listbox event
       
   358     */
       
   359     IMPORT_C void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   360 
       
   361     /** CountComponentControls()
       
   362     * From CCoeControl
       
   363     */
       
   364     IMPORT_C TInt CountComponentControls() const;
       
   365 
       
   366     /** ComponentControl()
       
   367     * From CCoeControl
       
   368     */
       
   369     IMPORT_C CCoeControl* ComponentControl( TInt aIndex ) const;
       
   370 
       
   371     /** OfferKeyEventL()
       
   372     * From CCoeControl
       
   373     */
       
   374     IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   375 
       
   376     /** CreateCustomControlL() creates own list or grid layouts.
       
   377     *
       
   378     * Normal implementation of this method is:
       
   379     *
       
   380     * @code
       
   381     * SEikControlInfo CreateCustomControlL(TInt aControlType)
       
   382     *     {
       
   383     *     CCoeControl *control = NULL;
       
   384     *     if ( aControlType == EMyCtGridLayout )
       
   385     *         {
       
   386     *         // CMyOddStyleGrid should be derived from CAknFormattedCellListBox or CEikColumnListBox.
       
   387     *         control = new(ELeave)CMyOddStyleGrid;
       
   388     *         } 
       
   389     *     SEikControlInfo info = {control,0,0};
       
   390     *     return info;
       
   391     *     }
       
   392     * @endcode
       
   393     * See also IsAcceptableListBoxType(). CreateCustomControlL() and IsAcceptableListBoxType() forms a pair that should
       
   394     * be implemented together.
       
   395     */
       
   396     IMPORT_C SEikControlInfo CreateCustomControlL(TInt aControlType);
       
   397 protected:
       
   398     /** ListBox()
       
   399     * accessor to listbox control
       
   400     * @return a pointer to the listbox
       
   401     */
       
   402     IMPORT_C virtual CEikListBox *ListBox() const;
       
   403 
       
   404     /** FindBox()
       
   405     * accessor to findbox control
       
   406     * @return a pointer to the findbox
       
   407     */
       
   408     IMPORT_C CAknSearchField *FindBox() const;
       
   409 
       
   410     /** IsFormattedCellListBox()
       
   411     * used to check whether listbox control is a CEikFormattedCellListBox or a CEikColumnListBox.
       
   412     * If you derive from IsAcceptableListBoxType() you must take care of the aIsFormattedCellListParameter to
       
   413     * make this method to work correctly.
       
   414     * @return whether listbox control is a CEikFormattedCellListBox
       
   415     */
       
   416     IMPORT_C TBool IsFormattedCellListBox() const;
       
   417 
       
   418     /** Draw()
       
   419     * from CCoeControl
       
   420     */
       
   421     IMPORT_C void Draw(const TRect&) const;
       
   422 private: 
       
   423     /**
       
   424     * From CAknControl
       
   425     */
       
   426     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   427 private: 
       
   428     IMPORT_C virtual void CEikDialog_Reserved_1();
       
   429     IMPORT_C virtual void CEikDialog_Reserved_2();
       
   430 private: 
       
   431     IMPORT_C virtual void CAknDialog_Reserved();
       
   432 private: // new function 
       
   433     IMPORT_C virtual void CAknSelectionListDialog_Reserved();
       
   434 protected:
       
   435     /** iEnterKeyPressed Set as ETrue if EAknCmdOpen is handled in
       
   436     * ProcessCommandL(). This will eventually cause OkToExitL() to
       
   437     * be called with EAknSoftkeyOk as aButtonId.
       
   438     */
       
   439     TBool iEnterKeyPressed;
       
   440 protected:
       
   441     /** ExitViaIdle()
       
   442     *
       
   443     * Callback function to exit dialog after selecting something with
       
   444     * tapping it.  This prevents dialog to be destroyed before dialog
       
   445     * page's handlepointereventl is fully completed.
       
   446     * @param aSelectionList pointer to current CAknSelectionList
       
   447     */
       
   448     static TInt ExitViaIdle(TAny* aSelectionList );    
       
   449 private:
       
   450     CAknSelectionListDialogExtension *iExtension;
       
   451 private:
       
   452     CAknSearchField *iFindBox;
       
   453     TFindType iFindType;
       
   454     TInt *iSelectedItem;
       
   455     MDesCArray *iArray;
       
   456     MEikCommandObserver *iCmdObserver;
       
   457     TInt iDialogResourceId;
       
   458     TInt iSpare[4];
       
   459     };
       
   460 
       
   461 /** CAknMarkableListDialog is an interface for applications
       
   462 *
       
   463 * The class provides a list with items markable with shift+selection_key.
       
   464 *
       
   465 * What this class does:
       
   466 *
       
   467 *   1) Setup listbox for markable list (resource file still needs to be correct for markable lists :)
       
   468 *
       
   469 *   2) Loading default bitmaps
       
   470 *
       
   471 *   3) Handles mark/unmark/mark all/unmark all and edit list options menu visibility
       
   472 *
       
   473 *   4) Handles mark/unmark/mark all/unmark all commands from options menu
       
   474 *
       
   475 *
       
   476 *
       
   477 * @lib Avkon.lib
       
   478 * @since S60 v1.0
       
   479 *
       
   480 * resource definition for this class:
       
   481 @code
       
   482 * RESOURCE DIALOG r_res_id_for_a_dialog
       
   483 *   {
       
   484 *   flags = EAknDialogMarkableList;
       
   485 *   buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
       
   486 *   items =
       
   487 *        {
       
   488 *        DLG_LINE
       
   489 *            {
       
   490 *            type = EAknCtSingleGraphicListBox;
       
   491 *            id = ESelectionListControl;
       
   492 *            control = LISTBOX
       
   493 *                {
       
   494 *                flags = EAknListBoxMarkableList;
       
   495 *                };
       
   496 *            }
       
   497 *     // the next dlg line is optional.
       
   498 *        ,
       
   499 *        DLG_LINE
       
   500 *            {
       
   501 *             itemflags = EEikDlgItemNonFocusing;
       
   502 *            id = EFindControl;
       
   503 *            type = EAknCtSelectionListFixedFind;
       
   504 *            }
       
   505 *        };
       
   506 *   }
       
   507 @endcode
       
   508 
       
   509 * The listbox type can be one of the following ( defined in avkon.hrh and aknlists.h ):
       
   510 @verbatim
       
   511 EAknCtSingleListBox                (See CAknSingleStyleListBox)
       
   512 EAknCtSingleNumberListBox          (See CAknSingleNumberStyleListBox)
       
   513 EAknCtSingleHeadingListBox         (See CAknSingleHeadingStyleListBox)
       
   514 EAknCtSingleGraphicListBox         (See CAknSingleGraphicStyleListBox)
       
   515 EAknCtSingleGraphicHeadingListBox  (See CAknSingleGraphicHeadingStyleListBox)
       
   516 EAknCtSingleNumberHeadingListBox   (See CAknSingleNumberHeadingStyleListBox)
       
   517 EAknCtSingleLargeListBox           (See CAknSingleLargeStyleListBox)
       
   518 EAknCtDoubleListBox                (See CAknDoubleStyleListBox)
       
   519 EAknCtDoubleNumberListBox          (See CAknDoubleNumberStyleListBox)
       
   520 EAknCtDoubleTimeListBox            (See CAknDoubleTimeStyleListBox)
       
   521 EAknCtDoubleLargeListBox           (See CAknDoubleLargeStyleListBox)
       
   522 EAknCtDoubleGraphicListBox         (See CAknDoubleGraphicStyleListBox)
       
   523 @endverbatim
       
   524 *
       
   525 * The type field while defining find can be one of the following:
       
   526 @verbatim
       
   527 EAknCtSelectionListFixedFind
       
   528 EAknCtSelectionListPopupFind
       
   529 EAknCtSelectionListAdaptiveFind
       
   530 @endverbatim
       
   531 *
       
   532 * The menubar you give for markable list dialog should have
       
   533 * one of the following as menu panes:
       
   534 @verbatim
       
   535 R_AVKON_MENUPANE_MARKABLE_LIST   to get edit list menu
       
   536 R_AVKON_MENUPANE_MARKABLE_LIST_WITH_FIND_POPUP to get find and edit list
       
   537 @endverbatim
       
   538 *
       
   539 * @code
       
   540 * RESOURCE MENU_BAR r_res_id_for_a_menubar
       
   541 *     {
       
   542 *     titles =
       
   543 *         {
       
   544 *         MENU_TITLE { menu_pane = R_AVKON_MENUPANE_MARKABLE_LIST; }
       
   545 *         };
       
   546 *     };
       
   547 * @endcode
       
   548 *
       
   549 * C++ Usage:
       
   550 *
       
   551 * @code
       
   552 *    TInt openedItem = 0;
       
   553 *    MDesCArray *arrayOfItems = ...; 
       
   554 *    CArrayFix<TInt> *selectedItems = ...;
       
   555 *    CAknMarkableListDialog *dialog = CAknMarkableListDialog::NewL(openedItem, selectedItems, arrayOfItems, R_RES_ID_FOR_A_MENUBAR);
       
   556 *    TInt result = dialog->ExecuteLD(R_RES_ID_FOR_A_DIALOG);
       
   557 *    if (result)
       
   558 *        {
       
   559 *        ...
       
   560 *        }
       
   561 *    else
       
   562 *        {
       
   563 *        ...
       
   564 *        }
       
   565 * @endcode
       
   566 *
       
   567 */
       
   568 class CAknMarkableListDialog : public CAknSelectionListDialog
       
   569     {
       
   570 public:
       
   571     /** CAknMarkableListDialog::NewL()
       
   572     *
       
   573     * Static factory constructor. Uses two phase construction.
       
   574     * 
       
   575     * @param aOpenedItem        Variable to be modified when user
       
   576     *                           selects a list item.
       
   577     * @param aSelectedItems     array of selected items
       
   578     * @param aArray             Content of list items;
       
   579     *                           A tab-separated string with texts and indexes to icon array
       
   580     * @param aMenuBarResourceId Menu items to be shown in options menu.  May be NULL.
       
   581     * @param aOkMenuBarId       Resource id of a menu bar. This menu bar is displayed,
       
   582     *                           when there are marked items in the list
       
   583     *                           and user presses selection ( OK )  key.  May be NULL.
       
   584     * @param aObserver          Observer for the menu bar.  May be NULL.
       
   585     * @return A pointer to created object  
       
   586     */
       
   587     IMPORT_C static CAknMarkableListDialog *NewL( TInt &aOpenedItem,
       
   588                                                   CArrayFix<TInt> *aSelectedItems,
       
   589                                                   MDesCArray *aArray,
       
   590                                                   TInt aMenuBarResourceId,
       
   591                                                   TInt aOkMenuBarId,
       
   592                                                   MEikCommandObserver *aObserver =0 );
       
   593         
       
   594     /** CAknMarkableListDialog::NewL()
       
   595     *
       
   596     * Static factory constructor. Uses two phase construction.
       
   597     * Leaves created object to cleanup stack.
       
   598     * 
       
   599     * @param aOpenedItem        Variable to be modified when user
       
   600     *                           selects a list item.
       
   601     * @param aSelectedItems     array of selected items
       
   602     * @param aArray             Content of list items;
       
   603     *                           A tab-separated string with texts and indexes to icon array
       
   604     * @param aMenuBarResourceId Menu items to be shown in options menu. May be NULL.
       
   605     * @param aOkMenuBarId       Resource id of a menu bar. This menu bar is displayed,
       
   606     *                           when there are marked items in the list
       
   607     *                           and user presses selection ( OK )  key. May be NULL.
       
   608     * @param aObserver          Observer for the menu bar. May be NULL.
       
   609     * @return A pointer to created object  
       
   610     */
       
   611     IMPORT_C static CAknMarkableListDialog *NewLC( TInt &aOpenedItem,
       
   612                                                    CArrayFix<TInt> *aSelectedItems,
       
   613                                                    MDesCArray *aArray,
       
   614                                                    TInt aMenuBarResourceId,
       
   615                                                    TInt aOkMenuBarId,
       
   616                                                    MEikCommandObserver *aObserver =0 );
       
   617 
       
   618     /** ConstructL()
       
   619     * 2nd phase constructor.
       
   620     * @param aMenuTitleResourceId Menu items to be shown in options menu
       
   621     */
       
   622     IMPORT_C void ConstructL( TInt aMenuTitleResourceId );
       
   623 
       
   624     /* ~CAknMarkableListDialog()
       
   625     * Destructor.
       
   626     */
       
   627     IMPORT_C ~CAknMarkableListDialog();
       
   628 
       
   629 public: // From CCoeControl
       
   630     /** HandlePointerEventL()
       
   631     * from CCoeControl.
       
   632     * @param aPointerEvent a pointer event.
       
   633     */
       
   634     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   635 
       
   636 protected:
       
   637     /** CAknMarkableListDialog()
       
   638     *
       
   639     * Default constructor.
       
   640     * @param aOpenedItem           Variable to be modified when user
       
   641     *                              selects a list item.
       
   642     * @param aSelectedItems        array of selected items
       
   643     * @param aArray                Content of list items;
       
   644     *                              A tab-separated string with texts and indexes to icon array
       
   645     * @param aMenuBarResourceId    Menu items to be shown in options menu. May be NULL.
       
   646     * @param aOkMenuBarResourceId  Resource id of a menu bar. This menu bar is displayed,
       
   647     *                              when there are marked items in the list
       
   648     *                              and user presses selection ( OK )  key. May be NULL.
       
   649     * @param aObserver             Observer for the menu bar. May be NULL.
       
   650     * @return                      A pointer to created object  
       
   651     */
       
   652     IMPORT_C CAknMarkableListDialog( TInt &aOpenedItem,
       
   653                                      CArrayFix<TInt> *aSelectedItems,
       
   654                                      MDesCArray *aArray,
       
   655                                      TInt aMenuBarResourceId,
       
   656                                      TInt aOkMenuBarResourceId,
       
   657                                      MEikCommandObserver *aObserver );
       
   658     /** PreLayoutDynInitL()
       
   659     * From CAknDialog.
       
   660     */
       
   661     IMPORT_C void PreLayoutDynInitL();
       
   662 
       
   663     /** PreLayoutDynInitL()
       
   664     * From CAknDialog.
       
   665     */
       
   666     IMPORT_C void PostLayoutDynInitL();
       
   667 
       
   668     /** SelectionListProcessCommandL() handles selection list and markable list
       
   669     *  default commands.
       
   670     *
       
   671     *  For markable lists, this method handles EAknCmdMark, EAknCmdUnmark, EAknMarkAll, EAknUnmarkAll
       
   672     *  defined in options menu pane R_AVKON_MENUPANE_MARKABLE_LIST.
       
   673     */
       
   674     IMPORT_C void SelectionListProcessCommandL(TInt aCommand);
       
   675 
       
   676     /** ProcessCommandL()
       
   677     * From CAknDialog. Processes commands and passes commands to FindBox and ListBox as needed.
       
   678     * @param aCommand id of the command.
       
   679     */
       
   680     IMPORT_C void ProcessCommandL(TInt aCommand);
       
   681 
       
   682     /** DynInitMenuPaneL()
       
   683     * From MEikCommandObserver
       
   684     * @param aResourceId resource id of the menu pane to be modified
       
   685     * @param aMenuPane pointer to menu pane to be modified
       
   686     */
       
   687     IMPORT_C void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane);
       
   688 
       
   689     /** HandleListBoxEventL()
       
   690     * From MEikListBoxObserver
       
   691     * Handles listbox events.
       
   692     * @param aListBox currently ignored
       
   693     * @param aEventType type of the listbox event
       
   694     */
       
   695     IMPORT_C void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   696 
       
   697     /** OfferKeyEventL()
       
   698     * From CCoeControl
       
   699     */
       
   700     IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   701 
       
   702     /** OkToExitL()
       
   703     * From CAknDialog.
       
   704     * This is not called if the Cancel button is activated unless the EEikDialogFlagNotifyEsc flag has been set.
       
   705     * @param aButtonId The ID of the button that was activated.
       
   706     */
       
   707     IMPORT_C TBool OkToExitL(TInt aButtonId);
       
   708 
       
   709 private:
       
   710     CArrayFix<TInt> *iSelectionIndexArray; // Not owned
       
   711 
       
   712 protected:
       
   713     /**
       
   714     * resource id of the menu bar
       
   715     */
       
   716     TInt iMenuBarResourceId;
       
   717 
       
   718     /**
       
   719     * resource id of the OK menu bar
       
   720     */        
       
   721     TInt iOkMenuBarResourceId;
       
   722 
       
   723 public: // DEPRECATED METHODS, DO NOT USE
       
   724     /** NewL()
       
   725     * @deprecated Do not use.
       
   726     */
       
   727     IMPORT_C static CAknMarkableListDialog *NewL(TInt &aOpenedItem, CArrayFix<TInt> *aSelectedItems,
       
   728                                                  MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aObserver =0);
       
   729     /** NewLC()
       
   730     * @deprecated Do  not use.
       
   731     */
       
   732     IMPORT_C static CAknMarkableListDialog *NewLC(TInt &aOpenedItem, CArrayFix<TInt> *aSelectedItems,
       
   733                                                   MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aObserver =0);
       
   734 protected: // DEPRECATED METHODS, DO NOT USE
       
   735      /** CAknMarkableListDialog()
       
   736      * @deprecated Do not use.
       
   737      */
       
   738     IMPORT_C CAknMarkableListDialog(TInt &aValue, CArrayFix<TInt> *aSelectedItems, MDesCArray *aArray, MEikCommandObserver *aObserver);
       
   739 
       
   740 private: 
       
   741     /**
       
   742     * From CAknControl
       
   743     */
       
   744     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   745 private: 
       
   746     IMPORT_C virtual void CEikDialog_Reserved_1();
       
   747     IMPORT_C virtual void CEikDialog_Reserved_2();
       
   748 private: 
       
   749     IMPORT_C virtual void CAknDialog_Reserved();
       
   750 private: 
       
   751     IMPORT_C virtual void CAknSelectionListDialog_Reserved();
       
   752 private:  
       
   753     CAknMarkableListDialogExtension *iMarkableExtension;
       
   754 private:
       
   755     TInt iSpare[2];
       
   756     };
       
   757 
       
   758 
       
   759 typedef CAknSelectionListDialog CAknSelectionGridDialog;
       
   760 typedef CAknMarkableListDialog CAknMarkableGridDialog;
       
   761 
       
   762 
       
   763 #endif