photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp
branchRCL_3
changeset 13 71da52165949
parent 9 6b87b143d312
child 14 ce1c7ad1f18b
equal deleted inserted replaced
9:6b87b143d312 13:71da52165949
   134 	//Creating a CGlxMetadataAsyncUpdate object
   134 	//Creating a CGlxMetadataAsyncUpdate object
   135 	iAsyncRequest = CGlxMetadataAsyncUpdate::NewL(*this);
   135 	iAsyncRequest = CGlxMetadataAsyncUpdate::NewL(*this);
   136 	
   136 	
   137 	//Initializing to NULL
   137 	//Initializing to NULL
   138 	iModifiedUri = NULL;	
   138 	iModifiedUri = NULL;	
       
   139 	
       
   140 	//Flag to check if rename is completed successfully.
       
   141 	iRenameCompleted = EFalse;
   139 	}
   142 	}
   140 
   143 
   141 // ---------------------------------------------------------
   144 // ---------------------------------------------------------
   142 // ~CGlxMetadataContainer
   145 // ~CGlxMetadataContainer
   143 // ---------------------------------------------------------
   146 // ---------------------------------------------------------
   307 // CGlxMetadataContainer::IsLocationItem
   310 // CGlxMetadataContainer::IsLocationItem
   308 //-----------------------------------------------------------------------------
   311 //-----------------------------------------------------------------------------
   309 TBool CGlxMetadataContainer::IsLocationItem()
   312 TBool CGlxMetadataContainer::IsLocationItem()
   310     {
   313     {
   311     //if its location item - enable the delete option
   314     //if its location item - enable the delete option
   312     if(ListBox()->CurrentItemIndex()== ELocationItem)
   315     if (iItemMediaList->Count() && ListBox()->CurrentItemIndex()
       
   316             == ELocationItem)
   313         {
   317         {
   314         const TGlxMedia& item = iItemMediaList->Item(0);
   318         const TGlxMedia& item = iItemMediaList->Item(0);
   315         TCoordinate coordinate;
   319         TCoordinate coordinate;
   316         if(item.GetCoordinate(coordinate))
   320         if (item.GetCoordinate(coordinate))
   317 			{
   321             {
   318 			return EFalse;
   322             return EFalse;
   319 			}
   323             }
   320         return ETrue;        
   324         return ETrue;
   321         }
   325         }
   322     //return ETrue to dim the item
   326     //return ETrue to dim the item
   323     return ETrue;    
   327     return ETrue;
   324     }
   328     }
   325     
   329     
   326 //-----------------------------------------------------------------------------
   330 //-----------------------------------------------------------------------------
   327 // CGlxMetadataContainer::HandleListBoxEventL
   331 // CGlxMetadataContainer::HandleListBoxEventL
   328 //-----------------------------------------------------------------------------
   332 //-----------------------------------------------------------------------------
   941     {
   945     {
   942     TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()");
   946     TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()");
   943     //generic medialist for the item for all the attributes required other than tags and albums.
   947     //generic medialist for the item for all the attributes required other than tags and albums.
   944     if(aList == iItemMediaList)
   948     if(aList == iItemMediaList)
   945         {
   949         {
   946 		// Loop untill it checks for all the avialable attributes
   950         // Loop untill it checks for all the avialable attributes
   947 		for (TInt i = aAttributes.Count() - 1; i >= 0 ; i--)
   951         for (TInt i = aAttributes.Count() - 1; i >= 0; i--)
   948 			{
   952             {
   949 			//set attributes to the items in the container
   953             //set attributes to the items in the container
   950 			SetAttributesL(aAttributes[i]);                   
   954             SetAttributesL(aAttributes[i]);
   951 			}
   955             }
       
   956         if (iRenameCompleted)
       
   957             {
       
   958             iRenameCompleted = EFalse;
       
   959             iAvkonAppUi->ProcessCommandL(EGlxCmdRenameCompleted);
       
   960             }
   952         }
   961         }
   953     //updation of tags and albums list based on the medialist callback.
   962     //updation of tags and albums list based on the medialist callback.
   954     if(aList == iTagMediaList ||  aList == iAlbumMediaList)
   963     if(aList == iTagMediaList ||  aList == iAlbumMediaList)
   955         {
   964         {
   956         for (TInt i = aAttributes.Count() - 1; i >= 0 ; i--)
   965         for (TInt i = aAttributes.Count() - 1; i >= 0 ; i--)
  1011         if(iItemMediaList->Count())
  1020         if(iItemMediaList->Count())
  1012 			{
  1021 			{
  1013 			TGlxMedia item = iItemMediaList->Item(0);
  1022 			TGlxMedia item = iItemMediaList->Item(0);
  1014 			CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL();
  1023 			CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL();
  1015 			CleanupStack::PushL(stringConverter );
  1024 			CleanupStack::PushL(stringConverter );
  1016 			for(TInt index = 0; index <= 9; index++)
  1025 			for(TInt index = 0; index <= ElicenseItem ; index++)
  1017 				{
  1026 				{
  1018 				HBufC* string = NULL;               
  1027 				HBufC* string = NULL;               
  1019   
  1028   
  1020 				if(index == ESizeItem)
  1029 				if(index == ESizeItem)
  1021 					{
  1030 					{
  1051 				else if(index == EResolutionItem)
  1060 				else if(index == EResolutionItem)
  1052 					{
  1061 					{
  1053 					stringConverter->AsStringL(item,
  1062 					stringConverter->AsStringL(item,
  1054 							KGlxMediaGeneralDimensions,0, string );
  1063 							KGlxMediaGeneralDimensions,0, string );
  1055 					}    
  1064 					}    
       
  1065 				else if(index == ElicenseItem)
       
  1066 					{
       
  1067 					// If an item is DRM protected, License field in details
       
  1068 					// should display "View Details"
       
  1069 					string = StringLoader::LoadL(R_GLX_METADATA_VIEW_OPTIONS_VIEW);					
       
  1070 					} 				
  1056 				else
  1071 				else
  1057 					{
  1072 					{
  1058 					//no implementation
  1073 					//no implementation
  1059 					} 
  1074 					} 
  1060 				if(string)
  1075 				if(string)
  1061 					{
  1076 					{
  1062 					iTextSetter.Copy(KGlxTextSetter);
  1077 					iTextSetter.Copy(KGlxTextSetter);
  1063 					iTextSetter.Append(*string);
  1078 					iTextSetter.Append(*string);
  1064 					}
  1079 					}	
  1065 				EditItemL(index,EFalse);                 
  1080 				CleanupStack::PushL( string );
  1066 				delete string;
  1081 				EditItemL(index,EFalse);
  1067 				string = NULL;
  1082 				CleanupStack::PopAndDestroy(string );
  1068 				}
  1083 				}
  1069 			CleanupStack::PopAndDestroy(stringConverter );
  1084 			CleanupStack::PopAndDestroy(stringConverter );
  1070 			}   
  1085 			}   
  1071         }
  1086         }
  1072     }
  1087     }
  1080     iMarquee = ETrue;
  1095     iMarquee = ETrue;
  1081     ListBox()->UseLogicalToVisualConversion(ETrue);
  1096     ListBox()->UseLogicalToVisualConversion(ETrue);
  1082     ListBox()->ItemDrawer()->ColumnData()->SetMarqueeParams (KMarqueeLoopCount,
  1097     ListBox()->ItemDrawer()->ColumnData()->SetMarqueeParams (KMarqueeLoopCount,
  1083             KMarqueeScrollAmount, KMarqueeScrollDelay, KMarqueeScrollInterval);
  1098             KMarqueeScrollAmount, KMarqueeScrollDelay, KMarqueeScrollInterval);
  1084     ListBox()->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
  1099     ListBox()->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
  1085 
       
  1086 	//Fetch the current item index
       
  1087     TInt index = ListBox()->CurrentItemIndex();
       
  1088 
       
  1089 	//Reset the disable marquee flag, so that marquee effect can continue (this is normally reset by 
       
  1090 	//base class of glxmetaDatadialog::HandlePointerEventL()
       
  1091     ListBox()->ItemDrawer()->ClearFlags(CListItemDrawer::EDisableMarquee);
       
  1092 	
       
  1093 	//This is the function which actually starts marquee effect. It is anyway being called from base
       
  1094 	//implementation of OfferKeyEventL(), but for pointer event, we have to call
       
  1095 	//this function
       
  1096     ListBox()->DrawItem(index);
       
  1097     }    
  1100     }    
  1098 // ----------------------------------------------------------------------------
  1101 // ----------------------------------------------------------------------------
  1099 // HandleCommandCompleteL
  1102 // HandleCommandCompleteL
  1100 // ----------------------------------------------------------------------------
  1103 // ----------------------------------------------------------------------------
  1101 // 
  1104 // 
  1295 // ---------------------------------------------------------------------------
  1298 // ---------------------------------------------------------------------------
  1296 // Create new MediaList with modified FileName.
  1299 // Create new MediaList with modified FileName.
  1297 // ---------------------------------------------------------------------------
  1300 // ---------------------------------------------------------------------------
  1298 void CGlxMetadataContainer::RefreshMediaListL()
  1301 void CGlxMetadataContainer::RefreshMediaListL()
  1299 	{
  1302 	{
  1300 	TRACER("CGlxMetadataContainer::RefreshMediaList()");
  1303     TRACER("CGlxMetadataContainer::RefreshMediaList()");
  1301 	if(iItemMediaList)
  1304     if (iItemMediaList)
  1302 	    {
  1305         {
  1303 	    iItemMediaList->RemoveContext(iMainListAttributecontext);
  1306         iItemMediaList->RemoveContext(iMainListAttributecontext);
  1304 	    iItemMediaList->RemoveMediaListObserver(this);
  1307         iItemMediaList->RemoveMediaListObserver(this);
  1305 	    iItemMediaList->Close();
  1308         iItemMediaList->Close();
  1306 	    iItemMediaList = NULL;
  1309         iItemMediaList = NULL;
  1307 	    if( iMainListAttributecontext )
  1310         if (iMainListAttributecontext)
  1308 			{
  1311             {
  1309 			delete iMainListAttributecontext;
  1312             delete iMainListAttributecontext;
  1310 			iMainListAttributecontext = NULL;
  1313             iMainListAttributecontext = NULL;
  1311 			}
  1314             }
  1312 	    CreateMediaListForSelectedItemL(ETrue);
  1315         CreateMediaListForSelectedItemL(ETrue);
  1313 	    }
  1316         }
  1314 	}
  1317     iRenameCompleted = ETrue;
       
  1318     }
  1315 
  1319 
  1316 // ---------------------------------------------------------------------------
  1320 // ---------------------------------------------------------------------------
  1317 // Completes the active object causing a call from the active scheduler to RunL()
  1321 // Completes the active object causing a call from the active scheduler to RunL()
  1318 // ---------------------------------------------------------------------------
  1322 // ---------------------------------------------------------------------------
  1319 //
  1323 //