os/graphics/graphicsdeviceinterface/gdi/tgdi/TGlyphSel.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsdeviceinterface/gdi/tgdi/TGlyphSel.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,153 @@
     1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __TGLYPHSEL_H_
    1.20 +#define __TGLYPHSEL_H_
    1.21 +
    1.22 +
    1.23 +#include "TGraphicsContext.h"
    1.24 +#include "TGraphicsHarness.h"
    1.25 +
    1.26 +
    1.27 +class TStopWatch
    1.28 +	{
    1.29 +public:
    1.30 +	inline void Start();
    1.31 +	inline TUint Stop();
    1.32 +private:
    1.33 +	TTime iTime;
    1.34 +	};
    1.35 +
    1.36 +void TStopWatch::Start()
    1.37 +	{
    1.38 +	iTime.UniversalTime();
    1.39 +	}
    1.40 +
    1.41 +TUint TStopWatch::Stop()
    1.42 +	{
    1.43 +	TTime t;
    1.44 +	t.UniversalTime();
    1.45 +	TInt64 i = ((t.MicroSecondsFrom(iTime).Int64()) + 500)/1000;
    1.46 +	return I64LOW(i);
    1.47 +	}
    1.48 +
    1.49 +//	Forward declaration
    1.50 +struct TTestInput_PositionParam6;
    1.51 +class CTGlyphSelection : public CTGraphicsBase
    1.52 +/**
    1.53 + This is a unit test class. Its responsibilites are to define and
    1.54 + execute test cases that exercise CFont::GetCharacterPosition() 
    1.55 + functionality.
    1.56 +@internalComponent
    1.57 +@test
    1.58 +*/
    1.59 +	{
    1.60 +public:
    1.61 +
    1.62 +	// House keeping methods for test setup and shutdown.
    1.63 +	CTGlyphSelection(CTestStep* aStep);
    1.64 +	~CTGlyphSelection();
    1.65 +protected:
    1.66 +//from 	CTGraphicsStep
    1.67 +	virtual void RunTestCaseL(TInt aCurTestCase);
    1.68 +	virtual void ConstructL();
    1.69 +	
    1.70 +	void CreateTestGraphicsContextL();
    1.71 +	void TestPerformance();
    1.72 +
    1.73 +	// Test case methods testing specific functionality.
    1.74 +	void TestCtrlCharsIgnored();
    1.75 +	void TestApiBoundaries();
    1.76 +	void TestLatinChars();
    1.77 +	void TestGlyphs(CFont* aFont, CFont::TPositionParam& aParam,
    1.78 +		const TPtrC16& aText, const TPtrC16& aExpectedGlyphs);
    1.79 +	
    1.80 +	//TestIndicChars() is main function to perform testing for all Indic languages and calls all the indic language functions.
    1.81 +	 
    1.82 +	void TestIndicCharsL();
    1.83 +	void TestHindiChars(CFbsFont* aFont);
    1.84 +	void TestKannadaChars(CFbsFont* aFont);
    1.85 +	void TestMarathiChars(CFbsFont* aFont);
    1.86 +	void TestGujaratiChars(CFbsFont* aFont);
    1.87 +	void TestBengaliChars(CFbsFont* aFont);
    1.88 +	void TestTamilChars(CFbsFont* aFont);
    1.89 +	void TestTeluguChars(CFbsFont* aFont);
    1.90 +	void TestIndicPunctuation(CFbsFont* aFont);
    1.91 +	void TestIndicPunctuationGlyphs(CFbsFont* aFont, CFont::TPositionParam& aParam,
    1.92 +		const TPtrC16& aText, const TPtrC16& aExpectedGlyphs);
    1.93 +	
    1.94 +	//Gurumukhi and Malayalam support
    1.95 +	void ExecuteIndicGurmukhiMalayalamTests();
    1.96 +	void DoEachGurmukhiMalayalamCase( const TTestInput_PositionParam6* aArray, const CFbsFont& aFont );
    1.97 +	void TestGurmukhiDigit( const CFbsFont& aFont );
    1.98 +	void TestGurmukhiAndLatin( const CFbsFont& aFont );
    1.99 +	void TestGurmukhiModifierAfterConsonantViramaZWJ( const CFbsFont& aFont );
   1.100 +	void TestGurmukhiWithConsonantInitial( const CFbsFont& aFont );
   1.101 +	void TestGurmukhiWithVowelInitial( const CFbsFont& aFont );
   1.102 +	void TestMalayalamDigit( const CFbsFont& aFont );
   1.103 +	void TestMalayalamAndLatin( const CFbsFont& aFont );
   1.104 +	void TestMalayalamModifierAfterConsonantViramaZWJ( const CFbsFont& aFont );
   1.105 +	void TestMalayalamWithConsonantInitial( const CFbsFont& aFont );
   1.106 +	void TestMalayalamWithVowelInitial( const CFbsFont& aFont );
   1.107 +	
   1.108 +	void TestVietnameseChars();
   1.109 +	void TestSoftHyphen();
   1.110 +	void TestSurrogates();
   1.111 +	void TestNonBmpCharsL();
   1.112 +	void TestNonBmpCharsInGB18030(CFbsFont* aFont);
   1.113 +	void TestCombiningLatinChars();
   1.114 +	void TestTextDirection();
   1.115 +	void TestAllUnicodeChars();
   1.116 +	void TestLigaturesWithDiacritics();
   1.117 +	void TestIsolatedCombiningLatinChars();
   1.118 +	void TestContextInShapeInfo();
   1.119 +
   1.120 +	// Test cases methods testing Thai functionality.
   1.121 +	void ExecuteThaiTests();
   1.122 +	void TestThai_SimpleChars();
   1.123 +	void TestThai_ValidGlyphClusters();
   1.124 +	void TestThai_InvalidGlyphClusters();
   1.125 +	void TestThai_INC118424();
   1.126 +	
   1.127 +	void TestMeasureText();
   1.128 +
   1.129 +	void TestCodepoint(TUint aCodepoint, CFont* aFont);
   1.130 +	
   1.131 +	void GenerateGurmukhiMalayalamData( const TDesC& filename, const TTestInput_PositionParam6* aArray, const CFbsFont& aFont );
   1.132 +
   1.133 +public:
   1.134 +	// Context data needed for the test cases in this class.
   1.135 +	CTestFont* iTestFont;
   1.136 +	CTestGraphicsDevice* iTestGraphicsDevice;
   1.137 +	CTestGraphicsContext* iTestGraphicsContext;
   1.138 +private:
   1.139 +    RFs iFs;
   1.140 +	};
   1.141 +
   1.142 +class CTGlyphSelectionStep : public CTGraphicsStep
   1.143 +	{
   1.144 +public:
   1.145 +	CTGlyphSelectionStep();
   1.146 +protected:	
   1.147 +	//from CTGraphicsStep
   1.148 +	virtual CTGraphicsBase* CreateTestL();
   1.149 +	void TestSetupL();
   1.150 +	};
   1.151 +
   1.152 +_LIT(KTGlyphSelectionStep,"TGlyphSelection");
   1.153 +
   1.154 +
   1.155 +#endif //__TGLYPHSEL_H_
   1.156 +