[XDK]
[reactos.git] / include / psdk / t2embapi.h
1 #ifndef __T2EMBED_API_H
2 #define __T2EMBED_API_H
3
4 #ifndef CHARSET_UNICODE
5 #define CHARSET_UNICODE 1
6 #define CHARSET_DEFAULT 1
7 #define CHARSET_SYMBOL 2
8 #define CHARSET_GLYPHIDX 3
9 #endif
10
11 #ifndef EMBED_PREVIEWPRINT
12 #define EMBED_PREVIEWPRINT 1
13 #define EMBED_EDITABLE 2
14 #define EMBED_INSTALLABLE 3
15 #define EMBED_NOEMBEDDING 4
16 #endif
17
18 #ifndef LICENSE_INSTALLABLE
19 #define LICENSE_INSTALLABLE 0x0
20 #define LICENSE_DEFAULT 0x0
21 #define LICENSE_NOEMBEDDING 0x2
22 #define LICENSE_PREVIEWPRINT 0x4
23 #define LICENSE_EDITABLE 0x8
24 #endif
25
26 #ifndef TTEMBED_RAW
27 #define TTEMBED_RAW 0x0
28 #define TTEMBED_SUBSET 0x1
29 #define TTEMBED_TTCOMPRESSED 0x4
30 #define TTEMBED_FAILIFVARIATIONSIMULATED 0x10
31 #define TTEMBED_EMBEDEUDC 0x20
32 #define TTEMBED_VALIDATIONTESTS 0x40
33 #define TTEMBED_WEBOBJECT 0x80
34 #define TTEMBED_ENCRYPTDATA 0x10000000
35 #endif
36
37 #ifndef E_NONE
38 #define E_NONE 0x0
39 #endif
40
41 #ifndef E_CHARCODECOUNTINVALID
42 #define E_CHARCODECOUNTINVALID 0x2
43 #define E_CHARCODESETINVALID 0x3
44 #define E_DEVICETRUETYPEFONT 0x4
45 #define E_HDCINVALID 0x6
46 #define E_NOFREEMEMORY 0x7
47 #define E_FONTREFERENCEINVALID 0x8
48 #define E_NOTATRUETYPEFONT 0xA
49 #define E_ERRORACCESSINGFONTDATA 0xC
50 #define E_ERRORACCESSINGFACENAME 0xD
51 #define E_ERRORUNICODECONVERSION 0x11
52 #define E_ERRORCONVERTINGCHARS 0x12
53 #define E_EXCEPTION 0x13
54 #define E_RESERVEDPARAMNOTNULL 0x14
55 #define E_CHARSETINVALID 0x15
56 #define E_WIN32S_NOTSUPPORTED 0x16
57 #define E_FILE_NOT_FOUND 0x17
58 #define E_TTC_INDEX_OUT_OF_RANGE 0x18
59 #define E_INPUTPARAMINVALID 0x19
60 #endif
61
62 #ifndef E_ERRORCOMPRESSINGFONTDATA
63 #define E_ERRORCOMPRESSINGFONTDATA 0x100
64 #define E_FONTDATAINVALID 0x102
65 #define E_NAMECHANGEFAILED 0x103
66 #define E_FONTNOTEMBEDDABLE 0x104
67 #define E_PRIVSINVALID 0x105
68 #define E_SUBSETTINGFAILED 0x106
69 #define E_READFROMSTREAMFAILED 0x107
70 #define E_SAVETOSTREAMFAILED 0x108
71 #define E_NOOS2 0x109
72 #define E_T2NOFREEMEMORY 0x10A
73 #define E_ERRORREADINGFONTDATA 0x10B
74 #define E_FLAGSINVALID 0x10C
75 #define E_ERRORCREATINGFONTFILE 0x10D
76 #define E_FONTALREADYEXISTS 0x10E
77 #define E_FONTNAMEALREADYEXISTS 0x10F
78 #define E_FONTINSTALLFAILED 0x110
79 #define E_ERRORDECOMPRESSINGFONTDATA 0x111
80 #define E_ERRORACCESSINGEXCLUDELIST 0x112
81 #define E_FACENAMEINVALID 0x113
82 #define E_STREAMINVALID 0x114
83 #define E_STATUSINVALID 0x115
84 #define E_PRIVSTATUSINVALID 0x116
85 #define E_PERMISSIONSINVALID 0x117
86 #define E_PBENABLEDINVALID 0x118
87 #define E_SUBSETTINGEXCEPTION 0x119
88 #define E_SUBSTRING_TEST_FAIL 0x11A
89 #define E_FONTVARIATIONSIMULATED 0x11B
90 #define E_FONTVALIDATEFAIL 0x11C
91 #define E_FONTFAMILYNAMENOTINFULL 0x11D
92 #endif
93
94 #ifndef E_ADDFONTFAILED
95 #define E_ADDFONTFAILED 0x200
96 #define E_COULDNTCREATETEMPFILE 0x201
97 #define E_FONTFILECREATEFAILED 0x203
98 #define E_WINDOWSAPI 0x204
99 #define E_FONTFILENOTFOUND 0x205
100 #define E_RESOURCEFILECREATEFAILED 0x206
101 #define E_ERROREXPANDINGFONTDATA 0x207
102 #define E_ERRORGETTINGDC 0x208
103 #define E_EXCEPTIONINDECOMPRESSION 0x209
104 #define E_EXCEPTIONINCOMPRESSION 0x20A
105 #endif
106
107 #ifdef __cplusplus
108 extern "C" {
109 #endif
110
111 typedef unsigned long(WINAPIV *WRITEEMBEDPROC)
112 (
113 void* lpvWriteStream,
114 const void* lpvBuffer,
115 const unsigned long cbBuffer
116 );
117
118 typedef unsigned long(WINAPIV *READEMBEDPROC)
119 (
120 void* lpvReadStream,
121 void* lpvBuffer,
122 const unsigned long cbBuffer
123 );
124
125
126 typedef struct
127 {
128 unsigned long ulStructSize;
129 long lTestFromSize;
130 long lTestToSize;
131 unsigned long ulCharSet;
132 unsigned short usReserved1;
133 unsigned short usCharCodeCount;
134 unsigned short* pusCharCodeSet;
135 } TTVALIDATIONTESTPARAMS;
136
137 typedef struct
138 {
139 unsigned long ulStructSize;
140 long lTestFromSize;
141 long lTestToSize;
142 unsigned long ulCharSet;
143 unsigned short usReserved1;
144 unsigned short usCharCodeCount;
145 unsigned long* pulCharCodeSet;
146 } TTVALIDATIONTESTPARAMSEX;
147
148 typedef struct
149 {
150 unsigned short usStructSize;
151 unsigned short usRootStrSize;
152 unsigned short *pusRootStr;
153 } TTEMBEDINFO;
154
155 typedef struct
156 {
157 unsigned short usStructSize;
158 unsigned short usRefStrSize;
159 unsigned short *pusRefStr;
160 } TTLOADINFO;
161
162 LONG
163 WINAPI
164 TTCharToUnicode(HDC hDC,
165 UCHAR* pucCharCodes,
166 ULONG ulCharCodeSize,
167 USHORT* pusShortCodes,
168 ULONG ulShortCodeSize,
169 ULONG ulFlags);
170
171 LONG
172 WINAPI
173 TTDeleteEmbeddedFont(HANDLE hFontReference,
174 ULONG ulFlags,
175 ULONG* pulStatus);
176
177 LONG
178 WINAPI
179 TTEmbedFont(HDC hDC,
180 ULONG ulFlags,
181 ULONG ulCharSet,
182 ULONG* pulPrivStatus,
183 ULONG* pulStatus,
184 WRITEEMBEDPROC lpfnWriteToStream,
185 LPVOID lpvWriteStream,
186 USHORT* pusCharCodeSet,
187 USHORT usCharCodeCount,
188 USHORT usLanguage,
189 TTEMBEDINFO* pTTEmbedInfo);
190
191 LONG
192 WINAPI
193 TTEmbedFontFromFileA(HDC hDC,
194 LPCSTR szFontFileName,
195 USHORT usTTCIndex,
196 ULONG ulFlags,
197 ULONG ulCharSet,
198 ULONG* pulPrivStatus,
199 ULONG* pulStatus,
200 WRITEEMBEDPROC lpfnWriteToStream,
201 LPVOID lpvWriteStream,
202 USHORT* pusCharCodeSet,
203 USHORT usCharCodeCount,
204 USHORT usLanguage,
205 TTEMBEDINFO* pTTEmbedInfo);
206
207 LONG
208 WINAPI
209 TTEnableEmbeddingForFacename(LPSTR lpszFacename,
210 BOOL bEnable);
211
212 LONG
213 WINAPI
214 TTGetEmbeddedFontInfo(ULONG ulFlags,
215 ULONG* pulPrivStatus,
216 ULONG ulPrivs,
217 ULONG* pulStatus,
218 READEMBEDPROC lpfnReadFromStream,
219 LPVOID lpvReadStream,
220 TTLOADINFO* pTTLoadInfo);
221
222 LONG
223 WINAPI
224 TTGetEmbeddingType(HDC hDC,
225 ULONG* pulPrivStatus);
226
227 LONG
228 WINAPI
229 TTIsEmbeddingEnabled(HDC hDC,
230 BOOL* pbEnabled);
231
232 LONG
233 WINAPI
234 TTIsEmbeddingEnabledForFacename(LPSTR lpszFacename,
235 BOOL* pbEnabled);
236
237 LONG
238 WINAPI
239 TTLoadEmbeddedFont(HANDLE *phFontReference,
240 ULONG ulFlags,
241 ULONG* pulPrivStatus,
242 ULONG ulPrivs,
243 ULONG* pulStatus,
244 READEMBEDPROC lpfnReadFromStream,
245 LPVOID lpvReadStream,
246 LPWSTR szWinFamilyName,
247 LPSTR szMacFamilyName,
248 TTLOADINFO* pTTLoadInfo);
249
250 LONG
251 WINAPI
252 TTRunValidationTests(HDC hDC,
253 TTVALIDATIONTESTPARAMS* pTestParam);
254
255 LONG
256 WINAPI
257 TTEmbedFontEx(HDC hDC,
258 ULONG ulFlags,
259 ULONG ulCharSet,
260 ULONG* pulPrivStatus,
261 ULONG* pulStatus,
262 WRITEEMBEDPROC lpfnWriteToStream,
263 LPVOID lpvWriteStream,
264 ULONG* pulCharCodeSet,
265 USHORT usCharCodeCount,
266 USHORT usLanguage,
267 TTEMBEDINFO* pTTEmbedInfo);
268
269 LONG
270 WINAPI
271 TTRunValidationTestsEx(HDC hDC,
272 TTVALIDATIONTESTPARAMSEX* pTestParam);
273
274 LONG
275 WINAPI
276 TTGetNewFontName(HANDLE* phFontReference,
277 LPWSTR szWinFamilyName,
278 long cchMaxWinName,
279 LPSTR szMacFamilyName,
280 long cchMaxMacName);
281
282 #ifdef __cplusplus
283 }
284 #endif
285
286 #endif /* __T2EMBED_API_H */