engine/collectionframework/thumbnailcreator/test/ut_cglxtndeletethumbnailstask/ut_cglxtndeletethumbnailstask.h
changeset 71 27f2d7aec52a
parent 69 45459746d5e8
child 72 0a8e959402e5
equal deleted inserted replaced
69:45459746d5e8 71:27f2d7aec52a
     1 /*
       
     2 * Copyright (c) 2007 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:   Delete thumbnails task unit tests.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __UT_CGLXTNDELETETHUMBNAILSTASK_H__
       
    21 #define __UT_CGLXTNDELETETHUMBNAILSTASK_H__
       
    22 
       
    23 //  EXTERNAL INCLUDES
       
    24 
       
    25 #include <CEUnitTestSuiteClass.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 //  INTERNAL INCLUDES
       
    29 
       
    30 #include "mglxtnstorage.h"
       
    31 #include "mglxtnthumbnailcreatorclient.h"
       
    32 
       
    33 //  FORWARD DECLARATIONS
       
    34 
       
    35 class CGlxtnDeleteThumbnailsTask;
       
    36 
       
    37 #include <e32def.h>
       
    38 #ifndef NONSHARABLE_CLASS
       
    39     #define NONSHARABLE_CLASS(x) class x
       
    40 #endif
       
    41 
       
    42 //  CLASS DEFINITION
       
    43 /**
       
    44  *
       
    45  * EUnitWizard generated test class. 
       
    46  *
       
    47  */
       
    48 NONSHARABLE_CLASS( UT_CGlxtnDeleteThumbnailsTask )
       
    49      : public CEUnitTestSuiteClass, public MGlxtnThumbnailCreatorClient,
       
    50         public MGlxtnThumbnailStorage
       
    51     {
       
    52     public:     // Constructors and destructors
       
    53 
       
    54         /**
       
    55          * Two phase construction
       
    56          */
       
    57         static UT_CGlxtnDeleteThumbnailsTask* NewL();
       
    58         static UT_CGlxtnDeleteThumbnailsTask* NewLC();
       
    59         /**
       
    60          * Destructor
       
    61          */
       
    62         ~UT_CGlxtnDeleteThumbnailsTask();
       
    63 
       
    64     private:    // Constructors and destructors
       
    65 
       
    66         UT_CGlxtnDeleteThumbnailsTask();
       
    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     public: // Functions from MGlxtnThumbnailStorage
       
    81         void LoadThumbnailDataL(HBufC8*& aData, TGlxImageDataFormat& aFormat,
       
    82                     const TGlxMediaId& aId, const CGlxtnFileInfo& aFileInfo,
       
    83                     const TSize& aSize, TRequestStatus* aStatus);
       
    84         void SaveThumbnailDataL(const TDesC8& aData,
       
    85                     TGlxImageDataFormat aFormat, const TGlxMediaId& aId,
       
    86                     const CGlxtnFileInfo& aFileInfo, const TSize& aSize,
       
    87                     TRequestStatus* aStatus);
       
    88         void DeleteThumbnailsL(const TGlxMediaId& aId,
       
    89                     const CGlxtnFileInfo& aFileInfo, TRequestStatus* aStatus);
       
    90         void CleanupThumbnailsL(TRequestStatus* aStatus);
       
    91         void IsThumbnailAvailableL(const TGlxMediaId& aId,
       
    92                     const CGlxtnFileInfo& aFileInfo,
       
    93                     const TSize& aSize, TRequestStatus* aStatus);
       
    94         void StorageCancel();
       
    95         void NotifyBackgroundError(const TGlxMediaId& aId, TInt aError);
       
    96 
       
    97     private:    // New methods
       
    98 
       
    99         void SetupL();
       
   100         void Teardown();
       
   101 
       
   102         void UT_CGlxtnDeleteThumbnailsTask_ConstructL();
       
   103         void UT_CGlxtnDeleteThumbnailsTask_DeleteL();
       
   104 
       
   105     private:    // Data
       
   106 
       
   107         CGlxtnDeleteThumbnailsTask* iDeleteThumbnailsTask;
       
   108     	TUint iIdDeleted;
       
   109     	TInt iError;
       
   110 
       
   111         EUNIT_DECLARE_TEST_TABLE;
       
   112     };
       
   113 
       
   114 #endif  //  __UT_CGLXTNDELETETHUMBNAILSTASK_H__
       
   115 
       
   116 // End of file