|
1 /* |
|
2 * Copyright (c) 2006-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SPEECHSYNTHESISTEST_H |
|
20 #define SPEECHSYNTHESISTEST_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <stiflogger.h> |
|
24 #include <testscripterinternal.h> |
|
25 #include <stiftestmodule.h> |
|
26 |
|
27 #include "speechsynthesistester.h" |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // Logging path |
|
32 _LIT( KSpeechSynthesisTestLogPath, "\\logs\\testframework\\SpeechSynthesisTest\\" ); |
|
33 // Log file |
|
34 _LIT( KSpeechSynthesisTestLogFile, "SpeechSynthesisTest.txt" ); |
|
35 |
|
36 |
|
37 |
|
38 /** |
|
39 * CSpeechSynthesisTest test class for STIF Test Framework TestScripter. |
|
40 */ |
|
41 NONSHARABLE_CLASS( CSpeechSynthesisTest ) : public CScriptBase, |
|
42 public MTesterObserver |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CSpeechSynthesisTest* NewL( CTestModuleIf& aTestModuleIf ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CSpeechSynthesisTest(); |
|
55 |
|
56 public: // Functions from base classes |
|
57 |
|
58 /** |
|
59 * From CScriptBase Runs a script line. |
|
60 * @param aItem Script line containing method name and parameters |
|
61 * @return Symbian OS error code |
|
62 */ |
|
63 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
64 |
|
65 protected: |
|
66 |
|
67 // Callbacks from iTester |
|
68 void SynthesisInitComplete( TInt aError ); |
|
69 void SynthesisComplete( TInt aError ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 CSpeechSynthesisTest( CTestModuleIf& aTestModuleIf ); |
|
77 |
|
78 /** |
|
79 * By default Symbian 2nd phase constructor is private. |
|
80 */ |
|
81 void ConstructL(); |
|
82 |
|
83 /** |
|
84 * Frees all resources allocated from test methods. |
|
85 */ |
|
86 void Delete(); |
|
87 |
|
88 /** |
|
89 * Test methods |
|
90 * @param aItem Script line containing parameters. |
|
91 * @return Symbian OS error code. |
|
92 */ |
|
93 virtual TInt OpenL( CStifItemParser& aItem ); |
|
94 virtual TInt CloseL( CStifItemParser& aItem ); |
|
95 |
|
96 virtual TInt SynthesisInitL( CStifItemParser& aItem ); |
|
97 virtual TInt SynthesisInitFileL( CStifItemParser& aItem ); |
|
98 virtual TInt SynthesiseL( CStifItemParser& aItem ); |
|
99 virtual TInt StopL( CStifItemParser& aItem ); |
|
100 virtual TInt PauseL( CStifItemParser& aItem ); |
|
101 |
|
102 virtual TInt GetSupportedLanguagesL( CStifItemParser& aItem ); |
|
103 |
|
104 virtual TInt GetSupportedVoicesL( CStifItemParser& aItem ); |
|
105 virtual TInt VoiceL( CStifItemParser& aItem ); |
|
106 virtual TInt SetVoiceL( CStifItemParser& aItem ); |
|
107 |
|
108 virtual TInt MaxVolumeL( CStifItemParser& aItem ); |
|
109 virtual TInt VolumeL( CStifItemParser& aItem ); |
|
110 virtual TInt SetVolumeL( CStifItemParser& aItem ); |
|
111 |
|
112 virtual TInt MaxSpeakingRateL( CStifItemParser& aItem ); |
|
113 virtual TInt SpeakingRateL( CStifItemParser& aItem ); |
|
114 virtual TInt SetSpeakingRateL( CStifItemParser& aItem ); |
|
115 |
|
116 virtual TInt SetAudioPriorityL( CStifItemParser& aItem ); |
|
117 virtual TInt CustomCommandL( CStifItemParser& aItem ); |
|
118 |
|
119 TInt ReadExpectedResultL( CStifItemParser& aItem ); |
|
120 void CheckResultL( TInt aExpectedResult, TInt aResult ); |
|
121 |
|
122 private: |
|
123 |
|
124 CSpeechSynthesisTester* iTester; |
|
125 |
|
126 TBuf<2048> iText; |
|
127 |
|
128 TInt iExpectedResult; |
|
129 }; |
|
130 |
|
131 #endif // SPEECHSYNTHESISTEST_H |
|
132 |
|
133 // End of File |