fontservices/fontstore/src/FNTSTD.H
changeset 32 8b9155204a54
child 49 4d76f1414957
child 51 a7c938434754
equal deleted inserted replaced
31:b9ad20498fb4 32:8b9155204a54
       
     1 /*
       
     2 * Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FNTSTD_H__
       
    20 #define __FNTSTD_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <graphics/shapeimpl.h>
       
    24 
       
    25 /**
       
    26 @internalComponent
       
    27 */
       
    28 enum TFntStorePanic
       
    29 	{
       
    30 	EFntTypefaceIndexOutOfRange,
       
    31 	EFntHeightIndexOutOfRange,
       
    32 	EFntNoTypefaces,
       
    33 	EFntNoTypefaceFontBitmaps,
       
    34 	EFntTypefaceHasNoFontBitmaps,
       
    35 	EFntFontBitmapNotLoaded,
       
    36 	EFntFontAccessCountNonZero,
       
    37 	EFntFontStoreFileInUse,
       
    38 	EFntKPixelHeightInTwipsZero,
       
    39 	EFntSessionCacheIndexOutOfRange,
       
    40 	EFntMetricsIndexOutOfBounds,
       
    41 	EFntNoFontFound,
       
    42 	EFntRemovingAlreadyDeletedLinkedFont,
       
    43 	EFntOverFlow,
       
    44 	EFntMetricsNotOnHeap,
       
    45 	EFntPointerNotByteAligned,
       
    46 	};
       
    47 
       
    48 /**
       
    49 @internalComponent
       
    50 */
       
    51 GLREF_C void Panic(TFntStorePanic aPanic);
       
    52 
       
    53 // COpenFontSessionCacheList is placed here rather than openfont.cpp because it is used in fntstore.cpp as well.
       
    54 
       
    55 class COpenFontSessionCacheListItem;
       
    56 class COpenFont;
       
    57 
       
    58 class COpenFontSessionCacheList
       
    59 /**
       
    60 @internalComponent
       
    61 */
       
    62 	{
       
    63 public:
       
    64 	inline COpenFontSessionCacheList();
       
    65 	void Delete(RHeap* aHeap);
       
    66 	void DeleteCache(RHeap* aHeap,TInt aSessionHandle);
       
    67 
       
    68 	COpenFontSessionCacheListItem* Start();
       
    69 	void SetStart(COpenFontSessionCacheListItem* aItem);
       
    70 
       
    71 	void DeleteFontGlyphs(RHeap* aHeap,const COpenFont* aFont);
       
    72 
       
    73 	TInt iStartOffset;
       
    74 	};
       
    75 
       
    76 inline COpenFontSessionCacheList::COpenFontSessionCacheList():
       
    77 	iStartOffset(0)
       
    78 	{
       
    79 	}
       
    80 
       
    81 /**
       
    82 @internalComponent
       
    83 */
       
    84 #ifdef __GCC32__
       
    85 #define PACKED_STRUCTURE_PREFIX
       
    86 #define PACKED_STRUCTURE_SUFFIX __attribute__(( __packed__))
       
    87 #elif defined(__ARMCC__)
       
    88 #define PACKED_STRUCTURE_PREFIX __packed
       
    89 #define PACKED_STRUCTURE_SUFFIX
       
    90 #else
       
    91 #define PACKED_STRUCTURE_PREFIX
       
    92 #define PACKED_STRUCTURE_SUFFIX
       
    93 #endif
       
    94 
       
    95 PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterOffset
       
    96 /**
       
    97 Class to store an offset to the given position of a characters binary data in the 
       
    98 bitmap section of the font file.
       
    99 @internalComponent
       
   100 */
       
   101 
       
   102 	{
       
   103 public:
       
   104 	TBitmapFontCharacterOffset();
       
   105 	void InternalizeL(RReadStream& aStream);
       
   106 public:
       
   107 	TUint16 iBitmapOffset;  // restricts bitmap to 64k
       
   108 	} PACKED_STRUCTURE_SUFFIX;
       
   109 
       
   110 PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterMetrics
       
   111 /**
       
   112 Character metrics stored in .GDR files.
       
   113 
       
   114 This structure cannot be changed without changing the format of bitmap font
       
   115 files (.GDR files). This is because a pointer to TBitmapFontCharacterMetrics is made to point
       
   116 to part of the .GDR file in ROM.
       
   117 @internalComponent
       
   118 */
       
   119 
       
   120 	{
       
   121 	public:
       
   122 	TBitmapFontCharacterMetrics();
       
   123 	void InternalizeL(RReadStream& aStream);
       
   124 
       
   125 	TInt8 iAscentInPixels;
       
   126 	TInt8 iHeightInPixels;
       
   127 	TInt8 iLeftAdjustInPixels;
       
   128 	TInt8 iMoveInPixels;
       
   129 	TInt8 iRightAdjustInPixels;
       
   130 	} PACKED_STRUCTURE_SUFFIX;
       
   131 
       
   132 #endif