mmappfw_plat/harvester_metadata_extractor_api/tsrc/harvestermetadataextractortest/inc/harvestermetadataextractortest.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: test class header file for STIF Test Framework TestScripter
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef HARVESTERMETADATAEXTRACTORTEST_H
       
    21 #define HARVESTERMETADATAEXTRACTORTEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <StifLogger.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <StifTestModule.h>
       
    27 #include <TestclassAssert.h>
       
    28 #include <mpxmedia.h>
       
    29 #include <APGCLI.H>
       
    30 #include <mpxcollectiontype.h>
       
    31 #include <mpxmetadataextractor.h>
       
    32 #include <MetaDataUtility.h>
       
    33 #include <mpxharvesterutility.h>
       
    34 #include <mpxcollectionobserver.h>
       
    35 #include <mpxharvesterutilityobserver.h>
       
    36 
       
    37 
       
    38 //#include <mpxmetadataextractor.h>
       
    39 // CONSTANTS
       
    40 //const ?type ?constant_var = ?constant;
       
    41 
       
    42 
       
    43 // Logging path
       
    44 #ifdef __WINSCW__
       
    45 _LIT( KharvestermetadataextractortestLogPath, "C:\\logs\\testframework\\harvestermetadataextractortest\\" ); 
       
    46 // Log file
       
    47 _LIT( KharvestermetadataextractortestLogFile, "harvestermetadataextractortest.txt" ); 
       
    48 _LIT( KharvestermetadataextractortestLogFileWithTitle, "harvestermetadataextractortest_[%S].txt" );
       
    49 _LIT( KmpxMetadataExtractor_digitalPath, "C:\\testing\\data\\" ); 
       
    50 _LIT( KTestFile, "C:\\Catwalk.aac");
       
    51 _LIT( KTestFileMimeType, ".aac" );
       
    52 #else
       
    53 // Log file
       
    54 _LIT( KharvestermetadataextractortestLogPath, "\\logs\\testframework\\harvestermetadataextractortest\\" ); 
       
    55 // Log file
       
    56 _LIT( KharvestermetadataextractortestLogFile, "harvestermetadataextractortest.txt" ); 
       
    57 _LIT( KharvestermetadataextractortestLogFileWithTitle, "harvestermetadataextractortest_[%S].txt" );
       
    58 _LIT( KmpxMetadataExtractor_digitalPath, "e:\\testing\\data\\" ); 
       
    59 _LIT( KTestFile, "\\Catwalk.aac");
       
    60 _LIT( KTestFileMimeType, ".aac" );
       
    61 
       
    62 #endif
       
    63 
       
    64 
       
    65 // FUNCTION PROTOTYPES
       
    66 //?type ?function_name(?arg_list);
       
    67 
       
    68 // FORWARD DECLARATIONS
       
    69 //class ?FORWARD_CLASSNAME;
       
    70 class Charvestermetadataextractortest;
       
    71 class MMPXHarvesterUtility;
       
    72 class MMPXCollectionUtility;
       
    73 class CMPXMetadataScanner;
       
    74 // DATA TYPES
       
    75 //enum ?declaration
       
    76 //typedef ?declaration
       
    77 //extern ?data_type;
       
    78 
       
    79 // CLASS DECLARATION
       
    80 
       
    81 /**
       
    82 *  Charvestermetadataextractortest test class for STIF Test Framework TestScripter.
       
    83 *  ?other_description_lines
       
    84 *
       
    85 *  @lib ?library
       
    86 *  @since ?Series60_version
       
    87 */
       
    88 NONSHARABLE_CLASS(Charvestermetadataextractortest) : public CScriptBase,
       
    89 													 public MMPXCollectionObserver,
       
    90 													 public MMPXHarvesterUtilityObserver
       
    91     {
       
    92     private:
       
    93     	enum TExpectedEvents
       
    94     		{
       
    95     		EEventHandlePlaylistExportCompletedL,
       
    96     		EEventHandlePlaylistImportCompletedL,
       
    97     		EEventHandleFileAddCompletedL,
       
    98     		EEventHandleDeleteCompletedL,
       
    99     		EEventHandleFileImportCompletedL,
       
   100     		EEventHandleFileGetMediaCompletedL
       
   101     		};
       
   102     
       
   103     public:  // Constructors and destructor
       
   104 
       
   105         /**
       
   106         * Two-phased constructor.
       
   107         */
       
   108         static Charvestermetadataextractortest* NewL( CTestModuleIf& aTestModuleIf );
       
   109 
       
   110         /**
       
   111         * Destructor.
       
   112         */
       
   113         virtual ~Charvestermetadataextractortest();
       
   114         
       
   115        
       
   116 
       
   117   
       
   118 
       
   119     public: // Functions from base classes
       
   120 
       
   121         /**
       
   122         * From CScriptBase Runs a script line.
       
   123         * @since ?Series60_version
       
   124         * @param aItem Script line containing method name and parameters
       
   125         * @return Symbian OS error code
       
   126         */
       
   127         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   128         /**
       
   129     	* From MMPXHarvesterUtilityObserver.
       
   130     	* @since s60 5.0
       
   131     	*/
       
   132     	virtual void HandlePlaylistExportCompletedL( CMPXMedia* aMedia, TInt aErr );
       
   133     	virtual void HandlePlaylistImportCompletedL( CMPXMedia* aMedia, TInt aErr );
       
   134     	virtual void HandleFileAddCompletedL( CMPXMedia* aMedia, TInt aErr );
       
   135     	virtual void HandleDeleteCompletedL( TInt aErr );
       
   136     	virtual void HandleFileImportCompletedL( CMPXMedia* aMedia, TInt aErr );
       
   137         virtual void HandleFileGetMediaCompletedL( CMPXMedia* aMedia, TInt aErr );
       
   138         
       
   139         /**
       
   140     	* From MMPXCollectionObserver.
       
   141     	* @since s60 5.0
       
   142     	*/
       
   143     	virtual void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
       
   144     	virtual void HandleCollectionMessage( CMPXMessage* aMsg, TInt aError );
       
   145     	virtual void HandleOpenL( const CMPXMedia& aEntries, TInt aIndex, TBool aComplete, TInt aError );
       
   146     	virtual void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError );
       
   147         
       
   148        
       
   149    
       
   150 
       
   151     private:
       
   152 
       
   153         /**
       
   154         * C++ default constructor.
       
   155         */
       
   156         Charvestermetadataextractortest( CTestModuleIf& aTestModuleIf );
       
   157 
       
   158         /**
       
   159         * By default Symbian 2nd phase constructor is private.
       
   160         */
       
   161         void ConstructL();
       
   162 
       
   163         // Prohibit copy constructor if not deriving from CBase.
       
   164         // ?classname( const ?classname& );
       
   165         // Prohibit assigment operator if not deriving from CBase.
       
   166         // ?classname& operator=( const ?classname& );
       
   167 
       
   168         /**
       
   169         * Frees all resources allocated from test methods.
       
   170         * @since ?Series60_version
       
   171         */
       
   172         void Delete();
       
   173         
       
   174         /**
       
   175     	* Remove event from the expected event list
       
   176     	* @since S60 5.0
       
   177     	*/
       
   178     	TBool RemoveExpectedEvent( TExpectedEvents aEvent );
       
   179 
       
   180         /**
       
   181         * Test methods are listed below. 
       
   182         */
       
   183         
       
   184         virtual TInt ExampleL( CStifItemParser& aItem );
       
   185         TInt CMPXMetadataExtractorCreateInstance( CStifItemParser& aItem );
       
   186         TInt CMPXMetadataExtractorCreateMediaL( CStifItemParser& aItem );
       
   187         TInt CMPXMetadataExtractorExtractAlbumArtL( CStifItemParser& aItem );
       
   188             /**
       
   189          * Method used to log version of test class
       
   190          */
       
   191       
       
   192         //ADD NEW METHOD DEC HERE
       
   193         //[TestMethods] - Do not remove
       
   194 
       
   195    
       
   196     private:    // Friend classes
       
   197         //?friend_class_declaration;
       
   198     	CMPXMetadataExtractor* iMetadataExtractor; 
       
   199     	MMPXHarvesterUtility* iHarvester;
       
   200     	MMPXCollectionUtility* iCollection;
       
   201 		RArray<TExpectedEvents> iExpectedEvents;
       
   202 		TInt iResult;
       
   203 		TDataType iMimeType;
       
   204     };
       
   205 
       
   206 #endif      // HARVESTERMETADATAEXTRACTORTEST_H
       
   207 
       
   208 // End of File