browserui/browser/FavouritesSrc/BrowserFavouritesListbox.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 CBrowserFavouritesListbox.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <aknkeys.h>
       
    24 #include <EIKCLBD.H>
       
    25 #include <gulicon.h>
       
    26 #include <AknIconArray.h>
       
    27 #include <favouritesdb.h>
       
    28 #include <BrowserNG.rsg>
       
    29 #include <ApListItemList.h>
       
    30 #include <favouritesitem.h>
       
    31 #include <favouritesitemlist.h>
       
    32 #include <AknsConstants.h>
       
    33 
       
    34 #include "BrowserFavouritesListbox.h"
       
    35 #include "BrowserFavouritesListboxState.h"
       
    36 #include "BrowserFavouritesListboxModel.h"
       
    37 #include "BrowserFavouritesListboxView.h"
       
    38 #include "BrowserFavouritesModel.h"
       
    39 #include "CommsModel.h"
       
    40 #include "BrowserFavouritesListboxIconHandler.h"
       
    41 #include "BrowserFavouritesIconIndexArray.h"
       
    42 #include "BrowserUtil.h"
       
    43 #include "BrowserFavouritesListboxCursorObserver.h"
       
    44 #include "BrowserFavouritesListboxState.h"
       
    45 #include "BrowserFavouritesListboxItemDrawer.h"
       
    46 #include "ApiProvider.h"
       
    47 #include "BrowserAppUi.h"
       
    48 
       
    49 #include "BrowserFaviconHandler.h"
       
    50 #include <AknLayout2ScalableDef.h>
       
    51 #include <aknlayoutscalable_avkon.cdl.h>
       
    52 
       
    53 #include "eikon.hrh"
       
    54 
       
    55 
       
    56 // CONSTANTS
       
    57 /// Granularity of the icon index array.
       
    58 LOCAL_C const TInt KGranularity = 4;
       
    59 
       
    60 
       
    61 // ================= LOCAL FUNCTIONS =======================
       
    62 
       
    63 /**
       
    64 * Append elements from aSource to the end of aTarget.
       
    65 * @param aTarget Array which receives copied elements from aSource.
       
    66 * @param aSource Elements from this will be appended to aTarget.
       
    67 */
       
    68 LOCAL_D void AppendArrayL
       
    69 ( CArrayFix<TInt>& aTarget, const CArrayFix<TInt>& aSource )
       
    70     {
       
    71     TInt i;
       
    72     TInt count = aSource.Count();
       
    73     for ( i = 0; i < count; i++ )
       
    74         {
       
    75         aTarget.AppendL( aSource.At( i ) );
       
    76         }
       
    77     }
       
    78 
       
    79 // ================= MEMBER FUNCTIONS =======================
       
    80 
       
    81 // ---------------------------------------------------------
       
    82 // CBrowserFavouritesListbox::NewL
       
    83 // ---------------------------------------------------------
       
    84 //
       
    85 CBrowserFavouritesListbox* CBrowserFavouritesListbox::NewL
       
    86         (
       
    87         MApiProvider& aApiProvider,
       
    88         const CCoeControl* aParent,
       
    89         const MBrowserFavouritesListboxIconHandler& aIconHandler
       
    90         )
       
    91     {
       
    92     CBrowserFavouritesListbox* listbox =
       
    93         new (ELeave) CBrowserFavouritesListbox( aApiProvider );
       
    94     CleanupStack::PushL( listbox );
       
    95     listbox->ConstructL( aParent, aIconHandler );
       
    96     CleanupStack::Pop();    // listbox
       
    97     return listbox;
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------
       
   101 // CBrowserFavouritesListbox::~CBrowserFavouritesListbox
       
   102 // ---------------------------------------------------------
       
   103 //
       
   104 CBrowserFavouritesListbox::~CBrowserFavouritesListbox()
       
   105     {
       
   106     delete iFaviconHandler;
       
   107     delete iIconIndexes;
       
   108     delete iItems;
       
   109     delete iNewState;
       
   110     if(iIconUpdateCallback) iIconUpdateCallback->Cancel();
       
   111     delete iIconUpdateCallback;
       
   112     
       
   113     if ( iFontItalic )
       
   114         {
       
   115         CWsScreenDevice& screenDev = *( CEikonEnv::Static()->ScreenDevice() );
       
   116         screenDev.ReleaseFont( iFontItalic );
       
   117         }
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // CBrowserFavouritesListbox::SetListboxCursorObserver
       
   122 // ---------------------------------------------------------
       
   123 //
       
   124 void CBrowserFavouritesListbox::SetListboxCursorObserver
       
   125 (MBrowserFavouritesListboxCursorObserver* aObserver)
       
   126     {
       
   127     iCursorObserver = aObserver;
       
   128     if ( View() )
       
   129         {
       
   130         STATIC_CAST( CBrowserFavouritesListboxView*, View() )->
       
   131             SetCursorObserver( aObserver );
       
   132         }
       
   133     }
       
   134 
       
   135 // ---------------------------------------------------------
       
   136 // CBrowserFavouritesListbox::SetDataL
       
   137 // ---------------------------------------------------------
       
   138 //
       
   139 void CBrowserFavouritesListbox::SetDataL
       
   140 ( CFavouritesItemList* aItems, /*MCommsModel& aCommsModel,*/ TBool aKeepState )
       
   141     {
       
   142     __ASSERT_DEBUG( aItems, Util::Panic( Util::EUnExpected ) );
       
   143 
       
   144     // Ownership of aItems is taken, and will become a member (but not yet
       
   145     // that) - push until then.
       
   146     CleanupStack::PushL( aItems );
       
   147 
       
   148     // Get all favicons asynchronously by iteration on icon array
       
   149     /* TODO: There should a callback from engine when favIcon are decode
       
   150        otherwise it takes some redundant calls to engine in order to get 
       
   151      the favIcons to UI. */
       
   152 #ifdef BRDO_PERF_IMPROVEMENTS_ENABLED_FF    
       
   153     if(iApiProvider.StartedUp())
       
   154         UpdateFavIconsL();
       
   155 #else
       
   156     iFaviconHandler->StartGetFaviconsL( aItems );
       
   157 #endif     
       
   158 
       
   159 
       
   160     // Get icon indexes into new list. Replace the existing
       
   161     // data only if successfully gotten. This ensures that they don't go out
       
   162     // of sync (there cannot be different number of items in the two list).
       
   163     CBrowserFavouritesIconIndexArray* newIconIndexes =
       
   164         GetIconIndexesLC( /*aCommsModel,*/ *aItems );
       
   165 
       
   166     if ( aKeepState )
       
   167         {
       
   168         // Calculate new state now, while we still have old items.
       
   169         CalcNewStateL( *aItems );
       
   170         }
       
   171 
       
   172     // Got new data. Empty existing data, but keep the empty lists.
       
   173     ClearSelection();
       
   174     iItems->ResetAndDestroy();
       
   175     iIconIndexes->Reset();
       
   176     SetTopItemIndex(0);
       
   177     UpdateFilterL();
       
   178     HandleItemRemovalL();
       
   179     // Replace data with new.
       
   180     delete iIconIndexes;                            // Not NULL-ed, because...
       
   181     delete iItems;                                  // Not NULL-ed, because...
       
   182     iItems = aItems;                                // ... this cannot leave
       
   183     iIconIndexes = newIconIndexes;                  // ... this cannot leave
       
   184 
       
   185     // Let the model know the change.
       
   186     TheModel()->SetData( *iItems, *iIconIndexes );  // ... this cannot leave
       
   187 
       
   188     CleanupStack::Pop( 2 ); // newIconIndexes, aItems: now members.
       
   189     HandleItemAdditionL();
       
   190     UpdateFilterL();
       
   191     if ( aKeepState )
       
   192         {
       
   193         // Now set the new state into listbox, then discard it.
       
   194         __ASSERT_DEBUG( iNewState, Util::Panic( Util::EUnExpected ) );
       
   195         SetStateL( *iNewState );
       
   196         delete iNewState;
       
   197         iNewState = NULL;
       
   198         }
       
   199     }
       
   200 
       
   201 // ---------------------------------------------------------
       
   202 // CBrowserFavouritesListbox::UpdateFavIcons
       
   203 // ---------------------------------------------------------
       
   204 //
       
   205 void CBrowserFavouritesListbox::UpdateFavIconsL()
       
   206     {
       
   207     if(iIconUpdateCallback)
       
   208         iIconUpdateCallback->Cancel();
       
   209     else 
       
   210         iIconUpdateCallback = CIdle::NewL(CActive::EPriorityIdle);
       
   211 
       
   212     iFaviconHandler->RequestFavicons(iItems);
       
   213     iIconUpdateCallback->Start(TCallBack(UpdateFavIconsCallback, this));
       
   214     }
       
   215 
       
   216 // ----------------------------------------------------------------------------
       
   217 // CBrowserBookmarksView::CompleteAppInitCallback
       
   218 // ----------------------------------------------------------------------------
       
   219 //
       
   220 TInt CBrowserFavouritesListbox::UpdateFavIconsCallback( TAny* aParam )
       
   221     {
       
   222     CBrowserFavouritesListbox  *favListBox = STATIC_CAST(CBrowserFavouritesListbox*, aParam);
       
   223     TRAP_IGNORE( (favListBox->iFaviconHandler->StartGetFaviconsL(favListBox->iItems)) )
       
   224     return EFalse;
       
   225     }
       
   226 
       
   227 
       
   228 // ---------------------------------------------------------
       
   229 // CBrowserFavouritesListbox::DrawFavicons
       
   230 // ---------------------------------------------------------
       
   231 //
       
   232 TInt CBrowserFavouritesListbox::DrawFavicons()
       
   233     {
       
   234     // We have some favicons to draw
       
   235     TInt err = KErrNone;
       
   236 
       
   237     //Update the icon indices
       
   238     TRAP(   err,
       
   239             CBrowserFavouritesIconIndexArray* newIconIndexes =
       
   240                 GetIconIndexesLC( /*aCommsModel,*/ *iItems );
       
   241             iIconIndexes->Reset();
       
   242             delete iIconIndexes;
       
   243             iIconIndexes = newIconIndexes;
       
   244             CleanupStack::Pop( newIconIndexes );
       
   245         );
       
   246 
       
   247     // Don't draw the favicons if there is a leave
       
   248     if ( !err )
       
   249         {
       
   250         // Let the model know the change and update the lisbox.
       
   251         TheModel()->SetData( *iItems, *iIconIndexes );
       
   252         DrawNow();
       
   253         }
       
   254 
       
   255     return err;
       
   256     }
       
   257 
       
   258 // ---------------------------------------------------------
       
   259 // CBrowserFavouritesListbox::SelectionStateL
       
   260 // ---------------------------------------------------------
       
   261 //
       
   262 TBrowserFavouritesSelectionState
       
   263 CBrowserFavouritesListbox::SelectionStateL() const
       
   264     {
       
   265     TBrowserFavouritesSelectionState state;
       
   266 
       
   267     // Check marking first.
       
   268     const CArrayFix<TInt>* selection = MarkedRealIndexesLC();
       
   269     TInt i;
       
   270     TInt count = selection->Count();
       
   271     for ( i = 0; i < count; i++ )
       
   272         {
       
   273         state.iMarkFlags |=
       
   274             SelectionFlags( *(iItems->At( selection->At( i ) )) );
       
   275         if ( iItems->At( selection->At( i ) )->IsItem() )
       
   276             {
       
   277             state.iMarkedItemCount++;
       
   278             }
       
   279         else
       
   280             {
       
   281             state.iMarkedFolderCount++;
       
   282             }
       
   283         }
       
   284 
       
   285     if ( count == iItems->Count() )
       
   286         {
       
   287         state.iMarkFlags |= TBrowserFavouritesSelectionState::EAll;
       
   288         }
       
   289 
       
   290     TInt visibleCount;
       
   291     CAknListBoxFilterItems* filter = TheModel()->Filter();
       
   292     visibleCount = filter ? filter->FilteredNumberOfItems() : iItems->Count();
       
   293     for ( i = 0; i < visibleCount; i++ )
       
   294         {
       
   295         if ( iItems->At( RealIndex( i ) )->IsItem() )
       
   296             {
       
   297             state.iVisibleItemCount++;
       
   298             }
       
   299         else
       
   300             {
       
   301             state.iVisibleFolderCount++;
       
   302             }
       
   303         }
       
   304 
       
   305     TKeyArrayFix key( 0, ECmpTInt32 );
       
   306     TInt dummy;
       
   307     if ( !selection->Find( CurrentItemRealIndex(), key, dummy ) )
       
   308         {
       
   309         state.iMarkFlags |=
       
   310             TBrowserFavouritesSelectionState::ECurrent;
       
   311         }
       
   312 
       
   313     CleanupStack::PopAndDestroy();  // selection
       
   314 
       
   315     // Then comes the current.
       
   316     const CFavouritesItem* current = CurrentItem();
       
   317     if ( current )
       
   318         {
       
   319         state.iCurrentFlags |= SelectionFlags( *current );
       
   320         }
       
   321 
       
   322     return state;
       
   323     }
       
   324 
       
   325 // ---------------------------------------------------------
       
   326 // CBrowserFavouritesListbox::CurrentItem
       
   327 // ---------------------------------------------------------
       
   328 //
       
   329 const CFavouritesItem* CBrowserFavouritesListbox::CurrentItem() const
       
   330     {
       
   331     TInt index = CurrentItemRealIndex();
       
   332     if ( index >= 0 )
       
   333         {
       
   334         return iItems->At( index );
       
   335         }
       
   336     return NULL;
       
   337     }
       
   338 
       
   339 // ---------------------------------------------------------
       
   340 // CBrowserFavouritesListbox::MarkedItemL
       
   341 // ---------------------------------------------------------
       
   342 //
       
   343 const CFavouritesItem* CBrowserFavouritesListbox::MarkedItemL() const
       
   344     {
       
   345     CFavouritesItem* item = NULL;
       
   346     CArrayFix<TInt>* marked = MarkedRealIndexesLC();
       
   347     if ( marked->Count() == 1 )
       
   348         {
       
   349         item = iItems->At( marked->At( 0 ) );
       
   350         }
       
   351     CleanupStack::PopAndDestroy();
       
   352     return item;
       
   353     }
       
   354 
       
   355 // ---------------------------------------------------------
       
   356 // CBrowserFavouritesListbox::HighlightUidNow
       
   357 // ---------------------------------------------------------
       
   358 //
       
   359 TBool CBrowserFavouritesListbox::HighlightUidNow( TInt aUid )
       
   360     {
       
   361     TInt index = 0;
       
   362     if (aUid != 0)
       
   363         {
       
   364         index = UidToViewIndex( aUid );
       
   365         }
       
   366 
       
   367     if ( index >= 0 )
       
   368         {
       
   369         SetCurrentItemIndexAndDraw( index );
       
   370         return ETrue;
       
   371         }
       
   372     return EFalse;
       
   373     }
       
   374 
       
   375 // ---------------------------------------------------------
       
   376 // CBrowserFavouritesListbox::HandleMarkableListCommandL
       
   377 // ---------------------------------------------------------
       
   378 //
       
   379 void CBrowserFavouritesListbox::HandleMarkableListCommandL( TInt aCommand )
       
   380     {
       
   381     if ( ListboxFlags() & EAknListBoxMarkableList )
       
   382         {
       
   383         TInt index;
       
   384         switch ( aCommand )
       
   385             {
       
   386             case EWmlCmdMark:
       
   387                 {
       
   388                 index = CurrentItemIndex();
       
   389                 if ( index >= 0 )
       
   390                     {
       
   391                     View()->SelectItemL( index );
       
   392                     }
       
   393                 break;
       
   394                 }
       
   395 
       
   396             case EWmlCmdUnmark:
       
   397                 {
       
   398                 index = CurrentItemIndex();
       
   399                 if ( index >= 0 )
       
   400                     {
       
   401                     View()->DeselectItem( index );
       
   402                     }
       
   403                 break;
       
   404                 }
       
   405 
       
   406             case EWmlCmdMarkAll:
       
   407                 {
       
   408                 ClearSelection();
       
   409                 TInt count = Model()->NumberOfItems();
       
   410                 if ( count )
       
   411                     {
       
   412                     TInt i = 0;
       
   413                     CArrayFixFlat<TInt>* selection =
       
   414                         new(ELeave) CArrayFixFlat<TInt>( 1 );
       
   415                     CleanupStack::PushL( selection );
       
   416                     selection->SetReserveL( count );
       
   417                     for ( i = 0; i < count; i++ )
       
   418                         {
       
   419                         selection->AppendL( i );
       
   420                         }
       
   421                     SetSelectionIndexesL( selection );
       
   422                     CleanupStack::PopAndDestroy();  // selection
       
   423                     }
       
   424                 break;
       
   425                 }
       
   426 
       
   427             case EWmlCmdUnmarkAll:
       
   428                 {
       
   429                 ClearSelection();
       
   430                 break;
       
   431                 }
       
   432 
       
   433             default:
       
   434                 {
       
   435                 Util::Panic( Util::EUnExpected );
       
   436                 }
       
   437             }
       
   438         }
       
   439     }
       
   440 
       
   441 // ---------------------------------------------------------
       
   442 // CBrowserFavouritesListbox::MarkedUidsLC
       
   443 // ---------------------------------------------------------
       
   444 //
       
   445 CArrayFix<TInt>* CBrowserFavouritesListbox::MarkedUidsLC() const
       
   446     {
       
   447     CArrayFix<TInt>* array = MarkedRealIndexesLC();
       
   448     RealIndexesToUids( *array );
       
   449     return array;
       
   450     }
       
   451 
       
   452 // ---------------------------------------------------------
       
   453 // CBrowserFavouritesListbox::SelectedUidsLC
       
   454 // ---------------------------------------------------------
       
   455 //
       
   456 CArrayFix<TInt>* CBrowserFavouritesListbox::SelectedUidsLC() const
       
   457     {
       
   458     CArrayFix<TInt>* array = SelectedRealIndexesLC();
       
   459     RealIndexesToUids( *array );
       
   460     return array;
       
   461     }
       
   462 
       
   463 // ---------------------------------------------------------
       
   464 // CBrowserFavouritesListbox::SelectedItemsLC
       
   465 // ---------------------------------------------------------
       
   466 //
       
   467 CArrayPtr<const CFavouritesItem>*
       
   468 CBrowserFavouritesListbox::SelectedItemsLC(TBool aIncludeSpecialItems) const
       
   469     {
       
   470     CArrayPtrFlat<const CFavouritesItem>* itemPtrs =
       
   471         new (ELeave) CArrayPtrFlat<const CFavouritesItem>( KGranularity );
       
   472     CleanupStack::PushL( itemPtrs );
       
   473     CArrayFix<TInt>* indexes = SelectedRealIndexesLC();
       
   474     TInt i;
       
   475     TInt count = indexes->Count();
       
   476     for ( i = 0; i < count; i++ )
       
   477         {
       
   478         CFavouritesItem* item = iItems->At( indexes->At( i ) );
       
   479 
       
   480         if ( !aIncludeSpecialItems )
       
   481             {
       
   482             // Skip special items:
       
   483             // folders, homepage, last visited & start page URLs.
       
   484             // Need a workaround for the start page since CFavouritesItem
       
   485             // does not provide IsStartPage() or something similar.
       
   486             if ( (item->Uid() == KFavouritesHomepageUid ) ||
       
   487                 (item->Uid() == KFavouritesLastVisitedUid ) ||
       
   488                 item->IsFolder() ||
       
   489                 item->Uid() == KFavouritesStartPageUid )
       
   490                     continue;
       
   491             }
       
   492         itemPtrs->AppendL( item );
       
   493         }
       
   494     CleanupStack::PopAndDestroy();  // indexes
       
   495     return itemPtrs;
       
   496     }
       
   497 
       
   498 // ---------------------------------------------------------
       
   499 // CBrowserFavouritesListbox::ItemByUid
       
   500 // ---------------------------------------------------------
       
   501 //
       
   502 const CFavouritesItem* CBrowserFavouritesListbox::ItemByUid
       
   503 ( TInt aUid ) const
       
   504     {
       
   505     return iItems->ItemByUid( aUid );
       
   506     }
       
   507 
       
   508 // ---------------------------------------------------------
       
   509 // CBrowserFavouritesListbox::UnfilteredNumberOfItems
       
   510 // ---------------------------------------------------------
       
   511 //
       
   512 TInt CBrowserFavouritesListbox::UnfilteredNumberOfItems()
       
   513     {
       
   514     return iItems->Count();
       
   515     }
       
   516 
       
   517 
       
   518 // ---------------------------------------------------------
       
   519 // CBrowserFavouritesListbox::FilteredNumberOfItems
       
   520 // ---------------------------------------------------------
       
   521 //
       
   522 TInt CBrowserFavouritesListbox::FilteredNumberOfItems()
       
   523     {
       
   524 
       
   525     CAknListBoxFilterItems* filter = TheModel()->Filter();
       
   526     return filter->FilteredNumberOfItems();
       
   527     }
       
   528 
       
   529 
       
   530 // ---------------------------------------------------------
       
   531 // CBrowserFavouritesListbox::UpdateFilterL
       
   532 // ---------------------------------------------------------
       
   533 //
       
   534 void CBrowserFavouritesListbox::UpdateFilterL()
       
   535     {
       
   536     CAknListBoxFilterItems* filter = TheModel()->Filter();
       
   537     if ( filter )
       
   538         {
       
   539         filter->HandleItemArrayChangeL();
       
   540         }
       
   541     }
       
   542 
       
   543 // ---------------------------------------------------------
       
   544 // CBrowserFavouritesListbox::AnyFoldersL
       
   545 // ---------------------------------------------------------
       
   546 //
       
   547 TBool CBrowserFavouritesListbox::AnyFoldersL()
       
   548     {
       
   549     TInt i;
       
   550     TInt count = iItems->Count();
       
   551     for ( i = 0; i < count; i++ )
       
   552         {
       
   553         if ( iItems->At( i )->IsFolder() )
       
   554             {
       
   555             if (iItems->At( i )->Uid()!=KFavouritesAdaptiveItemsFolderUid) return ETrue; //exclude Adaptive Bookmarks Folder
       
   556             }
       
   557         }
       
   558     return EFalse;
       
   559     }
       
   560 
       
   561 // ---------------------------------------------------------
       
   562 // CBrowserFavouritesListbox::OfferKeyEventL
       
   563 // ---------------------------------------------------------
       
   564 //
       
   565 TKeyResponse CBrowserFavouritesListbox::OfferKeyEventL
       
   566 ( const TKeyEvent& aKeyEvent, TEventCode aType )
       
   567     {
       
   568     TKeyResponse result = EKeyWasNotConsumed;
       
   569 
       
   570     switch ( aKeyEvent.iCode )
       
   571         {
       
   572         case EKeyLeftUpArrow:     // Northwest
       
   573         case EStdKeyDevice10:     //   : Extra KeyEvent supports diagonal event simulator wedge
       
   574         case EKeyLeftArrow:       // West
       
   575         case EKeyLeftDownArrow:   // Southwest
       
   576         case EStdKeyDevice13:     //   : Extra KeyEvent supports diagonal event simulator wedge
       
   577 
       
   578         case EKeyRightUpArrow:    // Northeast
       
   579         case EStdKeyDevice11:     //   : Extra KeyEvent supports diagonal event simulator wedge
       
   580         case EKeyRightArrow:      // East
       
   581         case EKeyRightDownArrow:  // Southeast
       
   582         case EStdKeyDevice12:     //   : Extra KeyEvent supports diagonal event simulator wedge
       
   583             {
       
   584             // This listbox does not consume left/right or diagonal keypresses.
       
   585             // (The base class always does, even if it doesn't use them )
       
   586             break;
       
   587             }
       
   588 
       
   589         default:
       
   590             {
       
   591             result = CAknSingleGraphicStyleListBox::OfferKeyEventL
       
   592                 ( aKeyEvent, aType );
       
   593             // Call UpdateCBA to update MSK in case of mark/unmark
       
   594             CBrowserAppUi::Static()->UpdateCbaL();
       
   595             }
       
   596 
       
   597         }
       
   598 
       
   599     return result;
       
   600     }
       
   601 
       
   602 // ---------------------------------------------------------
       
   603 // CBrowserFavouritesListbox::FocusChanged
       
   604 // ---------------------------------------------------------
       
   605 //
       
   606 void CBrowserFavouritesListbox::FocusChanged( TDrawNow aDrawNow )
       
   607     {
       
   608     // Do nothing until the listbox is fully constructed
       
   609     // The dialogpage sets the focus before calling ConstructL
       
   610     if ( iView )
       
   611         {
       
   612         CAknSingleGraphicStyleListBox::FocusChanged( aDrawNow );
       
   613         }
       
   614     }
       
   615 
       
   616 // ---------------------------------------------------------
       
   617 // CBrowserFavouritesListbox::CreateModelL
       
   618 // ---------------------------------------------------------
       
   619 //
       
   620 void CBrowserFavouritesListbox::CreateModelL()
       
   621     {
       
   622     iModel = CBrowserFavouritesListboxModel::NewL( *iItems, *iIconIndexes );
       
   623     }
       
   624 
       
   625 // ---------------------------------------------------------
       
   626 // CBrowserFavouritesListbox::MakeViewClassInstanceL
       
   627 // ---------------------------------------------------------
       
   628 //
       
   629 CListBoxView* CBrowserFavouritesListbox::MakeViewClassInstanceL()
       
   630     {
       
   631     return new (ELeave) CBrowserFavouritesListboxView( *this );
       
   632     }
       
   633 
       
   634 
       
   635 // ---------------------------------------------------------
       
   636 // CBrowserFavouritesListbox::CreateItemDrawerL
       
   637 // ---------------------------------------------------------
       
   638 //
       
   639 void CBrowserFavouritesListbox::CreateItemDrawerL()
       
   640     {
       
   641     CAknSingleGraphicStyleListBox::CreateItemDrawerL();
       
   642     }
       
   643 
       
   644 
       
   645 // ---------------------------------------------------------
       
   646 // CBrowserFavouritesListbox::CBrowserFavouritesListbox
       
   647 // ---------------------------------------------------------
       
   648 //
       
   649 CBrowserFavouritesListbox::CBrowserFavouritesListbox
       
   650                             ( MApiProvider& aApiProvider ) :
       
   651     iApiProvider( aApiProvider )
       
   652     {
       
   653     }
       
   654 
       
   655 // ---------------------------------------------------------
       
   656 // CBrowserFavouritesListbox::ConstructL
       
   657 // ---------------------------------------------------------
       
   658 //
       
   659 void CBrowserFavouritesListbox::ConstructL
       
   660         (
       
   661         const CCoeControl* aParent,
       
   662         const MBrowserFavouritesListboxIconHandler& aIconHandler
       
   663         )
       
   664     {
       
   665     iSkinUpdated = EFalse;
       
   666     iIconHandler = &aIconHandler;
       
   667     iItems = new (ELeave) CFavouritesItemList();
       
   668     iIconIndexes =
       
   669         new (ELeave) CBrowserFavouritesIconIndexArray( KGranularity );
       
   670     CAknSingleGraphicStyleListBox::ConstructL( aParent, ListboxFlags() );
       
   671     // MUST call this after the listbox has finished; listbox construction
       
   672     // is buggy and overwrites the model's itemarray ptr.
       
   673     TheModel()->SetItemArray();
       
   674     CreateScrollBarFrameL( ETrue );
       
   675     ScrollBarFrame()->SetScrollBarVisibilityL
       
   676         ( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
       
   677 
       
   678     // Load icons
       
   679     ItemDrawer()->ColumnData()->SetIconArray
       
   680         ( iIconHandler->CreateIconArrayL() );
       
   681 
       
   682     // Store the size of an icon
       
   683     TAknWindowComponentLayout layout =
       
   684                 AknLayoutScalable_Avkon::list_single_graphic_pane_g1(0);
       
   685 
       
   686     TAknLayoutRect naviPaneGraphicsLayoutRect;
       
   687     TRect listBoxGraphicRect;
       
   688     TRect rect = iAvkonAppUi->ClientRect();
       
   689 
       
   690 
       
   691     naviPaneGraphicsLayoutRect.LayoutRect( rect, layout);
       
   692     listBoxGraphicRect = naviPaneGraphicsLayoutRect.Rect();
       
   693 
       
   694     TSize listBoxGraphicSize( listBoxGraphicRect.iBr.iX - listBoxGraphicRect.iTl.iX,
       
   695                                 listBoxGraphicRect.iBr.iY - listBoxGraphicRect.iTl.iY );
       
   696     // Favicon handler
       
   697     iFaviconHandler = CBrowserFaviconHandler::NewL(
       
   698                                 iApiProvider,
       
   699                                 ItemDrawer()->ColumnData()->IconArray(),
       
   700                                 *this,
       
   701                                 listBoxGraphicSize );
       
   702 
       
   703     ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
       
   704 
       
   705 
       
   706     // Setup italicized font for use later    
       
   707     const CFont* logicalFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);
       
   708     
       
   709     // Note: This font is owned by the application's system font array (where it 
       
   710     // is likely already to have been created) and does not need to be
       
   711     // released. It can just go out of scope.// Extract font information
       
   712     TFontSpec fontSpec = logicalFont->FontSpecInTwips();// Desired height, weight, and posture already set in locals
       
   713     fontSpec.iFontStyle.SetPosture( EPostureItalic );// Obtain new font
       
   714     CWsScreenDevice& screenDev = *( CEikonEnv::Static()->ScreenDevice() );
       
   715     screenDev.GetNearestFontInTwips( ( CFont*& )iFontItalic, fontSpec );
       
   716  
       
   717     }
       
   718 
       
   719 // ---------------------------------------------------------
       
   720 // CBrowserFavouritesListbox::ListboxFlags
       
   721 // ---------------------------------------------------------
       
   722 //
       
   723 TInt CBrowserFavouritesListbox::ListboxFlags()
       
   724     {
       
   725     return AknLayoutUtils::PenEnabled() ?  
       
   726          EAknListBoxStylusMarkableList :  EAknListBoxMarkableList;
       
   727     }
       
   728 
       
   729 // ---------------------------------------------------------
       
   730 // CBrowserFavouritesListbox::GetIconIndexesLC
       
   731 // ---------------------------------------------------------
       
   732 //
       
   733 CBrowserFavouritesIconIndexArray*
       
   734 CBrowserFavouritesListbox::GetIconIndexesLC
       
   735 ( /*MCommsModel& aCommsModel, */CFavouritesItemList& aItems )
       
   736     {
       
   737     // Create new empty list.
       
   738     CBrowserFavouritesIconIndexArray* iconIndexes =
       
   739         new (ELeave) CBrowserFavouritesIconIndexArray( KGranularity );
       
   740     CleanupStack::PushL( iconIndexes );
       
   741     // Get list of access points. Not copy, owned by the AP model.
       
   742    // const CApListItemList* apList = aCommsModel.AccessPoints();
       
   743     // Fill the list.
       
   744     TInt i = 0;
       
   745     TInt count = aItems.Count();
       
   746     for ( i = 0; i < count; i++ )
       
   747         {
       
   748         iconIndexes->AppendL
       
   749             ( iIconHandler->IconIndexes( *(aItems.At( i ))/*, apList*/,this ) );
       
   750         }
       
   751     return iconIndexes;
       
   752     }
       
   753 
       
   754 // ---------------------------------------------------------
       
   755 // CBrowserFavouritesListbox::CalcNewStateL
       
   756 // ---------------------------------------------------------
       
   757 //
       
   758 void CBrowserFavouritesListbox::CalcNewStateL
       
   759 ( CFavouritesItemList& aNewItems )
       
   760     {
       
   761     delete iNewState;
       
   762     iNewState = NULL;
       
   763     iNewState = new( ELeave ) CBrowserFavouritesListboxState;
       
   764 
       
   765     // 1. Check if we have any new item. If yes, highlight goes to first
       
   766     // new one.
       
   767     TInt i;
       
   768     TInt count = aNewItems.Count();
       
   769     for ( i = 0; i < count; i++ )
       
   770         {
       
   771         if ( iItems->UidToIndex( aNewItems.IndexToUid( i ) ) ==
       
   772                                                             KErrNotFound )
       
   773             {
       
   774             // New item, not found among the old ones.
       
   775             // Set highlight to that, and also becomes top item.
       
   776             iNewState->iHighlightUid = iNewState->iTopItemUid =
       
   777                 aNewItems.IndexToUid( i );
       
   778             break;
       
   779             }
       
   780         }
       
   781 
       
   782     // 2. If there is no new item, get the new highlight. That is the old
       
   783     // one, if still exists, or the next remaining one after the
       
   784     // deleted old one(s).
       
   785     TInt uid;
       
   786     if ( iNewState->iHighlightUid == KFavouritesNullUid )
       
   787         {
       
   788         i = CurrentItemRealIndex();
       
   789         if ( i >= 0 )
       
   790             {
       
   791             // Have current item.
       
   792             // Now go down the old list, beginning from highlighted one;
       
   793             // find first item that still exists.
       
   794             count = iItems->Count();
       
   795             for ( /*current highlight index: i*/; i < count; i++ )
       
   796                 {
       
   797                 uid = iItems->At( i )->Uid();
       
   798                 if ( aNewItems.UidToIndex( uid ) != KErrNotFound )
       
   799                     {
       
   800                     iNewState->iHighlightUid = uid;
       
   801                     break;
       
   802                     }
       
   803                 }
       
   804             // Here we should have higlight uid, unless the deleted element(s)
       
   805             // were last. In that case, set last item highlighted (if there is
       
   806             // anything to highlight).
       
   807             if ( iNewState->iHighlightUid == KFavouritesNullUid &&
       
   808                                                             aNewItems.Count() )
       
   809                 {
       
   810                 iNewState->iHighlightUid = aNewItems.IndexToUid
       
   811                     ( aNewItems.Count() - 1 );
       
   812                 }
       
   813             }
       
   814         }
       
   815 
       
   816     // 3. Get mark uids. Whether these uids exist in the new list or not, is
       
   817     // not checked here; setting marks to the already changed listbox is
       
   818     // fool-proof.
       
   819     iNewState->iMarkUids = MarkedUidsLC();
       
   820     CleanupStack::Pop();    // Uid list; ownership is now in the state.
       
   821     }
       
   822 
       
   823 // ---------------------------------------------------------
       
   824 // CBrowserFavouritesListbox::SetStateL
       
   825 // ---------------------------------------------------------
       
   826 //
       
   827 void CBrowserFavouritesListbox::SetStateL
       
   828 ( const CBrowserFavouritesListboxState& aState )
       
   829     {
       
   830     TInt topIndex;
       
   831 
       
   832     // Set marks.
       
   833     if ( aState.iMarkUids->Count() )
       
   834         {
       
   835         CArrayFix<TInt>* marks = new (ELeave) CArrayFixFlat<TInt>( 4 );
       
   836         CleanupStack::PushL( marks );
       
   837         marks->AppendL
       
   838             ( aState.iMarkUids->Back( 0 ), aState.iMarkUids->Count() );
       
   839         UidsToViewIndexes( *marks );
       
   840         SetSelectionIndexesL( marks );
       
   841         CleanupStack::PopAndDestroy();  // marks
       
   842         }
       
   843 
       
   844     // Set top item index.
       
   845     topIndex = UidToViewIndex ( aState.iTopItemUid );
       
   846     if ( topIndex >= 0 )
       
   847         {
       
   848         // Always try to fill the listbox (if there were empty lines below,
       
   849         // "scroll down", instead of strictly restoring the top item index).
       
   850         TInt topIndexToSeeLastItem = Model()->NumberOfItems() -
       
   851             View()->NumberOfItemsThatFitInRect( View()->ViewRect() );
       
   852         if ( topIndexToSeeLastItem < 0 )
       
   853             {
       
   854             topIndexToSeeLastItem = 0;
       
   855             }
       
   856         topIndex = Min( topIndex, topIndexToSeeLastItem );
       
   857         SetTopItemIndex( topIndex );
       
   858         }
       
   859 
       
   860     // Set higlight.
       
   861     TInt curIndex = UidToViewIndex ( aState.iHighlightUid );
       
   862     if ( curIndex < 0 )
       
   863         {
       
   864         // If cannot restore highlight, set it to top item.
       
   865         curIndex = topIndex;
       
   866         }
       
   867     if ( curIndex >= 0 )
       
   868         {
       
   869         SetCurrentItemIndex( curIndex );
       
   870         }
       
   871 
       
   872     DrawNow();
       
   873 
       
   874     if ( iCursorObserver )
       
   875         {
       
   876         // Cursor now points to some different item. Let the observer know it.
       
   877         iCursorObserver->HandleCursorChangedL( this );
       
   878         }
       
   879     }
       
   880 
       
   881 // ---------------------------------------------------------
       
   882 // CBrowserFavouritesListbox::UidToViewIndex
       
   883 // ---------------------------------------------------------
       
   884 //
       
   885 TInt CBrowserFavouritesListbox::UidToViewIndex( TInt aUid ) const
       
   886     {
       
   887     TInt viewIndex = KErrNotFound;
       
   888     TInt realIndex = iItems->UidToIndex( aUid );
       
   889     if ( realIndex >= 0 )
       
   890         {
       
   891         CAknListBoxFilterItems* filter = TheModel()->Filter();
       
   892         if ( filter )
       
   893             {
       
   894             // Have filter, do the conversion.
       
   895             viewIndex = filter->VisibleItemIndex( realIndex );
       
   896             }
       
   897         else
       
   898             {
       
   899             // No filter, no conversion necessary.
       
   900             viewIndex = realIndex;
       
   901             }
       
   902         }
       
   903     return viewIndex;
       
   904     }
       
   905 
       
   906 // ---------------------------------------------------------
       
   907 // CBrowserFavouritesListbox::UidsToViewIndexes
       
   908 // ---------------------------------------------------------
       
   909 //
       
   910 void CBrowserFavouritesListbox::UidsToViewIndexes
       
   911 ( CArrayFix<TInt>& aList ) const
       
   912     {
       
   913     TInt i;
       
   914     TInt j;
       
   915     TInt index;
       
   916     TInt count = aList.Count();
       
   917     for ( i = 0, j = 0; i < count; i++ )
       
   918         {
       
   919         index = UidToViewIndex( aList.At ( i ) );
       
   920         if ( index != KErrNotFound )
       
   921             {
       
   922             aList.At( j++ ) = index;
       
   923             }
       
   924         }
       
   925     if ( j < count )
       
   926         {
       
   927         // Not all Uids were converted. Delete the trailing rubbish.
       
   928         aList.Delete( j, count - j );
       
   929         }
       
   930     }
       
   931 
       
   932 // ---------------------------------------------------------
       
   933 // CBrowserFavouritesListbox::RealIndexesToUids
       
   934 // ---------------------------------------------------------
       
   935 //
       
   936 void CBrowserFavouritesListbox::RealIndexesToUids
       
   937 ( CArrayFix<TInt>& aList ) const
       
   938     {
       
   939     TInt i;
       
   940     TInt uid;
       
   941     TInt count = aList.Count();
       
   942     for ( i = 0; i < count; i++ )
       
   943         {
       
   944         uid = iItems->IndexToUid( aList.At( i ) );
       
   945         __ASSERT_DEBUG( uid != KFavouritesNullUid, \
       
   946             Util::Panic( Util::EFavouritesBadBookmarkUid ) );
       
   947         aList.At( i ) = uid;
       
   948         }
       
   949     }
       
   950 
       
   951 // ---------------------------------------------------------
       
   952 // CBrowserFavouritesListbox::MarkedRealIndexesLC
       
   953 // ---------------------------------------------------------
       
   954 //
       
   955 CArrayFix<TInt>* CBrowserFavouritesListbox::MarkedRealIndexesLC() const
       
   956     {
       
   957     CListBoxView::CSelectionIndexArray* array =
       
   958         new (ELeave) CArrayFixFlat<TInt>( KGranularity );
       
   959     CleanupStack::PushL( array );
       
   960     if ( iItems->Count() )
       
   961         {
       
   962         const CArrayFix<TInt>* marked;
       
   963         CAknListBoxFilterItems* filter = TheModel()->Filter();
       
   964         if ( filter )
       
   965             {
       
   966             // Filter knows all.
       
   967             filter->UpdateSelectionIndexesL();
       
   968             marked = filter->SelectionIndexes();
       
   969 #if 1 /* TODO remove when AVKON bug fixed*/
       
   970             // Overcoming AVKON bug. If filter criteria is empty (i.e. the
       
   971             // user is not typing in the filter), selection indexes between
       
   972             // the filter and the listbox are not synchronized! Unfortunately,
       
   973             // this strange back-way is the only means by we can discover if
       
   974             // we have criteria or not; CAknListBoxFilterItems has the
       
   975             // criteria as private; and the CAknSearchField, which holds the
       
   976             // filter (and has the string) is not accessible here in the
       
   977             // listbox (it's in the container).
       
   978             if ( filter->FilteredNumberOfItems() ==
       
   979                 filter->NonFilteredNumberOfItems() )
       
   980                 {
       
   981                 marked = View()->SelectionIndexes();
       
   982                 }
       
   983 #endif
       
   984             }
       
   985         else
       
   986             {
       
   987             // No filter.
       
   988             marked = View()->SelectionIndexes();
       
   989             }
       
   990         AppendArrayL( /*aTarget=*/*array, /*aSource=*/*marked );
       
   991         }
       
   992     return array;
       
   993     }
       
   994 
       
   995 // ---------------------------------------------------------
       
   996 // CBrowserFavouritesListbox::SelectedRealIndexesLC
       
   997 // ---------------------------------------------------------
       
   998 //
       
   999 CArrayFix<TInt>* CBrowserFavouritesListbox::SelectedRealIndexesLC() const
       
  1000     {
       
  1001     CListBoxView::CSelectionIndexArray* selection =
       
  1002         MarkedRealIndexesLC();
       
  1003     if ( selection->Count() == 0 )
       
  1004         {
       
  1005         // No marks; use the highlighted one.
       
  1006         selection->AppendL( CurrentItemRealIndex() );
       
  1007         }
       
  1008     return selection;
       
  1009     }
       
  1010 
       
  1011 // ---------------------------------------------------------
       
  1012 // CBrowserFavouritesListbox::CurrentItemRealIndex
       
  1013 // ---------------------------------------------------------
       
  1014 //
       
  1015 TInt CBrowserFavouritesListbox::CurrentItemRealIndex() const
       
  1016     {
       
  1017     return RealIndex( CurrentItemIndex() /*that's view index*/ );
       
  1018     }
       
  1019 
       
  1020 // ---------------------------------------------------------
       
  1021 // CBrowserFavouritesListbox::RealIndex
       
  1022 // ---------------------------------------------------------
       
  1023 //
       
  1024 TInt CBrowserFavouritesListbox::RealIndex( TInt aViewIndex ) const
       
  1025     {
       
  1026     TInt index = KErrNotFound;
       
  1027     if ( aViewIndex >= 0 )
       
  1028         {
       
  1029         CAknListBoxFilterItems* filter = TheModel()->Filter();
       
  1030         if ( filter )
       
  1031             {
       
  1032             // If we have the index and the filter also, do the conversion.
       
  1033             index = filter->FilteredItemIndex( aViewIndex );
       
  1034             }
       
  1035         else
       
  1036             {
       
  1037             index = aViewIndex;
       
  1038             }
       
  1039         }
       
  1040     return index;
       
  1041     }
       
  1042 
       
  1043 // ---------------------------------------------------------
       
  1044 // CBrowserFavouritesListbox::RealIndexes
       
  1045 // ---------------------------------------------------------
       
  1046 //
       
  1047 void CBrowserFavouritesListbox::RealIndexes( CArrayFix<TInt>& aList ) const
       
  1048     {
       
  1049     TInt i;
       
  1050     TInt j;
       
  1051     TInt index;
       
  1052     TInt count = aList.Count();
       
  1053     for ( i = 0, j = 0; i < count; i++ )
       
  1054         {
       
  1055         index = RealIndex( aList.At ( i ) );
       
  1056         if ( index != KErrNotFound )
       
  1057             {
       
  1058             aList.At( j++ ) = index;
       
  1059             }
       
  1060         }
       
  1061     if ( j < count )
       
  1062         {
       
  1063         // Not all indexes were converted. Delete the trailing rubbish.
       
  1064         aList.Delete( j, count - j );
       
  1065         }
       
  1066     }
       
  1067 
       
  1068 // ---------------------------------------------------------
       
  1069 // CBrowserFavouritesListbox::SelectionFlags
       
  1070 // ---------------------------------------------------------
       
  1071 //
       
  1072 TInt CBrowserFavouritesListbox::SelectionFlags
       
  1073 ( const CFavouritesItem& aItem ) const
       
  1074     {
       
  1075     TInt flags = 0;
       
  1076     if ( aItem.IsItem() )
       
  1077         {
       
  1078         switch ( aItem.Uid() )
       
  1079             {
       
  1080             case KFavouritesHomepageUid:
       
  1081                 {
       
  1082                 flags |=
       
  1083                     TBrowserFavouritesSelectionState::EAny |
       
  1084                     TBrowserFavouritesSelectionState::EHomepage |
       
  1085                     TBrowserFavouritesSelectionState::EItem;
       
  1086                 break;
       
  1087                 }
       
  1088 
       
  1089             case KFavouritesStartPageUid:
       
  1090                 {
       
  1091                 flags |=
       
  1092                     TBrowserFavouritesSelectionState::EAny |
       
  1093                     TBrowserFavouritesSelectionState::EStartPage |
       
  1094                     TBrowserFavouritesSelectionState::EItem;
       
  1095                 break;
       
  1096                 }
       
  1097 
       
  1098             case KFavouritesLastVisitedUid:
       
  1099                 {
       
  1100                 flags |=
       
  1101                     TBrowserFavouritesSelectionState::EAny |
       
  1102                     TBrowserFavouritesSelectionState::ELastVisited |
       
  1103                     TBrowserFavouritesSelectionState::EItem;
       
  1104                 break;
       
  1105                 }
       
  1106 
       
  1107             default:
       
  1108                 {
       
  1109                 flags |=
       
  1110                     TBrowserFavouritesSelectionState::EAny |
       
  1111                     TBrowserFavouritesSelectionState::EPlainItem |
       
  1112                     TBrowserFavouritesSelectionState::EItem;
       
  1113                 break;
       
  1114                 }
       
  1115             }
       
  1116         }
       
  1117     else
       
  1118         {
       
  1119         flags |=
       
  1120             TBrowserFavouritesSelectionState::EAny |
       
  1121             TBrowserFavouritesSelectionState::EFolder;
       
  1122         }
       
  1123     return flags;
       
  1124     }
       
  1125 
       
  1126 // ---------------------------------------------------------
       
  1127 // CBrowserFavouritesListbox::TheModel
       
  1128 // ---------------------------------------------------------
       
  1129 //
       
  1130 CBrowserFavouritesListboxModel*
       
  1131 CBrowserFavouritesListbox::TheModel() const
       
  1132     {
       
  1133     return REINTERPRET_CAST( CBrowserFavouritesListboxModel*, Model() );
       
  1134     }
       
  1135 
       
  1136 
       
  1137 // ---------------------------------------------------------
       
  1138 // CBrowserFavouritesListbox::HandleResourceChange
       
  1139 // ---------------------------------------------------------
       
  1140 //
       
  1141 void CBrowserFavouritesListbox::HandleResourceChange( TInt aType )
       
  1142     {
       
  1143     CAknSingleGraphicStyleListBox::HandleResourceChange( aType );
       
  1144     if ( aType == KAknsMessageSkinChange )
       
  1145         {
       
  1146         CArrayPtr<CGulIcon>* array =
       
  1147         ItemDrawer()->ColumnData()->IconArray();
       
  1148 
       
  1149         array->ResetAndDestroy();
       
  1150         delete array;
       
  1151 
       
  1152         CAknIconArray* iconArray = NULL;
       
  1153         TRAPD( err,
       
  1154                 iconArray = iIconHandler->CreateIconArrayL()
       
  1155                 )
       
  1156 
       
  1157         if ( !err )
       
  1158             {
       
  1159             ItemDrawer()->ColumnData()->SetIconArray( iconArray );
       
  1160             iFaviconHandler->UpdateIconArray(ItemDrawer()->ColumnData()->IconArray());
       
  1161             SetSkinUpdated(ETrue);
       
  1162             }
       
  1163         }
       
  1164     }
       
  1165 
       
  1166 // ---------------------------------------------------------
       
  1167 // CBrowserFavouritesListbox::SetSkinUpdated
       
  1168 // ---------------------------------------------------------
       
  1169 //
       
  1170 void CBrowserFavouritesListbox::SetSkinUpdated(TBool aSkinUpdated)
       
  1171     {
       
  1172     iSkinUpdated = aSkinUpdated;
       
  1173     }
       
  1174 
       
  1175 // ---------------------------------------------------------
       
  1176 // CBrowserFavouritesListbox::ItalicizeRowItemL
       
  1177 // ---------------------------------------------------------
       
  1178 //
       
  1179 void CBrowserFavouritesListbox::ItalicizeRowItemL(TInt aRowIndex)
       
  1180     {
       
  1181     if (ItemDrawer() && ItemDrawer()->ColumnData() && iFontItalic)
       
  1182         {
       
  1183         ItemDrawer()->ColumnData()->SetColumnFontForRowL( aRowIndex, 1, iFontItalic );
       
  1184         }
       
  1185     }
       
  1186 
       
  1187 //  End of File