photosgallery/viewframework/visuallistmanager/src/glxitemvisual.cpp
branchRCL_3
changeset 18 bcb43dc84c44
parent 14 ce1c7ad1f18b
equal deleted inserted replaced
14:ce1c7ad1f18b 18:bcb43dc84c44
    47 #include <glxthumbnailattributeinfo.h>
    47 #include <glxthumbnailattributeinfo.h>
    48 #include <mglxmedialist.h>
    48 #include <mglxmedialist.h>
    49 #include <glxthumbnailutility.h>
    49 #include <glxthumbnailutility.h>
    50 #include <alf/alftransformation.h>
    50 #include <alf/alftransformation.h>
    51 #include "mglxvisualobjectstatusobserver.h"
    51 #include "mglxvisualobjectstatusobserver.h"
    52 #include "mglxvisualobjectlayoutrefreshobserver.h"
       
    53 
    52 
    54 const TInt KGlxOpacityFadeDuration = 400;
    53 const TInt KGlxOpacityFadeDuration = 400;
    55 
       
    56 const TInt KGlxForegroundAnchorOrdinal = 2;
    54 const TInt KGlxForegroundAnchorOrdinal = 2;
    57 
    55 
    58 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    59 // Constructor. Inlined to save a few bits of rom
    57 // Constructor. Inlined to save a few bits of rom
    60 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
   105         delete iAnimatedTexture;
   103         delete iAnimatedTexture;
   106     if ( iUiUtility )
   104     if ( iUiUtility )
   107         {
   105         {
   108         iUiUtility->Close();
   106         iUiUtility->Close();
   109         }
   107         }
   110     iObservers.Close();
       
   111     }
   108     }
   112 
   109 
   113 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   114 // ConstructL
   111 // ConstructL
   115 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   135         CAlfAnchorLayout::AddNewL( aFactory.VisualOwner(), iVisual );    
   132         CAlfAnchorLayout::AddNewL( aFactory.VisualOwner(), iVisual );    
   136                                         
   133                                         
   137     // create the child image visual
   134     // create the child image visual
   138     iImageVisual = 
   135     iImageVisual = 
   139         CAlfImageVisual::AddNewL( aFactory.VisualOwner(), iMainVisual );
   136         CAlfImageVisual::AddNewL( aFactory.VisualOwner(), iMainVisual );
   140     //iImageVisual->SetScaleMode( aFactory.ThumbnailScaleMode() );
       
   141 	iImageVisual->SetScaleMode(CAlfImageVisual::EScaleNormal);
   137 	iImageVisual->SetScaleMode(CAlfImageVisual::EScaleNormal);
   142     // Turn on clipping only if cover-mode has been chosen
   138     // Turn on clipping only if cover-mode has been chosen
   143     iImageVisual->SetClipping(ETrue);
   139     iImageVisual->SetClipping(ETrue);
   144 
   140 
   145 	User::LeaveIfError( iMainVisual->SetRelativeAnchorRect(
   141 	User::LeaveIfError( iMainVisual->SetRelativeAnchorRect(
   284 // HandleAttributesAvailableL
   280 // HandleAttributesAvailableL
   285 // -----------------------------------------------------------------------------
   281 // -----------------------------------------------------------------------------
   286 //
   282 //
   287 void CGlxVisualObject::HandleAttributesAvailableL(
   283 void CGlxVisualObject::HandleAttributesAvailableL(
   288     const TGlxIdSpaceId& aIdSpaceId, const TGlxMedia& aItem,
   284     const TGlxIdSpaceId& aIdSpaceId, const TGlxMedia& aItem,
   289     const RArray<TMPXAttribute>& aAttributes)
   285     const RArray<TMPXAttribute>& /*aAttributes*/)
   290     {
   286     {
   291     TRACER("CGlxVisualObject::HandleAttributesAvailableL");
   287     TRACER("CGlxVisualObject::HandleAttributesAvailableL");
   292     TBool animate = ( EHasDefaultIcon == Status() );
   288     TBool animate = ( EHasDefaultIcon == Status() );
   293 
   289 
   294     // get texture manager
   290     // get texture manager
   498 // ---------------------------------------------------------------------------
   494 // ---------------------------------------------------------------------------
   499 // AddZoomTileL
   495 // AddZoomTileL
   500 // ---------------------------------------------------------------------------
   496 // ---------------------------------------------------------------------------
   501 //
   497 //
   502 TInt CGlxVisualObject::AddZoomTileL(
   498 TInt CGlxVisualObject::AddZoomTileL(
   503                     const TGlxMedia& aItem, const TMPXAttribute& aAttribute,
   499                     const TGlxMedia& /*aItem*/, const TMPXAttribute& aAttribute,
   504                     TGlxIdSpaceId aIdSpaceId, const TRect& aCroppingRect )
   500                     TGlxIdSpaceId /*aIdSpaceId*/, const TRect& aCroppingRect )
   505     {
   501     {
   506     TRACER("CGlxVisualObject::AddZoomTileL");
   502     TRACER("CGlxVisualObject::AddZoomTileL");
   507     // Reserve space for new tile
   503     // Reserve space for new tile
   508     iZoomTiles.ReserveL( iZoomTiles.Count() + 1 );
   504     iZoomTiles.ReserveL( iZoomTiles.Count() + 1 );
   509 
   505 
  1039                 const TGlxIconAnchors& aIcon1, const TGlxIconAnchors& aIcon2 )
  1035                 const TGlxIconAnchors& aIcon1, const TGlxIconAnchors& aIcon2 )
  1040     {
  1036     {
  1041     TRACER("CGlxVisualObject::Match");
  1037     TRACER("CGlxVisualObject::Match");
  1042     return ( aIcon1.iTexture == aIcon2.iTexture );
  1038     return ( aIcon1.iTexture == aIcon2.iTexture );
  1043     }
  1039     }
  1044     
  1040 
  1045 void CGlxVisualObject::AddObserver( MGlxVisualObjectLayoutRefreshObserver* aObserver ) 
       
  1046     {
       
  1047     TRACER("CGlxVisualObject::AddObserver");
       
  1048     	__ASSERT_DEBUG(iObservers.Find(aObserver) == KErrNotFound, 
       
  1049 	                    Panic(EGlxPanicIllegalArgument)); // Already exists
       
  1050 	iObservers.Append(aObserver);
       
  1051     }
       
  1052     
       
  1053 void CGlxVisualObject::RemoveObserver( MGlxVisualObjectLayoutRefreshObserver* aObserver )
       
  1054     {
       
  1055     TRACER("CGlxVisualObject::RemoveObserver");
       
  1056     TInt i = iObservers.Find(aObserver);
       
  1057     if (i != KErrNotFound)
       
  1058         {
       
  1059         iObservers.Remove(i);
       
  1060         }
       
  1061     }
       
  1062     
       
  1063  
       
  1064