engine/collectionframework/thumbnailcreator/test/ut_cglxtnquickthumbnailtask/ut_cglxtnquickthumbnailtask.h
changeset 71 27f2d7aec52a
parent 69 45459746d5e8
child 72 0a8e959402e5
equal deleted inserted replaced
69:45459746d5e8 71:27f2d7aec52a
     1 /*
       
     2 * Copyright (c) 2006-2006 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:   Quick thumbnail generation task unit tests.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __UT_CGLXTNQUICKTHUMBNAILTASK_H__
       
    21 #define __UT_CGLXTNQUICKTHUMBNAILTASK_H__
       
    22 
       
    23 //  EXTERNAL INCLUDES
       
    24 
       
    25 #include <CEUnitTestSuiteClass.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 //  INTERNAL INCLUDES
       
    29 
       
    30 #include "mglxtnthumbnailcreatorclient.h"
       
    31 
       
    32 //  FORWARD DECLARATIONS
       
    33 
       
    34 class CGlxtnFileUtility;
       
    35 class CGlxtnQuickThumbnailTask;
       
    36 class CFbsBitmap;
       
    37 
       
    38 #include <e32def.h>
       
    39 #ifndef NONSHARABLE_CLASS
       
    40     #define NONSHARABLE_CLASS(x) class x
       
    41 #endif
       
    42 
       
    43 //  CLASS DEFINITION
       
    44 /**
       
    45  *
       
    46  * EUnitWizard generated test class. 
       
    47  *
       
    48  */
       
    49 NONSHARABLE_CLASS( UT_CGlxtnQuickThumbnailTask )
       
    50      : public CEUnitTestSuiteClass, public MGlxtnThumbnailCreatorClient
       
    51     {
       
    52     public:     // Constructors and destructors
       
    53 
       
    54         /**
       
    55          * Two phase construction
       
    56          */
       
    57         static UT_CGlxtnQuickThumbnailTask* NewL();
       
    58         static UT_CGlxtnQuickThumbnailTask* NewLC();
       
    59         /**
       
    60          * Destructor
       
    61          */
       
    62         ~UT_CGlxtnQuickThumbnailTask();
       
    63 
       
    64     private:    // Constructors and destructors
       
    65 
       
    66         UT_CGlxtnQuickThumbnailTask();
       
    67         void ConstructL();
       
    68 
       
    69     private:    // From MGlxtnThumbnailCreatorClient
       
    70         void ThumbnailFetchComplete(const TGlxMediaId& aItemId,
       
    71                             TGlxThumbnailQuality aQuality, TInt aErrorCode);
       
    72         void ThumbnailDeletionComplete(const TGlxMediaId& aItemId, TInt aErrorCode);
       
    73         void FilterAvailableComplete( const RArray<TGlxMediaId>& aIdArray,
       
    74                                         TInt aErrorCode );
       
    75         void FetchFileInfoL(CGlxtnFileInfo* aInfo, const TGlxMediaId& aItemId,
       
    76                         TRequestStatus* aStatus);
       
    77         void CancelFetchUri(const TGlxMediaId& aItemId);
       
    78         MGlxtnThumbnailStorage* ThumbnailStorage();
       
    79 
       
    80     private:    // New methods
       
    81 
       
    82          void SetupL();
       
    83         
       
    84          void Teardown();
       
    85         
       
    86         void UT_CGlxtnQuickThumbnailTask_ConstructL();
       
    87         void UT_CGlxtnQuickThumbnailTask_GenerateL();
       
    88         void UT_CGlxtnQuickThumbnailTask_GenerateNoExifL();
       
    89         void UT_CGlxtnQuickThumbnailTask_ErrorCorruptFileL();
       
    90         void UT_CGlxtnQuickThumbnailTask_ErrorFileNotFoundL();
       
    91 
       
    92         void DoGenerateL(const TDesC& aUri);
       
    93 
       
    94     private:    // Data
       
    95 
       
    96         CGlxtnFileUtility* iFileUtility;
       
    97         CGlxtnQuickThumbnailTask* iQuickThumbnailTask;
       
    98         CFbsBitmap* iBitmap;
       
    99         TPtrC iUri;
       
   100     	TSize iSizeClass;
       
   101     	TGlxThumbnailQuality iQuality;
       
   102     	TInt iError;
       
   103 
       
   104         EUNIT_DECLARE_TEST_TABLE; 
       
   105 
       
   106     };
       
   107 
       
   108 #endif      //  __UT_CGLXTNQUICKTHUMBNAILTASK_H__
       
   109 
       
   110 // End of file