photosgallery/viewframework/medialists/inc/glxthumbnailutility.h
changeset 0 4e91876724a2
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:    Common utility for thumbnail attributes
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __GLXTHUMBNAILUTILITY_H__
       
    22 #define __GLXTHUMBNAILUTILITY_H__
       
    23 
       
    24 #include <mpxattribute.h>
       
    25 
       
    26 // Forward declarations
       
    27 class CGlxMedia;
       
    28 
       
    29 /**
       
    30  * Common utility for thumbnail attributes
       
    31  *
       
    32  * @author Dan Rhodes
       
    33  * @ingroup glx_media_lists
       
    34  */
       
    35 NONSHARABLE_CLASS( GlxThumbnailUtility )
       
    36     {
       
    37 public:
       
    38     /**
       
    39      * Find the closest available thumbnail to a given size for a media item.
       
    40      * @param aDesiredSize Size of thumbnail required
       
    41      * @param aMedia Media item whose attributes are to be searched
       
    42      * @param aDrmValid If false, the function will not return a thumbnail
       
    43                 bigger than the requested size
       
    44      * @return TInt Index of closest attribute, or KErrNotFound if none found
       
    45      */
       
    46     IMPORT_C static TInt ClosestThumbnail( const TSize& aDesiredSize,
       
    47                                 const CGlxMedia& aMedia, TBool aDrmValid );
       
    48 	 
       
    49 	 /**
       
    50      * Check from the attributes if there is a full thumbnail available .
       
    51      * @param aAttr attribute to check  
       
    52      * @return ETrue if full thumbnail found, else EFalse
       
    53      */
       
    54  	 IMPORT_C static TBool IsFullThumbnail(const TMPXAttribute& aAttr);
       
    55 
       
    56 private:
       
    57     /**
       
    58      * Determine if this attribute should be preferred to that already selected
       
    59      * @param aThisDimen dimension describing this attribute
       
    60      * @param aSelectedDimen dimension describing the attribute already selected
       
    61      * @param aReqDimen the required dimension
       
    62      * @param aQuality the quality of the bitmap of this attribute
       
    63      * @param aSelectedQuality the quality of the bitmap of the attribute already selected
       
    64      * @param aDrmValid EFalse for item which has invalid DRM rights
       
    65      * @return ETrue if this attribute is preferred, else EFalse
       
    66      */
       
    67     static TBool PreferThisAttribute(
       
    68                 TInt aThisDimen, TInt aSelectedDimen, TInt aReqDimen,
       
    69                 TInt aThisQuality, TInt aSelectedQuality, TBool aDrmValid );
       
    70     };
       
    71 
       
    72 #endif // __GLXTHUMBNAILUTILITY_H__
       
    73