os/textandloc/fontservices/fontstore/src/FNTSTD.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/fontstore/src/FNTSTD.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,133 @@
     1.4 +/*
     1.5 +* Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __FNTSTD_H__
    1.23 +#define __FNTSTD_H__
    1.24 +
    1.25 +#include <e32std.h>
    1.26 +#include <graphics/shapeimpl.h>
    1.27 +
    1.28 +/**
    1.29 +@internalComponent
    1.30 +*/
    1.31 +enum TFntStorePanic
    1.32 +	{
    1.33 +	EFntTypefaceIndexOutOfRange,
    1.34 +	EFntHeightIndexOutOfRange,
    1.35 +	EFntNoTypefaces,
    1.36 +	EFntNoTypefaceFontBitmaps,
    1.37 +	EFntTypefaceHasNoFontBitmaps,
    1.38 +	EFntFontBitmapNotLoaded,
    1.39 +	EFntFontAccessCountNonZero,
    1.40 +	EFntFontStoreFileInUse,
    1.41 +	EFntKPixelHeightInTwipsZero,
    1.42 +	EFntSessionCacheIndexOutOfRange,
    1.43 +	EFntMetricsIndexOutOfBounds,
    1.44 +	EFntNoFontFound,
    1.45 +	EFntRemovingAlreadyDeletedLinkedFont,
    1.46 +	EFntOverFlow,
    1.47 +	EFntMetricsNotOnHeap,
    1.48 +	EFntPointerNotByteAligned,
    1.49 +	};
    1.50 +
    1.51 +/**
    1.52 +@internalComponent
    1.53 +*/
    1.54 +GLREF_C void Panic(TFntStorePanic aPanic);
    1.55 +
    1.56 +// COpenFontSessionCacheList is placed here rather than openfont.cpp because it is used in fntstore.cpp as well.
    1.57 +
    1.58 +class COpenFontSessionCache;
    1.59 +class COpenFont;
    1.60 +
    1.61 +class COpenFontSessionCacheList
    1.62 +/**
    1.63 +@internalComponent
    1.64 +*/
    1.65 +	{
    1.66 +public:
    1.67 +	inline COpenFontSessionCacheList();
    1.68 +	TInt AddCache(COpenFontSessionCache* aCache);
    1.69 +	COpenFontSessionCache* FindCache(TInt aSessionHandle) const;
    1.70 +	void Delete(RHeap* aHeap);
    1.71 +	void DeleteCache(RHeap* aHeap,TInt aSessionHandle);
    1.72 +	void DeleteFontGlyphs(RHeap* aHeap,const COpenFont* aFont);
    1.73 +private:
    1.74 +	enum { EMaxNumCaches = 256 };
    1.75 +private:
    1.76 +	TInt iSessionHandleArray[EMaxNumCaches];
    1.77 +	TInt iCacheOffsetArray[EMaxNumCaches];
    1.78 +	};
    1.79 +
    1.80 +inline COpenFontSessionCacheList::COpenFontSessionCacheList()
    1.81 +	{
    1.82 +	Mem::FillZ(this, sizeof(COpenFontSessionCacheList));
    1.83 +	}
    1.84 +
    1.85 +/**
    1.86 +@internalComponent
    1.87 +*/
    1.88 +#ifdef __GCC32__
    1.89 +#define PACKED_STRUCTURE_PREFIX
    1.90 +#define PACKED_STRUCTURE_SUFFIX __attribute__(( __packed__))
    1.91 +#elif defined(__ARMCC__)
    1.92 +#define PACKED_STRUCTURE_PREFIX __packed
    1.93 +#define PACKED_STRUCTURE_SUFFIX
    1.94 +#else
    1.95 +#define PACKED_STRUCTURE_PREFIX
    1.96 +#define PACKED_STRUCTURE_SUFFIX
    1.97 +#endif
    1.98 +
    1.99 +PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterOffset
   1.100 +/**
   1.101 +Class to store an offset to the given position of a characters binary data in the 
   1.102 +bitmap section of the font file.
   1.103 +@internalComponent
   1.104 +*/
   1.105 +
   1.106 +	{
   1.107 +public:
   1.108 +	TBitmapFontCharacterOffset();
   1.109 +	void InternalizeL(RReadStream& aStream);
   1.110 +public:
   1.111 +	TUint16 iBitmapOffset;  // restricts bitmap to 64k
   1.112 +	} PACKED_STRUCTURE_SUFFIX;
   1.113 +
   1.114 +PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterMetrics
   1.115 +/**
   1.116 +Character metrics stored in .GDR files.
   1.117 +
   1.118 +This structure cannot be changed without changing the format of bitmap font
   1.119 +files (.GDR files). This is because a pointer to TBitmapFontCharacterMetrics is made to point
   1.120 +to part of the .GDR file in ROM.
   1.121 +@internalComponent
   1.122 +*/
   1.123 +
   1.124 +	{
   1.125 +	public:
   1.126 +	TBitmapFontCharacterMetrics();
   1.127 +	void InternalizeL(RReadStream& aStream);
   1.128 +
   1.129 +	TInt8 iAscentInPixels;
   1.130 +	TInt8 iHeightInPixels;
   1.131 +	TInt8 iLeftAdjustInPixels;
   1.132 +	TInt8 iMoveInPixels;
   1.133 +	TInt8 iRightAdjustInPixels;
   1.134 +	} PACKED_STRUCTURE_SUFFIX;
   1.135 +
   1.136 +#endif