homesync/contentmanager/homesyncwizard/inc/cmsmultiselectionpopup.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2008 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:  CMSMultiselectionPopup class definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMSMULTISELECTIONPOPUP_H
       
    20 #define CMSMULTISELECTIONPOPUP_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknnavide.h>
       
    24 #include <AknIconArray.h>
       
    25 #include <aknlistquerydialog.h>
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  * CMSMultiselectionPopup dialog class
       
    31  *
       
    32  * @since S60 5.1
       
    33  */
       
    34 NONSHARABLE_CLASS( CMSMultiselectionPopup ) : public CAknListQueryDialog
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Two-phased constructor.
       
    40      *
       
    41      * @since S60 5.1
       
    42      * @param aItemArray, list item array
       
    43      * @param aSelectionIndexArray, currently selected items
       
    44      * @param aHeading, popup heading
       
    45      * @return CMSMultiselectionPopup* the new CMSMultiselectionPopup object
       
    46      */
       
    47     static CMSMultiselectionPopup* NewL(
       
    48         CDesCArrayFlat* aItemArray,
       
    49         CListBoxView::CSelectionIndexArray* aSelectionIndexArray,
       
    50         const TDesC& aHeading );
       
    51 
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      *
       
    55      * @since S60 5.1
       
    56      * @param aItemArray, list item array
       
    57      * @param aSelectionIndexArray, currently selected items
       
    58      * @param aHeading, popup heading
       
    59      * @return CMSMultiselectionPopup* the new CMSMultiselectionPopup object
       
    60      */
       
    61     static CMSMultiselectionPopup* NewLC(
       
    62         CDesCArrayFlat* aItemArray,
       
    63         CListBoxView::CSelectionIndexArray* aSelectionIndexArray,
       
    64         const TDesC& aHeading );                
       
    65 
       
    66     /**
       
    67      * Destructor.
       
    68      */
       
    69     virtual ~CMSMultiselectionPopup();
       
    70 
       
    71 public:
       
    72 
       
    73     /**
       
    74      * Updates the list of items
       
    75      *
       
    76      * @since S60 5.1
       
    77      * @param aItemArray, list item array
       
    78      * @return None
       
    79      */
       
    80     void UpdateAndDrawPopupL( CDesCArrayFlat* aItemArray );
       
    81 
       
    82 protected:
       
    83 
       
    84 // From base class CAknSelectionListDialog
       
    85 
       
    86     /**
       
    87      * From CAknSelectionListDialog
       
    88      * See base class defition
       
    89      */
       
    90     void PreLayoutDynInitL();
       
    91 
       
    92     /**
       
    93      * From CAknSelectionListDialog
       
    94      * See base class defition
       
    95      */
       
    96     TBool OkToExitL( TInt aButtonId );
       
    97 
       
    98 
       
    99 private:
       
   100 
       
   101     /**
       
   102      * Performs the first phase of two phase construction.
       
   103      *
       
   104      * @since S60 5.1
       
   105      * @param aSelectionIndexArray, selected indexes
       
   106      * @param aHeading, popup heading
       
   107      * @return None
       
   108      */
       
   109     CMSMultiselectionPopup(
       
   110         CListBoxView::CSelectionIndexArray* aSelectionIndexArray,
       
   111         const TDesC& aHeading );
       
   112 
       
   113     /**
       
   114      * Performs the second phase construction.
       
   115      *
       
   116      * @since S60 5.1
       
   117      * @param aItemArray, list items
       
   118      * @param aSelectionIndexArray, selected indexes
       
   119      * @return None
       
   120      */
       
   121     void ConstructL( CDesCArrayFlat* aItemArray,
       
   122                      CListBoxView::CSelectionIndexArray*
       
   123                                             aSelectionIndexArray);
       
   124 
       
   125    /**
       
   126     * Loads a possibly skinned icon and adds it to icon array
       
   127     *
       
   128     * @since S60 5.1
       
   129     * @param CAknIconArray, array of icons
       
   130     * @param MAknsSkinInstance, skin instance
       
   131     * @param TDesC, reference to icon file
       
   132     * @param TAknsItemID, skinned icon id
       
   133     * @param TInt, bitmap id
       
   134     * @param TInt, bitmap mask id
       
   135     * @return None
       
   136     */
       
   137     void AppendIconToArrayL( CAknIconArray* aArray,
       
   138                              MAknsSkinInstance* aSkin,
       
   139                              const TDesC& aMbmFile,
       
   140                              const TAknsItemID& aID,
       
   141                              TInt aBitmapId,
       
   142                              TInt aMaskId ) const;
       
   143 
       
   144    /**
       
   145     * Creates listbox items and sets item array
       
   146     *
       
   147     * @since S60 5.1
       
   148     */
       
   149     void CreateAndSetListboxItemsL();
       
   150 
       
   151 private:
       
   152 
       
   153     /**
       
   154      * Dialog listbox
       
   155      */
       
   156     CEikListBox*                      iListBox;         // owned
       
   157     /**
       
   158      * Item array
       
   159      */    
       
   160     CDesCArrayFlat*                   iItemArray;       // not owned
       
   161     /**
       
   162      * Selected item indexes
       
   163      */
       
   164     CArrayFix<TInt>*                  iSelectionIndexes;// not owned
       
   165     /**
       
   166      * Dialog title
       
   167      */
       
   168     TPtrC                             iHeading;    
       
   169     };
       
   170 #endif
       
   171 
       
   172 // End of File