127 aMedia.IdSpaceId() ).Id() ); |
127 aMedia.IdSpaceId() ).Id() ); |
128 } |
128 } |
129 //URI length could be zero for Media Id based Thumbnail fetch |
129 //URI length could be zero for Media Id based Thumbnail fetch |
130 else if ( fsTnmAvailable ) |
130 else if ( fsTnmAvailable ) |
131 { |
131 { |
132 GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL"); |
132 GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL"); |
133 TMPXGeneralCategory cat = aMedia.Category(); |
133 TMPXGeneralCategory cat = aMedia.Category(); |
134 //Check if media is DRM rights protected |
134 //Check if media is DRM rights protected |
135 if(drm) |
135 if (drm) |
136 { |
136 { |
|
137 TBool privatePath = EFalse; |
|
138 CreateImageViewerInstanceL(); |
|
139 if (iImageViewerInstance->IsPrivate()) |
|
140 { |
|
141 privatePath = ETrue; |
|
142 } |
137 |
143 |
138 //call 'DisplayItemRightsCheckL' only for focused item |
144 //call 'DisplayItemRightsCheckL' only for focused item |
139 if(aIsFocused) |
145 if (aIsFocused) |
140 { |
146 { |
141 expired = !iDrmUtility->DisplayItemRightsCheckL(uri, (cat == EMPXImage)); |
147 if (privatePath) |
142 } |
148 { |
|
149 expired = !iDrmUtility->DisplayItemRightsCheckL |
|
150 (iImageViewerInstance->ImageFileHandle(),(cat == EMPXImage)); |
|
151 } |
|
152 else |
|
153 { |
|
154 expired = !iDrmUtility->DisplayItemRightsCheckL(uri, (cat == EMPXImage)); |
|
155 } |
|
156 } |
143 else |
157 else |
144 { |
158 { |
145 //call 'ItemRightsValidityCheckL' for validity check of non-focused item |
159 if (privatePath) |
146 expired = !iDrmUtility->ItemRightsValidityCheckL(uri, (cat == EMPXImage)); |
160 { |
147 } |
161 expired = !iDrmUtility->ItemRightsValidityCheckL( |
148 |
162 iImageViewerInstance->ImageFileHandle(), (cat |
|
163 == EMPXImage)); |
|
164 } |
|
165 else |
|
166 { |
|
167 //call 'ItemRightsValidityCheckL' for validity check of non-focused item |
|
168 expired = !iDrmUtility->ItemRightsValidityCheckL(uri, |
|
169 (cat == EMPXImage)); |
|
170 } |
|
171 } |
|
172 DeleteImageViewerInstance(); |
149 //Check If DRM rights have expired. |
173 //Check If DRM rights have expired. |
150 if( expired ) |
174 if (expired) |
151 { |
175 { |
152 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( |
176 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( |
153 EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() ); |
177 EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() ); |
154 } |
178 } |
155 else |
179 else |
156 { |
180 { |
157 if ( isValid == EGlxDrmRightsValid) |
181 if (isValid == EGlxDrmRightsValid) |
158 { |
182 { |
159 // Fix for EABI-7RL9DD |
183 // Fix for EABI-7RL9DD |
160 // Replaced defaultSize with aSize |
184 // Replaced defaultSize with aSize |
161 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( |
185 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( |
162 aMedia, aMedia.IdSpaceId(), aSize, this ).Id() ); |
186 aMedia, aMedia.IdSpaceId(), aSize, this ).Id() ); |
163 } |
187 } |
164 |
188 |
165 } |
189 } |
166 } |
190 } |
167 else |
191 else |
168 { |
192 { |
169 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( |
193 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( |
170 aMedia, aMedia.IdSpaceId(), aSize, this ).Id() ); |
194 aMedia, aMedia.IdSpaceId(), aSize, this ).Id() ); |
171 } |
195 } |
172 } |
196 } |
173 else if ( aMedia.GetIconInfo(icon) ) |
197 else if ( aMedia.GetIconInfo(icon) ) |
174 { |
198 { |
175 GLX_DEBUG1("GlxThumbnailVariantType::CreateIconTextureL"); |
199 GLX_DEBUG1("GlxThumbnailVariantType::CreateIconTextureL"); |
176 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( |
200 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( |
177 icon.bitmapId, resFile, defaultSize ).Id() ); |
201 icon.bitmapId, resFile, defaultSize ).Id() ); |
396 GLX_LOG_INFO("GlxThumbnailVariantType::HasRelevantThumbnail() - TN avail"); |
420 GLX_LOG_INFO("GlxThumbnailVariantType::HasRelevantThumbnail() - TN avail"); |
397 return ETrue; |
421 return ETrue; |
398 } |
422 } |
399 return EFalse; |
423 return EFalse; |
400 } |
424 } |
|
425 |
|
426 // ----------------------------------------------------------------------------- |
|
427 // CreateImageViewerInstanceL |
|
428 // ----------------------------------------------------------------------------- |
|
429 // |
|
430 void GlxThumbnailVariantType::CreateImageViewerInstanceL() |
|
431 { |
|
432 TRACER("GlxThumbnailVariantType::CreateImageViewerInstanceL"); |
|
433 iImageViewerInstance = CGlxImageViewerManager::InstanceL(); |
|
434 __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer)); |
|
435 } |
|
436 |
|
437 // ----------------------------------------------------------------------------- |
|
438 // DeleteImageViewerInstance |
|
439 // ----------------------------------------------------------------------------- |
|
440 // |
|
441 void GlxThumbnailVariantType::DeleteImageViewerInstance() |
|
442 { |
|
443 TRACER("GlxThumbnailVariantType::DeleteImageViewerInstance"); |
|
444 if ( iImageViewerInstance ) |
|
445 { |
|
446 iImageViewerInstance->DeleteInstance(); |
|
447 } |
|
448 } |
401 |
449 |
402 // ---------------------------------------------------------------------------- |
450 // ---------------------------------------------------------------------------- |
403 // type |
451 // type |
404 // ---------------------------------------------------------------------------- |
452 // ---------------------------------------------------------------------------- |
405 // |
453 // |