|
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 fonts api |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_TESTSDKFONTS_H |
|
21 #define C_TESTSDKFONTS_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <stiflogger.h> |
|
25 #include <testscripterinternal.h> |
|
26 #include <stiftestmodule.h> |
|
27 #include <testclassassert.h> |
|
28 |
|
29 #include <aknfontaccess.h> |
|
30 #include <stringloader.h> |
|
31 #include <gdi.h> |
|
32 #include <coemain.h> |
|
33 |
|
34 #include <aknlayoutfont.h> |
|
35 #include <aknfontspecification.h> |
|
36 #include <akntextdecorationmetrics.h> |
|
37 #include <fbs.h> |
|
38 #include <akntextdecorationmetrics.h> |
|
39 #include <fntstore.h> |
|
40 #include <aknutils.h> |
|
41 |
|
42 |
|
43 |
|
44 // MACROS |
|
45 #define TEST_CLASS_VERSION_MAJOR 0 |
|
46 #define TEST_CLASS_VERSION_MINOR 0 |
|
47 #define TEST_CLASS_VERSION_BUILD 0 |
|
48 |
|
49 // Logging path |
|
50 _LIT( KtestsdkfontsLogPath, "\\logs\\testframework\\testsdkfonts\\" ); |
|
51 // Log file |
|
52 _LIT( KtestsdkfontsLogFile, "testsdkfonts.txt" ); |
|
53 _LIT( KtestsdkfontsLogFileWithTitle, "testsdkfonts_[%S].txt" ); |
|
54 |
|
55 /** |
|
56 * Ctestsdkfonts test class for STIF Test Framework TestScripter. |
|
57 * @since S60 5.0 |
|
58 */ |
|
59 NONSHARABLE_CLASS( CTestSdkFonts ) : public CScriptBase |
|
60 { |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 */ |
|
66 static CTestSdkFonts* NewL( CTestModuleIf& aTestModuleIf ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 virtual ~CTestSdkFonts(); |
|
72 |
|
73 public: // Functions from base classes |
|
74 |
|
75 /** |
|
76 * From CScriptBase Runs a script line. |
|
77 * @since S60 5.0 |
|
78 * @param aItem Script line containing method name and parameters |
|
79 * @return Symbian OS error code |
|
80 */ |
|
81 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
82 |
|
83 private: |
|
84 |
|
85 /** |
|
86 * C++ default constructor. |
|
87 */ |
|
88 CTestSdkFonts( CTestModuleIf& aTestModuleIf ); |
|
89 |
|
90 /** |
|
91 * By default Symbian 2nd phase constructor is private. |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 /** |
|
96 * Method used to log version of test class |
|
97 */ |
|
98 void SendTestClassVersion(); |
|
99 |
|
100 /** |
|
101 * Turn off ScreenSaver |
|
102 * @since S60 5.0 |
|
103 * @return Symbian OS error code. |
|
104 */ |
|
105 void TurnOffScreenSaver(); |
|
106 |
|
107 /** |
|
108 * Restore ScreenSaver |
|
109 * @since S60 5.0 |
|
110 * @return Symbian OS error code. |
|
111 */ |
|
112 void RestoreScreenSaver(); |
|
113 |
|
114 private: // AknFontAccess.h |
|
115 /** |
|
116 * TestFAGetFont test function in class AknFontAccess for testing the GetFontL function |
|
117 * @since S60 5.0 |
|
118 * @param aItem never used |
|
119 * @return Symbian OS error code. |
|
120 */ |
|
121 virtual TInt TestFAGetFont( CStifItemParser& aItem ); |
|
122 |
|
123 /** |
|
124 * TestFAGetFontDesc test function in class AknFontAccess for testing the GetFont function |
|
125 * @since S60 5.0 |
|
126 * @param aItem never used |
|
127 * @return Symbian OS error code. |
|
128 */ |
|
129 virtual TInt TestFAGetFontDesc( CStifItemParser& aItem ); |
|
130 |
|
131 /** |
|
132 * TestFAGetClosestFont test function in class AknFontAccess for testing the GetClosestFontL function |
|
133 * @since S60 5.0 |
|
134 * @param aItem never used |
|
135 * @return Symbian OS error code. |
|
136 */ |
|
137 virtual TInt TestFAGetClosestFont( CStifItemParser& aItem ); |
|
138 |
|
139 /** |
|
140 * TestFAGetClosestFontDesc test function in class AknFontAccess for testing the GetClosestFontL function |
|
141 * @since S60 5.0 |
|
142 * @param aItem never used |
|
143 * @return Symbian OS error code. |
|
144 */ |
|
145 virtual TInt TestFAGetClosestFontDesc( CStifItemParser& aItem ); |
|
146 |
|
147 /** |
|
148 * TestFACreateLayoutFontFromSpecificationL test function in class CreateLayoutFontFromSpecificationL for testing the GetClosestFontL function |
|
149 * @since S60 5.0 |
|
150 * @param aItem never used |
|
151 * @return Symbian OS error code. |
|
152 */ |
|
153 virtual TInt TestFACreateLayoutFontFromSpecificationL( CStifItemParser& aItem ); |
|
154 |
|
155 /** |
|
156 * TestFACreateLayoutFontFromSpecificationTTypefaceL test function in class CreateLayoutFontFromSpecificationL for testing the GetClosestFontL function |
|
157 * @since S60 5.0 |
|
158 * @param aItem never used |
|
159 * @return Symbian OS error code. |
|
160 */ |
|
161 virtual TInt TestFACreateLayoutFontFromSpecificationTTypefaceL( CStifItemParser& aItem ); |
|
162 |
|
163 |
|
164 private: // CAknLayoutFont.h |
|
165 /** |
|
166 * TestLFUpdateL test function in class CAknLayoutFont for testing the UpdateL function |
|
167 * @since S60 5.0 |
|
168 * @param aItem never used |
|
169 * @return Symbian OS error code. |
|
170 */ |
|
171 virtual TInt TestLFUpdateL( CStifItemParser& aItem ); |
|
172 |
|
173 /** |
|
174 * TestLFMaxAscentL test function in class CAknLayoutFont for testing the MaxAscentL function |
|
175 * @since S60 5.0 |
|
176 * @param aItem never used |
|
177 * @return Symbian OS error code. |
|
178 */ |
|
179 virtual TInt TestLFMaxAscentL( CStifItemParser& aItem ); |
|
180 |
|
181 /** |
|
182 * TestLFMaxDescentL test function in class CAknLayoutFont for testing the MaxDescentL function |
|
183 * @since S60 5.0 |
|
184 * @param aItem never used |
|
185 * @return Symbian OS error code. |
|
186 */ |
|
187 virtual TInt TestLFMaxDescentL( CStifItemParser& aItem ); |
|
188 |
|
189 /** |
|
190 * TestLFTextPaneTopToBaselineL test function in class CAknLayoutFont for testing the TextPaneTopToBaselineL function |
|
191 * @since S60 5.0 |
|
192 * @param aItem never used |
|
193 * @return Symbian OS error code. |
|
194 */ |
|
195 virtual TInt TestLFTextPaneTopToBaselineL( CStifItemParser& aItem ); |
|
196 |
|
197 |
|
198 /** |
|
199 * TestLFBaselineToTextPaneBottomL test function in class CAknLayoutFont for testing the BaselineToTextPaneBottomL function |
|
200 * Position of the text pane bottom measured down from the baseline |
|
201 * @return distance from text pane top to baseline |
|
202 */ |
|
203 virtual TInt TestLFBaselineToTextPaneBottomL( CStifItemParser& aItem ); |
|
204 |
|
205 /** |
|
206 * TestLFTextPaneHeightL test function in class CAknLayoutFont for testing the TextPaneHeightL function |
|
207 * Series 60 text pane height. |
|
208 * Always equal to TextPaneTopToBaseline() + BaselineToTextPaneBottom() |
|
209 * @return text pane height |
|
210 */ |
|
211 virtual TInt TestLFTextPaneHeightL( CStifItemParser& aItem ); |
|
212 |
|
213 /** |
|
214 * TestLFAscentForCharacterL test function in class CAknLayoutFont for testing the AscentForCharacterL function |
|
215 * This provides the baseline relative to the top of the combined font for a specific |
|
216 * character code. This value does not include any TopShortfall. |
|
217 **/ |
|
218 virtual TInt TestLFAscentForCharacterL( CStifItemParser& aItem ); |
|
219 |
|
220 /** |
|
221 * TestLFAsCAknLayoutFontOrNullL test function in class CAknLayoutFont for testing the AsCAknLayoutFontOrNullL function |
|
222 * Returns if a font pointer cast to this type if the actual type conforms to this type. |
|
223 * @returns NULL if the font does not conform to CAknLayoutFont. |
|
224 */ |
|
225 virtual TInt TestLFAsCAknLayoutFontOrNullL( CStifItemParser& aItem ); |
|
226 |
|
227 /** |
|
228 * TestLFTextDecorationMetricsL test function in class CAknLayoutFont for testing the TextDecorationMetricsL function |
|
229 * Returns an object describing how the text with this font is to be decorated |
|
230 * @return text decoration metrics for the font |
|
231 */ |
|
232 virtual TInt TestLFTextDecorationMetricsL( CStifItemParser& aItem ); |
|
233 |
|
234 /** |
|
235 * TestLFFontCategoryL test function in class CAknLayoutFont for testing the FontCategoryL function |
|
236 * Returns the Avkon font category (EAknFontCategoryPrimary, EAknFontCategorySecondary...) |
|
237 * that was used to generate this font. |
|
238 * @return font category |
|
239 */ |
|
240 virtual TInt TestLFFontCategoryL( CStifItemParser& aItem ); |
|
241 |
|
242 /** |
|
243 * TestLFFontSpecificationL test function in class CAknLayoutFont for testing the FontSpecificationL function |
|
244 * This API allows the font to provide the metrics under which the font was requested. |
|
245 * @return the font specification for which the font has been supplied |
|
246 */ |
|
247 virtual TInt TestLFFontSpecificationL( CStifItemParser& aItem ); |
|
248 |
|
249 private: // TAknTextDecorationMetrics.h |
|
250 /** |
|
251 * TestTDMTAknTextDecorationMetrics test function in class TAknTextDecorationMetricsL for testing the TAknTextDecorationMetricsSpec function |
|
252 * @since S60 5.0 |
|
253 * @param aItem never used |
|
254 * @return Symbian OS error code. |
|
255 */ |
|
256 virtual TInt TestTDMTAknTextDecorationMetricsL( CStifItemParser& aItem ); |
|
257 |
|
258 /** |
|
259 * TestTDMTAknTextDecorationMetricsFont test function in class TAknTextDecorationMetricsFontL for testing the TAknTextDecorationMetricsSpecL function |
|
260 * @since S60 5.0 |
|
261 * @param aItem never used |
|
262 * @return Symbian OS error code. |
|
263 */ |
|
264 virtual TInt TestTDMTAknTextDecorationMetricsFontL( CStifItemParser& aItem ); |
|
265 |
|
266 /** |
|
267 * TestTDMTAknTextDecorationMetricsSpec test function in class TAknTextDecorationMetricsSpecL for testing the TAknTextDecorationMetricsSpecL function |
|
268 * @since S60 5.0 |
|
269 * @param aItem never used |
|
270 * @return Symbian OS error code. |
|
271 */ |
|
272 virtual TInt TestTDMTAknTextDecorationMetricsSpecL( CStifItemParser& aItem ); |
|
273 |
|
274 /** |
|
275 * TestTDMGetLeftAndRightMargins test function in class TAknTextDecorationMetricsL for testing the GetLeftAndRightMarginsL function |
|
276 * @since S60 5.0 |
|
277 * @param aItem never used |
|
278 * @return Symbian OS error code. |
|
279 */ |
|
280 virtual TInt TestTDMGetLeftAndRightMarginsL( CStifItemParser& aItem ); |
|
281 |
|
282 /** |
|
283 * TestTDMGetTopAndBottomMargins test function in class TAknTextDecorationMetricsL for testing the GetTopAndBottomMarginsL function |
|
284 * @since S60 5.0 |
|
285 * @param aItem never used |
|
286 * @return Symbian OS error code. |
|
287 */ |
|
288 virtual TInt TestTDMGetTopAndBottomMarginsL( CStifItemParser& aItem ); |
|
289 |
|
290 /** |
|
291 * TestTDMCursorWidth test function in class TAknTextDecorationMetricsL for testing the CursorWidthL function |
|
292 * @since S60 5.0 |
|
293 * @param aItem never used |
|
294 * @return Symbian OS error code. |
|
295 */ |
|
296 virtual TInt TestTDMCursorWidthL( CStifItemParser& aItem ); |
|
297 |
|
298 /** |
|
299 * TestTDMBaselineToUnderlineOffset test function in class TAknTextDecorationMetricsL for testing the BaselineToUnderlineOffsetL function |
|
300 * @since S60 5.0 |
|
301 * @param aItem never used |
|
302 * @return Symbian OS error code. |
|
303 */ |
|
304 virtual TInt TestTDMBaselineToUnderlineOffsetL( CStifItemParser& aItem ); |
|
305 |
|
306 /** |
|
307 * TestTDMUnderlineHeight test function in class TAknTextDecorationMetricsL for testing the UnderlineHeightL function |
|
308 * @since S60 5.0 |
|
309 * @param aItem never used |
|
310 * @return Symbian OS error code. |
|
311 */ |
|
312 virtual TInt TestTDMUnderlineHeightL( CStifItemParser& aItem ); |
|
313 |
|
314 |
|
315 private: // Data |
|
316 |
|
317 /** |
|
318 * ScreenSaver Property |
|
319 */ |
|
320 TInt iOldScreenSaverProperty; |
|
321 /** |
|
322 * Pointer to a control, maybe you need one in your test |
|
323 * own |
|
324 */ |
|
325 AknFontAccess* iFontAccess; |
|
326 |
|
327 }; |
|
328 |
|
329 |
|
330 |
|
331 #endif // C_TESTSDKFONTS_H |
|
332 |
|
333 // End of File |