profilesservices/FileList/Src/CFLDPopupList.cpp
changeset 18 e3554c9069b6
parent 4 3f8368f032cf
child 19 30540fccecae
equal deleted inserted replaced
4:3f8368f032cf 18:e3554c9069b6
     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 "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:  Implementation of the CFLDPopupList.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // CLASS HEADER
       
    21 #include    "CFLDPopupList.h"
       
    22 
       
    23 // INTERNAL INCLUDES
       
    24 #include    "CFLDFileListModel.h"
       
    25 #include    "MFLDFileObserver.h"
       
    26 #include    "MFLDFileListBoxObserver.h"
       
    27 
       
    28 // EXTERNAL INCLUDES
       
    29 #include <AknIconArray.h>
       
    30 #include <aknmemorycardui.mbg>
       
    31 #include <AknsUtils.h>
       
    32 #include <gulicon.h>
       
    33 #include <aknconsts.h> // KAvkonBitmapFile, KAvkonVariatedBitmapsFile
       
    34 #include <variatedbitmaps.mbg> // MBM indices for seamless link
       
    35 #include <avkon.mbg>
       
    36 #include <data_caging_path_literals.hrh>
       
    37 #include <aknlists.h>
       
    38 #include <commondialogs.mbg>
       
    39 #include <filelist.mbg>
       
    40 #ifdef RD_TACTILE_FEEDBACK
       
    41 #include <touchfeedback.h>
       
    42 #endif //RD_TACTILE_FEEDBACK
       
    43 // CONSTANTS
       
    44 namespace
       
    45 	{
       
    46     _LIT( KFLDMassStorageBitmapFile, "z:filelist.mbm" );
       
    47     _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
       
    48 
       
    49 	const TInt KIconGranularity( 3 );
       
    50 	}
       
    51 
       
    52 
       
    53 // ============================ MEMBER FUNCTIONS ===============================
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CFLDPopupList::CFLDPopupList
       
    57 // C++ constructor can NOT contain any code, that might leave.
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 CFLDPopupList::CFLDPopupList(
       
    61 	MFLDFileObserver& aFileObserver,
       
    62     MFLDFileListBoxObserver* aListBoxObserver,
       
    63 	CFLDFileListModel& aModel )
       
    64 	:	CAknPopupList(),
       
    65 		iFileObserver( aFileObserver ),
       
    66         iListBoxObserver( aListBoxObserver ),
       
    67 		iModel( aModel ),
       
    68 		iPoint(-1,-1)
       
    69     {
       
    70     }
       
    71 
       
    72 
       
    73 void CFLDPopupList::ConstructL(
       
    74  CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType )
       
    75 	{
       
    76 	// Notify foreground lost
       
    77     CCoeEnv* coeEnv = CCoeEnv::Static();
       
    78     coeEnv->AddForegroundObserverL( *this );
       
    79     coeEnv->AddFocusObserverL( *this );
       
    80     
       
    81     CAknPopupList::ConstructL( aListBox, aCbaResource, aType );
       
    82 	}
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CFLDPopupList::NewL
       
    86 // Two-phased constructor.
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 CFLDPopupList* CFLDPopupList::NewL(
       
    90 	CEikListBox* aListBox,
       
    91 	TInt aCbaResource,
       
    92 	MFLDFileObserver& aFileObserver,
       
    93     MFLDFileListBoxObserver* aListBoxObserver,
       
    94 	CFLDFileListModel& aModel,
       
    95 	AknPopupLayouts::TAknPopupLayouts aType )
       
    96 	{
       
    97 	CFLDPopupList* self = new( ELeave )
       
    98         CFLDPopupList( aFileObserver, aListBoxObserver, aModel );
       
    99 	CleanupStack::PushL( self );
       
   100 	self->ConstructL( aListBox, aCbaResource, aType );
       
   101 	CleanupStack::Pop( self );
       
   102 	return self;
       
   103 	}
       
   104 
       
   105 // Destructor
       
   106  CFLDPopupList::~CFLDPopupList()
       
   107     {
       
   108     CCoeEnv::Static()->RemoveForegroundObserver( *this );
       
   109     CCoeEnv::Static()->RemoveFocusObserver( *this );
       
   110     }
       
   111     
       
   112  // -----------------------------------------------------------------------------
       
   113  // CFLDPopupList::HandlePointerEventL
       
   114  // (other items were commented in a header).
       
   115  // -----------------------------------------------------------------------------
       
   116  //
       
   117  void CFLDPopupList::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   118 	 {
       
   119 	 if ( aPointerEvent.iType == TPointerEvent::EButton1Down)
       
   120 		 {
       
   121 		 iPoint = aPointerEvent.iPosition;
       
   122 		 CancelPreview();
       
   123 		 }
       
   124 	if (!Rect().Contains(iPoint))
       
   125 		{
       
   126 #ifdef RD_TACTILE_FEEDBACK 
       
   127 		MTouchFeedback* feedback = MTouchFeedback::Instance();
       
   128 		if (feedback)
       
   129 			{
       
   130 			feedback->InstantFeedback(this, ETouchFeedbackBasic);
       
   131 			}
       
   132 #endif //RD_TACTILE_FEEDBACK		}
       
   133 		}
       
   134 	CAknPopupList::HandlePointerEventL(aPointerEvent);
       
   135 	 }
       
   136 // -----------------------------------------------------------------------------
       
   137 // CFLDPopupList::AttemptExitL
       
   138 // (other items were commented in a header).
       
   139 // -----------------------------------------------------------------------------
       
   140 //
       
   141 void CFLDPopupList::AttemptExitL( TBool aAccept )
       
   142 	{
       
   143 	if( iExitChecksDone )
       
   144 	    {
       
   145 	    CAknPopupList::AttemptExitL( aAccept );
       
   146 	    return;
       
   147 	    }
       
   148 
       
   149 	TFileName fileName( KNullDesC );
       
   150 	iModel.GetFileName( fileName, iListBox->CurrentItemIndex() );
       
   151 
       
   152 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   153 	// Get current softkey state
       
   154 	if( iListBoxObserver )
       
   155     	{
       
   156 		iListBoxObserver->HandleSoftKeyState( iSoftKeyState );
       
   157     	}
       
   158 	TBool isVideo( EFalse );
       
   159 	if ( iModel.MediaFileType( fileName ) == ECLFMediaTypeVideo )
       
   160 		{
       
   161 		isVideo = ETrue;
       
   162 		}
       
   163 #endif
       
   164 
       
   165 	if( aAccept )
       
   166 		{
       
   167 		// User made a selection (didn't press cancel).
       
   168 
       
   169 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   170 		if( isVideo )
       
   171 			{
       
   172 			if( iSoftKeyState ==
       
   173 			 MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
       
   174 				{
       
   175 				// Cancel listbox timer
       
   176         		if( iListBoxObserver )
       
   177             		{
       
   178             		iListBoxObserver->HandleFileListBoxEventL(
       
   179                 		MFLDFileListBoxObserver::EOtherKeyEvent,
       
   180                 		fileName );
       
   181             		}
       
   182 				}
       
   183 			else
       
   184 				{
       
   185 				// No need to cancel timer
       
   186 				// (it has been already cancelled)
       
   187 				}
       
   188 			}
       
   189 		else
       
   190 			{
       
   191         	// Cancel listbox timer
       
   192         	if( iListBoxObserver )
       
   193             	{
       
   194             	iListBoxObserver->HandleFileListBoxEventL(
       
   195                 	MFLDFileListBoxObserver::EOtherKeyEvent,
       
   196                 	fileName );
       
   197             	}
       
   198 			}
       
   199 #else
       
   200 		// Cancel listbox timer
       
   201         if( iListBoxObserver )
       
   202         	{
       
   203             iListBoxObserver->HandleFileListBoxEventL(
       
   204             	MFLDFileListBoxObserver::EOtherKeyEvent,
       
   205                 fileName );
       
   206             }
       
   207 #endif
       
   208 
       
   209 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   210 	if( !isVideo )	// Only perform file validity check for audio files here
       
   211 		{
       
   212 		// Ask the observer if the file is valid.
       
   213         if( !iFileObserver.IsFileValidL(
       
   214          fileName, MFLDFileObserver::ESelect ) )
       
   215 			{
       
   216             // Not ok to close the pop-up.
       
   217             // Return. Don't call CAknPopupList::AttemptExitL.
       
   218 			return;
       
   219 			}
       
   220 		}
       
   221 
       
   222 #else
       
   223         // Ask the observer if the file is valid.
       
   224     if( !iFileObserver.IsFileValidL(
       
   225      fileName, MFLDFileObserver::ESelect ) )
       
   226     	{
       
   227 	    // Not ok to close the pop-up.
       
   228         // Return. Don't call CAknPopupList::AttemptExitL.
       
   229 		return;
       
   230 		}
       
   231 #endif
       
   232 
       
   233 
       
   234 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   235 		if( iListBoxObserver )
       
   236 			{
       
   237 			// Ask the observer if the file is video
       
   238 			if( isVideo )
       
   239 				{// File is a video
       
   240 
       
   241 				// Change the softkeys back to normal
       
   242 				iListBoxObserver->HandleFileListBoxEventL(
       
   243  						MFLDFileListBoxObserver::EVideoPreviewCanceled,
       
   244  						 fileName );
       
   245  						
       
   246 				if( iSoftKeyState
       
   247 				 == MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
       
   248 			 		{	// File is a video and we are in tone selection list
       
   249 
       
   250 			 		// Ask the observer if the file is valid.
       
   251         			if( !iFileObserver.IsFileValidL(
       
   252         			 fileName, MFLDFileObserver::ESelect ) )
       
   253         				{
       
   254 						// Not ok to close the pop-up.
       
   255             			// Return. Don't call CAknPopupList::AttemptExitL.
       
   256 						return;
       
   257         				}
       
   258 			 		}
       
   259 			 	else if( iSoftKeyState
       
   260 			 	 == MFLDFileListBoxObserver::EPreviewSoftKeyState )
       
   261 			 		{	// File is a video and it has been focused for 1s
       
   262 
       
   263 			 		// Ask the observer if the file is valid.
       
   264         			if( !iFileObserver.IsFileValidL(
       
   265         			 fileName, MFLDFileObserver::EPlay ) )
       
   266         				{
       
   267 						// Not ok to close the pop-up.
       
   268             			// Return. Don't call CAknPopupList::AttemptExitL.
       
   269 						return;
       
   270         				}
       
   271 
       
   272 			 		iListBoxObserver->HandleFileListBoxEventL(
       
   273                 		MFLDFileListBoxObserver::EVideoPreview,
       
   274                 		fileName );
       
   275                 	
       
   276 			 		// Disable scrollbar
       
   277 			 		ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( ETrue );
       
   278 
       
   279 			 		// Remove the focus from listbox
       
   280                 	ListBox()->SetDimmed( ETrue );
       
   281 
       
   282                 	// Not ok to close the pop-up.
       
   283             		// Return. Don't call CAknPopupList::AttemptExitL.
       
   284                 	return;
       
   285 			 		}
       
   286 			 	else if( iSoftKeyState
       
   287 			 	 == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
       
   288 			 		{	// File is a video and it is in preview state
       
   289 
       
   290 			 		// Ask the observer if the file is valid.
       
   291         			if( !iFileObserver.IsFileValidL(
       
   292         			 fileName, MFLDFileObserver::ESelect ) )
       
   293 						{
       
   294 						// When video screen is closed,
       
   295 						// listbox must be forced to be refreshed
       
   296 						// ( otherwise scrollbar is not redrawn)
       
   297 						ListBox()->SetDimmed( EFalse );
       
   298 	                    ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   299 						DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
       
   300 						// Not ok to close the pop-up.
       
   301             			// Return. Don't call CAknPopupList::AttemptExitL.
       
   302 						return;
       
   303 						}
       
   304 
       
   305 					// When video screen is closed, listbox must be refreshed
       
   306 					DrawDeferred();
       
   307 	            	}
       
   308 				}
       
   309 			}
       
   310 		}
       
   311 	else	// 	if( aAccept )
       
   312 		{
       
   313 		// User canceled selection
       
   314 		if( iListBoxObserver )
       
   315 			{
       
   316 			if( isVideo )
       
   317 				{	// File is a video
       
   318 				
       
   319 				// Change the softkeys back to normal
       
   320 				iListBoxObserver->HandleFileListBoxEventL(
       
   321 	       			MFLDFileListBoxObserver::EVideoPreviewCanceled,
       
   322 	       			 fileName );
       
   323 				
       
   324 	 			if( iSoftKeyState ==
       
   325 	 			 MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
       
   326 					{	// File is a video and it is in preview state
       
   327 
       
   328 					// When video screen is closed,
       
   329 					// listbox must be forced to be refreshed
       
   330 					// ( otherwise scrollbar is not redrawn)
       
   331 					ListBox()->SetDimmed( EFalse );
       
   332                     ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   333 					DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
       
   334 					// Not ok to close the pop-up.
       
   335             		// Return. Don't call CAknPopupList::AttemptExitL.
       
   336 					return;
       
   337 					}
       
   338 	 			}
       
   339 			}
       
   340 #endif
       
   341 
       
   342 		}
       
   343 
       
   344 	iExitChecksDone = ETrue;
       
   345 	CAknPopupList::AttemptExitL( aAccept );
       
   346 	}
       
   347 
       
   348 // -----------------------------------------------------------------------------
       
   349 // CFLDPopupList::HandleResourceChange
       
   350 // (other items were commented in a header).
       
   351 // -----------------------------------------------------------------------------
       
   352 //
       
   353 void CFLDPopupList::HandleResourceChange( TInt aType )
       
   354     {
       
   355 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   356     if( aType == KEikDynamicLayoutVariantSwitch ||
       
   357          aType == KAknsMessageSkinChange )
       
   358         {
       
   359 		if( iListBoxObserver )
       
   360 			{
       
   361  			TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
       
   362  				MFLDFileListBoxObserver::EVideoPreviewCanceled ) );
       
   363  		    if( ListBox()->IsFocused() )
       
   364  		        {
       
   365  		        ListBox()->SetDimmed( EFalse );
       
   366                 ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   367  		        }
       
   368 			}
       
   369         }
       
   370 #endif
       
   371     if( aType == KAknsMessageSkinChange )
       
   372         {
       
   373         TRAP_IGNORE( PopulateIconArrayL() );
       
   374         }
       
   375 
       
   376     CAknPopupList::HandleResourceChange( aType );
       
   377     }
       
   378 
       
   379 // -----------------------------------------------------------------------------
       
   380 // CFLDPopupList::GetFileListBoxObserver
       
   381 // (other items were commented in a header).
       
   382 // -----------------------------------------------------------------------------
       
   383 //
       
   384 MFLDFileListBoxObserver* CFLDPopupList::GetFileListBoxObserver()
       
   385 	{
       
   386 	return iListBoxObserver;
       
   387 	}
       
   388 
       
   389 // -----------------------------------------------------------------------------
       
   390 // CFLDPopupList::HandleListBoxEventL
       
   391 // (other items were commented in a header).
       
   392 // -----------------------------------------------------------------------------
       
   393 //
       
   394 void CFLDPopupList::HandleListBoxEventL( CEikListBox* aListBox,
       
   395 	TListBoxEvent aEventType )
       
   396     {
       
   397 	switch( aEventType )
       
   398 		{
       
   399 		// Special handling for touch: first click just starts preview;
       
   400 		// second click (double click) will select the tone.
       
   401 		// Fall through.
       
   402 		case EEventItemClicked:
       
   403 			{
       
   404 			iModel.GetFileName( iCurrentFileName, iListBox->CurrentItemIndex() );
       
   405 			iListBoxObserver->HandleFileListBoxEventL( 
       
   406 				MFLDFileListBoxObserver::EFocusChanged, iCurrentFileName );
       
   407 			return;
       
   408 			}
       
   409 
       
   410 		case EEventItemDoubleClicked:
       
   411 			AttemptExitL( ETrue );
       
   412 			return;
       
   413 
       
   414 		default:
       
   415 			break;
       
   416 		}
       
   417 
       
   418 	CAknPopupList::HandleListBoxEventL( aListBox, aEventType );
       
   419     }
       
   420 
       
   421 // -----------------------------------------------------------------------------
       
   422 // CFLDPopupList::CancelPreview
       
   423 // (other items were commented in a header).
       
   424 // -----------------------------------------------------------------------------
       
   425 //
       
   426 void CFLDPopupList::CancelPreview()
       
   427     {
       
   428     if( iListBoxObserver )
       
   429     	{
       
   430         TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
       
   431          				MFLDFileListBoxObserver::EOtherKeyEvent, KNullDesC ) );
       
   432     	}
       
   433     }
       
   434 
       
   435 // -----------------------------------------------------------------------------
       
   436 // CFLDPopupList::PopupListWindow::
       
   437 // (other items were commented in a header).
       
   438 // -----------------------------------------------------------------------------
       
   439 //
       
   440 RWindow& CFLDPopupList::PopupListWindow() const
       
   441 	{
       
   442 	return Window();
       
   443 	}
       
   444 
       
   445 // -----------------------------------------------------------------------------
       
   446 // CFLDPopupList::HandleGainingForeground
       
   447 // (other items were commented in a header).
       
   448 // -----------------------------------------------------------------------------
       
   449 //
       
   450 void CFLDPopupList::HandleGainingForeground()
       
   451 	{
       
   452 	TRAP_IGNORE( ListBox()->HandleItemAdditionL() );
       
   453 	}
       
   454 // -----------------------------------------------------------------------------
       
   455 // CFLDPopupList::HandleLosingForeground
       
   456 // (other items were commented in a header).
       
   457 // -----------------------------------------------------------------------------
       
   458 //
       
   459 void CFLDPopupList::HandleLosingForeground()
       
   460 	{
       
   461     if( iListBoxObserver )
       
   462         {
       
   463         iListBoxObserver->HandleSoftKeyState( iSoftKeyState );
       
   464         if( iSoftKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
       
   465             {
       
   466             TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
       
   467                 MFLDFileListBoxObserver::EVideoPreviewCanceled, KNullDesC ) );
       
   468             DrawNow();
       
   469             }
       
   470 
       
   471         // Set the vertical scroll bar and listbox to not dimmed.        
       
   472         if ( ListBox()->IsFocused() )
       
   473             {
       
   474             ListBox()->SetDimmed( EFalse );
       
   475             ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   476             }
       
   477         }
       
   478 	}	
       
   479 
       
   480 // -----------------------------------------------------------------------------
       
   481 // CFLDPopupList::HandleChangeInFocus
       
   482 // (other items were commented in a header).
       
   483 // -----------------------------------------------------------------------------
       
   484 //
       
   485 void CFLDPopupList::HandleChangeInFocus()
       
   486 	{
       
   487 	if( ListBox()->IsFocused() )
       
   488 		{
       
   489 		ListBox()->SetDimmed( EFalse );
       
   490 		}
       
   491 	}	
       
   492 // -----------------------------------------------------------------------------
       
   493 // CFLDPopupList::HandleDestructionOfFocusedItem
       
   494 // (other items were commented in a header).
       
   495 // -----------------------------------------------------------------------------
       
   496 //
       
   497 void CFLDPopupList::HandleDestructionOfFocusedItem()
       
   498 	{
       
   499 	}	
       
   500 
       
   501 // -----------------------------------------------------------------------------
       
   502 // CFLDPopupList::PopulateIconArrayL
       
   503 // (other items were commented in a header).
       
   504 // -----------------------------------------------------------------------------
       
   505 //
       
   506 void CFLDPopupList::PopulateIconArrayL()
       
   507     {
       
   508     CAknSingleGraphicBtPopupMenuStyleListBox* listBox = 
       
   509     	static_cast<CAknSingleGraphicBtPopupMenuStyleListBox*>( ListBox() );
       
   510 
       
   511 	if( !listBox )
       
   512 		{
       
   513 		return;
       
   514 		}
       
   515 
       
   516     // Create new icon array
       
   517     CArrayPtr<CGulIcon>* iconArray = new( ELeave ) CAknIconArray( KIconGranularity );
       
   518     CleanupStack::PushL( iconArray );
       
   519 
       
   520     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   521 
       
   522     //    
       
   523     // Create an empty icon in icon array position 0
       
   524     // 
       
   525     CGulIcon* icon =
       
   526         AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropEmpty, KAvkonBitmapFile,
       
   527         EMbmAvkonQgn_prop_empty, EMbmAvkonQgn_prop_empty_mask  );
       
   528     CleanupStack::PushL( icon );
       
   529     iconArray->AppendL( icon );
       
   530     CleanupStack::Pop( icon );
       
   531 
       
   532     //
       
   533     // Create an URL icon for download tones in icon array position 1
       
   534     //
       
   535     icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropLinkEmbdSmall,
       
   536         KAvkonVariatedBitmapsFile,
       
   537         EMbmVariatedbitmapsQgn_prop_link_embd_small,
       
   538         EMbmVariatedbitmapsQgn_prop_link_embd_small_mask );
       
   539     CleanupStack::PushL( icon );
       
   540     iconArray->AppendL( icon );
       
   541     CleanupStack::Pop( icon );
       
   542 
       
   543     //
       
   544     // Create an memory card icon in icon array position 2
       
   545     //		
       
   546 	TParse* fp = new(ELeave) TParse();
       
   547 	fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
       
   548 	TFileName resourceFileName( fp->FullName() );
       
   549 	delete fp;
       
   550         
       
   551     TRgb defaultColour( KRgbBlack );
       
   552     CFbsBitmap* bmap = NULL;
       
   553     CFbsBitmap* mask = NULL;
       
   554 
       
   555     AknsUtils::GetCachedColor( skin, defaultColour,
       
   556                KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 );
       
   557     AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall,
       
   558                 KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap, mask,
       
   559                 resourceFileName, EMbmAknmemorycarduiQgn_indi_mmc_add,
       
   560                 EMbmAknmemorycarduiQgn_indi_mmc_add_mask,
       
   561                 defaultColour );
       
   562     icon = CGulIcon::NewL( bmap, mask );
       
   563     icon->SetBitmapsOwnedExternally( EFalse );
       
   564     CleanupStack::Pop( 2 ); // icon owns the bitmaps now
       
   565         
       
   566     CleanupStack::PushL( icon );
       
   567     iconArray->AppendL( icon );
       
   568     CleanupStack::Pop( icon );
       
   569      
       
   570     //
       
   571     // Create an audio file icon in icon array position 3
       
   572     //
       
   573     icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileSound,
       
   574         KCommonDialogsBitmapFile,
       
   575         EMbmCommondialogsQgn_prop_fmgr_file_sound,
       
   576         EMbmCommondialogsQgn_prop_fmgr_file_sound_mask );
       
   577     CleanupStack::PushL( icon );
       
   578     iconArray->AppendL( icon );
       
   579     CleanupStack::Pop( icon );
       
   580 
       
   581     //
       
   582     // Create a video file icon in icon array position 4
       
   583     //
       
   584     icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileVideo,
       
   585         KCommonDialogsBitmapFile,
       
   586         EMbmCommondialogsQgn_prop_fmgr_file_video,
       
   587         EMbmCommondialogsQgn_prop_fmgr_file_video_mask );
       
   588     CleanupStack::PushL( icon );
       
   589     iconArray->AppendL( icon );
       
   590     CleanupStack::Pop( icon );
       
   591 
       
   592     //
       
   593     // create mass storage icon in icon array position 5
       
   594     //
       
   595 	TParse* fp2 = new(ELeave) TParse();
       
   596 	fp2->Set(KFLDMassStorageBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
       
   597 	resourceFileName = fp2->FullName();
       
   598 	delete fp2;
       
   599 
       
   600     TRgb defaultColour2( KRgbBlack );
       
   601     CFbsBitmap* bmap2 = NULL;
       
   602     CFbsBitmap* mask2 = NULL;
       
   603 
       
   604     AknsUtils::GetCachedColor( skin, defaultColour2,
       
   605                KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 );
       
   606     AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall,
       
   607                 KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap2, mask2,
       
   608                 resourceFileName, EMbmFilelistQgn_indi_fmgr_ms_add,
       
   609                 EMbmFilelistQgn_indi_fmgr_ms_add_mask,
       
   610                 defaultColour2 );
       
   611     
       
   612     icon = CGulIcon::NewL( bmap2, mask2 );
       
   613     icon->SetBitmapsOwnedExternally( EFalse );
       
   614     CleanupStack::Pop( 2 ); // icon owns the bitmaps now
       
   615         
       
   616     CleanupStack::PushL( icon );
       
   617     iconArray->AppendL( icon );
       
   618     CleanupStack::Pop( icon );
       
   619 
       
   620 
       
   621     // Delete old icons
       
   622     CArrayPtr<CGulIcon>* arr = listBox->ItemDrawer()->ColumnData()->IconArray();
       
   623     if( arr )
       
   624     	{
       
   625     	arr->ResetAndDestroy();
       
   626 	    delete arr;
       
   627 	    arr = NULL;
       
   628     	}
       
   629 
       
   630 	listBox->ItemDrawer()->ColumnData()->SetIconArrayL( iconArray );
       
   631 	CleanupStack::Pop( iconArray );
       
   632 
       
   633     }
       
   634 
       
   635 
       
   636 //  End of File