cbs/cbsui/UiSrc/CCbsUiTopicViewContainer.cpp
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  CCbsUiTopicViewContainer is container for CCbsUiTopicView. 
       
    15 *               It has one control, a list box, which is showing information
       
    16 *               about messages in one topic.
       
    17 *
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 //  INCLUDES
       
    23 #include <AknsConstants.h>    // KAknsMessageSkinChange
       
    24 #include <cbsuiapp.mbg>       // TMbmCbsuiapp
       
    25 #include <AknsUtils.h>        // CreateIconL, SkinInstance
       
    26 #include <akncontext.h>       // CAknContextPane
       
    27 #include <AknUtils.h>         // AknLayoutUtils 
       
    28 #include <AknDef.h>           // KEikDynamicLayoutVariantSwitch
       
    29 #include <e32std.h>
       
    30 #include <calslbs.h>
       
    31 #include <barsread.h>
       
    32 #include <gulicon.h>
       
    33 #include <eikfrlbd.h>
       
    34 #include <eikclbd.h>
       
    35 #include <eikslb.h>
       
    36 #include <eiklbx.h>
       
    37 #include <avkon.hrh>
       
    38 #include <aknlists.h>
       
    39 #include <AknIconArray.h>
       
    40 #include <data_caging_path_literals.hrh> // KDC_RESOURCE_FILES_DIR
       
    41 #include <cbsuiApp.rsg>
       
    42 #include "CbsUiId.h"
       
    43 #include <csxhelp/cbs.hlp.hrh>
       
    44 #include "Cbsuiapp.hrh"
       
    45 #include "CCbsUiTopicViewContainer.h"
       
    46 #include "CCbsUiTopicView.h"
       
    47 #include "CbsUiUtility.h"
       
    48 #include "CbsUiPanic.h"
       
    49 #include "CbsUiConstants.h"
       
    50  
       
    51 
       
    52 // CONSTANTS
       
    53 _LIT(KDirAndCbsUiAppMbmFile,"z:cbsuiapp.mbm");
       
    54 _LIT(KSeparator1, "1\t");
       
    55 _LIT(KSeparator2, "0\t");
       
    56 _LIT(KSeparator3, "\t2");
       
    57 
       
    58 const TInt KNumberOfIconsInTopicViewcontainer = 6;
       
    59 
       
    60 
       
    61 //DATA TYPES
       
    62 enum TopicViewIconArrayIndexes
       
    63     {
       
    64     ECbsPropCbMsgUnread = 0,
       
    65     ECbsPropCbMsg,
       
    66     ECbsIndiCbKeptAdd
       
    67     };
       
    68 
       
    69 
       
    70 
       
    71 // ================= MEMBER FUNCTIONS =======================
       
    72 
       
    73 // C++ default constructor can NOT contain any code, that
       
    74 // might leave.
       
    75 //
       
    76 CCbsUiTopicViewContainer::CCbsUiTopicViewContainer( CCbsUiTopicView& aTopicView )
       
    77                                                    : iTopicView( aTopicView )
       
    78     {
       
    79     }
       
    80 
       
    81 // Symbian OS default constructor can leave.
       
    82 void CCbsUiTopicViewContainer::ConstructL( const TRect& aRect )
       
    83     {
       
    84     CreateWindowL();
       
    85     SetMopParent(&iTopicView);
       
    86     
       
    87     iListBox = new (ELeave) CAknSingleGraphicStyleListBox;
       
    88     iListBox->SetContainerWindowL(*this);
       
    89     iListBox->ConstructL(this, EEikListBoxMultipleSelection);
       
    90     iListBox->CreateScrollBarFrameL( ETrue );
       
    91     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
       
    92         CEikScrollBarFrame::EOff,
       
    93         CEikScrollBarFrame::EAuto );
       
    94     
       
    95     CDesCArrayFlat* array = 
       
    96         new (ELeave) CDesCArrayFlat( KNumberOfTemporaryMessages );
       
    97     
       
    98     // changing the owner, shouldn't leave 
       
    99     iListBox->Model()->SetItemTextArray(array);
       
   100     iListBox->SetListBoxObserver( this );
       
   101     
       
   102     SetRect(aRect);
       
   103     LoadIconsL();
       
   104     }
       
   105 
       
   106 // Two-phased constructor.
       
   107 CCbsUiTopicViewContainer* CCbsUiTopicViewContainer::NewL( CCbsUiTopicView& aTopicView, const TRect& aRect )
       
   108     {
       
   109     CCbsUiTopicViewContainer* self = 
       
   110         new (ELeave) CCbsUiTopicViewContainer(aTopicView);
       
   111     
       
   112     CleanupStack::PushL(self);
       
   113     self->ConstructL(aRect);
       
   114     CleanupStack::Pop();
       
   115     return self;
       
   116     }
       
   117 
       
   118 // Destructor
       
   119 CCbsUiTopicViewContainer::~CCbsUiTopicViewContainer()
       
   120     {
       
   121     delete iListBox;
       
   122     }
       
   123 
       
   124 // ---------------------------------------------------------
       
   125 // CCbsUiTopicViewContainer::ReloadStarts
       
   126 // 
       
   127 // 
       
   128 // ---------------------------------------------------------
       
   129 //
       
   130 void CCbsUiTopicViewContainer::ReloadStarts() const
       
   131     {
       
   132     MDesCArray* itemList = iListBox->Model()->ItemTextArray();
       
   133     CDesCArray* itemArray = STATIC_CAST(CDesCArray*, itemList);
       
   134     itemArray->Reset();
       
   135     }
       
   136 
       
   137 // ---------------------------------------------------------
       
   138 // CCbsUiTopicViewContainer::ReloadOfferL
       
   139 // 
       
   140 // 
       
   141 // ---------------------------------------------------------
       
   142 // 
       
   143 void CCbsUiTopicViewContainer::ReloadOfferL( const TCbsMessage& aMessage, const TDesC& aBuffer ) const
       
   144     {
       
   145     MDesCArray* itemList = iListBox->Model()->ItemTextArray();
       
   146     CDesCArray* itemArray = STATIC_CAST(CDesCArray*, itemList);
       
   147     
       
   148     TInt titleLength( (aBuffer.Length() > KMaxMessageTitleLength ) ? 
       
   149                        KMaxMessageTitleLength : aBuffer.Length() );
       
   150     
       
   151     HBufC* buffer = HBufC::NewMaxLC( titleLength + KSeparator1().Length() + KSeparator2().Length() +
       
   152         KSeparator3().Length() );
       
   153     
       
   154     TPtr ptr = buffer->Des();    
       
   155     
       
   156     // First column icon.
       
   157     if ( aMessage.iRead )
       
   158         {
       
   159         ptr = KSeparator1;
       
   160         }
       
   161     else
       
   162         {
       
   163         ptr = KSeparator2;
       
   164         }
       
   165     
       
   166     for ( TInt index(0); index < titleLength; index++ )
       
   167         {
       
   168         TChar character = aBuffer[index];
       
   169         
       
   170         // if character is line break, then stop
       
   171         if ( character == EKeyLineFeed
       
   172             || character == EKeyEnter )
       
   173             {
       
   174             break;
       
   175             }
       
   176         
       
   177         ptr.Append( character );
       
   178         }
       
   179     
       
   180     // And finally saved icon.
       
   181     if ( aMessage.iPermanent )
       
   182         {
       
   183         ptr.Append(KSeparator3);
       
   184         }
       
   185     
       
   186     // Finally append!
       
   187     itemArray->AppendL(*buffer);
       
   188     CleanupStack::PopAndDestroy(); // buffer
       
   189     }
       
   190 
       
   191 // ---------------------------------------------------------
       
   192 // CCbsUiTopicViewContainer::ReloadEndsL
       
   193 // 
       
   194 // 
       
   195 // ---------------------------------------------------------
       
   196 //    
       
   197 void CCbsUiTopicViewContainer::ReloadEndsL()
       
   198     {  
       
   199     // Inform listbox that some items has been added.
       
   200     iListBox->HandleItemAdditionL();
       
   201     // check if listbox has any item. if numberOfItems == 0
       
   202     // then disable scrollbars
       
   203     if ( iListBox->Model()->NumberOfItems() == 0 )
       
   204     	{
       
   205     	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   206     		CEikScrollBarFrame::EOff,
       
   207     		CEikScrollBarFrame::EOff );
       
   208     	}
       
   209     else
       
   210     	{
       
   211     	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
       
   212     		CEikScrollBarFrame::EOff,
       
   213     		CEikScrollBarFrame::EAuto );
       
   214     	}	
       
   215     }
       
   216 
       
   217 // ---------------------------------------------------------
       
   218 // CCbsUiTopicViewContainer::CurrentPosition
       
   219 // 
       
   220 // 
       
   221 // ---------------------------------------------------------
       
   222 //
       
   223 TInt CCbsUiTopicViewContainer::CurrentPosition() const
       
   224     {
       
   225     return iListBox->CurrentItemIndex();
       
   226     }
       
   227 
       
   228 // ---------------------------------------------------------
       
   229 // CCbsUiTopicViewContainer::SetCurrentItemIndex
       
   230 // 
       
   231 // 
       
   232 // ---------------------------------------------------------
       
   233 //
       
   234 void CCbsUiTopicViewContainer::SetCurrentItemIndex( TInt aItemIndex ) const
       
   235     {
       
   236     __ASSERT_DEBUG( aItemIndex >= 0, CbsUiPanic(EErrInvalidValue) );
       
   237     
       
   238     MDesCArray* itemList = iListBox->Model()->ItemTextArray();
       
   239     CDesCArray* itemArray = STATIC_CAST(CDesCArray*, itemList);
       
   240     
       
   241     TInt count( itemArray->MdcaCount() );
       
   242     
       
   243     if ( count > aItemIndex && count >= 0 )
       
   244         {
       
   245         iListBox->SetCurrentItemIndexAndDraw(aItemIndex);
       
   246         }
       
   247     }
       
   248 
       
   249 // ----------------------------------------------------
       
   250 // CCbsUiTopicViewContainer::HandleListBoxEventL
       
   251 //
       
   252 // ----------------------------------------------------
       
   253 void CCbsUiTopicViewContainer::HandleListBoxEventL(	CEikListBox* /*aListBox*/,
       
   254                                                      TListBoxEvent aEventType )
       
   255     {
       
   256     switch ( aEventType )
       
   257         {
       
   258         case EEventItemSingleClicked:
       
   259             {
       
   260             TKeyEvent keyEvent;
       
   261             keyEvent.iCode = EKeyOK;
       
   262             OfferKeyEventL( keyEvent, EEventKey );
       
   263             break;
       
   264             }
       
   265         default:
       
   266             break;
       
   267         }
       
   268     }
       
   269 
       
   270 // ---------------------------------------------------------
       
   271 // CCbsUiTopicViewContainer::GetListBox
       
   272 // 
       
   273 // 
       
   274 // ---------------------------------------------------------
       
   275 //
       
   276 CEikColumnListBox* CCbsUiTopicViewContainer::GetListBox() 
       
   277     {
       
   278     return iListBox;
       
   279     }
       
   280 
       
   281 // ---------------------------------------------------------
       
   282 // CCbsUiTopicViewContainer::CountComponentControls
       
   283 // 
       
   284 // 
       
   285 // ---------------------------------------------------------
       
   286 //
       
   287 TInt CCbsUiTopicViewContainer::CountComponentControls() const
       
   288     {
       
   289     return 1;
       
   290     }
       
   291 
       
   292 // ---------------------------------------------------------
       
   293 // 
       
   294 // 
       
   295 // 
       
   296 // ---------------------------------------------------------
       
   297 //
       
   298 CCoeControl* CCbsUiTopicViewContainer::ComponentControl( TInt /*aIndex*/ ) const 
       
   299     { 
       
   300     return iListBox;
       
   301     }
       
   302 
       
   303 // ---------------------------------------------------------
       
   304 // CCbsUiTopicViewContainer::OfferKeyEventL
       
   305 // 
       
   306 // 
       
   307 // ---------------------------------------------------------
       
   308 //
       
   309 TKeyResponse CCbsUiTopicViewContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
       
   310     {    
       
   311     TKeyResponse result = EKeyWasNotConsumed;
       
   312     
       
   313     switch (aKeyEvent.iCode)
       
   314         {
       
   315         case EKeyLeftArrow:
       
   316             {
       
   317             if( AknLayoutUtils::LayoutMirrored() )
       
   318                 {
       
   319                 // Go to next topic.
       
   320                 iTopicView.ProcessCommandL( ECbsUiappTopicViewCmdGoToNextTopic );
       
   321                 }
       
   322             else
       
   323                 {            
       
   324                 // Go to previous topic.
       
   325                 iTopicView.ProcessCommandL( ECbsUiappTopicViewCmdGoToPrevTopic );
       
   326                 }
       
   327             result = EKeyWasConsumed;
       
   328             break;
       
   329             }            
       
   330         case EKeyRightArrow:
       
   331             {
       
   332             if( AknLayoutUtils::LayoutMirrored() )
       
   333                 {
       
   334                 // Go to previous topic.
       
   335                 iTopicView.ProcessCommandL( ECbsUiappTopicViewCmdGoToPrevTopic );
       
   336                 }
       
   337             else
       
   338                 {            
       
   339                 // Go to next topic.
       
   340                 iTopicView.ProcessCommandL( ECbsUiappTopicViewCmdGoToNextTopic );
       
   341                 }
       
   342             result = EKeyWasConsumed;
       
   343             break;
       
   344             } 
       
   345         case EKeyEnter:
       
   346         case EKeyOK:
       
   347             {
       
   348             // to open a right message
       
   349             iTopicView.MarkCurrentlyFocusedHandle();
       
   350             iTopicView.ProcessCommandL( ECbsUiappCmdTopicMenuRead );
       
   351             result = EKeyWasConsumed;
       
   352             break;
       
   353             }            
       
   354         case EKeyBackspace:
       
   355             {
       
   356             iTopicView.MarkCurrentlyFocusedHandle();
       
   357             iTopicView.ProcessCommandL( ECbsUiappCmdMessageDelete );
       
   358             result = EKeyWasConsumed;
       
   359             break;
       
   360             }
       
   361         default:
       
   362             {
       
   363             result = iListBox->OfferKeyEventL( aKeyEvent, aType );
       
   364             break;            
       
   365             }
       
   366         }
       
   367     
       
   368     return result;
       
   369     }
       
   370 
       
   371 // ---------------------------------------------------------
       
   372 // CCbsUiTopicViewContainer::SizeChanged
       
   373 // 
       
   374 // 
       
   375 // ---------------------------------------------------------
       
   376 //
       
   377 void CCbsUiTopicViewContainer::SizeChanged()
       
   378     {
       
   379     if (iListBox) 
       
   380         {
       
   381         iListBox->SetRect( Rect() );
       
   382         }
       
   383     }
       
   384 
       
   385 
       
   386 // ---------------------------------------------------------
       
   387 // CCbsUiTopicViewContainer::FocusChanged
       
   388 // ---------------------------------------------------------
       
   389 //
       
   390 void CCbsUiTopicViewContainer::FocusChanged( TDrawNow aDrawNow )
       
   391     {
       
   392     CCoeControl::FocusChanged( aDrawNow );
       
   393     if( iListBox )
       
   394         {
       
   395         iListBox->SetFocus( IsFocused(), aDrawNow );
       
   396         }
       
   397     }
       
   398 
       
   399 
       
   400 // ---------------------------------------------------------
       
   401 // CCbsUiTopicViewContainer::GetHelpContext
       
   402 // 
       
   403 // Gets the control's help context.
       
   404 // ---------------------------------------------------------
       
   405 //
       
   406 void CCbsUiTopicViewContainer::GetHelpContext( TCoeHelpContext& aContext ) const
       
   407     {
       
   408     aContext.iMajor = TUid::Uid(KUidCbsUiappDef);
       
   409     aContext.iContext = KCBS_HLP_TOPIC_VIEW;
       
   410     }
       
   411 
       
   412 
       
   413 // ----------------------------------------------------
       
   414 // CCbsUiTopicViewContainer::HandleResourceChange
       
   415 //
       
   416 //
       
   417 // ----------------------------------------------------
       
   418 void CCbsUiTopicViewContainer::HandleResourceChange( TInt aType )
       
   419     {
       
   420     CCoeControl::HandleResourceChange( aType );
       
   421 
       
   422     if( aType == KEikDynamicLayoutVariantSwitch )
       
   423         {
       
   424         iTopicView.HandleRectChangeInContainer();  
       
   425         }
       
   426     
       
   427     if( aType == KAknsMessageSkinChange )
       
   428         {
       
   429         // change skin bitmap
       
   430         TRAPD( ignore, SkinBitmapChangesL( ) );
       
   431         if( ignore )
       
   432             {
       
   433             ignore = KErrNone; //This prevent only ARMV5 varnings!!
       
   434             }
       
   435         }    
       
   436     }
       
   437 
       
   438 
       
   439 
       
   440 // ---------------------------------------------------------
       
   441 // CCbsUiTopicViewContainer::LoadIconsL
       
   442 // 
       
   443 // 
       
   444 // ---------------------------------------------------------
       
   445 //
       
   446 void CCbsUiTopicViewContainer::LoadIconsL()
       
   447     {
       
   448     CAknIconArray* icons = new (ELeave) CAknIconArray(KNumberOfIconsInTopicViewcontainer);
       
   449     CleanupStack::PushL(icons);
       
   450 
       
   451     TParse parse; 
       
   452     parse.Set(KDirAndCbsUiAppMbmFile, &KDC_APP_BITMAP_DIR, NULL); 
       
   453     TFileName mbmFileAndPathName(parse.FullName());
       
   454 
       
   455     // First icon & mask.
       
   456     AddIconL( KAknsIIDQgnPropCbMsgUnread, icons, mbmFileAndPathName, EMbmCbsuiappQgn_prop_cb_msg_unread,
       
   457               EMbmCbsuiappQgn_prop_cb_msg_unread_mask );
       
   458 
       
   459     // Second icon & mask.
       
   460     AddIconL( KAknsIIDQgnPropCbMsg, icons, mbmFileAndPathName, EMbmCbsuiappQgn_prop_cb_msg,
       
   461               EMbmCbsuiappQgn_prop_cb_msg_mask );
       
   462 
       
   463     // Third icon & mask.
       
   464     AddIconL( KAknsIIDQgnIndiCbKeptAdd, icons, mbmFileAndPathName, EMbmCbsuiappQgn_indi_cb_kept_add,
       
   465               EMbmCbsuiappQgn_indi_cb_kept_add_mask, ETrue );
       
   466 
       
   467     CleanupStack::Pop(); // icons
       
   468     
       
   469     iListBox->ItemDrawer()->ColumnData()->SetIconArray( icons );
       
   470     }
       
   471 
       
   472 
       
   473 // ---------------------------------------------------------
       
   474 // CCbsUiTopicViewContainer::AddIconL
       
   475 // 
       
   476 // 
       
   477 // ---------------------------------------------------------
       
   478 //
       
   479 void CCbsUiTopicViewContainer::AddIconL(
       
   480     TAknsItemID aId,
       
   481     CAknIconArray* aIcons,
       
   482     const TDesC& aIconFileWithPath,
       
   483     TInt aIconGraphicsIndex,
       
   484     TInt aIconGraphicsMaskIndex,
       
   485     TBool aColorIcon )
       
   486     {    
       
   487     // icon & mask.   
       
   488     MAknsSkinInstance* skins = AknsUtils::SkinInstance();  
       
   489     
       
   490     // COnstruct the icon and append it to icon array
       
   491     CGulIcon* icon = ConstructIconL( aColorIcon, skins, aId, 
       
   492         aIconFileWithPath, aIconGraphicsIndex, aIconGraphicsMaskIndex );
       
   493     CleanupStack::PushL( icon );
       
   494     aIcons->AppendL( icon );    
       
   495     CleanupStack::Pop( ); // icon
       
   496     }
       
   497 
       
   498 
       
   499 
       
   500 // ----------------------------------------------------
       
   501 // CCbsUiTopicViewContainer::SkinBitmapChangesL
       
   502 // ----------------------------------------------------
       
   503 void CCbsUiTopicViewContainer::SkinBitmapChangesL()
       
   504     {
       
   505     CArrayPtr<CGulIcon> *icons = 0;
       
   506     icons = iListBox->ItemDrawer()->ColumnData()->IconArray();
       
   507     TAknsItemID id; 
       
   508     id.iMajor = 0;
       
   509     id.iMinor = 0;    
       
   510     TInt count = icons->Count();
       
   511     TInt bitmapIndex = 0;
       
   512     TInt bitmapMaskIndex = 0;
       
   513 
       
   514     //change list icons
       
   515     MAknsSkinInstance* skins = AknsUtils::SkinInstance();
       
   516     for ( TInt cc=count; --cc>=0; )
       
   517         {
       
   518         switch( cc )
       
   519             {
       
   520             case ECbsPropCbMsgUnread:                
       
   521                 bitmapIndex = EMbmCbsuiappQgn_prop_cb_msg_unread;
       
   522                 bitmapMaskIndex = EMbmCbsuiappQgn_prop_cb_msg_unread_mask;
       
   523                 id = KAknsIIDQgnPropCbMsgUnread;
       
   524                 break;
       
   525             case ECbsPropCbMsg:                
       
   526                 bitmapIndex = EMbmCbsuiappQgn_prop_cb_msg;
       
   527                 bitmapMaskIndex = EMbmCbsuiappQgn_prop_cb_msg_mask;
       
   528                 id = KAknsIIDQgnPropCbMsg;
       
   529                 break;
       
   530             case ECbsIndiCbKeptAdd:                
       
   531                 bitmapIndex = EMbmCbsuiappQgn_indi_cb_kept_add;
       
   532                 bitmapMaskIndex = EMbmCbsuiappQgn_indi_cb_kept_add_mask;
       
   533                 id = KAknsIIDQgnIndiCbKeptAdd;
       
   534                 break;
       
   535             default:                
       
   536                 bitmapIndex = EMbmCbsuiappQgn_prop_cb_msg_unread;
       
   537                 bitmapMaskIndex = EMbmCbsuiappQgn_prop_cb_msg_unread_mask;
       
   538                 id = KAknsIIDQgnPropCbMsgUnread;
       
   539                 break;           
       
   540             } 
       
   541         
       
   542         CFbsBitmap* bitmap;
       
   543         CFbsBitmap* mask;
       
   544         TParse parse; 
       
   545         parse.Set(KDirAndCbsUiAppMbmFile, &KDC_APP_BITMAP_DIR, NULL); 
       
   546         TFileName mbmFileAndPathName(parse.FullName());
       
   547         AknsUtils::CreateIconL( skins, id, bitmap,
       
   548             mask, mbmFileAndPathName, bitmapIndex, bitmapMaskIndex );      
       
   549 
       
   550         CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
       
   551      
       
   552         CleanupStack::PushL( icon );
       
   553         CGulIcon* iconToBeDelete = icons->At( cc );
       
   554         icons->At( cc ) = icon;
       
   555         delete iconToBeDelete;
       
   556         iconToBeDelete = NULL;
       
   557 
       
   558         CleanupStack::Pop(); // icon
       
   559     
       
   560         }  
       
   561     }
       
   562 
       
   563 
       
   564 // ----------------------------------------------------
       
   565 // CCbsUiTopicViewContainer::ConstructIconL
       
   566 // ----------------------------------------------------
       
   567 CGulIcon* CCbsUiTopicViewContainer::ConstructIconL( 
       
   568     TBool& aColourIcon,
       
   569     MAknsSkinInstance* aSkins, 
       
   570     const TAknsItemID& aID,
       
   571     const TDesC& aFilename,
       
   572     const TInt aFileBitmapId, 
       
   573     const TInt aFileMaskId )
       
   574     {
       
   575     // icon & mask
       
   576     CFbsBitmap* bitmap;
       
   577     CFbsBitmap* mask;
       
   578         
       
   579     if ( aColourIcon )
       
   580         {
       
   581         AknsUtils::CreateColorIconL(
       
   582             aSkins, 
       
   583             aID, 
       
   584             KAknsIIDQsnIconColors, 
       
   585             EAknsCIQsnIconColorsCG13, // Check the used color group - this is usually correct group for D-column stuff
       
   586             bitmap, 
       
   587             mask,
       
   588             aFilename,
       
   589             aFileBitmapId,
       
   590             aFileMaskId ,
       
   591             KRgbBlack ); // This is default color used, if the color skinning fails, or there is no color defined.
       
   592         }
       
   593     else
       
   594         {
       
   595         AknsUtils::CreateIconL( aSkins, aID, bitmap,
       
   596         mask, aFilename, aFileBitmapId, 
       
   597         aFileMaskId );
       
   598         }
       
   599 
       
   600     CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
       
   601     return icon;
       
   602     }
       
   603 
       
   604 
       
   605 //  End of File