sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __TESTFRAMEWORKRECOG_H__ sl@0: #define __TESTFRAMEWORKRECOG_H__ sl@0: sl@0: #include sl@0: sl@0: _LIT(KRecogSemaphoreName, "TFR_SEM"); // Semaphore of the current test thread sl@0: _LIT(KRecogParentSemaphoreName, "TFR_PARENT_SEM"); // Semaphore of the main recognizer thread sl@0: const TInt KUidTestFrameworkRecognizerValue = 0x101F7C0E; sl@0: const TUid KUidTestFrameworkRecognizer = { KUidTestFrameworkRecognizerValue }; sl@0: sl@0: class TTestScriptInfo sl@0: { sl@0: public: sl@0: TInt iThreadStartupDelay; sl@0: TFileName iScriptPath; sl@0: TBuf<32> iParams; sl@0: }; sl@0: typedef CArrayFixFlat CTestScriptArray; sl@0: sl@0: // CTestFrameworkRecogActive sl@0: class CTestFrameworkRecogActive : public CActive sl@0: { sl@0: public: sl@0: CTestFrameworkRecogActive(CTestScriptArray* aTestScriptArray); sl@0: ~CTestFrameworkRecogActive(); sl@0: public: sl@0: TInt CreateNextTestThread(); sl@0: protected: sl@0: static TInt ThreadFunc(TAny* aPtr); sl@0: void DoThreadFuncL(); sl@0: static TInt StartTestThreadFn(TAny* aPtr); sl@0: void DoStartTestThreadL(); sl@0: // from CActive sl@0: protected: sl@0: void RunL(); sl@0: void DoCancel(); sl@0: protected: sl@0: CTestScriptArray* iTestScriptArray; sl@0: TInt iCurrentScript; sl@0: }; sl@0: sl@0: // CTestFrameworkRecognizer sl@0: class CTestFrameworkRecognizer : public CApaDataRecognizerType sl@0: { sl@0: public: sl@0: CTestFrameworkRecognizer(); sl@0: ~CTestFrameworkRecognizer(); sl@0: // New functions sl@0: public: sl@0: void DoCreateL(); sl@0: protected: sl@0: void LoadConfigFileL(const TDesC& aFileName); sl@0: void ProcessLineL(const TDesC8& aLine); sl@0: // from CApaDataRecognizerType sl@0: protected: sl@0: TUint PreferredBufSize(); sl@0: TDataType SupportedDataTypeL(TInt aIndex) const; sl@0: void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer); sl@0: protected: sl@0: CTestScriptArray* iTestScriptArray; sl@0: CTestFrameworkRecogActive* iTestActive; sl@0: TBool iRunScript; sl@0: }; sl@0: sl@0: #endif // __TESTFRAMEWORKRECOG_H__