sl@0
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __TGLYPHSEL_H_
|
sl@0
|
17 |
#define __TGLYPHSEL_H_
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
#include "TGraphicsContext.h"
|
sl@0
|
21 |
#include "TGraphicsHarness.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
class TStopWatch
|
sl@0
|
25 |
{
|
sl@0
|
26 |
public:
|
sl@0
|
27 |
inline void Start();
|
sl@0
|
28 |
inline TUint Stop();
|
sl@0
|
29 |
private:
|
sl@0
|
30 |
TTime iTime;
|
sl@0
|
31 |
};
|
sl@0
|
32 |
|
sl@0
|
33 |
void TStopWatch::Start()
|
sl@0
|
34 |
{
|
sl@0
|
35 |
iTime.UniversalTime();
|
sl@0
|
36 |
}
|
sl@0
|
37 |
|
sl@0
|
38 |
TUint TStopWatch::Stop()
|
sl@0
|
39 |
{
|
sl@0
|
40 |
TTime t;
|
sl@0
|
41 |
t.UniversalTime();
|
sl@0
|
42 |
TInt64 i = ((t.MicroSecondsFrom(iTime).Int64()) + 500)/1000;
|
sl@0
|
43 |
return I64LOW(i);
|
sl@0
|
44 |
}
|
sl@0
|
45 |
|
sl@0
|
46 |
// Forward declaration
|
sl@0
|
47 |
struct TTestInput_PositionParam6;
|
sl@0
|
48 |
class CTGlyphSelection : public CTGraphicsBase
|
sl@0
|
49 |
/**
|
sl@0
|
50 |
This is a unit test class. Its responsibilites are to define and
|
sl@0
|
51 |
execute test cases that exercise CFont::GetCharacterPosition()
|
sl@0
|
52 |
functionality.
|
sl@0
|
53 |
@internalComponent
|
sl@0
|
54 |
@test
|
sl@0
|
55 |
*/
|
sl@0
|
56 |
{
|
sl@0
|
57 |
public:
|
sl@0
|
58 |
|
sl@0
|
59 |
// House keeping methods for test setup and shutdown.
|
sl@0
|
60 |
CTGlyphSelection(CTestStep* aStep);
|
sl@0
|
61 |
~CTGlyphSelection();
|
sl@0
|
62 |
protected:
|
sl@0
|
63 |
//from CTGraphicsStep
|
sl@0
|
64 |
virtual void RunTestCaseL(TInt aCurTestCase);
|
sl@0
|
65 |
virtual void ConstructL();
|
sl@0
|
66 |
|
sl@0
|
67 |
void CreateTestGraphicsContextL();
|
sl@0
|
68 |
void TestPerformance();
|
sl@0
|
69 |
|
sl@0
|
70 |
// Test case methods testing specific functionality.
|
sl@0
|
71 |
void TestCtrlCharsIgnored();
|
sl@0
|
72 |
void TestApiBoundaries();
|
sl@0
|
73 |
void TestLatinChars();
|
sl@0
|
74 |
void TestGlyphs(CFont* aFont, CFont::TPositionParam& aParam,
|
sl@0
|
75 |
const TPtrC16& aText, const TPtrC16& aExpectedGlyphs);
|
sl@0
|
76 |
|
sl@0
|
77 |
//TestIndicChars() is main function to perform testing for all Indic languages and calls all the indic language functions.
|
sl@0
|
78 |
|
sl@0
|
79 |
void TestIndicCharsL();
|
sl@0
|
80 |
void TestHindiChars(CFbsFont* aFont);
|
sl@0
|
81 |
void TestKannadaChars(CFbsFont* aFont);
|
sl@0
|
82 |
void TestMarathiChars(CFbsFont* aFont);
|
sl@0
|
83 |
void TestGujaratiChars(CFbsFont* aFont);
|
sl@0
|
84 |
void TestBengaliChars(CFbsFont* aFont);
|
sl@0
|
85 |
void TestTamilChars(CFbsFont* aFont);
|
sl@0
|
86 |
void TestTeluguChars(CFbsFont* aFont);
|
sl@0
|
87 |
void TestIndicPunctuation(CFbsFont* aFont);
|
sl@0
|
88 |
void TestIndicPunctuationGlyphs(CFbsFont* aFont, CFont::TPositionParam& aParam,
|
sl@0
|
89 |
const TPtrC16& aText, const TPtrC16& aExpectedGlyphs);
|
sl@0
|
90 |
|
sl@0
|
91 |
//Gurumukhi and Malayalam support
|
sl@0
|
92 |
void ExecuteIndicGurmukhiMalayalamTests();
|
sl@0
|
93 |
void DoEachGurmukhiMalayalamCase( const TTestInput_PositionParam6* aArray, const CFbsFont& aFont );
|
sl@0
|
94 |
void TestGurmukhiDigit( const CFbsFont& aFont );
|
sl@0
|
95 |
void TestGurmukhiAndLatin( const CFbsFont& aFont );
|
sl@0
|
96 |
void TestGurmukhiModifierAfterConsonantViramaZWJ( const CFbsFont& aFont );
|
sl@0
|
97 |
void TestGurmukhiWithConsonantInitial( const CFbsFont& aFont );
|
sl@0
|
98 |
void TestGurmukhiWithVowelInitial( const CFbsFont& aFont );
|
sl@0
|
99 |
void TestMalayalamDigit( const CFbsFont& aFont );
|
sl@0
|
100 |
void TestMalayalamAndLatin( const CFbsFont& aFont );
|
sl@0
|
101 |
void TestMalayalamModifierAfterConsonantViramaZWJ( const CFbsFont& aFont );
|
sl@0
|
102 |
void TestMalayalamWithConsonantInitial( const CFbsFont& aFont );
|
sl@0
|
103 |
void TestMalayalamWithVowelInitial( const CFbsFont& aFont );
|
sl@0
|
104 |
|
sl@0
|
105 |
void TestVietnameseChars();
|
sl@0
|
106 |
void TestSoftHyphen();
|
sl@0
|
107 |
void TestSurrogates();
|
sl@0
|
108 |
void TestNonBmpCharsL();
|
sl@0
|
109 |
void TestNonBmpCharsInGB18030(CFbsFont* aFont);
|
sl@0
|
110 |
void TestCombiningLatinChars();
|
sl@0
|
111 |
void TestTextDirection();
|
sl@0
|
112 |
void TestAllUnicodeChars();
|
sl@0
|
113 |
void TestLigaturesWithDiacritics();
|
sl@0
|
114 |
void TestIsolatedCombiningLatinChars();
|
sl@0
|
115 |
void TestContextInShapeInfo();
|
sl@0
|
116 |
|
sl@0
|
117 |
// Test cases methods testing Thai functionality.
|
sl@0
|
118 |
void ExecuteThaiTests();
|
sl@0
|
119 |
void TestThai_SimpleChars();
|
sl@0
|
120 |
void TestThai_ValidGlyphClusters();
|
sl@0
|
121 |
void TestThai_InvalidGlyphClusters();
|
sl@0
|
122 |
void TestThai_INC118424();
|
sl@0
|
123 |
|
sl@0
|
124 |
void TestMeasureText();
|
sl@0
|
125 |
|
sl@0
|
126 |
void TestCodepoint(TUint aCodepoint, CFont* aFont);
|
sl@0
|
127 |
|
sl@0
|
128 |
void GenerateGurmukhiMalayalamData( const TDesC& filename, const TTestInput_PositionParam6* aArray, const CFbsFont& aFont );
|
sl@0
|
129 |
|
sl@0
|
130 |
public:
|
sl@0
|
131 |
// Context data needed for the test cases in this class.
|
sl@0
|
132 |
CTestFont* iTestFont;
|
sl@0
|
133 |
CTestGraphicsDevice* iTestGraphicsDevice;
|
sl@0
|
134 |
CTestGraphicsContext* iTestGraphicsContext;
|
sl@0
|
135 |
private:
|
sl@0
|
136 |
RFs iFs;
|
sl@0
|
137 |
};
|
sl@0
|
138 |
|
sl@0
|
139 |
class CTGlyphSelectionStep : public CTGraphicsStep
|
sl@0
|
140 |
{
|
sl@0
|
141 |
public:
|
sl@0
|
142 |
CTGlyphSelectionStep();
|
sl@0
|
143 |
protected:
|
sl@0
|
144 |
//from CTGraphicsStep
|
sl@0
|
145 |
virtual CTGraphicsBase* CreateTestL();
|
sl@0
|
146 |
void TestSetupL();
|
sl@0
|
147 |
};
|
sl@0
|
148 |
|
sl@0
|
149 |
_LIT(KTGlyphSelectionStep,"TGlyphSelection");
|
sl@0
|
150 |
|
sl@0
|
151 |
|
sl@0
|
152 |
#endif //__TGLYPHSEL_H_
|
sl@0
|
153 |
|