messagingappbase/mce/src/MceOneRowMessageListBitmapResolver.cpp
branchRCL_3
changeset 60 7fdbb852d323
parent 0 72b543305e3a
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 2007 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:  
       
    15 *     Handles different mce bitmaps.
       
    16 *     First collects all the bitmaps from different mtm's and also local
       
    17 *     folder's bitmaps to icon array.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include "MceOneRowMessageListBitmapResolver.h"
       
    25 #include <mtudcbas.h>       // cbasemtmuidata
       
    26 #include "MtmRegistryObserver.h" // mmtmuidataregistryobserver
       
    27 #include <msvuids.h>
       
    28 #include <msvids.h>         // fixed entry ids
       
    29 #include <gulicon.h>        // CGulIcon
       
    30 #include <AknIconArray.h>   // cakniconarray
       
    31 #include <fbs.h>            // CFbsFont
       
    32 #include <muiu.mbg>         // bitmap enums
       
    33 #include <avkon.mbg>        // bitmap enums
       
    34 #include <mtud.hrh>         // EMtudEntryStateOpen
       
    35 #include <SenduiMtmUids.h>  // mtm uids
       
    36 #include <aknsinglecolumnstyletreelist.h>
       
    37 
       
    38 #include "MceUtils.h"
       
    39 
       
    40 // security data caging
       
    41 #include <data_caging_path_literals.hrh>
       
    42 #include <bldvariant.hrh>
       
    43 #include <AknIconUtils.h>
       
    44 
       
    45 
       
    46 // LOCAL CONSTANTS AND MACROS
       
    47 
       
    48 _LIT( KMceDirAndFileMuiu,"muiu.mbm" );
       
    49 
       
    50 const TInt KMceIconArrayGranularity = 10;
       
    51 
       
    52 // ================= MEMBER FUNCTIONS =======================
       
    53 
       
    54 CMceOneRowBitmapResolver* CMceOneRowBitmapResolver::NewL(
       
    55     CMsvSessionPtr aSession,
       
    56     MMtmUiDataRegistryObserver& aRegObserver )
       
    57     { // static
       
    58     CMceOneRowBitmapResolver* self=new(ELeave) CMceOneRowBitmapResolver(
       
    59         aSession,
       
    60         aRegObserver );
       
    61     CleanupStack::PushL(self);
       
    62     self->ConstructL();
       
    63     CleanupStack::Pop(); // self
       
    64     return self;
       
    65     }
       
    66 
       
    67 CMceOneRowBitmapResolver::CMceOneRowBitmapResolver(
       
    68     CMsvSessionPtr aSession,
       
    69     MMtmUiDataRegistryObserver& aRegObserver )
       
    70     :
       
    71     iRegObserver( aRegObserver ),
       
    72     iSession( aSession ),
       
    73     iBitmapsLoaded( 0 )
       
    74     {
       
    75     }
       
    76 
       
    77 CMceOneRowBitmapResolver::~CMceOneRowBitmapResolver()
       
    78     {
       
    79     if ( iIcons )
       
    80         {
       
    81         iIcons->ResetAndDestroy();
       
    82         }
       
    83     delete iIcons;
       
    84     iIconArray.Close();
       
    85     }
       
    86 
       
    87 
       
    88 // ----------------------------------------------------
       
    89 // CMceOneRowBitmapResolver::ConstructL
       
    90 // ----------------------------------------------------
       
    91 void CMceOneRowBitmapResolver::ConstructL()
       
    92     {
       
    93     // security data caging
       
    94     TParse fp;
       
    95     fp.Set( AknIconUtils::AvkonIconFileName(), &KDC_RESOURCE_FILES_DIR , NULL );
       
    96     iFilenameAvkon = fp.FullName();
       
    97 
       
    98     fp.Set( KMceDirAndFileMuiu, &KDC_APP_BITMAP_DIR , NULL );
       
    99     iFilenameMuiu = fp.FullName();
       
   100 
       
   101     iIcons = new(ELeave) CAknIconArray( KMceIconArrayGranularity );
       
   102     ChangeBitmapInIconArrayL();
       
   103 
       
   104     iIconArray.Reset();
       
   105     for ( TInt i = EMceBitmapIndexUnknown; i < EMceBitmapIndexLastIconIndex; i++ )
       
   106         {
       
   107         TMceHierListIconEntry iconEntry;
       
   108         iconEntry.iBitmapPointer = 0;
       
   109         iconEntry.iIconId = 0;
       
   110         iIconArray.AppendL( iconEntry );
       
   111         }
       
   112 
       
   113     }
       
   114 
       
   115 // ----------------------------------------------------
       
   116 // CMceOneRowBitmapResolver::CreateAndAppendIconL
       
   117 // ----------------------------------------------------
       
   118 void CMceOneRowBitmapResolver::CreateAndAppendIconL(
       
   119     MAknsSkinInstance* aSkin,
       
   120     TAknsItemID aId,
       
   121     const TDesC& aFileName,
       
   122     TInt aBitmapIndex, 
       
   123     TMceOneRowBitmapLoadType aBitmapType )
       
   124     {
       
   125     CFbsBitmap* bitmap = NULL;
       
   126     CFbsBitmap* mask = NULL;
       
   127     
       
   128     if ( aBitmapType == EMceOneRowBitmapLoadNormal )
       
   129         {
       
   130         AknsUtils::CreateIconL( 
       
   131             aSkin, 
       
   132             aId, 
       
   133             bitmap,
       
   134             mask, 
       
   135             aFileName, 
       
   136             aBitmapIndex, 
       
   137             aBitmapIndex + 1 );  
       
   138         
       
   139         }
       
   140     else if ( aBitmapType == EMceOneRowBitmapLoadSkinned )
       
   141         {
       
   142         AknsUtils::CreateColorIconL(
       
   143             aSkin,
       
   144             aId,
       
   145             KAknsIIDQsnIconColors,
       
   146             EAknsCIQsnIconColorsCG13,
       
   147             bitmap,
       
   148             mask,
       
   149             aFileName,
       
   150             aBitmapIndex,
       
   151             aBitmapIndex + 1,
       
   152             KRgbBlack );
       
   153         }
       
   154     else
       
   155         {
       
   156         AknsUtils::CreateColorIconL(
       
   157             aSkin,
       
   158             aId,
       
   159             KAknsIIDQsnIconColors,
       
   160             EAknsCIQsnIconColorsCG16,
       
   161             bitmap,
       
   162             mask,
       
   163             aFileName,
       
   164             aBitmapIndex,
       
   165             aBitmapIndex + 1,
       
   166             KRgbBlack );
       
   167         }
       
   168     CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
       
   169 
       
   170     CleanupStack::PushL( icon );
       
   171     iIcons->AppendL( icon );
       
   172     CleanupStack::Pop(); // icon
       
   173 
       
   174     iBitmapsLoaded = iIcons->Count();
       
   175     }
       
   176 
       
   177 
       
   178 // ----------------------------------------------------
       
   179 // CMceOneRowBitmapResolver::IconArray
       
   180 // ----------------------------------------------------
       
   181 CArrayPtrFlat<CGulIcon>* CMceOneRowBitmapResolver::IconArray()
       
   182     {
       
   183     return iIcons;
       
   184     }
       
   185 
       
   186 // ----------------------------------------------------
       
   187 // CMceOneRowBitmapResolver::BitmapIndex
       
   188 // ----------------------------------------------------
       
   189 TInt CMceOneRowBitmapResolver::BitmapIndex( const TMsvEntry& aEntry )
       
   190     {
       
   191     TInt foundIndex = KErrNotFound;
       
   192     const TMsvId id = aEntry.Id();
       
   193     if ( aEntry.iMtm == KUidMsvLocalServiceMtm &&
       
   194          aEntry.iType == KUidMsvFolderEntry )
       
   195         {
       
   196         foundIndex = LocalEntryBitmapIndex( id );
       
   197 
       
   198         // check if folder has unread messages
       
   199         if ( id ==  KMsvGlobalInBoxIndexEntryId ||
       
   200 //            id ==  KMceDocumentsEntryId ||
       
   201             id >= KFirstFreeEntryId
       
   202             )
       
   203             {
       
   204             TBool unreadMessages = EFalse;
       
   205             TRAPD(err, ( unreadMessages = HasUnreadMessagesL( id ) ) );
       
   206             if (err == KErrNone && unreadMessages )
       
   207                 {
       
   208                 foundIndex++;
       
   209                 }
       
   210             }
       
   211         }
       
   212 
       
   213     if ( foundIndex == KErrNotFound )
       
   214         {
       
   215         TRAPD(err, ( foundIndex = LoadBitmapL( aEntry ) ) );
       
   216         if (err != KErrNone )
       
   217             {
       
   218             foundIndex = KErrNotFound;
       
   219             }
       
   220         }
       
   221 
       
   222     return ( foundIndex == KErrNotFound ?
       
   223         EMceBitmapIndexUnknown : foundIndex );
       
   224     }
       
   225 
       
   226 // ----------------------------------------------------
       
   227 // CMceOneRowBitmapResolver::LoadBitmapL
       
   228 // ----------------------------------------------------
       
   229 TInt CMceOneRowBitmapResolver::LoadBitmapL( const TMsvEntry& aEntry )
       
   230     {
       
   231     CBaseMtmUiData* uiData = iRegObserver.GetMtmUiDataL(aEntry.iMtm);
       
   232 
       
   233     if ( uiData )
       
   234         {
       
   235         TInt flags = 0;
       
   236         if ( aEntry.iType.iUid == KUidMsvServiceEntryValue ||
       
   237             aEntry.iType == KUidMsvFolderEntry)
       
   238             {
       
   239             TBool unreadMessages = EFalse;
       
   240             TRAPD( err, ( unreadMessages = HasUnreadMessagesL( aEntry.Id() ) ) );
       
   241             // leave error codes are filtered, because it is not important to know
       
   242             // if there are unread messages or not,
       
   243             // just different icon would be displayed
       
   244             if (err == KErrNone && unreadMessages )
       
   245                 {
       
   246                 flags = EMtudEntryStateOpen; // includes unread messages
       
   247                 }
       
   248 
       
   249             //check for sub folders
       
   250 
       
   251             TMsvSelectionOrdering selectionOrdering( KMsvGroupByType, EMsvSortByNone, ETrue );
       
   252             CMsvEntry* entry = iSession->GetEntryL( aEntry.Id() );
       
   253             entry->SetSortTypeL( selectionOrdering );
       
   254             CleanupStack::PushL( entry );
       
   255             TInt index = entry->Count()-1;
       
   256             while ( ( index>=0 ) && ( (*entry)[index].iType != KUidMsvFolderEntry ) )
       
   257                 {
       
   258                 index--;
       
   259                 }
       
   260             CleanupStack::PopAndDestroy( entry );
       
   261             if( index != -1 )
       
   262                 {
       
   263                 flags |= EMtudEntryStateSubFolder;
       
   264                 }
       
   265 
       
   266             }
       
   267 
       
   268         const CBaseMtmUiData::CBitmapArray* bitmaps = NULL;
       
   269         bitmaps = &uiData->ContextIcon( aEntry, flags );
       
   270 
       
   271         if ( bitmaps )
       
   272             {
       
   273             CGulIcon* tempBmp = NULL;
       
   274 
       
   275             if ( bitmaps->Count() == 1 )
       
   276                 {
       
   277                 tempBmp = CGulIcon::NewL( bitmaps->At( 0 ) );
       
   278                 }
       
   279             else if ( bitmaps->Count() > 1 )
       
   280                 {
       
   281                 tempBmp = CGulIcon::NewL( bitmaps->At( 0 ), bitmaps->At( 1 ) );
       
   282                 }
       
   283 
       
   284             if ( tempBmp )
       
   285                 {
       
   286                 CleanupStack::PushL( tempBmp );
       
   287                 tempBmp->SetBitmapsOwnedExternally( ETrue );
       
   288 
       
   289                 TInt index = iIcons->Count() - 1;
       
   290                 iIcons->AppendL( tempBmp ); // Array will be of count 22
       
   291                 // index greater than 20 so 21 or 22
       
   292                 if ( index > iBitmapsLoaded )
       
   293                     {
       
   294                     while ( iIcons->Count() != iBitmapsLoaded+1 )
       
   295                         {
       
   296                         CGulIcon* iconToBeDelete = iIcons->At( index );
       
   297                         iIcons->Delete( index );
       
   298                         delete iconToBeDelete;
       
   299                         index--;
       
   300                         }
       
   301                     }
       
   302                 else
       
   303                     {
       
   304                     CGulIcon* iconToBeDelete = iIcons->At( index );
       
   305                     iIcons->Delete( index );
       
   306                     delete iconToBeDelete;
       
   307                     }
       
   308 
       
   309                 CleanupStack::Pop(); // tempBmp
       
   310                 }
       
   311             }
       
   312         else
       
   313             {
       
   314             return KErrNotFound;
       
   315             }
       
   316         }
       
   317     else
       
   318         {
       
   319         // something is wrong
       
   320         return EMceBitmapIndexUnknown;
       
   321         }
       
   322     return iIcons->Count() - 1;
       
   323     }
       
   324 
       
   325 
       
   326 // ----------------------------------------------------
       
   327 // CMceOneRowBitmapResolver::GetBitmapL
       
   328 // ----------------------------------------------------
       
   329 TInt CMceOneRowBitmapResolver::GetBitmapL( TMsvEntry& aEntry, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask )
       
   330     {
       
   331     TInt index = BitmapIndex( aEntry );
       
   332     if ( index >= 0 )
       
   333         {
       
   334         CFbsBitmap* bitmap = NULL;
       
   335         CFbsBitmap* bitmapMask = NULL;
       
   336         CGulIcon* foundIcon = iIcons->At( index );
       
   337         bitmap = foundIcon->Bitmap();
       
   338         bitmapMask = foundIcon->Mask();
       
   339         aBitmap = bitmap;
       
   340         aMask = bitmapMask;
       
   341         
       
   342         // if this is found from the array already
       
   343         index = KErrNotFound;
       
   344         const TInt iconCount = iIconArray.Count();
       
   345         for (TInt i = 0; i < iconCount && index == KErrNotFound; i++)
       
   346             {
       
   347             if ( iIconArray.operator[](i).iBitmapPointer == bitmap )
       
   348                 {
       
   349                 index = iIconArray.operator[](i).iIconId;
       
   350                 }
       
   351             }
       
   352         }
       
   353         
       
   354     return (index < 0 ? KErrNotFound : index );
       
   355     }
       
   356 
       
   357 // ----------------------------------------------------
       
   358 // CMceOneRowBitmapResolver::GetBitmapL
       
   359 // ----------------------------------------------------
       
   360 TInt CMceOneRowBitmapResolver::GetBitmapL( TMceBitmapArrayIndexes aBitmapIndex, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask )
       
   361     {
       
   362     // or should it be ok just return iIconArray.operator[](aBitmapIndex).iIconId;
       
   363     CGulIcon* foundIcon = iIcons->At( aBitmapIndex );
       
   364     CFbsBitmap* bitmap = NULL;
       
   365     CFbsBitmap* bitmapMask = NULL;
       
   366     bitmap = foundIcon->Bitmap();
       
   367     bitmapMask = foundIcon->Mask();
       
   368     aBitmap = bitmap;
       
   369     aMask = bitmapMask;
       
   370         
       
   371     // if this is found from the array already
       
   372     TInt index = KErrNotFound;
       
   373     const TInt iconCount = iIconArray.Count();
       
   374     for (TInt i = 0; i < iconCount && index == KErrNotFound; i++)
       
   375         {
       
   376         if ( iIconArray.operator[](i).iBitmapPointer == bitmap )
       
   377             {
       
   378             index = iIconArray.operator[](i).iIconId;
       
   379             }
       
   380         }
       
   381     return index;
       
   382     }
       
   383 
       
   384 // ----------------------------------------------------
       
   385 // CMceOneRowBitmapResolver::AddTreeIconIdL
       
   386 // ----------------------------------------------------
       
   387 TInt CMceOneRowBitmapResolver::AddTreeIconIdL( 
       
   388     CFbsBitmap* aBitmap, 
       
   389     TInt aTreeIconIndex,
       
   390     TUid aMtmUid )
       
   391     {
       
   392     TMceHierListIconEntry iconEntry;
       
   393     iconEntry.iBitmapPointer = aBitmap;
       
   394     iconEntry.iIconId = aTreeIconIndex;
       
   395     iconEntry.iMtmUid = aMtmUid;
       
   396     iIconArray.AppendL( iconEntry );
       
   397     return iIconArray.Count();
       
   398     }
       
   399     
       
   400 // ----------------------------------------------------
       
   401 // CMceOneRowBitmapResolver::SetTreeIconId
       
   402 // ----------------------------------------------------
       
   403 void CMceOneRowBitmapResolver::SetTreeIconId( TMceBitmapArrayIndexes aBitmapIndex, TInt aTreeIconIndex )
       
   404     {
       
   405     iIconArray.operator[](aBitmapIndex).iIconId = aTreeIconIndex;
       
   406     }
       
   407     
       
   408 // ----------------------------------------------------
       
   409 // CMceOneRowBitmapResolver::TreeIconId
       
   410 // ----------------------------------------------------
       
   411 TInt CMceOneRowBitmapResolver::TreeIconId( TMceBitmapArrayIndexes aBitmapIndex )
       
   412     {
       
   413     return iIconArray.operator[](aBitmapIndex).iIconId;
       
   414     }
       
   415     
       
   416 
       
   417 
       
   418 // ----------------------------------------------------
       
   419 // CMceOneRowBitmapResolver::HasUnreadMessagesL
       
   420 // ----------------------------------------------------
       
   421 TBool CMceOneRowBitmapResolver::HasUnreadMessagesL( const TMsvId aId )
       
   422     {
       
   423     TBool unreadMessages = EFalse;
       
   424     CMsvEntry* entry = iSession->GetEntryL( aId );
       
   425     CleanupStack::PushL( entry );
       
   426 
       
   427     const TInt count = entry->Count();
       
   428     for ( TInt loop = 0; !unreadMessages && loop < count; loop++ )
       
   429         {
       
   430         if ( (*entry)[loop].iType.iUid == KUidMsvFolderEntryValue )
       
   431             {
       
   432             unreadMessages = HasUnreadMessagesL( (*entry)[loop].Id() );
       
   433             }
       
   434         else
       
   435             {
       
   436             unreadMessages = (*entry)[loop].Unread();
       
   437             }
       
   438         }
       
   439 
       
   440     CleanupStack::PopAndDestroy(); // entry
       
   441 
       
   442     return unreadMessages;
       
   443     }
       
   444 
       
   445 // ----------------------------------------------------
       
   446 // CMceOneRowBitmapResolver::LocalEntryBitmapIndex
       
   447 // ----------------------------------------------------
       
   448 TInt CMceOneRowBitmapResolver::LocalEntryBitmapIndex( TMsvId aEntryId ) const
       
   449     {
       
   450     TInt foundIndex = EMceBitmapIndexFolderSmall;
       
   451     switch( aEntryId )
       
   452         {
       
   453         case 0x1009: //KMceTemplatesEntryId:
       
   454             foundIndex = EMceBitmapIndexFolderTemp;
       
   455             break;
       
   456         default:
       
   457             // set in foundIndex declaration
       
   458             break;
       
   459         }
       
   460     return foundIndex;
       
   461     }
       
   462 
       
   463 // ----------------------------------------------------
       
   464 // CMceOneRowBitmapResolver::ChangeBitmapInIconArrayL
       
   465 // ----------------------------------------------------
       
   466 void CMceOneRowBitmapResolver::ChangeBitmapInIconArrayL(  )
       
   467     {
       
   468     if ( !iIcons )
       
   469         {
       
   470         // should not happen!
       
   471         return;
       
   472         }
       
   473         
       
   474     iIcons->ResetAndDestroy();
       
   475     
       
   476     MAknsSkinInstance* skins = AknsUtils::SkinInstance();
       
   477     CreateAndAppendIconL( 
       
   478         skins, 
       
   479         KAknsIIDQgnPropMceUnknownRead, 
       
   480         iFilenameMuiu, 
       
   481         EMbmMuiuQgn_prop_mce_unknown_read, 
       
   482         EMceOneRowBitmapLoadNormal );
       
   483     
       
   484     CreateAndAppendIconL( 
       
   485         skins, 
       
   486         KAknsIIDQgnPropMceTemplate, 
       
   487         iFilenameAvkon, 
       
   488         EMbmAvkonQgn_prop_folder_temp, 
       
   489         EMceOneRowBitmapLoadNormal );
       
   490         
       
   491     CreateAndAppendIconL( 
       
   492         skins, 
       
   493         KAknsIIDQgnPropFolderSmall, 
       
   494         iFilenameAvkon, 
       
   495         EMbmAvkonQgn_prop_folder_small, 
       
   496         EMceOneRowBitmapLoadNormal );
       
   497         
       
   498     CreateAndAppendIconL( 
       
   499         skins, 
       
   500         KAknsIIDQgnPropFolderSmallNew, 
       
   501         iFilenameAvkon, 
       
   502         EMbmAvkonQgn_prop_folder_small_new, 
       
   503         EMceOneRowBitmapLoadNormal );
       
   504         
       
   505     CreateAndAppendIconL( 
       
   506         skins, 
       
   507         KAknsIIDQgnIndiAttachementAdd, 
       
   508         iFilenameMuiu, 
       
   509         EMbmMuiuQgn_indi_attach_add, 
       
   510         EMceOneRowBitmapLoadSkinned );
       
   511         
       
   512     CreateAndAppendIconL( 
       
   513         skins, 
       
   514         KAknsIIDQgnIndiAttachementAdd, 
       
   515         iFilenameMuiu, 
       
   516         EMbmMuiuQgn_indi_attach_add, 
       
   517         EMceOneRowBitmapLoadSkinnedHighlight );
       
   518         
       
   519     CreateAndAppendIconL( 
       
   520         skins, 
       
   521         KAknsIIDQgnIndiMcePriorityHigh, 
       
   522         iFilenameAvkon, 
       
   523         EMbmAvkonQgn_indi_mce_priority_high, 
       
   524         EMceOneRowBitmapLoadSkinned );
       
   525         
       
   526     CreateAndAppendIconL( 
       
   527         skins, 
       
   528         KAknsIIDQgnIndiMcePriorityHigh, 
       
   529         iFilenameAvkon, 
       
   530         EMbmAvkonQgn_indi_mce_priority_high, 
       
   531         EMceOneRowBitmapLoadSkinnedHighlight );
       
   532         
       
   533     CreateAndAppendIconL( 
       
   534         skins, 
       
   535         KAknsIIDQgnIndiMcePriorityLow, 
       
   536         iFilenameAvkon, 
       
   537         EMbmAvkonQgn_indi_mce_priority_low, 
       
   538         EMceOneRowBitmapLoadSkinned );
       
   539         
       
   540     CreateAndAppendIconL( 
       
   541         skins, 
       
   542         KAknsIIDQgnIndiMcePriorityLow, 
       
   543         iFilenameAvkon, 
       
   544         EMbmAvkonQgn_indi_mce_priority_low, 
       
   545         EMceOneRowBitmapLoadSkinnedHighlight );
       
   546 
       
   547     CreateAndAppendIconL( 
       
   548         skins,
       
   549         KAknsIIDQgnPropMceSubSender,
       
   550         iFilenameMuiu,
       
   551         EMbmMuiuQgn_prop_mce_sub_sender,
       
   552         EMceOneRowBitmapLoadNormal );
       
   553 
       
   554     CreateAndAppendIconL( 
       
   555         skins,
       
   556         KAknsIIDQgnPropMceSubSenderUnread,
       
   557         iFilenameMuiu,
       
   558         EMbmMuiuQgn_prop_mce_sub_sender_unread,
       
   559         EMceOneRowBitmapLoadNormal );
       
   560 
       
   561     CreateAndAppendIconL( 
       
   562         skins,
       
   563         KAknsIIDQgnPropMceSubSubject,
       
   564         iFilenameMuiu, 
       
   565         EMbmMuiuQgn_prop_mce_sub_subject,
       
   566         EMceOneRowBitmapLoadNormal);
       
   567 
       
   568     CreateAndAppendIconL( 
       
   569         skins,
       
   570         KAknsIIDQgnPropMceSubSubjectUnread,
       
   571         iFilenameMuiu, 
       
   572         EMbmMuiuQgn_prop_mce_sub_subject_unread,
       
   573         EMceOneRowBitmapLoadNormal ); 
       
   574 
       
   575     CreateAndAppendIconL( 
       
   576         skins,
       
   577         KAknsIIDQgnPropMceSubTime,
       
   578         iFilenameMuiu, 
       
   579         EMbmMuiuQgn_prop_mce_sub_time,
       
   580         EMceOneRowBitmapLoadNormal );
       
   581 
       
   582     CreateAndAppendIconL( 
       
   583         skins,
       
   584         KAknsIIDQgnPropMceSubTimeUnread,
       
   585         iFilenameMuiu, 
       
   586         EMbmMuiuQgn_prop_mce_sub_time_unread,
       
   587         EMceOneRowBitmapLoadNormal );
       
   588 
       
   589     // add one dummy item which will be replaced when querying message items icons
       
   590     CreateAndAppendIconL( 
       
   591         skins, 
       
   592         KAknsIIDQgnPropMceUnknownRead, 
       
   593         iFilenameMuiu, 
       
   594         EMbmMuiuQgn_prop_mce_unknown_read, 
       
   595         EMceOneRowBitmapLoadNormal );
       
   596 
       
   597     }
       
   598 
       
   599 // ----------------------------------------------------
       
   600 // CMceOneRowBitmapResolver::SkinChangedL
       
   601 // ----------------------------------------------------
       
   602 void CMceOneRowBitmapResolver::SkinChangedL( CAknSingleColumnStyleTreeList* aListbox )
       
   603     {
       
   604     // first update default icons...
       
   605     ChangeBitmapInIconArrayL();
       
   606     // then assign new bitmaps to tree listbox
       
   607     TInt i = 0;
       
   608     for ( i = EMceBitmapIndexUnknown; i < EMceBitmapIndexLastIconIndex; i++ )
       
   609         {
       
   610         CFbsBitmap* bitmap = NULL;
       
   611         CFbsBitmap* bitmapMask = NULL;
       
   612         if ( GetBitmapL( (TMceBitmapArrayIndexes)i, bitmap, bitmapMask ) < 0 )
       
   613             {
       
   614             aListbox->AssignIconL(
       
   615                 iIconArray.operator[](i).iIconId,
       
   616                 bitmap,
       
   617                 bitmapMask,
       
   618                 EFalse,
       
   619                 EAspectRatioPreserved );
       
   620             iIconArray.operator[](i).iBitmapPointer = bitmap;
       
   621             }
       
   622         }
       
   623         
       
   624     // and then remove all the messaging icons
       
   625     const TInt count = iIconArray.Count();
       
   626     for ( i = iIconArray.Count()-1; i > EMceBitmapIndexLastIconIndex-1; i-- )
       
   627         {
       
   628         aListbox->RemoveIconL( iIconArray.operator[](i).iIconId );
       
   629         iIconArray.Remove( i );
       
   630         }
       
   631     // and finally start refresh of the list, that will re-load all the messaging icons
       
   632     }
       
   633 
       
   634 
       
   635 // ----------------------------------------------------
       
   636 // CMceOneRowBitmapResolver::UpdateIconArrayL
       
   637 // ----------------------------------------------------
       
   638 void CMceOneRowBitmapResolver::UpdateIconArrayL( CAknSingleColumnStyleTreeList* aListbox )
       
   639     {
       
   640     for ( TInt i = iIconArray.Count()-1; i > EMceBitmapIndexLastIconIndex-1; i-- )
       
   641         {
       
   642         if ( !MceUtils::IsMtmBuiltIn( iIconArray.operator[](i).iMtmUid ) )
       
   643             {
       
   644             aListbox->RemoveIconL( iIconArray.operator[](i).iIconId );
       
   645             iIconArray.Remove( i );
       
   646             }
       
   647         }
       
   648     }
       
   649 
       
   650 //  End of File