|
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 }; |
|
45 |
|
46 /** |
|
47 @internalComponent |
|
48 */ |
|
49 GLREF_C void Panic(TFntStorePanic aPanic); |
|
50 |
|
51 // COpenFontSessionCacheList is placed here rather than openfont.cpp because it is used in fntstore.cpp as well. |
|
52 |
|
53 class COpenFontSessionCacheListItem; |
|
54 class COpenFont; |
|
55 |
|
56 #ifdef FNTSTORE_SUPPORT_FMM |
|
57 class COpenFontSessionCacheList |
|
58 /** |
|
59 @internalComponent |
|
60 */ |
|
61 { |
|
62 public: |
|
63 inline COpenFontSessionCacheList(); |
|
64 void Delete(RHeap* aHeap); |
|
65 void DeleteCache(RHeap* aHeap,TInt aSessionHandle); |
|
66 |
|
67 COpenFontSessionCacheListItem* Start(); |
|
68 void SetStart(COpenFontSessionCacheListItem* aItem); |
|
69 |
|
70 void DeleteFontGlyphs(RHeap* aHeap,const COpenFont* aFont); |
|
71 |
|
72 TInt iStartOffset; |
|
73 }; |
|
74 |
|
75 inline COpenFontSessionCacheList::COpenFontSessionCacheList(): |
|
76 iStartOffset(0) |
|
77 { |
|
78 } |
|
79 #else |
|
80 class COpenFontSessionCacheList |
|
81 /** |
|
82 @internalComponent |
|
83 */ |
|
84 { |
|
85 friend class COpenFont; |
|
86 |
|
87 public: |
|
88 inline COpenFontSessionCacheList(); |
|
89 void Delete(RHeap* aHeap); |
|
90 void DeleteCache(RHeap* aHeap,TInt aSessionHandle); |
|
91 |
|
92 private: |
|
93 void DeleteFontGlyphs(RHeap* aHeap,const COpenFont* aFont); |
|
94 |
|
95 COpenFontSessionCacheListItem* iStart; |
|
96 }; |
|
97 |
|
98 inline COpenFontSessionCacheList::COpenFontSessionCacheList(): |
|
99 iStart(NULL) |
|
100 { |
|
101 } |
|
102 #endif // FNTSTORE_SUPPORT_FMM |
|
103 |
|
104 /** |
|
105 @internalComponent |
|
106 */ |
|
107 #ifdef __GCC32__ |
|
108 #define PACKED_STRUCTURE_PREFIX |
|
109 #define PACKED_STRUCTURE_SUFFIX __attribute__(( __packed__)) |
|
110 #elif defined(__ARMCC__) |
|
111 #define PACKED_STRUCTURE_PREFIX __packed |
|
112 #define PACKED_STRUCTURE_SUFFIX |
|
113 #else |
|
114 #define PACKED_STRUCTURE_PREFIX |
|
115 #define PACKED_STRUCTURE_SUFFIX |
|
116 #endif |
|
117 |
|
118 PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterOffset |
|
119 /** |
|
120 Class to store an offset to the given position of a characters binary data in the |
|
121 bitmap section of the font file. |
|
122 @internalComponent |
|
123 */ |
|
124 |
|
125 { |
|
126 public: |
|
127 TBitmapFontCharacterOffset(); |
|
128 void InternalizeL(RReadStream& aStream); |
|
129 public: |
|
130 TUint16 iBitmapOffset; // restricts bitmap to 64k |
|
131 } PACKED_STRUCTURE_SUFFIX; |
|
132 |
|
133 PACKED_STRUCTURE_PREFIX class TBitmapFontCharacterMetrics |
|
134 /** |
|
135 Character metrics stored in .GDR files. |
|
136 |
|
137 This structure cannot be changed without changing the format of bitmap font |
|
138 files (.GDR files). This is because a pointer to TBitmapFontCharacterMetrics is made to point |
|
139 to part of the .GDR file in ROM. |
|
140 @internalComponent |
|
141 */ |
|
142 |
|
143 { |
|
144 public: |
|
145 TBitmapFontCharacterMetrics(); |
|
146 void InternalizeL(RReadStream& aStream); |
|
147 |
|
148 TInt8 iAscentInPixels; |
|
149 TInt8 iHeightInPixels; |
|
150 TInt8 iLeftAdjustInPixels; |
|
151 TInt8 iMoveInPixels; |
|
152 TInt8 iRightAdjustInPixels; |
|
153 } PACKED_STRUCTURE_SUFFIX; |
|
154 |
|
155 #endif |