mmappfw_plat/mpx_albumart_utility_api/tsrc/mpxalbumartutilitytest/inc/mpxalbumartutilitytest.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:  STIF for mpx_albumart_utility_api
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MPXALBUMARTUTILITYTEST_H
       
    21 #define MPXALBUMARTUTILITYTEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <StifLogger.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <StifTestModule.h>
       
    27 #include <TestclassAssert.h>
       
    28 
       
    29 #include <mpxalbumartutility.h>
       
    30 #include <mpxmedia.h>
       
    31 #include <mpxmediageneraldefs.h>
       
    32 #include <mpxmediamusicdefs.h>
       
    33 #include <gulicon.h>
       
    34 // CONSTANTS
       
    35 //const ?type ?constant_var = ?constant;
       
    36 
       
    37 // MACROS
       
    38 //#define ?macro ?macro_def
       
    39 #define TEST_CLASS_VERSION_MAJOR 0
       
    40 #define TEST_CLASS_VERSION_MINOR 0
       
    41 #define TEST_CLASS_VERSION_BUILD 0
       
    42 
       
    43 // Logging path
       
    44 #ifdef __WINSCW__
       
    45 _LIT( KmpxalbumartutilitytestLogPath, "C:\\logs\\testframework\\mpxalbumartutilitytest\\" ); 
       
    46 // Log file
       
    47 _LIT( KmpxalbumartutilitytestLogFile, "mpxalbumartutilitytest.txt" ); 
       
    48 _LIT( KmpxalbumartutilitytestLogFileWithTitle, "mpxalbumartutilitytest_[%S].txt" );
       
    49 _LIT( Kmpxalbumartutilitytest_testPath, "C:\\testing\\data\\" );
       
    50 _LIT( KTestFileMimeType, "audio/aac" );
       
    51 _LIT( KDestJPG, "C:\\testing\\data\\test.jpg" );
       
    52  
       
    53 #else
       
    54 _LIT( KmpxalbumartutilitytestLogPath, "E:\\logs\\testframework\\mpxalbumartutilitytest\\" ); 
       
    55 // Log file
       
    56 _LIT( KmpxalbumartutilitytestLogFile, "mpxalbumartutilitytest.txt" ); 
       
    57 _LIT( KmpxalbumartutilitytestLogFileWithTitle, "mpxalbumartutilitytest_[%S].txt" );
       
    58 _LIT( Kmpxalbumartutilitytest_testPath, "E:\\testing\\data\\" );
       
    59 _LIT( KTestFileMimeType, "audio/aac" );
       
    60 _LIT( KDestJPG, "E:\\testing\\data\\test.jpg" );
       
    61 #endif
       
    62 
       
    63 // FUNCTION PROTOTYPES
       
    64 //?type ?function_name(?arg_list);
       
    65 
       
    66 // FORWARD DECLARATIONS
       
    67 //class ?FORWARD_CLASSNAME;
       
    68 class Cmpxalbumartutilitytest;
       
    69 class CMPXAlbumArtUtility;
       
    70 class CMPXMedia;
       
    71 
       
    72 /**
       
    73 *  Cmpxalbumartutilitytest test class for STIF Test Framework TestScripter.
       
    74 *  ?other_description_lines
       
    75 *
       
    76 *  @lib ?library
       
    77 *  @since ?Series60_version
       
    78 */
       
    79 NONSHARABLE_CLASS(Cmpxalbumartutilitytest) : public CScriptBase,
       
    80 											 public	MMPXAlbumArtUtilityObserver
       
    81     {
       
    82     public:  // Constructors and destructor
       
    83 
       
    84         /**
       
    85         * Two-phased constructor.
       
    86         */
       
    87         static Cmpxalbumartutilitytest* NewL( CTestModuleIf& aTestModuleIf );
       
    88 
       
    89         /**
       
    90         * Destructor.
       
    91         */
       
    92         virtual ~Cmpxalbumartutilitytest();
       
    93 
       
    94     
       
    95 
       
    96     public: // Functions from base classes
       
    97 
       
    98         /**
       
    99         * From CScriptBase Runs a script line.
       
   100         * @since ?Series60_version
       
   101         * @param aItem Script line containing method name and parameters
       
   102         * @return Symbian OS error code
       
   103         */
       
   104         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   105 
       
   106         /**
       
   107          *  Notify that extraction of album art started.
       
   108          *
       
   109          *  @since S60 3.2.3
       
   110          */
       
   111         virtual void ExtractAlbumArtStarted();
       
   112 
       
   113         /**
       
   114          *  Notify that the extraction of album art has completed.
       
   115          *
       
   116          *  @since S60 3.2.3
       
   117          *  @param aBitmap a converted image.
       
   118          *  @param aErr error code
       
   119          */
       
   120         virtual void ExtractAlbumArtCompleted( CFbsBitmap* aBitmap, TInt aErr ) ;
       
   121 
       
   122    
       
   123 
       
   124     private:
       
   125 
       
   126         /**
       
   127         * C++ default constructor.
       
   128         */
       
   129         Cmpxalbumartutilitytest( CTestModuleIf& aTestModuleIf );
       
   130 
       
   131         /**
       
   132         * By default Symbian 2nd phase constructor is private.
       
   133         */
       
   134         void ConstructL();
       
   135 
       
   136 
       
   137         /**
       
   138         * Frees all resources allocated from test methods.
       
   139         * @since ?Series60_version
       
   140         */
       
   141         void Delete();
       
   142         
       
   143         /* void ExtractAlbumArtStarted();
       
   144          void ExtractAlbumArtCompleted( CFbsBitmap* aBitmap, TInt aErr ) ;
       
   145 */
       
   146         /**
       
   147         * Test methods are listed below. 
       
   148         */
       
   149 
       
   150         /**
       
   151         * Example test method.
       
   152         * @since ?Series60_version
       
   153         * @param aItem Script line containing parameters.
       
   154         * @return Symbian OS error code.
       
   155         */
       
   156         virtual TInt ExampleL( CStifItemParser& aItem );
       
   157         TInt CMPXAlbumArtUtilityNewL( CStifItemParser& aItem );//Pass
       
   158         TInt CMPXAlbumArtUtilityDestructor( CStifItemParser& aItem );//Pass
       
   159         TInt CMPXAlbumArtUtilityExtractAlbumArtL( CStifItemParser& aItem );
       
   160         TInt CMPXAlbumArtUtilityDecode( CStifItemParser& aItem );
       
   161         TInt CMPXAlbumArtUtilityDecodeASourceJPG( CStifItemParser& aItem );
       
   162         TInt CMPXAlbumArtUtilityEncode( CStifItemParser& aItem );
       
   163         TInt CMPXAlbumArtUtilityScale( CStifItemParser& aItem );
       
   164         TInt CMPXAlbumArtUtilityDecodeL( CStifItemParser& aItem );//Pass
       
   165         TInt CMPXAlbumArtUtilityDecodeLASourceJPG( CStifItemParser& aItem );//Pass
       
   166         TInt CMPXAlbumArtUtilityEncodeL( CStifItemParser& aItem );//Pass
       
   167         TInt CMPXAlbumArtUtilityScaleL( CStifItemParser& aItem );
       
   168         TInt CMPXAlbumArtUtilityExtractL( CStifItemParser& aItem );//Pass
       
   169         TInt CMPXAlbumArtUtilityBitmapL( CStifItemParser& aItem );
       
   170         TInt CMPXAlbumArtUtilityBitmapDataL( CStifItemParser& aItem );
       
   171         TInt CMPXAlbumArtUtilityCancelRequest( CStifItemParser& aItem );//Pass
       
   172         /**
       
   173          * Method used to log version of test class
       
   174          */
       
   175         void SendTestClassVersion();
       
   176 
       
   177         
       
   178     private:    // Friend classes
       
   179         //?friend_class_declaration;
       
   180     	CMPXAlbumArtUtility* iAlbumArtUtility;
       
   181     	TBool iAlbumArtConverting;
       
   182     	CFbsBitmap*   iAlbumArt;
       
   183     	CFbsBitmap* iBackgroundBitmap;
       
   184     	TBool         iArtExist;
       
   185     	CGulIcon* iDefaultAAImage;
       
   186     };
       
   187 
       
   188 #endif      // MPXALBUMARTUTILITYTEST_H
       
   189 
       
   190 // End of File