photosgallery/slideshow/engine/coresrc/shwthumbnailcontext.h
changeset 0 4e91876724a2
child 47 f9e827349359
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:    Slideshow thumbnail context
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SHWTHUMBNAILCONTEXT_H__
       
    22 #define __SHWTHUMBNAILCONTEXT_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 
       
    28 #include <glxmedialistiterator.h>
       
    29 #include <glxthumbnailcontext.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  CShwThumbnailContext
       
    37  *
       
    38  */
       
    39 NONSHARABLE_CLASS( CShwThumbnailContext ) : public CBase,
       
    40 	public MGlxMediaListIterator
       
    41 	{
       
    42 	public:
       
    43 
       
    44 		/**
       
    45 		 * Constructor.
       
    46            * @param aIndex, the medialist index for the thumbnail to load
       
    47            * @param aSize, the size for the thumbnail
       
    48 		 */
       
    49 		static CShwThumbnailContext* NewLC( TInt aIndex, TSize aSize );
       
    50 
       
    51 		/**
       
    52 		 * Destructor.
       
    53 		 */
       
    54 		~CShwThumbnailContext();
       
    55 
       
    56 	public: // the API
       
    57 		
       
    58 		/**
       
    59 		 * Retrieve the index
       
    60 		 * @return the index of the media list item associated with this context
       
    61 		 */
       
    62 		TInt Index();
       
    63 
       
    64 		/// @ref MGlxFetchContext::RequestCountL
       
    65 		TInt RequestCountL(const MGlxMediaList* aList) const;
       
    66 
       
    67 		/**
       
    68 		 * Retrieve the context.
       
    69 		 * @return the context stored in this class
       
    70 		 */
       
    71 		MGlxFetchContext* Context();
       
    72 
       
    73 	public:	// from MGlxMediaListIterator
       
    74 
       
    75 		/// @ref MGlxMediaListIterator::SetToFirst
       
    76 		void SetToFirst( const MGlxMediaList* aList );
       
    77 		/// @ref MGlxMediaListIterator::operator++
       
    78 		TInt operator++( TInt );
       
    79 		/// @ref MGlxMediaListIterator::InRange
       
    80 		TBool InRange( TInt aIndex ) const;
       
    81 		
       
    82 	private: // Constructors
       
    83 
       
    84         /**
       
    85          * C++ constructor.
       
    86          */
       
    87         CShwThumbnailContext( TInt aIndex, TSize aSize );
       
    88 
       
    89         /**
       
    90          * 2nd stage constructor
       
    91          */
       
    92         void ConstructL();
       
    93 		
       
    94 	private:
       
    95 
       
    96         /// Own: the high quality thumbnail context
       
    97         CGlxThumbnailContext* iHighQualityContext;
       
    98         /// Own: flag set to ETrue when all attributes have been iterated
       
    99         TBool iIterated;
       
   100         /// Own: the size of the thumbnail for this context
       
   101         TSize iSize;
       
   102         /// Own: the currrent focus item
       
   103         TInt iCurrentIndex;
       
   104 
       
   105 	};
       
   106 
       
   107 #endif // __SHWTHUMBNAILCONTEXT_H__