profilesservices/FileList/Src/CFLDPopupList.cpp
branchRCL_3
changeset 54 7e0eff37aedb
equal deleted inserted replaced
53:8ee96d21d9bf 54:7e0eff37aedb
       
     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 		AttemptExitL(EFalse);
       
   134 		}
       
   135 	CAknPopupList::HandlePointerEventL(aPointerEvent);
       
   136 	 }
       
   137 // -----------------------------------------------------------------------------
       
   138 // CFLDPopupList::AttemptExitL
       
   139 // (other items were commented in a header).
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 void CFLDPopupList::AttemptExitL( TBool aAccept )
       
   143 	{
       
   144 	if( iExitChecksDone )
       
   145 	    {
       
   146 	    CAknPopupList::AttemptExitL( aAccept );
       
   147 	    return;
       
   148 	    }
       
   149 
       
   150 	TFileName fileName( KNullDesC );
       
   151 	iModel.GetFileName( fileName, iListBox->CurrentItemIndex() );
       
   152 
       
   153 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   154 	// Get current softkey state
       
   155 	if( iListBoxObserver )
       
   156     	{
       
   157 		iListBoxObserver->HandleSoftKeyState( iSoftKeyState );
       
   158     	}
       
   159 	TBool isVideo( EFalse );
       
   160 	if ( iModel.MediaFileType( fileName ) == ECLFMediaTypeVideo )
       
   161 		{
       
   162 		isVideo = ETrue;
       
   163 		}
       
   164 #endif
       
   165 
       
   166 	if( aAccept )
       
   167 		{
       
   168 		// User made a selection (didn't press cancel).
       
   169 
       
   170 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   171 		if( isVideo )
       
   172 			{
       
   173 			if( iSoftKeyState ==
       
   174 			 MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
       
   175 				{
       
   176 				// Cancel listbox timer
       
   177         		if( iListBoxObserver )
       
   178             		{
       
   179             		iListBoxObserver->HandleFileListBoxEventL(
       
   180                 		MFLDFileListBoxObserver::EOtherKeyEvent,
       
   181                 		fileName );
       
   182             		}
       
   183 				}
       
   184 			else
       
   185 				{
       
   186 				// No need to cancel timer
       
   187 				// (it has been already cancelled)
       
   188 				}
       
   189 			}
       
   190 		else
       
   191 			{
       
   192         	// Cancel listbox timer
       
   193         	if( iListBoxObserver )
       
   194             	{
       
   195             	iListBoxObserver->HandleFileListBoxEventL(
       
   196                 	MFLDFileListBoxObserver::EOtherKeyEvent,
       
   197                 	fileName );
       
   198             	}
       
   199 			}
       
   200 #else
       
   201 		// Cancel listbox timer
       
   202         if( iListBoxObserver )
       
   203         	{
       
   204             iListBoxObserver->HandleFileListBoxEventL(
       
   205             	MFLDFileListBoxObserver::EOtherKeyEvent,
       
   206                 fileName );
       
   207             }
       
   208 #endif
       
   209 
       
   210 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   211 	if( !isVideo )	// Only perform file validity check for audio files here
       
   212 		{
       
   213 		// Ask the observer if the file is valid.
       
   214         if( !iFileObserver.IsFileValidL(
       
   215          fileName, MFLDFileObserver::ESelect ) )
       
   216 			{
       
   217             // Not ok to close the pop-up.
       
   218             // Return. Don't call CAknPopupList::AttemptExitL.
       
   219 			return;
       
   220 			}
       
   221 		}
       
   222 
       
   223 #else
       
   224         // Ask the observer if the file is valid.
       
   225     if( !iFileObserver.IsFileValidL(
       
   226      fileName, MFLDFileObserver::ESelect ) )
       
   227     	{
       
   228 	    // Not ok to close the pop-up.
       
   229         // Return. Don't call CAknPopupList::AttemptExitL.
       
   230 		return;
       
   231 		}
       
   232 #endif
       
   233 
       
   234 
       
   235 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   236 		if( iListBoxObserver )
       
   237 			{
       
   238 			// Ask the observer if the file is video
       
   239 			if( isVideo )
       
   240 				{// File is a video
       
   241 
       
   242 				// Change the softkeys back to normal
       
   243 				iListBoxObserver->HandleFileListBoxEventL(
       
   244  						MFLDFileListBoxObserver::EVideoPreviewCanceled,
       
   245  						 fileName );
       
   246  						
       
   247 				if( iSoftKeyState
       
   248 				 == MFLDFileListBoxObserver::EToneSelectionSoftKeyState )
       
   249 			 		{	// File is a video and we are in tone selection list
       
   250 
       
   251 			 		// Ask the observer if the file is valid.
       
   252         			if( !iFileObserver.IsFileValidL(
       
   253         			 fileName, MFLDFileObserver::ESelect ) )
       
   254         				{
       
   255 						// Not ok to close the pop-up.
       
   256             			// Return. Don't call CAknPopupList::AttemptExitL.
       
   257 						return;
       
   258         				}
       
   259 			 		}
       
   260 			 	else if( iSoftKeyState
       
   261 			 	 == MFLDFileListBoxObserver::EPreviewSoftKeyState )
       
   262 			 		{	// File is a video and it has been focused for 1s
       
   263 
       
   264 			 		// Ask the observer if the file is valid.
       
   265         			if( !iFileObserver.IsFileValidL(
       
   266         			 fileName, MFLDFileObserver::EPlay ) )
       
   267         				{
       
   268 						// Not ok to close the pop-up.
       
   269             			// Return. Don't call CAknPopupList::AttemptExitL.
       
   270 						return;
       
   271         				}
       
   272 
       
   273 			 		iListBoxObserver->HandleFileListBoxEventL(
       
   274                 		MFLDFileListBoxObserver::EVideoPreview,
       
   275                 		fileName );
       
   276                 	
       
   277 			 		// Disable scrollbar
       
   278 			 		ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( ETrue );
       
   279 
       
   280 			 		// Remove the focus from listbox
       
   281                 	ListBox()->SetDimmed( ETrue );
       
   282 
       
   283                 	// Not ok to close the pop-up.
       
   284             		// Return. Don't call CAknPopupList::AttemptExitL.
       
   285                 	return;
       
   286 			 		}
       
   287 			 	else if( iSoftKeyState
       
   288 			 	 == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
       
   289 			 		{	// File is a video and it is in preview state
       
   290 
       
   291 			 		// Ask the observer if the file is valid.
       
   292         			if( !iFileObserver.IsFileValidL(
       
   293         			 fileName, MFLDFileObserver::ESelect ) )
       
   294 						{
       
   295 						// When video screen is closed,
       
   296 						// listbox must be forced to be refreshed
       
   297 						// ( otherwise scrollbar is not redrawn)
       
   298 						ListBox()->SetDimmed( EFalse );
       
   299 	                    ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   300 						DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
       
   301 						// Not ok to close the pop-up.
       
   302             			// Return. Don't call CAknPopupList::AttemptExitL.
       
   303 						return;
       
   304 						}
       
   305 
       
   306 					// When video screen is closed, listbox must be refreshed
       
   307 					DrawDeferred();
       
   308 	            	}
       
   309 				}
       
   310 			}
       
   311 		}
       
   312 	else	// 	if( aAccept )
       
   313 		{
       
   314 		// User canceled selection
       
   315 		if( iListBoxObserver )
       
   316 			{
       
   317 			if( isVideo )
       
   318 				{	// File is a video
       
   319 				
       
   320 				// Change the softkeys back to normal
       
   321 				iListBoxObserver->HandleFileListBoxEventL(
       
   322 	       			MFLDFileListBoxObserver::EVideoPreviewCanceled,
       
   323 	       			 fileName );
       
   324 				
       
   325 	 			if( iSoftKeyState ==
       
   326 	 			 MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
       
   327 					{	// File is a video and it is in preview state
       
   328 
       
   329 					// When video screen is closed,
       
   330 					// listbox must be forced to be refreshed
       
   331 					// ( otherwise scrollbar is not redrawn)
       
   332 					ListBox()->SetDimmed( EFalse );
       
   333                     ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   334 					DrawNow( CEikonEnv::Static()->EikAppUi()->ApplicationRect() );
       
   335 					// Not ok to close the pop-up.
       
   336             		// Return. Don't call CAknPopupList::AttemptExitL.
       
   337 					return;
       
   338 					}
       
   339 	 			}
       
   340 			}
       
   341 #endif
       
   342 
       
   343 		}
       
   344 
       
   345 	iExitChecksDone = ETrue;
       
   346 	CAknPopupList::AttemptExitL( aAccept );
       
   347 	}
       
   348 
       
   349 // -----------------------------------------------------------------------------
       
   350 // CFLDPopupList::HandleResourceChange
       
   351 // (other items were commented in a header).
       
   352 // -----------------------------------------------------------------------------
       
   353 //
       
   354 void CFLDPopupList::HandleResourceChange( TInt aType )
       
   355     {
       
   356 #ifdef RD_VIDEO_AS_RINGING_TONE
       
   357     if( aType == KEikDynamicLayoutVariantSwitch ||
       
   358          aType == KAknsMessageSkinChange )
       
   359         {
       
   360 		if( iListBoxObserver )
       
   361 			{
       
   362  			TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
       
   363  				MFLDFileListBoxObserver::EVideoPreviewCanceled ) );
       
   364  		    if( ListBox()->IsFocused() )
       
   365  		        {
       
   366  		        ListBox()->SetDimmed( EFalse );
       
   367                 ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   368  		        }
       
   369 			}
       
   370         }
       
   371 #endif
       
   372     if( aType == KAknsMessageSkinChange )
       
   373         {
       
   374         TRAP_IGNORE( PopulateIconArrayL() );
       
   375         }
       
   376 
       
   377     CAknPopupList::HandleResourceChange( aType );
       
   378     }
       
   379 
       
   380 // -----------------------------------------------------------------------------
       
   381 // CFLDPopupList::GetFileListBoxObserver
       
   382 // (other items were commented in a header).
       
   383 // -----------------------------------------------------------------------------
       
   384 //
       
   385 MFLDFileListBoxObserver* CFLDPopupList::GetFileListBoxObserver()
       
   386 	{
       
   387 	return iListBoxObserver;
       
   388 	}
       
   389 
       
   390 // -----------------------------------------------------------------------------
       
   391 // CFLDPopupList::HandleListBoxEventL
       
   392 // (other items were commented in a header).
       
   393 // -----------------------------------------------------------------------------
       
   394 //
       
   395 void CFLDPopupList::HandleListBoxEventL( CEikListBox* aListBox,
       
   396 	TListBoxEvent aEventType )
       
   397     {
       
   398 	switch( aEventType )
       
   399 		{
       
   400 		// Special handling for touch: first click just starts preview;
       
   401 		// second click (double click) will select the tone.
       
   402 		// Fall through.
       
   403 		case EEventItemClicked:
       
   404 			{
       
   405 			iModel.GetFileName( iCurrentFileName, iListBox->CurrentItemIndex() );
       
   406 			iListBoxObserver->HandleFileListBoxEventL( 
       
   407 				MFLDFileListBoxObserver::EFocusChanged, iCurrentFileName );
       
   408 			return;
       
   409 			}
       
   410 
       
   411 		case EEventItemDoubleClicked:
       
   412 			AttemptExitL( ETrue );
       
   413 			return;
       
   414 
       
   415 		default:
       
   416 			break;
       
   417 		}
       
   418 
       
   419 	CAknPopupList::HandleListBoxEventL( aListBox, aEventType );
       
   420     }
       
   421 
       
   422 // -----------------------------------------------------------------------------
       
   423 // CFLDPopupList::CancelPreview
       
   424 // (other items were commented in a header).
       
   425 // -----------------------------------------------------------------------------
       
   426 //
       
   427 void CFLDPopupList::CancelPreview()
       
   428     {
       
   429     if( iListBoxObserver )
       
   430     	{
       
   431         TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
       
   432          				MFLDFileListBoxObserver::EOtherKeyEvent, KNullDesC ) );
       
   433     	}
       
   434     }
       
   435 
       
   436 // -----------------------------------------------------------------------------
       
   437 // CFLDPopupList::PopupListWindow::
       
   438 // (other items were commented in a header).
       
   439 // -----------------------------------------------------------------------------
       
   440 //
       
   441 RWindow& CFLDPopupList::PopupListWindow() const
       
   442 	{
       
   443 	return Window();
       
   444 	}
       
   445 
       
   446 // -----------------------------------------------------------------------------
       
   447 // CFLDPopupList::HandleGainingForeground
       
   448 // (other items were commented in a header).
       
   449 // -----------------------------------------------------------------------------
       
   450 //
       
   451 void CFLDPopupList::HandleGainingForeground()
       
   452 	{
       
   453 	TRAP_IGNORE( ListBox()->HandleItemAdditionL() );
       
   454 	}
       
   455 // -----------------------------------------------------------------------------
       
   456 // CFLDPopupList::HandleLosingForeground
       
   457 // (other items were commented in a header).
       
   458 // -----------------------------------------------------------------------------
       
   459 //
       
   460 void CFLDPopupList::HandleLosingForeground()
       
   461 	{
       
   462     if( iListBoxObserver )
       
   463         {
       
   464         iListBoxObserver->HandleSoftKeyState( iSoftKeyState );
       
   465         if( iSoftKeyState == MFLDFileListBoxObserver::EPreviewSelectSoftKeyState )
       
   466             {
       
   467             TRAP_IGNORE( iListBoxObserver->HandleFileListBoxEventL(
       
   468                 MFLDFileListBoxObserver::EVideoPreviewCanceled, KNullDesC ) );
       
   469             DrawNow();
       
   470             }
       
   471 
       
   472         // Set the vertical scroll bar and listbox to not dimmed.        
       
   473         if ( ListBox()->IsFocused() )
       
   474             {
       
   475             ListBox()->SetDimmed( EFalse );
       
   476             ListBox()->ScrollBarFrame()->VerticalScrollBar()->SetDimmed( EFalse );
       
   477             }
       
   478         }
       
   479 	}	
       
   480 
       
   481 // -----------------------------------------------------------------------------
       
   482 // CFLDPopupList::HandleChangeInFocus
       
   483 // (other items were commented in a header).
       
   484 // -----------------------------------------------------------------------------
       
   485 //
       
   486 void CFLDPopupList::HandleChangeInFocus()
       
   487 	{
       
   488 	if( ListBox()->IsFocused() )
       
   489 		{
       
   490 		ListBox()->SetDimmed( EFalse );
       
   491 		}
       
   492 	}	
       
   493 // -----------------------------------------------------------------------------
       
   494 // CFLDPopupList::HandleDestructionOfFocusedItem
       
   495 // (other items were commented in a header).
       
   496 // -----------------------------------------------------------------------------
       
   497 //
       
   498 void CFLDPopupList::HandleDestructionOfFocusedItem()
       
   499 	{
       
   500 	}	
       
   501 
       
   502 // -----------------------------------------------------------------------------
       
   503 // CFLDPopupList::PopulateIconArrayL
       
   504 // (other items were commented in a header).
       
   505 // -----------------------------------------------------------------------------
       
   506 //
       
   507 void CFLDPopupList::PopulateIconArrayL()
       
   508     {
       
   509     CAknSingleGraphicBtPopupMenuStyleListBox* listBox = 
       
   510     	static_cast<CAknSingleGraphicBtPopupMenuStyleListBox*>( ListBox() );
       
   511 
       
   512 	if( !listBox )
       
   513 		{
       
   514 		return;
       
   515 		}
       
   516 
       
   517     // Create new icon array
       
   518     CArrayPtr<CGulIcon>* iconArray = new( ELeave ) CAknIconArray( KIconGranularity );
       
   519     CleanupStack::PushL( iconArray );
       
   520 
       
   521     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   522 
       
   523     //    
       
   524     // Create an empty icon in icon array position 0
       
   525     // 
       
   526     CGulIcon* icon =
       
   527         AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropEmpty, KAvkonBitmapFile,
       
   528         EMbmAvkonQgn_prop_empty, EMbmAvkonQgn_prop_empty_mask  );
       
   529     CleanupStack::PushL( icon );
       
   530     iconArray->AppendL( icon );
       
   531     CleanupStack::Pop( icon );
       
   532 
       
   533     //
       
   534     // Create an URL icon for download tones in icon array position 1
       
   535     //
       
   536     icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropLinkEmbdSmall,
       
   537         KAvkonVariatedBitmapsFile,
       
   538         EMbmVariatedbitmapsQgn_prop_link_embd_small,
       
   539         EMbmVariatedbitmapsQgn_prop_link_embd_small_mask );
       
   540     CleanupStack::PushL( icon );
       
   541     iconArray->AppendL( icon );
       
   542     CleanupStack::Pop( icon );
       
   543 
       
   544     //
       
   545     // Create an memory card icon in icon array position 2
       
   546     //		
       
   547 	TParse* fp = new(ELeave) TParse();
       
   548 	fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
       
   549 	TFileName resourceFileName( fp->FullName() );
       
   550 	delete fp;
       
   551         
       
   552     TRgb defaultColour( KRgbBlack );
       
   553     CFbsBitmap* bmap = NULL;
       
   554     CFbsBitmap* mask = NULL;
       
   555 
       
   556     AknsUtils::GetCachedColor( skin, defaultColour,
       
   557                KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 );
       
   558     AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall,
       
   559                 KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap, mask,
       
   560                 resourceFileName, EMbmAknmemorycarduiQgn_indi_mmc_add,
       
   561                 EMbmAknmemorycarduiQgn_indi_mmc_add_mask,
       
   562                 defaultColour );
       
   563     icon = CGulIcon::NewL( bmap, mask );
       
   564     icon->SetBitmapsOwnedExternally( EFalse );
       
   565     CleanupStack::Pop( 2 ); // icon owns the bitmaps now
       
   566         
       
   567     CleanupStack::PushL( icon );
       
   568     iconArray->AppendL( icon );
       
   569     CleanupStack::Pop( icon );
       
   570      
       
   571     //
       
   572     // Create an audio file icon in icon array position 3
       
   573     //
       
   574     icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileSound,
       
   575         KCommonDialogsBitmapFile,
       
   576         EMbmCommondialogsQgn_prop_fmgr_file_sound,
       
   577         EMbmCommondialogsQgn_prop_fmgr_file_sound_mask );
       
   578     CleanupStack::PushL( icon );
       
   579     iconArray->AppendL( icon );
       
   580     CleanupStack::Pop( icon );
       
   581 
       
   582     //
       
   583     // Create a video file icon in icon array position 4
       
   584     //
       
   585     icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnPropFmgrFileVideo,
       
   586         KCommonDialogsBitmapFile,
       
   587         EMbmCommondialogsQgn_prop_fmgr_file_video,
       
   588         EMbmCommondialogsQgn_prop_fmgr_file_video_mask );
       
   589     CleanupStack::PushL( icon );
       
   590     iconArray->AppendL( icon );
       
   591     CleanupStack::Pop( icon );
       
   592 
       
   593     //
       
   594     // create mass storage icon in icon array position 5
       
   595     //
       
   596 	TParse* fp2 = new(ELeave) TParse();
       
   597 	fp2->Set(KFLDMassStorageBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
       
   598 	resourceFileName = fp2->FullName();
       
   599 	delete fp2;
       
   600 
       
   601     TRgb defaultColour2( KRgbBlack );
       
   602     CFbsBitmap* bmap2 = NULL;
       
   603     CFbsBitmap* mask2 = NULL;
       
   604 
       
   605     AknsUtils::GetCachedColor( skin, defaultColour2,
       
   606                KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13 );
       
   607     AknsUtils::CreateColorIconLC( skin, KAknsIIDQgnPropLinkEmbdSmall,
       
   608                 KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13, bmap2, mask2,
       
   609                 resourceFileName, EMbmFilelistQgn_indi_fmgr_ms_add,
       
   610                 EMbmFilelistQgn_indi_fmgr_ms_add_mask,
       
   611                 defaultColour2 );
       
   612     
       
   613     icon = CGulIcon::NewL( bmap2, mask2 );
       
   614     icon->SetBitmapsOwnedExternally( EFalse );
       
   615     CleanupStack::Pop( 2 ); // icon owns the bitmaps now
       
   616         
       
   617     CleanupStack::PushL( icon );
       
   618     iconArray->AppendL( icon );
       
   619     CleanupStack::Pop( icon );
       
   620 
       
   621 
       
   622     // Delete old icons
       
   623     CArrayPtr<CGulIcon>* arr = listBox->ItemDrawer()->ColumnData()->IconArray();
       
   624     if( arr )
       
   625     	{
       
   626     	arr->ResetAndDestroy();
       
   627 	    delete arr;
       
   628 	    arr = NULL;
       
   629     	}
       
   630 
       
   631 	listBox->ItemDrawer()->ColumnData()->SetIconArrayL( iconArray );
       
   632 	CleanupStack::Pop( iconArray );
       
   633 
       
   634     }
       
   635 
       
   636 
       
   637 //  End of File