106 // CGlxImgVwrMetadataContainer::ConstructL |
106 // CGlxImgVwrMetadataContainer::ConstructL |
107 // --------------------------------------------------------- |
107 // --------------------------------------------------------- |
108 // |
108 // |
109 void CGlxImgVwrMetadataContainer::ConstructL( const TRect& /*aRect*/ ) |
109 void CGlxImgVwrMetadataContainer::ConstructL( const TRect& /*aRect*/ ) |
110 { |
110 { |
|
111 TRACER("CGlxMetadataContainer::ConstructLL()"); |
111 //Creating the RBuf texts for all the items except tags & albums |
112 //Creating the RBuf texts for all the items except tags & albums |
112 //which would be updated as whne the item is edited |
113 //which would be updated as whne the item is edited |
113 iTextSetter.CreateL(KMaxFileName); |
114 iTextSetter.CreateL(KMaxFileName); |
114 CreateMediaListForSelectedItemL(); |
115 CreateMediaListForSelectedItemL(); |
115 } |
116 } |
143 //----------------------------------------------------------------------------- |
144 //----------------------------------------------------------------------------- |
144 // CGlxImgVwrMetadataContainer::MediaList |
145 // CGlxImgVwrMetadataContainer::MediaList |
145 //----------------------------------------------------------------------------- |
146 //----------------------------------------------------------------------------- |
146 MGlxMediaList& CGlxImgVwrMetadataContainer::MediaList() |
147 MGlxMediaList& CGlxImgVwrMetadataContainer::MediaList() |
147 { |
148 { |
|
149 TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()"); |
148 //returns the active medialist. |
150 //returns the active medialist. |
149 return *iItemMediaList; |
151 return *iItemMediaList; |
150 } |
152 } |
151 |
153 |
152 //----------------------------------------------------------------------------- |
154 //----------------------------------------------------------------------------- |
157 TRACER("CGlxImgVwrMetadataContainer::CreateSettingItemL"); |
159 TRACER("CGlxImgVwrMetadataContainer::CreateSettingItemL"); |
158 CAknSettingItem* settingItem = NULL; // No need to push onto cleanup stack |
160 CAknSettingItem* settingItem = NULL; // No need to push onto cleanup stack |
159 iTextSetter.Copy(KGlxTextSetter); |
161 iTextSetter.Copy(KGlxTextSetter); |
160 |
162 |
161 //Creating a empty Settings list box which will be populated with metadata in handleattributeavailable |
163 //Creating a empty Settings list box which will be populated with metadata in handleattributeavailable |
162 |
|
163 switch(aResourceId) |
164 switch(aResourceId) |
164 { |
165 { |
165 case EImgVwrNameItem: |
166 case EImgVwrNameItem: |
166 case EImgVwrDateAndTimeItem: |
167 case EImgVwrDateAndTimeItem: |
167 case EImgVwrDescriptionItem: |
168 case EImgVwrDescriptionItem: |
202 //----------------------------------------------------------------------------- |
203 //----------------------------------------------------------------------------- |
203 // CGlxImgVwrMetadataContainer::IsItemModifiable |
204 // CGlxImgVwrMetadataContainer::IsItemModifiable |
204 //----------------------------------------------------------------------------- |
205 //----------------------------------------------------------------------------- |
205 TBool CGlxImgVwrMetadataContainer::IsItemModifiable() |
206 TBool CGlxImgVwrMetadataContainer::IsItemModifiable() |
206 { |
207 { |
|
208 TRACER("CGlxMetadataContainer::IsItemModifiable()"); |
207 //Only items like name , description, tag and albums are modifiable |
209 //Only items like name , description, tag and albums are modifiable |
208 //The check is for the items from ENameItem(0) tille ETagsItem(4) |
210 //The check is for the items from ENameItem(0) tille ETagsItem(4) |
209 if(ListBox()->CurrentItemIndex()<=ETagsItem) |
211 if(ListBox()->CurrentItemIndex()<=ETagsItem) |
210 { |
212 { |
211 return EFalse; |
213 return EFalse; |
219 // CGlxImgVwrMetadataContainer::HandleListBoxEventL |
221 // CGlxImgVwrMetadataContainer::HandleListBoxEventL |
220 //----------------------------------------------------------------------------- |
222 //----------------------------------------------------------------------------- |
221 void CGlxImgVwrMetadataContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
223 void CGlxImgVwrMetadataContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
222 TListBoxEvent aEventType) |
224 TListBoxEvent aEventType) |
223 { |
225 { |
|
226 TRACER("CGlxMetadataContainer::HandleListBoxEventL()"); |
224 GLX_LOG_INFO("CGlxImgVwrMetadataContainer::HandleListBoxEventL"); |
227 GLX_LOG_INFO("CGlxImgVwrMetadataContainer::HandleListBoxEventL"); |
225 if ((aEventType == EEventEnterKeyPressed) || |
228 if (aEventType == EEventItemSingleClicked) |
226 (aEventType == EEventEditingStarted) || |
229 { |
227 (aEventType == EEventItemSingleClicked)) |
230 if(iItemMediaList->Count() == 0) |
228 { |
231 { |
229 //handle edit functionality if items when useer selects via touch |
232 GLX_LOG_INFO("CGlxImgVwrMetadataContainer:: NO Items"); |
230 HandleListboxChangesL(); |
233 return; |
231 } |
234 } |
232 } |
235 TInt index = ListBox()->CurrentItemIndex() ; |
233 //----------------------------------------------------------------------------- |
236 if(EImgVwrlicenseItem == index) |
234 // CGlxImgVwrMetadataContainer::HandleListboxChangesL |
237 { |
235 //----------------------------------------------------------------------------- |
238 GLX_LOG_INFO("CGlxImgVwrMetadataContainer::Licence item"); |
236 void CGlxImgVwrMetadataContainer::HandleListboxChangesL() |
|
237 { |
|
238 |
|
239 TInt index = ListBox()->CurrentItemIndex(); |
|
240 |
|
241 switch(index) |
|
242 { |
|
243 case EImgVwrNameItem: |
|
244 case EImgVwrDescriptionItem: |
|
245 { |
|
246 SetNameDescriptionL(index); |
|
247 break; |
|
248 } |
|
249 |
|
250 case EImgVwrlicenseItem: |
|
251 { |
|
252 |
|
253 //Create DRM utility |
|
254 CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); |
239 CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); |
255 CleanupClosePushL(*drmUtility); |
240 CleanupClosePushL(*drmUtility); |
256 drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri()/*iUri*/); |
241 drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri()); |
257 CleanupStack::PopAndDestroy(drmUtility); |
242 CleanupStack::PopAndDestroy(drmUtility); |
258 } |
243 } |
259 break; |
244 } |
260 default: |
245 } |
261 { |
|
262 break; |
|
263 } |
|
264 } |
|
265 |
|
266 } |
|
267 |
|
268 |
246 |
269 // ---------------------------------------------------------------------------- |
247 // ---------------------------------------------------------------------------- |
270 // CGlxImgVwrMetadataContainer::ViewDynInitMenuPaneL |
248 // CGlxImgVwrMetadataContainer::ViewDynInitMenuPaneL |
271 // ---------------------------------------------------------------------------- |
249 // ---------------------------------------------------------------------------- |
272 // |
250 // |
273 void CGlxImgVwrMetadataContainer::ViewDynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane) |
251 void CGlxImgVwrMetadataContainer::ViewDynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane) |
274 { |
252 { |
|
253 TRACER("CGlxMetadataContainer::ViewDynInitMenuPaneL()"); |
275 if( aMenuId == R_METADATA_MENU ) |
254 if( aMenuId == R_METADATA_MENU ) |
276 { |
255 { |
277 //Set dim the options based on the utem selected |
256 //Set dim the options based on the utem selected |
278 //Viewdetails option will be availble only for the license item |
257 //Viewdetails option will be availble only for the license item |
279 aMenuPane->SetItemDimmed(KGlxViewBoundMenuCommandId,IsLicenseItem()); |
258 aMenuPane->SetItemDimmed(KGlxViewBoundMenuCommandId,IsLicenseItem()); |
286 // ---------------------------------------------------------------------------- |
265 // ---------------------------------------------------------------------------- |
287 // |
266 // |
288 void CGlxImgVwrMetadataContainer::HandleAttributesAvailableL( TInt /*aItemIndex*/, |
267 void CGlxImgVwrMetadataContainer::HandleAttributesAvailableL( TInt /*aItemIndex*/, |
289 const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList ) |
268 const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList ) |
290 { |
269 { |
291 |
|
292 TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()"); |
270 TRACER("CGlxMetadataContainer::HandleAttributesAvailableL()"); |
293 //generic medialist for the item for all the attributes required other than tags and albums. |
271 //generic medialist for the item for all the attributes required other than tags and albums. |
294 TInt x = aAttributes.Count(); |
272 TInt x = aAttributes.Count(); |
295 if(aList == iItemMediaList) |
273 if(aList == iItemMediaList) |
296 { |
274 { |
527 //----------------------------------------------------------------------------- |
505 //----------------------------------------------------------------------------- |
528 // CGlxImgVwrMetadataContainer::CreateMediaListForSelectedItemL |
506 // CGlxImgVwrMetadataContainer::CreateMediaListForSelectedItemL |
529 //----------------------------------------------------------------------------- |
507 //----------------------------------------------------------------------------- |
530 void CGlxImgVwrMetadataContainer::CreateMediaListForSelectedItemL() |
508 void CGlxImgVwrMetadataContainer::CreateMediaListForSelectedItemL() |
531 { |
509 { |
532 TRACER("CGlxMetadataContainer::CreateMediaListL"); |
510 TRACER("CGlxMetadataContainer::CreateMediaListForSelectedItemL"); |
533 |
511 |
534 //create the collection path for the medialist to be created |
512 //create the collection path for the medialist to be created |
535 CMPXCollectionPath* path = CMPXCollectionPath::NewL(); |
513 CMPXCollectionPath* path = CMPXCollectionPath::NewL(); |
536 CleanupStack::PushL( path ); |
514 CleanupStack::PushL( path ); |
537 //set the all collection path as the details dialog can be launched from any of the grid views and filter with URI |
515 //set the all collection path as the details dialog can be launched from any of the grid views and filter with URI |
720 // CGlxImgVwrMetadataContainer::SetDurationLIicenseItemVisibilityL() |
698 // CGlxImgVwrMetadataContainer::SetDurationLIicenseItemVisibilityL() |
721 // ---------------------------------------------------------------------------- |
699 // ---------------------------------------------------------------------------- |
722 // |
700 // |
723 void CGlxImgVwrMetadataContainer::SetDurationLIicenseItemVisibilityL() |
701 void CGlxImgVwrMetadataContainer::SetDurationLIicenseItemVisibilityL() |
724 { |
702 { |
|
703 TRACER("CGlxMetadataContainer::SetDurationLIicenseItemVisibilityL()"); |
725 //get the media item. |
704 //get the media item. |
726 const TGlxMedia& item = iItemMediaList->Item(0); |
705 const TGlxMedia& item = iItemMediaList->Item(0); |
727 const CGlxMedia* media = item.Properties(); |
706 const CGlxMedia* media = item.Properties(); |
728 |
707 |
729 //in order to check for video category and drm rights |
708 //in order to check for video category and drm rights |
745 //----------------------------------------------------------------------------- |
724 //----------------------------------------------------------------------------- |
746 // CGlxImgVwrMetadataContainer::IsLicenseItem |
725 // CGlxImgVwrMetadataContainer::IsLicenseItem |
747 //----------------------------------------------------------------------------- |
726 //----------------------------------------------------------------------------- |
748 TBool CGlxImgVwrMetadataContainer::IsLicenseItem() |
727 TBool CGlxImgVwrMetadataContainer::IsLicenseItem() |
749 { |
728 { |
|
729 TRACER("CGlxMetadataContainer::IsLicenseItem()"); |
750 //Checks the item for DRMProtection. |
730 //Checks the item for DRMProtection. |
751 if((ListBox()->CurrentItemIndex()== EImgVwrlicenseItem)) |
731 if((ListBox()->CurrentItemIndex()== EImgVwrlicenseItem)) |
752 { |
732 { |
753 return EFalse; |
733 return EFalse; |
754 } |
734 } |