photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h
changeset 0 4e91876724a2
child 9 6b87b143d312
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Makes the Decision to Create Thumbnail Texture or Icon Texture
       
    15 *                 Considering Drm Validity and Thumbnail Availabilty
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _GLXTHUMBNAILVARIANTTYPE_H_
       
    23 #define _GLXTHUMBNAILVARIANTTYPE_H_
       
    24 
       
    25 #include <e32base.h>                  // Container Base Class
       
    26 #include <mul/mulvarianttype.h>       // Observer interface used to be notified when texture content changes
       
    27 #include "mglxtextureobserver.h"      // Observer interface used to be notified when texture content changes
       
    28 
       
    29 class TGlxMedia;                      // Reference to a media item in the item pool.
       
    30 class CGlxUiUtility;                  // Alf utils ; lib glxalfutils.lib
       
    31 class TSize;                          // Stores a two-dimensional size as a width and a height value
       
    32 class CGlxDRMUtility;
       
    33 class CGlxMedia;
       
    34 /**
       
    35  *
       
    36  */
       
    37 NONSHARABLE_CLASS( GlxThumbnailVariantType ) : public CBase, public 
       
    38 	Alf::MulVariantType, public MGlxTextureObserver
       
    39     {
       
    40 public:
       
    41 	
       
    42 	static GlxThumbnailVariantType* NewL( const TGlxMedia& aMedia, const TSize& aSize, 
       
    43     		TBool aIsFocused = EFalse );
       
    44 	
       
    45 	static GlxThumbnailVariantType* NewLC( const TGlxMedia& aMedia, const TSize& aSize, 
       
    46     		TBool aIsFocused = EFalse );
       
    47 	
       
    48 	void ConstructL( const TGlxMedia& aMedia, const TSize& aSize, TBool 
       
    49 			aIsFocused = EFalse );
       
    50 			
       
    51     /** constructor
       
    52      * Create via new (EMM) ... */
       
    53     GlxThumbnailVariantType( const TGlxMedia& aMedia, const TSize& aSize, 
       
    54     		TBool aIsFocused = EFalse );
       
    55     /** destructor */
       
    56     ~GlxThumbnailVariantType();
       
    57 
       
    58     void TextureContentChangedL( TBool aHasContent, CAlfTexture* aNewTexture );
       
    59     
       
    60     Alf::IMulVariantType::TMulType Type() const ;
       
    61     int integer() const ;
       
    62 
       
    63 private:
       
    64 
       
    65     void ConsumeDRMRightsL( const TGlxMedia& aMedia );
       
    66     
       
    67     TSize ThumbnailSize(const CGlxMedia* aMedia); 
       
    68     
       
    69     /**
       
    70      * Determine if DRM rights need to be consuned based on thumbnail
       
    71      * or visual size
       
    72      * @param aImageSize size of image
       
    73      * @param aBitmapSize bitmap size
       
    74      * @return ETrue if rights are to be consumed
       
    75      */
       
    76      TBool ConsumeRightsBasedOnSize( TSize aImageSize, 
       
    77                TSize aBitmapSize);
       
    78 
       
    79     /**
       
    80      * Determine if the relevant thumbnail is available.
       
    81      * @param aMedia The media item.
       
    82      * @param aSize Size of the Thumbnail.
       
    83      * @return ETrue if the requested size thumbnail present.
       
    84      */     
       
    85      TBool HasRelevantThumbnail(const TGlxMedia& aMedia, 
       
    86                                      const TSize& aSize);
       
    87         
       
    88 private:
       
    89     int mTextureId;
       
    90     CGlxUiUtility* iUiUtility;
       
    91     /** Poniter to instance of DRM utility (owned) */
       
    92     CGlxDRMUtility* iDrmUtility; 
       
    93     };  
       
    94 
       
    95 /**
       
    96  *
       
    97  */
       
    98 NONSHARABLE_CLASS( GlxIconVariantType ) : public CBase, public Alf::MulVariantType
       
    99     {
       
   100 public:
       
   101 	
       
   102 	static GlxIconVariantType* NewL( TInt aIconId, TFileName aFileName, const TSize& aSize );
       
   103 	
       
   104 	static GlxIconVariantType* NewLC( TInt aIconId, TFileName aFileName, const TSize& aSize );
       
   105 	
       
   106 	void ConstructL( TInt aIconId, TFileName aFileName, const TSize& aSize );
       
   107 	
       
   108     /** constructor
       
   109      * Create via new (EMM) ... */
       
   110     GlxIconVariantType( TInt aIconId, TFileName aFileName, const TSize& aSize );
       
   111     /** destructor */
       
   112     ~GlxIconVariantType();
       
   113     Alf::IMulVariantType::TMulType Type() const ;
       
   114     int integer() const ;
       
   115 
       
   116 private:
       
   117     int mIconId;
       
   118     CGlxUiUtility* iUiUtility;
       
   119     };  
       
   120 #endif // _GLXTHUMBNAILVARIANTTYPE_H_