musicplayer_plat/mpx_music_player_app_api/tsrc/ui_mpxmusicplayertest/inc/ui_mpxmusicplayertest.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     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:  Cmpxmusicplayertest test class for STIF Test Framework TestScripter.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef UI_MPXMUSICPLAYERTEST_H
       
    20 #define UI_MPXMUSICPLAYERTEST_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <StifLogger.h>
       
    24 #include <TestScripterInternal.h>
       
    25 #include <StifTestModule.h>
       
    26 
       
    27 #include <mpxtlshelper.h>
       
    28 #include "mpxcommonuihelper.h"
       
    29 #include <mpxcollectionutility.h>
       
    30 #include "edwintestcontrol.h"
       
    31 #include <mpxcollectionuihelperobserver.h>
       
    32 
       
    33 #include <AknProgressDialog.h>
       
    34 #include <EIKCMOBS.H>
       
    35 // CONSTANTS
       
    36 const TInt KErrBadTestParameter = -1000;         // Error on configuration file
       
    37 const TUid KHostUid = { 0x101FB3E3 };
       
    38 const TInt KMusicPlayerMSKControlID = 3;
       
    39 // MACROS
       
    40 // Logging path
       
    41 #ifdef __WINSCW__
       
    42 _LIT( KmpxmusicplayertestLogPath, "\\testing\\log\\" );
       
    43 _LIT( KRingToneFileName, "c:\\testing\\data\\mpxtest1.mp3" );
       
    44 _LIT( KRingToneFilePath, "c:\\testing\\data\\" );
       
    45 #else
       
    46 _LIT( KmpxmusicplayertestLogPath, "e:\\testing\\log\\" );
       
    47 _LIT( KRingToneFileName, "e:\\testing\\data\\mpxtest1.mp3" );
       
    48 _LIT( KRingToneFilePath, "e:\\testing\\data\\" );
       
    49 #endif
       
    50 // Log file
       
    51 _LIT( KmpxmusicplayertestLogFile, "mpxmusicplayertest.txt" );
       
    52 
       
    53 _LIT( KTagKErrNone, "KErrNone" );
       
    54 _LIT( KTagKErrNotReady, "KErrNotReady" );
       
    55 _LIT( KMPXIliegalCharacters, "IliegalCharacters" );
       
    56 _LIT( KMPXFileNotFound, "FileNotFound" );
       
    57 _LIT( KMPXSaveToCollectionNote, "Saved_to_collection_successfully!" );
       
    58 _LIT( KMPXSaveNote, "Saved_successfully!" );
       
    59 
       
    60 // FORWARD DECLARATIONS
       
    61 class MPXTlsHelper;
       
    62 class CMPXCommonUiHelper;
       
    63 class MMPXCollectionUtility;
       
    64 class CEdwinTestControl;
       
    65 
       
    66 // CLASS DECLARATION
       
    67 
       
    68 /**
       
    69 *  Cmpxmusicplayertest test class for STIF Test Framework TestScripter.
       
    70 *
       
    71 *  @lib mpxmusicplayertest.lib
       
    72 *  @since S60 v3.2.3
       
    73 */
       
    74 NONSHARABLE_CLASS(Cmpxmusicplayertest) : public CScriptBase,
       
    75 										 public MProgressDialogCallback,
       
    76 										 public MEikCommandObserver,
       
    77 										 public MMPXCHelperObserver
       
    78     {
       
    79 	public:  // Constructors and destructor
       
    80 	
       
    81 		/**
       
    82 		* Two-phased constructor.
       
    83 		*/
       
    84 		static Cmpxmusicplayertest* NewL( CTestModuleIf& aTestModuleIf );
       
    85 	
       
    86 		/**
       
    87 		* Destructor.
       
    88 		*/
       
    89 		virtual ~Cmpxmusicplayertest();
       
    90 	
       
    91 	public: // Functions from base classes
       
    92 	
       
    93 		/**
       
    94 		* From CScriptBase Runs a script line.
       
    95 		* @since S60 v3.2.3
       
    96 		* @param aItem Script line containing method name and parameters
       
    97 		* @return Symbian OS error code
       
    98 		*/
       
    99 		virtual TInt RunMethodL( CStifItemParser& aItem );
       
   100 		
       
   101 		// function from MProgressDialogCallback
       
   102 		virtual void DialogDismissedL( TInt aButtonId );
       
   103 		//function from MEikCommandObserver
       
   104 		virtual void ProcessCommandL(TInt aCommandId);
       
   105 		//function from MMPXCHelperObserver
       
   106 		virtual void HandleOperationCompleteL( TCHelperOperation aOperation,
       
   107 		                                           TInt aErr,
       
   108 		                                           void* aArgument );
       
   109 	private:
       
   110 	
       
   111 		/**
       
   112 		* C++ default constructor.
       
   113 		*/
       
   114 		Cmpxmusicplayertest( CTestModuleIf& aTestModuleIf );
       
   115 	
       
   116 		/**
       
   117 		* By default Symbian 2nd phase constructor is private.
       
   118 		*/
       
   119 		void ConstructL();
       
   120 	
       
   121 		/**
       
   122 		* Frees all resources allocated from test methods.
       
   123 		* @since S60 v3.2.3
       
   124 		*/
       
   125 		void Delete();
       
   126 	
       
   127 		/**
       
   128 		* Test methods are listed below.
       
   129 		* @since S60 v3.2.3
       
   130 		* @param aItem Script line containing parameters.
       
   131 		* @return Symbian OS error code.
       
   132 		*/
       
   133 		TInt Initialize( CStifItemParser& aItem );
       
   134 		TInt VerifyHostUid( CStifItemParser& aItem );
       
   135 		TInt VerifyNeedSave( CStifItemParser& aItem );
       
   136 		TInt VerifyAllowMove( CStifItemParser& aItem );
       
   137 		TInt VerifyLaunchMode( CStifItemParser& aItem );
       
   138 		TInt VerifyFilePath( CStifItemParser& aItem );
       
   139 		TInt Uninitialize( CStifItemParser& aItem );                      			  //debug pass  10,28
       
   140 		
       
   141 		//test functions for mpxcommonuihelper.h
       
   142 		//to test IMPORT_C static CMPXCommonUiHelper* NewL(MMPXCollectionUtility* aCollectionUtility = NULL);
       
   143 		TInt CMPXCommonUiHelperNewL( CStifItemParser& aItem );                        //debug pass  10,28
       
   144 		//to test virtual ~CMPXCommonUiHelper();
       
   145 		TInt CMPXCommonUiHelperDestruct( CStifItemParser& aItem );                    //debug pass  10,28
       
   146 		//to test IMPORT_C TBool IsHostMessagingBrowserL();
       
   147 		TInt UiHelperIsHostMessagingBrowserL( CStifItemParser& aItem );               //debug pass  10,28
       
   148 		//to test IMPORT_C TBool IsHostPodcastingAppL();
       
   149 		TInt UiHelperIsHostPodcastingAppL( CStifItemParser& aItem ); 				  //debug pass  10,28
       
   150 		//to test IMPORT_C TBool IsHostMessagingL();
       
   151 		TInt UiHelperIsHostMessagingL( CStifItemParser& aItem );    				  //debug pass  10,28
       
   152 		//to test IMPORT_C TBool IsHostBrowserL();
       
   153 		TInt UiHelperIsHostBrowserL( CStifItemParser& aItem ); 						  //debug pass  10,28
       
   154 		//to test IMPORT_C HBufC* DisplayableDurationL(
       
   155 	    //											TInt64 aDuration,
       
   156 	    //											TMPXDuratDisplayMode aMode = EMPXDuratAuto );
       
   157 		TInt UiHelperDisplayableDurationL( CStifItemParser& aItem );  				  //debug pass  10,29
       
   158 		//to test IMPORT_C HBufC* DisplayableDurationInTextL(TInt64 aDuration );
       
   159 		TInt UiHelperDisplayableDurationInTextL( CStifItemParser& aItem ); 			  //debug pass  10,29 
       
   160 	    //to test IMPORT_C void DoSetAsRingingToneL(
       
   161 	    //											const CMPXMedia& aMedia,
       
   162 	    //											TBool aSetToAllProfiles,
       
   163 	    //											TBool aShowQuery = EFalse );
       
   164 		TInt UiHelperDoSetAsRingingToneL( CStifItemParser& aItem );  			 	  //debug pass  10,29	
       
   165 		//to test IMPORT_C TBool IsProfileOfflineModeL();
       
   166 		TInt UiHelperIsProfileOfflineModeL( CStifItemParser& aItem );			 	  //debug pass  10,29	
       
   167 		//to test IMPORT_C HBufC* DefaultDriveLC();
       
   168 		TInt UiHelperDefaultDriveLC( CStifItemParser& aItem );			 	 		  //debug 10,29 crash-->pass 10,31
       
   169 		//to test IMPORT_C HBufC* AvailableDriveLC( TInt aSize );
       
   170 		TInt UiHelperAvailableDriveLC( CStifItemParser& aItem );		 	 		  //debug 10,29	crash-->pass 10,31
       
   171 		//to test IMPORT_C void DisplayInfoNoteL( TInt aResourceId );
       
   172 		TInt UiHelperDisplayInfoNoteLRSCID( CStifItemParser& aItem );  			 	  //debug pass  10,29			
       
   173 		//to test IMPORT_C void DisplayInfoNoteL( const TDesC& aText );
       
   174 		TInt UiHelperDisplayInfoNoteLText( CStifItemParser& aItem ); 			 	  //debug pass  10,29	 		
       
   175 		//to test IMPORT_C void DisplayConfirmNoteL( TInt aResourceId );
       
   176 		TInt UiHelperDisplayConfirmNoteLRSCID( CStifItemParser& aItem );		 	  //debug pass  10,29	 	
       
   177 		//to test IMPORT_C void DisplayConfirmNoteL( const TDesC& aText );
       
   178 		TInt UiHelperDisplayConfirmNoteLText( CStifItemParser& aItem );			 	  //debug pass  10,29	
       
   179 		//to test IMPORT_C HBufC* UnitConversionL( TInt64 aByte, TBool aFree = EFalse );
       
   180 		TInt UiHelperUnitConversionL( CStifItemParser& aItem );				 		  //debug pass  10,29	
       
   181 		//to test IMPORT_C CMPXMedia* FindPlaylistsL();
       
   182 		TInt UiHelperFindPlaylistsL( CStifItemParser& aItem );				 		  //debug pass  10,29		
       
   183 		//to test IMPORT_C TBool AddToSavedPlaylistL(
       
   184 	    //						const CMPXMedia& aPlaylists, const CMPXMedia& aTracks,
       
   185 	    //						MMPXCHelperObserver* aObserver,
       
   186 	    //						MProgressDialogCallback* aCallback );
       
   187 		TInt UiHelperAddToSavedPlaylistL( CStifItemParser& aItem );		 			  //debug pass  10,30	
       
   188 		//to test IMPORT_C TBool CreatePlaylistL( const CMPXMedia& aTracks,
       
   189 	    //										 MMPXCHelperObserver* aObserver,
       
   190 	    //										 MProgressDialogCallback* aCallback );
       
   191 		TInt UiHelperCreatePlaylistL( CStifItemParser& aItem );		 			  	  //debug pass  10,30	
       
   192 		//to test IMPORT_C TInt LaunchRenameDialogL(
       
   193 	    //											const TDesC& aOldName,
       
   194 		//											TDes& aNewName,
       
   195 		//											const TDesC& aPath );
       
   196 		TInt UiHelperLaunchRenameDialogL( CStifItemParser& aItem );		 			  //debug pass  10,30	
       
   197 		//to test IMPORT_C void ShowWaitNoteL( TDesC& aText, TInt aCBAId,
       
   198 	    //									   TBool aVisibilityDelayOff,
       
   199 		//									   MProgressDialogCallback* aCallback,
       
   200 		//									   TInt aResId = R_MPX_GENERIC_WAIT_NOTE );
       
   201 		TInt UiHelperShowWaitNoteL( CStifItemParser& aItem );						  //debug 10,30	crash-->pass 5,11,2008
       
   202 		//to test IMPORT_C void DismissWaitNoteL();
       
   203 		TInt UiHelperDismissWaitNoteL( CStifItemParser& aItem );				  //debug 10,30	crash-->pass 5,11,2008
       
   204 		//to test IMPORT_C TInt HandleErrorL( TInt aError,
       
   205 	    //									  const CMPXMedia* aMedia=NULL,
       
   206 	    //									  RFile* aFile=NULL );
       
   207 		TInt UiHelperHandleErrorL( CStifItemParser& aItem );		 			 	  //debug pass  10,30
       
   208 		//to test IMPORT_C void SetMiddleSoftKeyLabelL(
       
   209 	    //										CEikButtonGroupContainer& aCba,
       
   210 	    //										TInt aResourceId,
       
   211 	    //										TInt aCommandId );
       
   212 		TInt UiHelperSetMiddleSoftKeyLabelL( CStifItemParser& aItem );			  	  //debug 10,30	crash-->pass 6,11,2008
       
   213 		// to test IMPORT_C void RemoveMiddleSoftKeyLabel(CEikButtonGroupContainer& aCba );
       
   214 		TInt UiHelperRemoveMiddleSoftKeyLabel( CStifItemParser& aItem );		  	  //debug 10,30	crash-->pass 6,11,2008
       
   215 	    //to test IMPORT_C void SetMiddleSoftKeyIconL(
       
   216 	    //											  CEikButtonGroupContainer& aCba,
       
   217 	    //											  CFbsBitmap* aBitmap,
       
   218 	    //											  CFbsBitmap* aMask );
       
   219 	    TInt UiHelperSetMiddleSoftKeyIconL( CStifItemParser& aItem );                 // debug 10,30 crash-->pass 6,11,2008 
       
   220 	    //to test IMPORT_C HBufC* GenerateTitleL(
       
   221 	    //											TMPXGeneralCategory aCategory,
       
   222 	    //											const TDesC& aBaseTitle );
       
   223 		TInt UiHelperGenerateTitleL( CStifItemParser& aItem );  		 			  //debug pass  10,30  
       
   224 		//to test IMPORT_C TBool ExitOptionHiddenL();
       
   225 		TInt UiHelperExitOptionHiddenL( CStifItemParser& aItem );		 			  //debug pass  10,30   
       
   226 		//to test IMPORT_C static TBool SetStandAloneModePId( TInt64 aPId );
       
   227 		TInt UiHelperSetStandAloneModePId( CStifItemParser& aItem );		 		  //debug pass  10,30 	
       
   228 		//to test IMPORT_C static TInt64 StandAloneModePId();
       
   229 		TInt UiHelperStandAloneModePId( CStifItemParser& aItem );		 		  	  //debug pass  10,30 
       
   230 		//to test IMPORT_C TBool IsForegroundApplication(TInt aWindowGroupId);
       
   231 		TInt UiHelperIsForegroundApplication( CStifItemParser& aItem );	 		  	  //debug pass  10,30 
       
   232 		//to test IMPORT_C static TInt MMCDriveNumber();
       
   233 		TInt UiHelperMMCDriveNumber( CStifItemParser& aItem );	 		 		  	  //debug pass  10,30 
       
   234 		//to test IMPORT_C void CancelCollectionOperation();
       
   235 		TInt UiHelperCancelCollectionOperation( CStifItemParser& aItem );		  	  //debug       10,30 	through
       
   236 		
       
   237 		
       
   238 		
       
   239 	private:    // Data
       
   240 		// TLS Helper only contains static functions; no instance is necessary.
       
   241 		CMPXCommonUiHelper* iUiHelper;
       
   242 		CEdwinTestControl* iEdwinTestControl ;
       
   243 		MMPXCollectionUtility* iUtilityForUiHelper;
       
   244     };
       
   245 
       
   246 #endif      // MPXMUSICPLAYERTEST_H