sl@0: // Copyright (c) 2003-2010 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 __TGLYPHSEL_H_ sl@0: #define __TGLYPHSEL_H_ sl@0: sl@0: sl@0: #include "TGraphicsContext.h" sl@0: #include "TGraphicsHarness.h" sl@0: sl@0: sl@0: class TStopWatch sl@0: { sl@0: public: sl@0: inline void Start(); sl@0: inline TUint Stop(); sl@0: private: sl@0: TTime iTime; sl@0: }; sl@0: sl@0: void TStopWatch::Start() sl@0: { sl@0: iTime.UniversalTime(); sl@0: } sl@0: sl@0: TUint TStopWatch::Stop() sl@0: { sl@0: TTime t; sl@0: t.UniversalTime(); sl@0: TInt64 i = ((t.MicroSecondsFrom(iTime).Int64()) + 500)/1000; sl@0: return I64LOW(i); sl@0: } sl@0: sl@0: // Forward declaration sl@0: struct TTestInput_PositionParam6; sl@0: class CTGlyphSelection : public CTGraphicsBase sl@0: /** sl@0: This is a unit test class. Its responsibilites are to define and sl@0: execute test cases that exercise CFont::GetCharacterPosition() sl@0: functionality. sl@0: @internalComponent sl@0: @test sl@0: */ sl@0: { sl@0: public: sl@0: sl@0: // House keeping methods for test setup and shutdown. sl@0: CTGlyphSelection(CTestStep* aStep); sl@0: ~CTGlyphSelection(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: virtual void ConstructL(); sl@0: sl@0: void CreateTestGraphicsContextL(); sl@0: void TestPerformance(); sl@0: sl@0: // Test case methods testing specific functionality. sl@0: void TestCtrlCharsIgnored(); sl@0: void TestApiBoundaries(); sl@0: void TestLatinChars(); sl@0: void TestGlyphs(CFont* aFont, CFont::TPositionParam& aParam, sl@0: const TPtrC16& aText, const TPtrC16& aExpectedGlyphs); sl@0: sl@0: //TestIndicChars() is main function to perform testing for all Indic languages and calls all the indic language functions. sl@0: sl@0: void TestIndicCharsL(); sl@0: void TestHindiChars(CFbsFont* aFont); sl@0: void TestKannadaChars(CFbsFont* aFont); sl@0: void TestMarathiChars(CFbsFont* aFont); sl@0: void TestGujaratiChars(CFbsFont* aFont); sl@0: void TestBengaliChars(CFbsFont* aFont); sl@0: void TestTamilChars(CFbsFont* aFont); sl@0: void TestTeluguChars(CFbsFont* aFont); sl@0: void TestIndicPunctuation(CFbsFont* aFont); sl@0: void TestIndicPunctuationGlyphs(CFbsFont* aFont, CFont::TPositionParam& aParam, sl@0: const TPtrC16& aText, const TPtrC16& aExpectedGlyphs); sl@0: sl@0: //Gurumukhi and Malayalam support sl@0: void ExecuteIndicGurmukhiMalayalamTests(); sl@0: void DoEachGurmukhiMalayalamCase( const TTestInput_PositionParam6* aArray, const CFbsFont& aFont ); sl@0: void TestGurmukhiDigit( const CFbsFont& aFont ); sl@0: void TestGurmukhiAndLatin( const CFbsFont& aFont ); sl@0: void TestGurmukhiModifierAfterConsonantViramaZWJ( const CFbsFont& aFont ); sl@0: void TestGurmukhiWithConsonantInitial( const CFbsFont& aFont ); sl@0: void TestGurmukhiWithVowelInitial( const CFbsFont& aFont ); sl@0: void TestMalayalamDigit( const CFbsFont& aFont ); sl@0: void TestMalayalamAndLatin( const CFbsFont& aFont ); sl@0: void TestMalayalamModifierAfterConsonantViramaZWJ( const CFbsFont& aFont ); sl@0: void TestMalayalamWithConsonantInitial( const CFbsFont& aFont ); sl@0: void TestMalayalamWithVowelInitial( const CFbsFont& aFont ); sl@0: sl@0: void TestVietnameseChars(); sl@0: void TestSoftHyphen(); sl@0: void TestSurrogates(); sl@0: void TestNonBmpCharsL(); sl@0: void TestNonBmpCharsInGB18030(CFbsFont* aFont); sl@0: void TestCombiningLatinChars(); sl@0: void TestTextDirection(); sl@0: void TestAllUnicodeChars(); sl@0: void TestLigaturesWithDiacritics(); sl@0: void TestIsolatedCombiningLatinChars(); sl@0: void TestContextInShapeInfo(); sl@0: sl@0: // Test cases methods testing Thai functionality. sl@0: void ExecuteThaiTests(); sl@0: void TestThai_SimpleChars(); sl@0: void TestThai_ValidGlyphClusters(); sl@0: void TestThai_InvalidGlyphClusters(); sl@0: void TestThai_INC118424(); sl@0: sl@0: void TestMeasureText(); sl@0: sl@0: void TestCodepoint(TUint aCodepoint, CFont* aFont); sl@0: sl@0: void GenerateGurmukhiMalayalamData( const TDesC& filename, const TTestInput_PositionParam6* aArray, const CFbsFont& aFont ); sl@0: sl@0: public: sl@0: // Context data needed for the test cases in this class. sl@0: CTestFont* iTestFont; sl@0: CTestGraphicsDevice* iTestGraphicsDevice; sl@0: CTestGraphicsContext* iTestGraphicsContext; sl@0: private: sl@0: RFs iFs; sl@0: }; sl@0: sl@0: class CTGlyphSelectionStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTGlyphSelectionStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: void TestSetupL(); sl@0: }; sl@0: sl@0: _LIT(KTGlyphSelectionStep,"TGlyphSelection"); sl@0: sl@0: sl@0: #endif //__TGLYPHSEL_H_ sl@0: