os/graphics/graphicsdeviceinterface/bitgdi/tbit/TFont.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsdeviceinterface/bitgdi/tbit/TFont.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,123 @@
     1.4 +// Copyright (c) 2006-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 +/**
    1.20 + @file
    1.21 + @test
    1.22 + @internalComponent - Internal Symbian test code 
    1.23 +*/
    1.24 +
    1.25 +
    1.26 +#if !defined(__TFONT_H__)
    1.27 +#define __TFONT_H__
    1.28 +
    1.29 +#include <test/testexecutestepbase.h>
    1.30 +#include <test/fontinjector.h>
    1.31 +#include "TGraphicsHarness.h"
    1.32 +
    1.33 +
    1.34 +//--------------------------------------------------------------
    1.35 +
    1.36 +class CFbsFontEx : public CFbsFont
    1.37 +	{
    1.38 +public:
    1.39 +	static CBitmapFont* FontAddress(CFbsFont* aFont);
    1.40 +	};
    1.41 +
    1.42 +//--------------------------------------------------------------
    1.43 +
    1.44 +#ifdef __WINS__
    1.45 +template<class C> class XTCallCounter : public MShellcode
    1.46 +	{
    1.47 +public:
    1.48 +	XTCallCounter(CTGraphicsBase& aTestBase);
    1.49 +private:
    1.50 +	// From MShellcode
    1.51 +	void ExecuteShellcode(TInt aFromFunction);
    1.52 +private:
    1.53 +	CTGraphicsBase& iTestBase;
    1.54 +public:
    1.55 +	XVtableInjector<C> iInjector;
    1.56 +	TInt iVFCallsOutsideFBServ;
    1.57 +	};
    1.58 +#endif
    1.59 +
    1.60 +//--------------------------------------------------------------
    1.61 +
    1.62 +class CTFont : public CTGraphicsBase
    1.63 +	{
    1.64 +public:
    1.65 +	CTFont(CTestStep* aStep);
    1.66 +	~CTFont();
    1.67 +	void ConstructL();
    1.68 +protected:
    1.69 +//from 	CTGraphicsStep
    1.70 +	virtual void RunTestCaseL(TInt aCurTestCase);
    1.71 +public:
    1.72 +	void DoAllFontsL();
    1.73 +	void DoTextFormatsL();
    1.74 +	void DoBitAlignmentL();
    1.75 +	void DoLargeFontsL();
    1.76 +	void DoAntiAliasedTextL();
    1.77 +	void DoVerticalText();
    1.78 +	void DoVerticalBoxL();
    1.79 +	void DoUlStL();
    1.80 +	void DoSuperSubScriptL();
    1.81 +	void DoTextFormatsInContextL();
    1.82 +private:
    1.83 +	void ResetGc();
    1.84 +	void DrawTextInContext();
    1.85 +	void DrawTextInContextBox();
    1.86 +	void DrawTextInContextVertical();
    1.87 +	void Box();
    1.88 +	void Underline();
    1.89 +	void Clipping();
    1.90 +	void Justification();
    1.91 +	void BoxInContext();
    1.92 +	void JustificationInContext();
    1.93 +	void DisplayAsciiCharSet(const TDesC& aTypefaceName);
    1.94 +	void DisplayBoldItalic(const TDesC& aTypefaceName);
    1.95 +	void DisplayLargeChars();
    1.96 +	TInt DisplayCharAndBounds(TInt aChar,TPoint aPos,TBool aVertical,TBool aUp);
    1.97 +	void FontExternalizeL();
    1.98 +	TInt TestFontL(const TFontSpec &aFsp);
    1.99 +	TInt GetNearestFontToDesignHeightInPixels(CFbsFont*& aFont, const TFontSpec& aFontSpec);
   1.100 +	TInt GetNearestFontToDesignHeightInTwips(CFbsFont*& aFont, const TFontSpec& aFontSpec);
   1.101 +private:
   1.102 +	CFbsFont* iFont;
   1.103 +	CFbsBitGc* iGc;
   1.104 +	CFbsScreenDevice* iDev;
   1.105 +#ifdef __WINS__
   1.106 +	XTCallCounter<CFont> iFontCallCounter;
   1.107 +	XTCallCounter<COpenFont> iOpenFontCallCounter;
   1.108 +#endif
   1.109 +	};
   1.110 +
   1.111 +//--------------------------------------------------------------
   1.112 +
   1.113 +class CTFontStep : public CTGraphicsStep
   1.114 +	{
   1.115 +public:
   1.116 +	CTFontStep();
   1.117 +protected:	
   1.118 +	//from CTGraphicsStep
   1.119 +	virtual CTGraphicsBase* CreateTestL();
   1.120 +	virtual void TestSetupL();
   1.121 +	virtual void TestClose();
   1.122 +	};
   1.123 +
   1.124 +_LIT(KTFontStep,"TFont");
   1.125 +
   1.126 +#endif	// __TFONT_H__