browserui/browser/FavouritesInc/BrowserFavouritesFolderSelector.h
branchRCL_3
changeset 48 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 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 "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: 
       
    15 *      Declaration of class CBrowserFavouritesFolderSelector.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef BROWSER_FAVOURITES_FOLDER_SELECTOR_H
       
    22 #define BROWSER_FAVOURITES_FOLDER_SELECTOR_H
       
    23 
       
    24 // INCLUDE FILES
       
    25 
       
    26 #include "BrowserFavouritesFolderListboxIconHandler.h"
       
    27 #include <AknLists.h>
       
    28 // FORWARD DECLARATION
       
    29 
       
    30 // class CBrowserFavouritesFolderListbox;
       
    31 class CBrowserFavouritesModel;
       
    32 class MApiProvider;
       
    33 class CFavouritesItemList;
       
    34 class CBrowserFavouritesIconIndexArray;
       
    35 // class CAknSingleGraphicPopupMenuStyleListBox;
       
    36 // class MBrowserFavouritesListboxIconHandler;
       
    37 // CLASS DECLARATION
       
    38 
       
    39 class CBrowserFavouritesFolderSelectorListbox : public CAknSingleGraphicPopupMenuStyleListBox
       
    40 {
       
    41 public :
       
    42         /**
       
    43         * Constructor.
       
    44         * @param aIconHandler Pointer to the iconhandler class. Not owned.
       
    45         */
       
    46 	CBrowserFavouritesFolderSelectorListbox( const TBrowserFavouritesFolderListboxIconHandler* aIconHandler );
       
    47         /**
       
    48         * This function is called externally when skin is changed.
       
    49         * This reloads the icons when skin change happens.
       
    50 		* @param aType Type of the resource change
       
    51         */
       
    52 	void HandleResourceChange( TInt aType );
       
    53 
       
    54 protected:  
       
    55     /// Icon handler for the listbox.
       
    56     const TBrowserFavouritesFolderListboxIconHandler* iIconHandler;
       
    57 };
       
    58 
       
    59 /**
       
    60 * Folder selector. Contains a popup list to display all folders in a flat list.
       
    61 */
       
    62 class CBrowserFavouritesFolderSelector:
       
    63                                 public CBase
       
    64     {
       
    65     public:     // construct / destruct
       
    66 
       
    67         /**
       
    68         * Two-phased constructor. Leaves on failure.
       
    69         * @param aModel Model to be used for reading folder data. Not owned.
       
    70         * @param aApiProvider Api provider. Not owned.
       
    71         * @param aExcludeFolder Folder to be excluded from display.
       
    72         */
       
    73         static CBrowserFavouritesFolderSelector* NewL
       
    74             (
       
    75             CBrowserFavouritesModel& aModel,
       
    76             MApiProvider& aApiProvider,
       
    77             TInt aExcludeFolder
       
    78             );
       
    79 
       
    80     protected:  // construct / destruct
       
    81 
       
    82         /**
       
    83         * Constructor.
       
    84         * @param aModel Model to be used for reading folder data. Not owned.
       
    85         * Must remain intact while the dialog exists.
       
    86         * @param aApiProvider Api provider. Not owned.
       
    87         * @param aExcludeFolder Folder to be excluded from display.
       
    88         */
       
    89         CBrowserFavouritesFolderSelector(
       
    90             CBrowserFavouritesModel& aModel,
       
    91             MApiProvider& aApiProvider,
       
    92             TInt aExcludeFolder );
       
    93 
       
    94         /**
       
    95         * Destructor.
       
    96         */
       
    97         virtual ~CBrowserFavouritesFolderSelector();
       
    98 
       
    99         /**
       
   100         * Second phase constructor.
       
   101         */
       
   102         void ConstructL();
       
   103 
       
   104     public:     // new methods
       
   105 
       
   106         /**
       
   107         * Launch popup folder selector, return the selected folder's Uid then
       
   108         * delete the selector. Must not be on the cleanup stack when called
       
   109         * (this method pushes).
       
   110         * @return Uid of selectd folder (or KFavouritesNullUid).
       
   111         */
       
   112         TInt ExecuteLD();
       
   113 
       
   114     private:    // new methods
       
   115 
       
   116         /**
       
   117         * Get data (items and icon indexes) of folders.
       
   118         */
       
   119         void GetDataL();
       
   120 
       
   121         /**
       
   122         * Fill listbox.
       
   123         */
       
   124         void FillListboxL();
       
   125 
       
   126         /**
       
   127         * Get folders to be displayed (all except aFolder).
       
   128         * @return List of items. Pushed on the cleanup stack.
       
   129         */
       
   130         CFavouritesItemList* GetItemsLC();
       
   131 
       
   132         /**
       
   133         * Return icon indexes to be displayed in a list. Owner is the caller.
       
   134         * The returned list must have exactly as much items as aItems.
       
   135         * @param aItems Item list.
       
   136         * @return Icon index array.
       
   137         */
       
   138         CBrowserFavouritesIconIndexArray* GetIconIndexesLC
       
   139             ( CFavouritesItemList& aItems );
       
   140 
       
   141     private:    // data
       
   142 
       
   143         /// Used for reading folder data. Not owned.
       
   144         CBrowserFavouritesModel* iModel;
       
   145         /// Api provider. Not owned.
       
   146         MApiProvider* iApiProvider;
       
   147         /// Folder to be excluded from display.
       
   148         TInt iExcludeFolder;
       
   149 
       
   150         /// Real data for this listbox, array of items. Owned.
       
   151         CFavouritesItemList* iItems;
       
   152         /// Icon indexes for the items. Owned.
       
   153         CBrowserFavouritesIconIndexArray* iIconIndexes;
       
   154         /// Popup list. Owned.
       
   155         CAknPopupList* iPopupList;
       
   156         /// Listbox containing data. Owned.
       
   157         CAknSingleGraphicPopupMenuStyleListBox* iListbox;
       
   158         /// Listbox item array. Owned.
       
   159         CDesCArrayFlat* iListboxItemArray;
       
   160         /// Icon handler for the listbox.
       
   161         const TBrowserFavouritesFolderListboxIconHandler iIconHandler;
       
   162 
       
   163     };
       
   164 
       
   165 #endif
       
   166 
       
   167 // End of file