First public contribution.
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __TGLYPHSEL_H_
17 #define __TGLYPHSEL_H_
20 #include "TGraphicsContext.h"
21 #include "TGraphicsHarness.h"
33 void TStopWatch::Start()
35 iTime.UniversalTime();
38 TUint TStopWatch::Stop()
42 TInt64 i = ((t.MicroSecondsFrom(iTime).Int64()) + 500)/1000;
46 // Forward declaration
47 struct TTestInput_PositionParam6;
48 class CTGlyphSelection : public CTGraphicsBase
50 This is a unit test class. Its responsibilites are to define and
51 execute test cases that exercise CFont::GetCharacterPosition()
59 // House keeping methods for test setup and shutdown.
60 CTGlyphSelection(CTestStep* aStep);
64 virtual void RunTestCaseL(TInt aCurTestCase);
65 virtual void ConstructL();
67 void CreateTestGraphicsContextL();
68 void TestPerformance();
70 // Test case methods testing specific functionality.
71 void TestCtrlCharsIgnored();
72 void TestApiBoundaries();
73 void TestLatinChars();
74 void TestGlyphs(CFont* aFont, CFont::TPositionParam& aParam,
75 const TPtrC16& aText, const TPtrC16& aExpectedGlyphs);
77 //TestIndicChars() is main function to perform testing for all Indic languages and calls all the indic language functions.
79 void TestIndicCharsL();
80 void TestHindiChars(CFbsFont* aFont);
81 void TestKannadaChars(CFbsFont* aFont);
82 void TestMarathiChars(CFbsFont* aFont);
83 void TestGujaratiChars(CFbsFont* aFont);
84 void TestBengaliChars(CFbsFont* aFont);
85 void TestTamilChars(CFbsFont* aFont);
86 void TestTeluguChars(CFbsFont* aFont);
87 void TestIndicPunctuation(CFbsFont* aFont);
88 void TestIndicPunctuationGlyphs(CFbsFont* aFont, CFont::TPositionParam& aParam,
89 const TPtrC16& aText, const TPtrC16& aExpectedGlyphs);
91 //Gurumukhi and Malayalam support
92 void ExecuteIndicGurmukhiMalayalamTests();
93 void DoEachGurmukhiMalayalamCase( const TTestInput_PositionParam6* aArray, const CFbsFont& aFont );
94 void TestGurmukhiDigit( const CFbsFont& aFont );
95 void TestGurmukhiAndLatin( const CFbsFont& aFont );
96 void TestGurmukhiModifierAfterConsonantViramaZWJ( const CFbsFont& aFont );
97 void TestGurmukhiWithConsonantInitial( const CFbsFont& aFont );
98 void TestGurmukhiWithVowelInitial( const CFbsFont& aFont );
99 void TestMalayalamDigit( const CFbsFont& aFont );
100 void TestMalayalamAndLatin( const CFbsFont& aFont );
101 void TestMalayalamModifierAfterConsonantViramaZWJ( const CFbsFont& aFont );
102 void TestMalayalamWithConsonantInitial( const CFbsFont& aFont );
103 void TestMalayalamWithVowelInitial( const CFbsFont& aFont );
105 void TestVietnameseChars();
106 void TestSoftHyphen();
107 void TestSurrogates();
108 void TestNonBmpCharsL();
109 void TestNonBmpCharsInGB18030(CFbsFont* aFont);
110 void TestCombiningLatinChars();
111 void TestTextDirection();
112 void TestAllUnicodeChars();
113 void TestLigaturesWithDiacritics();
114 void TestIsolatedCombiningLatinChars();
115 void TestContextInShapeInfo();
117 // Test cases methods testing Thai functionality.
118 void ExecuteThaiTests();
119 void TestThai_SimpleChars();
120 void TestThai_ValidGlyphClusters();
121 void TestThai_InvalidGlyphClusters();
122 void TestThai_INC118424();
124 void TestMeasureText();
126 void TestCodepoint(TUint aCodepoint, CFont* aFont);
128 void GenerateGurmukhiMalayalamData( const TDesC& filename, const TTestInput_PositionParam6* aArray, const CFbsFont& aFont );
131 // Context data needed for the test cases in this class.
132 CTestFont* iTestFont;
133 CTestGraphicsDevice* iTestGraphicsDevice;
134 CTestGraphicsContext* iTestGraphicsContext;
139 class CTGlyphSelectionStep : public CTGraphicsStep
142 CTGlyphSelectionStep();
144 //from CTGraphicsStep
145 virtual CTGraphicsBase* CreateTestL();
149 _LIT(KTGlyphSelectionStep,"TGlyphSelection");
152 #endif //__TGLYPHSEL_H_