mmappfw_plat/playlist_engine_api/tsrc/playlistenginetest/inc/playlistenginetest.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: playlistenginetest header for STIF Test Framework TestScripter.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PLAYLISTENGINETEST_H
       
    21 #define PLAYLISTENGINETEST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <StifLogger.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <StifTestModule.h>
       
    27 #include <TestclassAssert.h>
       
    28 
       
    29 #include "mpxplaylistengine.h"
       
    30 #include "mpxmediaarray.h"
       
    31 #include "mpxmedia.h"
       
    32 #include "mpxmediageneraldefs.h"
       
    33 #include "mpxmediacontainerdefs.h"
       
    34 
       
    35 #include "mpxplaylistpluginhandler.h"
       
    36 #include "charconv.h"
       
    37 
       
    38 #include "mpxplaylistplugin.h"
       
    39 #include <ecom/ecom.h>
       
    40 // CONSTANTS
       
    41 //const ?type ?constant_var = ?constant;
       
    42 // MACROS
       
    43 //#define ?macro ?macro_def
       
    44 #define TEST_CLASS_VERSION_MAJOR 0
       
    45 #define TEST_CLASS_VERSION_MINOR 0
       
    46 #define TEST_CLASS_VERSION_BUILD 0
       
    47 
       
    48 
       
    49 
       
    50 #ifdef __WINSCW__
       
    51 _LIT( KplaylistenginetestLogPath, "\\logs\\testframework\\playlistenginetest\\" ); 
       
    52 _LIT( Kplaylistenginetest_testPath, "c:\\testing\\data\\" );
       
    53 _LIT( KlistExportPath,"c:\\testing\\listExport\\");
       
    54 _LIT( KTestItemPath2, "c:\\testing\\data\\mpxtestplaylist.m3u");
       
    55 #else
       
    56 _LIT( KplaylistenginetestLogPath, "e:\\testing\\log\\" );
       
    57 _LIT( Kplaylistenginetest_testPath, "e:\\testing\\data\\" );
       
    58 _LIT( KlistExportPath,"e:\\testing\\listExport\\");
       
    59 _LIT( KTestItemPath2, "e:\\testing\\data\\mpxtestplaylist.m3u");
       
    60 #endif
       
    61 // Log file
       
    62 _LIT( KplaylistenginetestLogFile, "playlistenginetest.txt" ); 
       
    63 _LIT( KplaylistenginetestLogFileWithTitle, "playlistenginetest_[%S].txt" );
       
    64 
       
    65 
       
    66 class Cplaylistenginetest;
       
    67 class CMPXPlaylistEngine ;
       
    68 class CMPXMediaArray;
       
    69 class CMPXMedia;
       
    70 class MMPXPlaylistPluginObserver;
       
    71 class MMPXPluginHandlerObserver;
       
    72 class MMPXPlaylistEngineObserver;
       
    73 class CMPXPlaylistPlugin;
       
    74 
       
    75 // CLASS DECLARATION
       
    76 
       
    77 /**
       
    78 *  Cplaylistenginetest test class for STIF Test Framework TestScripter.
       
    79 *  ?other_description_lines
       
    80 *
       
    81 *  @lib ?library
       
    82 *  @since ?Series60_version
       
    83 */
       
    84 NONSHARABLE_CLASS(Cplaylistenginetest) : public CScriptBase,
       
    85 										 public MMPXPlaylistPluginObserver,
       
    86 										 public MMPXPluginHandlerObserver
       
    87 										 
       
    88     {
       
    89     public:  // Constructors and destructor
       
    90     	enum TMediaProperties
       
    91     	        {
       
    92     	        ETitle = 0x01,
       
    93     	        EUri = 0x02,
       
    94     	        EDuration = 0x04,
       
    95     	        EType = 0x08,
       
    96     	        ECategory = 0x10,
       
    97     	        EArrayContents = 0x20,
       
    98     	        EArrayCount = 0x40,
       
    99     	        EOthers = 0x80,
       
   100     	        EAll = 0xffffffff
       
   101     	        };
       
   102         /**
       
   103         * Two-phased constructor.
       
   104         */
       
   105         static Cplaylistenginetest* NewL( CTestModuleIf& aTestModuleIf );
       
   106 
       
   107         /**
       
   108         * Destructor.
       
   109         */
       
   110         virtual ~Cplaylistenginetest();
       
   111 
       
   112     public: // New functions
       
   113 
       
   114     	 void HandlePlaylistL(CMPXMedia* aPlaylist,
       
   115     	                                     const TInt aError,
       
   116     	                                     const TBool aCompleted) ;
       
   117     	
       
   118     	 void HandlePlaylistL(const TDesC& aPlaylistUri,
       
   119     	                                     const TInt aError) ;   
       
   120     	
       
   121     	 void HandlePluginHandlerEvent(TPluginHandlerEvents aEvent, const TUid& aPluginUid,
       
   122     	        TBool aLoaded, TInt aData) ;
       
   123     	 
       
   124     	 // Create a playlist that contains the specified attributes
       
   125 	     CMPXMedia* CreatePlaylistL(const TUint& aAttributes);
       
   126 
       
   127     public: // Functions from base classes
       
   128 
       
   129         /**
       
   130         * From CScriptBase Runs a script line.
       
   131         * @since ?Series60_version
       
   132         * @param aItem Script line containing method name and parameters
       
   133         * @return Symbian OS error code
       
   134         */
       
   135         virtual TInt RunMethodL( CStifItemParser& aItem );  
       
   136         
       
   137         //test functions for mpxplaylistengine.h
       
   138         TInt CMPXPlaylistEngineCreate( CStifItemParser& aItem );
       
   139         TInt CMPXPlaylistEngineDestructor( CStifItemParser& aItem );
       
   140         TInt CMPXPlaylistEnginePlaylistPluginHandler( CStifItemParser& aItem );
       
   141         TInt CMPXPlaylistEngineIsPlaylistL( CStifItemParser& aItem );
       
   142         TInt CMPXPlaylistEngineInternalizePlaylistL( CStifItemParser& aItem );
       
   143         TInt CMPXPlaylistEngineInternalizePlaylistLRFile( CStifItemParser& aItem );
       
   144         TInt CMPXPlaylistEngineExternalizePlaylistL( CStifItemParser& aItem );         
       
   145         TInt CMPXPlaylistEngineCancelRequests( CStifItemParser& aItem );
       
   146         
       
   147         //test functions for mpxplaylistpluginhandler.h
       
   148         TInt CMPXPlaylistPluginHandlerCreate( CStifItemParser& aItem );
       
   149         TInt CMPXPlaylistPluginHandlerDestructor( CStifItemParser& aItem );
       
   150       
       
   151         TInt SelectPlaylistPluginLByUri( CStifItemParser& aItem );
       
   152         TInt SelectPlaylistPluginLByFile( CStifItemParser& aItem );
       
   153         TInt SelectPlaylistPluginLByType( CStifItemParser& aItem );
       
   154         TInt SelectPlaylistPluginLByName( CStifItemParser& aItem );
       
   155         TInt SelectPlaylistPluginLByUid( CStifItemParser& aItem );
       
   156 
       
   157         
       
   158         
       
   159        
       
   160 
       
   161         
       
   162     private:
       
   163 
       
   164         /**
       
   165         * C++ default constructor.
       
   166         */
       
   167         Cplaylistenginetest( CTestModuleIf& aTestModuleIf );
       
   168 
       
   169         /**
       
   170         * By default Symbian 2nd phase constructor is private.
       
   171         */
       
   172         void ConstructL();
       
   173 
       
   174         // Prohibit copy constructor if not deriving from CBase.
       
   175         // ?classname( const ?classname& );
       
   176         // Prohibit assigment operator if not deriving from CBase.
       
   177         // ?classname& operator=( const ?classname& );
       
   178 
       
   179         /**
       
   180         * Frees all resources allocated from test methods.
       
   181         * @since ?Series60_version
       
   182         */
       
   183         void Delete();
       
   184 
       
   185         /**
       
   186         * Test methods are listed below. 
       
   187         */
       
   188 
       
   189         /**
       
   190         * Example test method.
       
   191         * @since ?Series60_version
       
   192         * @param aItem Script line containing parameters.
       
   193         * @return Symbian OS error code.
       
   194         */
       
   195         virtual TInt ExampleL( CStifItemParser& aItem );
       
   196         
       
   197         /**
       
   198          * Method used to log version of test class
       
   199          */
       
   200         void SendTestClassVersion();
       
   201 
       
   202         //ADD NEW METHOD DEC HERE
       
   203         //[TestMethods] - Do not remove
       
   204 
       
   205   
       
   206     private:    // Friend classes
       
   207         //?friend_class_declaration;
       
   208     	CMPXPlaylistEngine* iPlaylistEngine;
       
   209     	CMPXPlaylistPluginHandler* iPlaylistPluginHandler;
       
   210     	CMPXPlaylistPlugin* iMPXPlaylistPlugin;
       
   211     };
       
   212 
       
   213 #endif      // PLAYLISTENGINETEST_H
       
   214 
       
   215 // End of File