fbs/fontandbitmapserver/tfbs/glyphatlastestwrapper.h
author hgs
Fri, 30 Jul 2010 11:41:40 +0300
changeset 136 62bb7c97884c
parent 121 d72fc2aace31
permissions -rw-r--r--
201030_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
121
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     1
// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     2
// All rights reserved.
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     7
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     8
// Initial Contributors:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    10
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    11
// Contributors:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    12
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    13
// Description:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    14
//
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    15
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    16
#ifndef GLYPHATLASTESTWRAPPER_H
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    17
#define GLYPHATLASTESTWRAPPER_H
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    18
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    19
#include "glyphatlas.h"
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    20
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    21
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    22
/**
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    23
Class to provide access to glyph atlas metrics for test purposes
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    24
*/
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    25
NONSHARABLE_CLASS(CGlyphAtlasTestWrapper)
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    26
    {
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    27
public:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    28
	~CGlyphAtlasTestWrapper();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    29
	static CGlyphAtlasTestWrapper* NewL(TInt aMaxCacheSizeInBytes);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    30
	static CGlyphAtlasTestWrapper* NewLC(TInt aMaxCacheSizeInBytes);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    31
	TInt GetGlyph(const CBitmapFont& aFont, TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    32
	TInt AddGlyph(const CBitmapFont& aFont, const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    33
	void FontReleased(const CBitmapFont& aFont);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    34
	
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    35
	// Utility functions providing access to internals of glyph atlas
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    36
	TInt SizeInBytes() const;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    37
	TInt GlyphCountByFont(const CBitmapFont* aFont);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    38
	TInt GlyphCount();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    39
	TInt FontCount() const;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    40
	TBool LruPageContainsGlyph(TUint aGlyphCode) const;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    41
private:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    42
	CGlyphAtlasTestWrapper();
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    43
	void ConstructL(TInt aMaxCacheSizeInBytes);
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    44
private:
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    45
	CGlyphAtlas* iAtlas;
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    46
    };
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    47
d72fc2aace31 201027_1
hgs
parents:
diff changeset
    48
#endif /* GLYPHATLASTESTWRAPPER_H */