fbs/fontandbitmapserver/tfbs/tfonttableandglyph.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 16:21:04 +0300
changeset 36 01a6848ebfd7
child 116 171fae344dd4
permissions -rw-r--r--
Revision: 201009 Kit: 201015

// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

#ifndef TFONTTABLEANDGLYPH_H_
#define TFONTTABLEANDGLYPH_H_

#include <gdi.h>
#include "TGraphicsHarness.h"

class CTFontAndGlyphStep : public CTGraphicsStep
    {
public:
    CTFontAndGlyphStep();
protected:  
    //from CTGraphicsStep
    virtual CTGraphicsBase* CreateTestL();
    };

_LIT(KTFontTableAndGlyphStep,"TFontTableAndGlyphOutline");



class CFbsTestForFont: public CFbsFont 
    {
public:
    CFbsTestForFont():CFbsFont() { }
    void Duplicate(TInt aFontHandle) {CFbsFont::Duplicate(aFontHandle);}    
    void SetHandle(TInt aHandle) { iHandle = aHandle; }
    TInt ClientHandle(){return iHandle;};
    ~CFbsTestForFont() { iHandle = 0; }
    };




class CTFontAndGlyph : public CTGraphicsBase
    {
    
public:
    CTFontAndGlyph(CTestStep* aStep);
    ~CTFontAndGlyph();

protected:
//from  CTGraphicsStep
    virtual void RunTestCaseL(TInt aCurTestCase);

private:
    void ConstructL();
    void CleanEnv();

    void GetHintedGlyphById();
    void GetUnHintedGlyphById();
    void GetHintedGlyphByWrongId();
    void GetGlyphWithNoMem();
    void GetFontTable();    
    void GetFontTableByWrongTag();
    void GetFontTableWithNoMem();
    
    void TestFbsFontHandleIsZeroForFont();          
    void TestFbsFontHandleIsZeroForGlyph();         
    void GlyphOutlineIteratorPanics();
    void SMPAndWDPSafeTest();
    
    void OutlinePanics(TInt (*aThreadFun)(TAny*));
    void OutlineLengthPanics(TInt (*aThreadFun)(TAny*));
       
private:
    CFbsBitmap*         iBmp;
    CFbsBitmap*         iBmp2;
    CFbsBitmapDevice*   iDevice;
    CFbsBitmapDevice*   iDevice2;
    CFont*       iFont;
    CFont*       iFont2;
    CFontStore*         iFontStore;
    TFontSpec           iFontSpec, iFontSpec2;
    TUid                iUid, iUid2;    
    };



#endif /* TFONTTABLEANDGLYPH_H_ */