photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp
branchRCL_3
changeset 14 ce1c7ad1f18b
parent 13 71da52165949
child 18 bcb43dc84c44
equal deleted inserted replaced
13:71da52165949 14:ce1c7ad1f18b
   120   
   120   
   121     if ( aIsFocused && frameCount > 1 && (fsTnmAvailable) )
   121     if ( aIsFocused && frameCount > 1 && (fsTnmAvailable) )
   122         {
   122         {
   123         GLX_DEBUG1("GlxThumbnailVariantType::CreateAnimatedGifTextureL");
   123         GLX_DEBUG1("GlxThumbnailVariantType::CreateAnimatedGifTextureL");
   124         TRAP( err, mTextureId = iUiUtility->GlxTextureManager().
   124         TRAP( err, mTextureId = iUiUtility->GlxTextureManager().
   125             CreateAnimatedGifTextureL( uri, aSize ).Id() );
   125             CreateAnimatedGifTextureL( uri, aSize, aMedia, 
       
   126                                        aMedia.IdSpaceId() ).Id() );
   126         }
   127         }
   127     //URI length could be zero for Media Id based Thumbnail fetch
   128     //URI length could be zero for Media Id based Thumbnail fetch
   128     else if ( fsTnmAvailable ) 
   129     else if ( fsTnmAvailable ) 
   129 	    {
   130 	    {
   130 	    GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL");
   131 	    GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL");
   131 	    TMPXGeneralCategory cat = aMedia.Category();
   132 	    TMPXGeneralCategory cat = aMedia.Category();
   132 	    if(drm)
   133 	    if(drm)
   133             {
   134             {
   134             expired = iDrmUtility->CheckOpenRightsL(uri, (cat == EMPXImage));
   135 
       
   136             //Fix for ESLM-82WJ59: call 'CheckDisplayRightsL' only for focused item
       
   137             if(aIsFocused)
       
   138             	{
       
   139             	expired = !iDrmUtility->CheckDisplayRightsL(uri, (cat == EMPXImage));
       
   140             	}
       
   141             else
       
   142             	{
       
   143             	//Fix for ESLM-82WJ59: for validity check of non-focused item
       
   144             	expired = !iDrmUtility->CheckOpenRightsL(uri, (cat == EMPXImage));
       
   145             	}
       
   146 
       
   147             //Fix for ESLM-82WJ59: mush easier to understand.
   135             if( expired )
   148             if( expired )
   136                 {
   149                 {
   137                if ( isValid )
   150                 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL(
   138                     {
   151                                                                     EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() );
   139                     // Fix for EABI-7RL9DD
       
   140                     // Replaced defaultSize with aSize
       
   141                     TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL(
       
   142                                                     aMedia, aMedia.IdSpaceId(), aSize, this ).Id() );
       
   143                     }
       
   144                 }
   152                 }
   145             else
   153             else
   146                 {
   154                 {
   147                 TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL( 
   155                 if ( isValid == EGlxDrmRightsValid)
   148                                                     EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() );
   156 					{
       
   157 					// Fix for EABI-7RL9DD
       
   158 					// Replaced defaultSize with aSize
       
   159 					TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL(
       
   160 													aMedia, aMedia.IdSpaceId(), aSize, this ).Id() );
       
   161 					}
       
   162 
   149                 }
   163                 }
   150             } 
   164             } 
   151 		else
   165 		else
   152 		    {
   166 		    {
   153 			TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( 
   167 			TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( 
   173                 {
   187                 {
   174 				//Currently scaling the grid TNM's only if their original size > grid size.
   188 				//Currently scaling the grid TNM's only if their original size > grid size.
   175 				//Have to relook at this.
   189 				//Have to relook at this.
   176                 if(origSize.iWidth > defaultSize.iWidth && origSize.iHeight > defaultSize.iHeight)
   190                 if(origSize.iWidth > defaultSize.iWidth && origSize.iHeight > defaultSize.iHeight)
   177                       {
   191                       {
   178 					  GLX_DEBUG1("GlxThumbnailVariantType::CreateIconTextureL::ScaledTnm");
   192 					  GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL::ScaledTnm");
   179                       TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( 
   193                       TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( 
   180                                 aMedia, aMedia.IdSpaceId(), aSize, this, ETrue ).Id() );
   194                                 aMedia, aMedia.IdSpaceId(), aSize, this, ETrue ).Id() );
   181 					  if(err == KErrNone)
   195 					  if(err == KErrNone)
   182 					      {
   196 					      {
   183 	                      isGridTnmShown = ETrue;
   197 	                      isGridTnmShown = ETrue;
   216     TRACER("CGlxCommandHandlerDrm::ConsumeRightsBasedOnSize");
   230     TRACER("CGlxCommandHandlerDrm::ConsumeRightsBasedOnSize");
   217     
   231     
   218     TBool drmRightsChecked = EFalse;
   232     TBool drmRightsChecked = EFalse;
   219     // minimum size (111 x 83)
   233     // minimum size (111 x 83)
   220     TInt minSize = KGlxThumbnailDrmWidth * KGlxThumbnailDrmHeight;
   234     TInt minSize = KGlxThumbnailDrmWidth * KGlxThumbnailDrmHeight;
   221     //TInt minSize =  111*83 ;
       
   222     // size of actual image
   235     // size of actual image
   223     TInt imgSize = aImageSize.iWidth * aImageSize.iHeight;
   236     TInt imgSize = aImageSize.iWidth * aImageSize.iHeight;
   224     
   237     
   225     // bitmap size
   238     // bitmap size
   226     TInt bmpSize = aBitmapSize.iWidth * aBitmapSize.iHeight;
   239     TInt bmpSize = aBitmapSize.iWidth * aBitmapSize.iHeight;
   324         iDrmUtility->Close();
   337         iDrmUtility->Close();
   325         }
   338         }
   326     
   339     
   327     if ( iUiUtility)
   340     if ( iUiUtility)
   328 		{
   341 		{
   329 //		iUiUtility->GlxTextureManager().RemoveTexture( mTextureId );
       
   330 		iUiUtility->Close ();
   342 		iUiUtility->Close ();
   331 		}
   343 		}
   332     }
   344     }
   333     
   345     
   334     
   346     
   451     {
   463     {
   452    
   464    
   453     TRACER("GlxIconVariantType::~GlxIconVariantType");
   465     TRACER("GlxIconVariantType::~GlxIconVariantType");
   454 	if ( iUiUtility)
   466 	if ( iUiUtility)
   455 		{
   467 		{
   456 //		iUiUtility->GlxTextureManager().RemoveTexture( mTextureId );
       
   457 		iUiUtility->Close ();
   468 		iUiUtility->Close ();
   458 		}
   469 		}
   459     }
   470     }
   460     
   471     
   461 // ----------------------------------------------------------------------------
   472 // ----------------------------------------------------------------------------