browserui/browser/FavouritesSrc/BrowserFavouritesListboxItemDrawer.cpp
branchRCL_3
changeset 64 6385c4c93049
parent 63 4baee4f15982
child 65 8e6fa1719340
equal deleted inserted replaced
63:4baee4f15982 64:6385c4c93049
     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 *      Implementation of CWmlBrowserFavouritesListboxItemDrawer.
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "BrowserFavouritesListboxItemDrawer.h"
       
    23 #include "BrowserFavouritesListboxModel.h"
       
    24 #include <favouritesitemlist.h>
       
    25 #include <favouritesitem.h>
       
    26 
       
    27 //================== MEMBER FUNCTIONS =========================================
       
    28 
       
    29 //-----------------------------------------------------------------------------
       
    30 // CBrowserFavouritesListboxItemDrawer::CBrowserFavouritesListboxItemDrawer
       
    31 //-----------------------------------------------------------------------------
       
    32 //
       
    33 CBrowserFavouritesListboxItemDrawer::CBrowserFavouritesListboxItemDrawer
       
    34         (
       
    35         MTextListBoxModel* aTextListBoxModel,
       
    36         const CFont* aFont,
       
    37         CColumnListBoxData* aColumnData
       
    38         )
       
    39     : CColumnListBoxItemDrawer( aTextListBoxModel, aFont, aColumnData )
       
    40     {
       
    41     }
       
    42 
       
    43 //-----------------------------------------------------------------------------
       
    44 // CBrowserFavouritesListboxItemDrawer::Properties
       
    45 //-----------------------------------------------------------------------------
       
    46 //
       
    47 TListItemProperties CBrowserFavouritesListboxItemDrawer::Properties( 
       
    48                                                         TInt aItemIndex ) const
       
    49     {
       
    50     CAknListBoxFilterItems *filter =
       
    51         STATIC_CAST(CAknFilteredTextListBoxModel*,iModel)->Filter();
       
    52     if ( filter )
       
    53         {
       
    54         aItemIndex = filter->FilteredItemIndex( aItemIndex );
       
    55         }
       
    56     TListItemProperties properties =
       
    57         CColumnListBoxItemDrawer::Properties( aItemIndex );
       
    58 
       
    59     // SEARCH CUSTOM:  Updated below for Italics in bookmarks view    
       
    60     // Selection of Folders is allowed, so no need to set it as Hidden.
       
    61     // if ( STATIC_CAST( CBrowserFavouritesListboxModel*, iModel ) ->
       
    62     //    Items()->At( aItemIndex )->IsFolder() )
       
    63     //    {
       
    64     //    // If this is a folder, set "hidden selection" true.
       
    65     //    properties.SetHiddenSelection( ETrue );
       
    66     //    }
       
    67 
       
    68         
       
    69      //Better solution would be adding italics properties to CFavouritesItem, but it requires changes in FavouritesEngine API
       
    70      CFavouritesItem* fi = STATIC_CAST( CBrowserFavouritesListboxModel*, iModel ) ->
       
    71         Items()->At( aItemIndex );
       
    72     if ( fi->ContextId() == KFavouritesServiceContextId )
       
    73     	{
       
    74     	properties.SetItalics(ETrue);
       
    75     	}
       
    76     return properties;
       
    77     }
       
    78 
       
    79 //  End of File