b05c2adfa2267dcdcf3b9e75c70087d837633140
[reactos.git] / dll / win32 / riched20 / rtf.h
1 #ifndef _RTF
2 #define _RTF
3
4 /*
5 * rtf.h - RTF document processing stuff. Release 1.10.
6 */
7
8
9 /*
10 * Twentieths of a point (twips) per inch (Many RTF measurements
11 * are in twips per inch (tpi) units). Assumes 72 points/inch.
12 */
13
14 # define rtfTpi 1440
15
16 /*
17 * RTF buffer size (avoids BUFSIZ, which differs across systems)
18 */
19
20 # define rtfBufSiz 1024
21
22 /*
23 * Tokens are associated with up to three classification numbers:
24 *
25 * Class number: Broadest (least detailed) breakdown. For programs
26 * that only care about gross token distinctions.
27 * Major/minor numbers: Within their class, tokens have a major
28 * number, and may also have a minor number to further
29 * distinguish tokens with the same major number.
30 *
31 * *** Class, major and minor token numbers are all >= 0 ***
32 *
33 * Tokens that can't be classified are put in the "unknown" class.
34 * For such, the major and minor numbers are meaningless, although
35 * rtfTextBuf may be of interest then.
36 *
37 * Text tokens are a single character, and the major number indicates
38 * the character value (note: can be non-ascii, i.e., greater than 127).
39 * There is no minor number.
40 *
41 * Control symbols may have a parameter value, which will be found in
42 * rtfParam. If no parameter was given, rtfParam = rtfNoParam.
43 *
44 * RTFGetToken() return value is the class number, but it sets all the
45 * global token vars.
46 *
47 * rtfEOF is a fake token used by the reader; the writer never sees
48 * it (except in the token reader hook, if it installs one).
49 */
50
51
52 # define rtfNoParam (-1000000)
53
54
55
56 /*
57 * For some reason, the no-style number is 222
58 */
59
60 # define rtfNoStyleNum 222
61 # define rtfNormalStyleNum 0
62
63
64 /*
65 * Token classes (must be zero-based and sequential)
66 */
67
68 # define rtfUnknown 0
69 # define rtfGroup 1
70 # define rtfText 2
71 # define rtfControl 3
72 # define rtfEOF 4
73 # define rtfMaxClass 5 /* highest class + 1 */
74
75 /*
76 * Group class major numbers
77 */
78
79 # define rtfBeginGroup 0
80 # define rtfEndGroup 1
81
82 /*
83 * Control class major and minor numbers.
84 */
85
86 # define rtfVersion 0
87
88 # define rtfDefFont 1
89
90 # define rtfCharSet 2
91 # define rtfAnsiCharSet 0
92 # define rtfMacCharSet 1
93 # define rtfPcCharSet 2
94 # define rtfPcaCharSet 3
95
96
97 /* destination minor numbers should be zero-based and sequential */
98
99 # define rtfDestination 3
100 # define rtfFontTbl 0
101 # define rtfFontAltName 1 /* new in 1.10 */
102 # define rtfEmbeddedFont 2 /* new in 1.10 */
103 # define rtfFontFile 3 /* new in 1.10 */
104 # define rtfFileTbl 4 /* new in 1.10 */
105 # define rtfFileInfo 5 /* new in 1.10 */
106 # define rtfColorTbl 6
107 # define rtfStyleSheet 7
108 # define rtfKeyCode 8
109 # define rtfRevisionTbl 9 /* new in 1.10 */
110 # define rtfInfo 10
111 # define rtfITitle 11
112 # define rtfISubject 12
113 # define rtfIAuthor 13
114 # define rtfIOperator 14
115 # define rtfIKeywords 15
116 # define rtfIComment 16
117 # define rtfIVersion 17
118 # define rtfIDoccomm 18
119 # define rtfIVerscomm 19
120 # define rtfNextFile 20 /* reclassified in 1.10 */
121 # define rtfTemplate 21 /* reclassified in 1.10 */
122 # define rtfFNSep 22
123 # define rtfFNContSep 23
124 # define rtfFNContNotice 24
125 # define rtfENSep 25 /* new in 1.10 */
126 # define rtfENContSep 26 /* new in 1.10 */
127 # define rtfENContNotice 27 /* new in 1.10 */
128 # define rtfPageNumLevel 28 /* new in 1.10 */
129 # define rtfParNumLevelStyle 29 /* new in 1.10 */
130 # define rtfHeader 30
131 # define rtfFooter 31
132 # define rtfHeaderLeft 32
133 # define rtfHeaderRight 33
134 # define rtfHeaderFirst 34
135 # define rtfFooterLeft 35
136 # define rtfFooterRight 36
137 # define rtfFooterFirst 37
138 # define rtfParNumText 38 /* new in 1.10 */
139 # define rtfParNumbering 39 /* new in 1.10 */
140 # define rtfParNumTextAfter 40 /* new in 1.10 */
141 # define rtfParNumTextBefore 41 /* new in 1.10 */
142 # define rtfBookmarkStart 42
143 # define rtfBookmarkEnd 43
144 # define rtfPict 44
145 # define rtfObject 45
146 # define rtfObjClass 46
147 # define rtfObjName 47
148 # define rtfObjTime 48 /* new in 1.10 */
149 # define rtfObjData 49
150 # define rtfObjAlias 50
151 # define rtfObjSection 51
152 # define rtfObjResult 52
153 # define rtfObjItem 53 /* new in 1.10 */
154 # define rtfObjTopic 54 /* new in 1.10 */
155 # define rtfDrawObject 55 /* new in 1.10 */
156 # define rtfFootnote 56
157 # define rtfAnnotRefStart 57 /* new in 1.10 */
158 # define rtfAnnotRefEnd 58 /* new in 1.10 */
159 # define rtfAnnotID 59 /* reclassified in 1.10 */
160 # define rtfAnnotAuthor 60 /* new in 1.10 */
161 # define rtfAnnotation 61 /* reclassified in 1.10 */
162 # define rtfAnnotRef 62 /* new in 1.10 */
163 # define rtfAnnotTime 63 /* new in 1.10 */
164 # define rtfAnnotIcon 64 /* new in 1.10 */
165 # define rtfField 65
166 # define rtfFieldInst 66
167 # define rtfFieldResult 67
168 # define rtfDataField 68 /* new in 1.10 */
169 # define rtfIndex 69
170 # define rtfIndexText 70
171 # define rtfIndexRange 71
172 # define rtfTOC 72
173 # define rtfNeXTGraphic 73
174 # define rtfGenerator 74
175 # define rtfNestTableProps 75
176 # define rtfNoNestTables 76
177 # define rtfShpPict 77
178 # define rtfNonShpPict 78
179 # define rtfMaxDestination 79 /* highest dest + 1 */
180
181 # define rtfFontFamily 4
182 # define rtfFFNil 0
183 # define rtfFFRoman 1
184 # define rtfFFSwiss 2
185 # define rtfFFModern 3
186 # define rtfFFScript 4
187 # define rtfFFDecor 5
188 # define rtfFFTech 6
189 # define rtfFFBidirectional 7 /* new in 1.10 */
190
191 # define rtfColorName 5
192 # define rtfRed 0
193 # define rtfGreen 1
194 # define rtfBlue 2
195
196 # define rtfSpecialChar 6
197 /* special chars seen in \info destination */
198 # define rtfIIntVersion 0
199 # define rtfICreateTime 1
200 # define rtfIRevisionTime 2
201 # define rtfIPrintTime 3
202 # define rtfIBackupTime 4
203 # define rtfIEditTime 5
204 # define rtfIYear 6
205 # define rtfIMonth 7
206 # define rtfIDay 8
207 # define rtfIHour 9
208 # define rtfIMinute 10
209 # define rtfISecond 11 /* new in 1.10 */
210 # define rtfINPages 12
211 # define rtfINWords 13
212 # define rtfINChars 14
213 # define rtfIIntID 15
214 /* other special chars */
215 # define rtfCurHeadDate 16
216 # define rtfCurHeadDateLong 17
217 # define rtfCurHeadDateAbbrev 18
218 # define rtfCurHeadTime 19
219 # define rtfCurHeadPage 20
220 # define rtfSectNum 21 /* new in 1.10 */
221 # define rtfCurFNote 22
222 # define rtfCurAnnotRef 23
223 # define rtfFNoteSep 24
224 # define rtfFNoteCont 25
225 # define rtfCell 26
226 # define rtfRow 27
227 # define rtfPar 28
228 # define rtfSect 29
229 # define rtfPage 30
230 # define rtfColumn 31
231 # define rtfLine 32
232 # define rtfSoftPage 33 /* new in 1.10 */
233 # define rtfSoftColumn 34 /* new in 1.10 */
234 # define rtfSoftLine 35 /* new in 1.10 */
235 # define rtfSoftLineHt 36 /* new in 1.10 */
236 # define rtfTab 37
237 # define rtfEmDash 38
238 # define rtfEnDash 39
239 # define rtfEmSpace 40 /* new in 1.10 */
240 # define rtfEnSpace 41 /* new in 1.10 */
241 # define rtfBullet 42
242 # define rtfLQuote 43
243 # define rtfRQuote 44
244 # define rtfLDblQuote 45
245 # define rtfRDblQuote 46
246 # define rtfFormula 47
247 # define rtfNoBrkSpace 49
248 # define rtfNoReqHyphen 50
249 # define rtfNoBrkHyphen 51
250 # define rtfOptDest 52
251 # define rtfLTRMark 53 /* new in 1.10 */
252 # define rtfRTLMark 54 /* new in 1.10 */
253 # define rtfNoWidthJoiner 55 /* new in 1.10 */
254 # define rtfNoWidthNonJoiner 56 /* new in 1.10 */
255 # define rtfCurHeadPict 57 /* valid? */
256 /*# define rtfCurAnnot 58*/ /* apparently not used */
257 # define rtfUnicode 58 /* no better category*/
258 # define rtfNestCell 59
259 # define rtfNestRow 60
260
261 # define rtfStyleAttr 7
262 # define rtfAdditive 0 /* new in 1.10 */
263 # define rtfBasedOn 1
264 # define rtfNext 2
265
266 # define rtfDocAttr 8
267 # define rtfDefTab 0
268 # define rtfHyphHotZone 1
269 # define rtfHyphConsecLines 2 /* new in 1.10 */
270 # define rtfHyphCaps 3 /* new in 1.10 */
271 # define rtfHyphAuto 4 /* new in 1.10 */
272 # define rtfLineStart 5
273 # define rtfFracWidth 6
274 # define rtfMakeBackup 7
275 # define rtfRTFDefault 8
276 # define rtfPSOverlay 9
277 # define rtfDocTemplate 10 /* new in 1.10 */
278 # define rtfDefLanguage 11
279 # define rtfFENoteType 12 /* new in 1.10 */
280 # define rtfFNoteEndSect 13
281 # define rtfFNoteEndDoc 14
282 # define rtfFNoteText 15
283 # define rtfFNoteBottom 16
284 # define rtfENoteEndSect 17 /* new in 1.10 */
285 # define rtfENoteEndDoc 18 /* new in 1.10 */
286 # define rtfENoteText 19 /* new in 1.10 */
287 # define rtfENoteBottom 20 /* new in 1.10 */
288 # define rtfFNoteStart 21
289 # define rtfENoteStart 22 /* new in 1.10 */
290 # define rtfFNoteRestartPage 23 /* new in 1.10 */
291 # define rtfFNoteRestart 24
292 # define rtfFNoteRestartCont 25 /* new in 1.10 */
293 # define rtfENoteRestart 26 /* new in 1.10 */
294 # define rtfENoteRestartCont 27 /* new in 1.10 */
295 # define rtfFNoteNumArabic 28 /* new in 1.10 */
296 # define rtfFNoteNumLLetter 29 /* new in 1.10 */
297 # define rtfFNoteNumULetter 30 /* new in 1.10 */
298 # define rtfFNoteNumLRoman 31 /* new in 1.10 */
299 # define rtfFNoteNumURoman 32 /* new in 1.10 */
300 # define rtfFNoteNumChicago 33 /* new in 1.10 */
301 # define rtfENoteNumArabic 34 /* new in 1.10 */
302 # define rtfENoteNumLLetter 35 /* new in 1.10 */
303 # define rtfENoteNumULetter 36 /* new in 1.10 */
304 # define rtfENoteNumLRoman 37 /* new in 1.10 */
305 # define rtfENoteNumURoman 38 /* new in 1.10 */
306 # define rtfENoteNumChicago 39 /* new in 1.10 */
307 # define rtfPaperWidth 40
308 # define rtfPaperHeight 41
309 # define rtfPaperSize 42 /* new in 1.10 */
310 # define rtfLeftMargin 43
311 # define rtfRightMargin 44
312 # define rtfTopMargin 45
313 # define rtfBottomMargin 46
314 # define rtfFacingPage 47
315 # define rtfGutterWid 48
316 # define rtfMirrorMargin 49
317 # define rtfLandscape 50
318 # define rtfPageStart 51
319 # define rtfWidowCtrl 52
320 # define rtfLinkStyles 53 /* new in 1.10 */
321 # define rtfNoAutoTabIndent 54 /* new in 1.10 */
322 # define rtfWrapSpaces 55 /* new in 1.10 */
323 # define rtfPrintColorsBlack 56 /* new in 1.10 */
324 # define rtfNoExtraSpaceRL 57 /* new in 1.10 */
325 # define rtfNoColumnBalance 58 /* new in 1.10 */
326 # define rtfCvtMailMergeQuote 59 /* new in 1.10 */
327 # define rtfSuppressTopSpace 60 /* new in 1.10 */
328 # define rtfSuppressPreParSpace 61 /* new in 1.10 */
329 # define rtfCombineTblBorders 62 /* new in 1.10 */
330 # define rtfTranspMetafiles 63 /* new in 1.10 */
331 # define rtfSwapBorders 64 /* new in 1.10 */
332 # define rtfShowHardBreaks 65 /* new in 1.10 */
333 # define rtfFormProtected 66 /* new in 1.10 */
334 # define rtfAllProtected 67 /* new in 1.10 */
335 # define rtfFormShading 68 /* new in 1.10 */
336 # define rtfFormDisplay 69 /* new in 1.10 */
337 # define rtfPrintData 70 /* new in 1.10 */
338 # define rtfRevProtected 71 /* new in 1.10 */
339 # define rtfRevisions 72
340 # define rtfRevDisplay 73
341 # define rtfRevBar 74
342 # define rtfAnnotProtected 75 /* new in 1.10 */
343 # define rtfRTLDoc 76 /* new in 1.10 */
344 # define rtfLTRDoc 77 /* new in 1.10 */
345 # define rtfAnsiCodePage 78
346 # define rtfUTF8RTF 79
347
348 # define rtfSectAttr 9
349 # define rtfSectDef 0
350 # define rtfENoteHere 1
351 # define rtfPrtBinFirst 2
352 # define rtfPrtBin 3
353 # define rtfSectStyleNum 4 /* new in 1.10 */
354 # define rtfNoBreak 5
355 # define rtfColBreak 6
356 # define rtfPageBreak 7
357 # define rtfEvenBreak 8
358 # define rtfOddBreak 9
359 # define rtfColumns 10
360 # define rtfColumnSpace 11
361 # define rtfColumnNumber 12 /* new in 1.10 */
362 # define rtfColumnSpRight 13 /* new in 1.10 */
363 # define rtfColumnWidth 14 /* new in 1.10 */
364 # define rtfColumnLine 15
365 # define rtfLineModulus 16
366 # define rtfLineDist 17
367 # define rtfLineStarts 18
368 # define rtfLineRestart 19
369 # define rtfLineRestartPg 20
370 # define rtfLineCont 21
371 # define rtfSectPageWid 22
372 # define rtfSectPageHt 23
373 # define rtfSectMarginLeft 24
374 # define rtfSectMarginRight 25
375 # define rtfSectMarginTop 26
376 # define rtfSectMarginBottom 27
377 # define rtfSectMarginGutter 28
378 # define rtfSectLandscape 29
379 # define rtfTitleSpecial 30
380 # define rtfHeaderY 31
381 # define rtfFooterY 32
382 # define rtfPageStarts 33
383 # define rtfPageCont 34
384 # define rtfPageRestart 35
385 # define rtfPageNumRight 36 /* renamed in 1.10 */
386 # define rtfPageNumTop 37
387 # define rtfPageDecimal 38
388 # define rtfPageURoman 39
389 # define rtfPageLRoman 40
390 # define rtfPageULetter 41
391 # define rtfPageLLetter 42
392 # define rtfPageNumHyphSep 43 /* new in 1.10 */
393 # define rtfPageNumSpaceSep 44 /* new in 1.10 */
394 # define rtfPageNumColonSep 45 /* new in 1.10 */
395 # define rtfPageNumEmdashSep 46 /* new in 1.10 */
396 # define rtfPageNumEndashSep 47 /* new in 1.10 */
397 # define rtfTopVAlign 48
398 # define rtfBottomVAlign 49
399 # define rtfCenterVAlign 50
400 # define rtfJustVAlign 51
401 # define rtfRTLSect 52 /* new in 1.10 */
402 # define rtfLTRSect 53 /* new in 1.10 */
403
404 # define rtfTblAttr 10
405 # define rtfRowDef 0
406 # define rtfRowGapH 1
407 # define rtfCellPos 2
408 # define rtfMergeRngFirst 3
409 # define rtfMergePrevious 4
410 # define rtfRowLeft 5
411 # define rtfRowRight 6
412 # define rtfRowCenter 7
413 # define rtfRowLeftEdge 8
414 # define rtfRowHt 9
415 # define rtfRowHeader 10 /* new in 1.10 */
416 # define rtfRowKeep 11 /* new in 1.10 */
417 # define rtfRTLRow 12 /* new in 1.10 */
418 # define rtfLTRRow 13 /* new in 1.10 */
419 # define rtfRowBordTop 14 /* new in 1.10 */
420 # define rtfRowBordLeft 15 /* new in 1.10 */
421 # define rtfRowBordBottom 16 /* new in 1.10 */
422 # define rtfRowBordRight 17 /* new in 1.10 */
423 # define rtfRowBordHoriz 18 /* new in 1.10 */
424 # define rtfRowBordVert 19 /* new in 1.10 */
425 # define rtfCellBordBottom 20
426 # define rtfCellBordTop 21
427 # define rtfCellBordLeft 22
428 # define rtfCellBordRight 23
429 # define rtfCellShading 24
430 # define rtfCellBgPatH 25
431 # define rtfCellBgPatV 26
432 # define rtfCellFwdDiagBgPat 27
433 # define rtfCellBwdDiagBgPat 28
434 # define rtfCellHatchBgPat 29
435 # define rtfCellDiagHatchBgPat 30
436 # define rtfCellDarkBgPatH 31
437 # define rtfCellDarkBgPatV 32
438 # define rtfCellFwdDarkBgPat 33
439 # define rtfCellBwdDarkBgPat 34
440 # define rtfCellDarkHatchBgPat 35
441 # define rtfCellDarkDiagHatchBgPat 36
442 # define rtfCellBgPatLineColor 37
443 # define rtfCellBgPatColor 38
444
445 # define rtfParAttr 11
446 # define rtfParDef 0
447 # define rtfStyleNum 1
448 # define rtfHyphenate 2 /* new in 1.10 */
449 # define rtfInTable 3
450 # define rtfKeep 4
451 # define rtfNoWidowControl 5 /* new in 1.10 */
452 # define rtfKeepNext 6
453 # define rtfOutlineLevel 7 /* new in 1.10 */
454 # define rtfNoLineNum 8
455 # define rtfPBBefore 9
456 # define rtfSideBySide 10
457 # define rtfQuadLeft 11
458 # define rtfQuadRight 12
459 # define rtfQuadJust 13
460 # define rtfQuadCenter 14
461 # define rtfFirstIndent 15
462 # define rtfLeftIndent 16
463 # define rtfRightIndent 17
464 # define rtfSpaceBefore 18
465 # define rtfSpaceAfter 19
466 # define rtfSpaceBetween 20
467 # define rtfSpaceMultiply 21 /* new in 1.10 */
468 # define rtfSubDocument 22 /* new in 1.10 */
469 # define rtfRTLPar 23 /* new in 1.10 */
470 # define rtfLTRPar 24 /* new in 1.10 */
471 # define rtfTabPos 25
472 # define rtfTabLeft 26 /* new in 1.10 */
473 # define rtfTabRight 27
474 # define rtfTabCenter 28
475 # define rtfTabDecimal 29
476 # define rtfTabBar 30
477 # define rtfLeaderDot 31
478 # define rtfLeaderHyphen 32
479 # define rtfLeaderUnder 33
480 # define rtfLeaderThick 34
481 # define rtfLeaderEqual 35
482 # define rtfParLevel 36 /* new in 1.10 */
483 # define rtfParBullet 37 /* new in 1.10 */
484 # define rtfParSimple 38 /* new in 1.10 */
485 # define rtfParNumCont 39 /* new in 1.10 */
486 # define rtfParNumOnce 40 /* new in 1.10 */
487 # define rtfParNumAcross 41 /* new in 1.10 */
488 # define rtfParHangIndent 42 /* new in 1.10 */
489 # define rtfParNumRestart 43 /* new in 1.10 */
490 # define rtfParNumCardinal 44 /* new in 1.10 */
491 # define rtfParNumDecimal 45 /* new in 1.10 */
492 # define rtfParNumULetter 46 /* new in 1.10 */
493 # define rtfParNumURoman 47 /* new in 1.10 */
494 # define rtfParNumLLetter 48 /* new in 1.10 */
495 # define rtfParNumLRoman 49 /* new in 1.10 */
496 # define rtfParNumOrdinal 50 /* new in 1.10 */
497 # define rtfParNumOrdinalText 51 /* new in 1.10 */
498 # define rtfParNumBold 52 /* new in 1.10 */
499 # define rtfParNumItalic 53 /* new in 1.10 */
500 # define rtfParNumAllCaps 54 /* new in 1.10 */
501 # define rtfParNumSmallCaps 55 /* new in 1.10 */
502 # define rtfParNumUnder 56 /* new in 1.10 */
503 # define rtfParNumDotUnder 57 /* new in 1.10 */
504 # define rtfParNumDbUnder 58 /* new in 1.10 */
505 # define rtfParNumNoUnder 59 /* new in 1.10 */
506 # define rtfParNumWordUnder 60 /* new in 1.10 */
507 # define rtfParNumStrikethru 61 /* new in 1.10 */
508 # define rtfParNumForeColor 62 /* new in 1.10 */
509 # define rtfParNumFont 63 /* new in 1.10 */
510 # define rtfParNumFontSize 64 /* new in 1.10 */
511 # define rtfParNumIndent 65 /* new in 1.10 */
512 # define rtfParNumSpacing 66 /* new in 1.10 */
513 # define rtfParNumInclPrev 67 /* new in 1.10 */
514 # define rtfParNumCenter 68 /* new in 1.10 */
515 # define rtfParNumLeft 69 /* new in 1.10 */
516 # define rtfParNumRight 70 /* new in 1.10 */
517 # define rtfParNumStartAt 71 /* new in 1.10 */
518 # define rtfBorderTop 72
519 # define rtfBorderBottom 73
520 # define rtfBorderLeft 74
521 # define rtfBorderRight 75
522 # define rtfBorderBetween 76
523 # define rtfBorderBar 77
524 # define rtfBorderBox 78
525 # define rtfBorderSingle 79
526 # define rtfBorderThick 80
527 # define rtfBorderShadow 81
528 # define rtfBorderDouble 82
529 # define rtfBorderDot 83
530 # define rtfBorderDash 84 /* new in 1.10 */
531 # define rtfBorderHair 85
532 # define rtfBorderWidth 86
533 # define rtfBorderColor 87
534 # define rtfBorderSpace 88
535 # define rtfShading 89
536 # define rtfBgPatH 90
537 # define rtfBgPatV 91
538 # define rtfFwdDiagBgPat 92
539 # define rtfBwdDiagBgPat 93
540 # define rtfHatchBgPat 94
541 # define rtfDiagHatchBgPat 95
542 # define rtfDarkBgPatH 96
543 # define rtfDarkBgPatV 97
544 # define rtfFwdDarkBgPat 98
545 # define rtfBwdDarkBgPat 99
546 # define rtfDarkHatchBgPat 100
547 # define rtfDarkDiagHatchBgPat 101
548 # define rtfBgPatLineColor 102
549 # define rtfBgPatColor 103
550 # define rtfNestLevel 104
551
552 # define rtfCharAttr 12
553 # define rtfPlain 0
554 # define rtfBold 1
555 # define rtfAllCaps 2
556 # define rtfDeleted 3
557 # define rtfSubScript 4
558 # define rtfSubScrShrink 5 /* new in 1.10 */
559 # define rtfNoSuperSub 6 /* new in 1.10 */
560 # define rtfExpand 7
561 # define rtfExpandTwips 8 /* new in 1.10 */
562 # define rtfKerning 9 /* new in 1.10 */
563 # define rtfFontNum 10
564 # define rtfFontSize 11
565 # define rtfItalic 12
566 # define rtfOutline 13
567 # define rtfRevised 14
568 # define rtfRevAuthor 15 /* new in 1.10 */
569 # define rtfRevDTTM 16 /* new in 1.10 */
570 # define rtfSmallCaps 17
571 # define rtfShadow 18
572 # define rtfStrikeThru 19
573 # define rtfUnderline 20
574 # define rtfDotUnderline 21 /* renamed in 1.10 */
575 # define rtfDbUnderline 22
576 # define rtfNoUnderline 23
577 # define rtfWordUnderline 24 /* renamed in 1.10 */
578 # define rtfSuperScript 25
579 # define rtfSuperScrShrink 26 /* new in 1.10 */
580 # define rtfInvisible 27
581 # define rtfForeColor 28
582 # define rtfBackColor 29
583 # define rtfRTLChar 30 /* new in 1.10 */
584 # define rtfLTRChar 31 /* new in 1.10 */
585 # define rtfCharStyleNum 32 /* new in 1.10 */
586 # define rtfCharCharSet 33 /* new in 1.10 */
587 # define rtfLanguage 34
588 # define rtfGray 35
589 # define rtfUnicodeLength 36
590
591 # define rtfPictAttr 13
592 # define rtfMacQD 0
593 # define rtfPMMetafile 1
594 # define rtfWinMetafile 2
595 # define rtfDevIndBitmap 3
596 # define rtfWinBitmap 4
597 # define rtfEmfBlip 5
598 # define rtfPixelBits 6
599 # define rtfBitmapPlanes 7
600 # define rtfBitmapWid 8
601 # define rtfPicWid 9
602 # define rtfPicHt 10
603 # define rtfPicGoalWid 11
604 # define rtfPicGoalHt 12
605 # define rtfPicScaleX 13
606 # define rtfPicScaleY 14
607 # define rtfPicScaled 15
608 # define rtfPicCropTop 16
609 # define rtfPicCropBottom 17
610 # define rtfPicCropLeft 18
611 # define rtfPicCropRight 19
612 # define rtfPicMFHasBitmap 20 /* new in 1.10 */
613 # define rtfPicMFBitsPerPixel 21 /* new in 1.10 */
614 # define rtfPicBinary 22
615
616 # define rtfBookmarkAttr 14
617 # define rtfBookmarkFirstCol 0
618 # define rtfBookmarkLastCol 1
619
620 # define rtfNeXTGrAttr 15
621 # define rtfNeXTGWidth 0
622 # define rtfNeXTGHeight 1
623
624 # define rtfFieldAttr 16
625 # define rtfFieldDirty 0
626 # define rtfFieldEdited 1
627 # define rtfFieldLocked 2
628 # define rtfFieldPrivate 3
629 # define rtfFieldAlt 4 /* new in 1.10 */
630
631 # define rtfTOCAttr 17
632 # define rtfTOCType 0
633 # define rtfTOCLevel 1
634
635 # define rtfPosAttr 18
636 # define rtfAbsWid 0
637 # define rtfAbsHt 1
638 # define rtfRPosMargH 2
639 # define rtfRPosPageH 3
640 # define rtfRPosColH 4
641 # define rtfPosX 5
642 # define rtfPosNegX 6 /* new in 1.10 */
643 # define rtfPosXCenter 7
644 # define rtfPosXInside 8
645 # define rtfPosXOutSide 9
646 # define rtfPosXRight 10
647 # define rtfPosXLeft 11
648 # define rtfRPosMargV 12
649 # define rtfRPosPageV 13
650 # define rtfRPosParaV 14
651 # define rtfPosY 15
652 # define rtfPosNegY 16 /* new in 1.10 */
653 # define rtfPosYInline 17
654 # define rtfPosYTop 18
655 # define rtfPosYCenter 19
656 # define rtfPosYBottom 20
657 # define rtfNoWrap 21
658 # define rtfDistFromTextAll 22 /* renamed in 1.10 */
659 # define rtfDistFromTextX 23 /* new in 1.10 */
660 # define rtfDistFromTextY 24 /* new in 1.10 */
661 # define rtfTextDistY 25
662 # define rtfDropCapLines 26 /* new in 1.10 */
663 # define rtfDropCapType 27 /* new in 1.10 */
664
665 # define rtfObjAttr 19
666 # define rtfObjEmb 0
667 # define rtfObjLink 1
668 # define rtfObjAutoLink 2
669 # define rtfObjSubscriber 3
670 # define rtfObjPublisher 4 /* new in 1.10 */
671 # define rtfObjICEmb 5
672 # define rtfObjLinkSelf 6
673 # define rtfObjLock 7
674 # define rtfObjUpdate 8 /* new in 1.10 */
675 # define rtfObjHt 9
676 # define rtfObjWid 10
677 # define rtfObjSetSize 11
678 # define rtfObjAlign 12 /* new in 1.10 */
679 # define rtfObjTransposeY 13
680 # define rtfObjCropTop 14
681 # define rtfObjCropBottom 15
682 # define rtfObjCropLeft 16
683 # define rtfObjCropRight 17
684 # define rtfObjScaleX 18
685 # define rtfObjScaleY 19
686 # define rtfObjResRTF 20
687 # define rtfObjResPict 21
688 # define rtfObjResBitmap 22
689 # define rtfObjResText 23
690 # define rtfObjResMerge 24
691 # define rtfObjBookmarkPubObj 25
692 # define rtfObjPubAutoUpdate 26
693
694 # define rtfFNoteAttr 20 /* new in 1.10 */
695 # define rtfFNAlt 0 /* new in 1.10 */
696
697 # define rtfKeyCodeAttr 21 /* new in 1.10 */
698 # define rtfAltKey 0 /* new in 1.10 */
699 # define rtfShiftKey 1 /* new in 1.10 */
700 # define rtfControlKey 2 /* new in 1.10 */
701 # define rtfFunctionKey 3 /* new in 1.10 */
702
703 # define rtfACharAttr 22 /* new in 1.10 */
704 # define rtfACBold 0 /* new in 1.10 */
705 # define rtfACAllCaps 1 /* new in 1.10 */
706 # define rtfACForeColor 2 /* new in 1.10 */
707 # define rtfACSubScript 3 /* new in 1.10 */
708 # define rtfACExpand 4 /* new in 1.10 */
709 # define rtfACFontNum 5 /* new in 1.10 */
710 # define rtfACFontSize 6 /* new in 1.10 */
711 # define rtfACItalic 7 /* new in 1.10 */
712 # define rtfACLanguage 8 /* new in 1.10 */
713 # define rtfACOutline 9 /* new in 1.10 */
714 # define rtfACSmallCaps 10 /* new in 1.10 */
715 # define rtfACShadow 11 /* new in 1.10 */
716 # define rtfACStrikeThru 12 /* new in 1.10 */
717 # define rtfACUnderline 13 /* new in 1.10 */
718 # define rtfACDotUnderline 14 /* new in 1.10 */
719 # define rtfACDbUnderline 15 /* new in 1.10 */
720 # define rtfACNoUnderline 16 /* new in 1.10 */
721 # define rtfACWordUnderline 17 /* new in 1.10 */
722 # define rtfACSuperScript 18 /* new in 1.10 */
723
724 # define rtfFontAttr 23 /* new in 1.10 */
725 # define rtfFontCharSet 0 /* new in 1.10 */
726 # define rtfFontPitch 1 /* new in 1.10 */
727 # define rtfFontCodePage 2 /* new in 1.10 */
728 # define rtfFTypeNil 3 /* new in 1.10 */
729 # define rtfFTypeTrueType 4 /* new in 1.10 */
730
731 # define rtfFileAttr 24 /* new in 1.10 */
732 # define rtfFileNum 0 /* new in 1.10 */
733 # define rtfFileRelPath 1 /* new in 1.10 */
734 # define rtfFileOSNum 2 /* new in 1.10 */
735
736 # define rtfFileSource 25 /* new in 1.10 */
737 # define rtfSrcMacintosh 0 /* new in 1.10 */
738 # define rtfSrcDOS 1 /* new in 1.10 */
739 # define rtfSrcNTFS 2 /* new in 1.10 */
740 # define rtfSrcHPFS 3 /* new in 1.10 */
741 # define rtfSrcNetwork 4 /* new in 1.10 */
742
743 /*
744 * Drawing attributes
745 */
746
747 # define rtfDrawAttr 26 /* new in 1.10 */
748 # define rtfDrawLock 0 /* new in 1.10 */
749 # define rtfDrawPageRelX 1 /* new in 1.10 */
750 # define rtfDrawColumnRelX 2 /* new in 1.10 */
751 # define rtfDrawMarginRelX 3 /* new in 1.10 */
752 # define rtfDrawPageRelY 4 /* new in 1.10 */
753 # define rtfDrawColumnRelY 5 /* new in 1.10 */
754 # define rtfDrawMarginRelY 6 /* new in 1.10 */
755 # define rtfDrawHeight 7 /* new in 1.10 */
756
757 # define rtfDrawBeginGroup 8 /* new in 1.10 */
758 # define rtfDrawGroupCount 9 /* new in 1.10 */
759 # define rtfDrawEndGroup 10 /* new in 1.10 */
760 # define rtfDrawArc 11 /* new in 1.10 */
761 # define rtfDrawCallout 12 /* new in 1.10 */
762 # define rtfDrawEllipse 13 /* new in 1.10 */
763 # define rtfDrawLine 14 /* new in 1.10 */
764 # define rtfDrawPolygon 15 /* new in 1.10 */
765 # define rtfDrawPolyLine 16 /* new in 1.10 */
766 # define rtfDrawRect 17 /* new in 1.10 */
767 # define rtfDrawTextBox 18 /* new in 1.10 */
768
769 # define rtfDrawOffsetX 19 /* new in 1.10 */
770 # define rtfDrawSizeX 20 /* new in 1.10 */
771 # define rtfDrawOffsetY 21 /* new in 1.10 */
772 # define rtfDrawSizeY 22 /* new in 1.10 */
773
774 # define rtfCOAngle 23 /* new in 1.10 */
775 # define rtfCOAccentBar 24 /* new in 1.10 */
776 # define rtfCOBestFit 25 /* new in 1.10 */
777 # define rtfCOBorder 26 /* new in 1.10 */
778 # define rtfCOAttachAbsDist 27 /* new in 1.10 */
779 # define rtfCOAttachBottom 28 /* new in 1.10 */
780 # define rtfCOAttachCenter 29 /* new in 1.10 */
781 # define rtfCOAttachTop 30 /* new in 1.10 */
782 # define rtfCOLength 31 /* new in 1.10 */
783 # define rtfCONegXQuadrant 32 /* new in 1.10 */
784 # define rtfCONegYQuadrant 33 /* new in 1.10 */
785 # define rtfCOOffset 34 /* new in 1.10 */
786 # define rtfCOAttachSmart 35 /* new in 1.10 */
787 # define rtfCODoubleLine 36 /* new in 1.10 */
788 # define rtfCORightAngle 37 /* new in 1.10 */
789 # define rtfCOSingleLine 38 /* new in 1.10 */
790 # define rtfCOTripleLine 39 /* new in 1.10 */
791
792 # define rtfDrawTextBoxMargin 40 /* new in 1.10 */
793 # define rtfDrawTextBoxText 41 /* new in 1.10 */
794 # define rtfDrawRoundRect 42 /* new in 1.10 */
795
796 # define rtfDrawPointX 43 /* new in 1.10 */
797 # define rtfDrawPointY 44 /* new in 1.10 */
798 # define rtfDrawPolyCount 45 /* new in 1.10 */
799
800 # define rtfDrawArcFlipX 46 /* new in 1.10 */
801 # define rtfDrawArcFlipY 47 /* new in 1.10 */
802
803 # define rtfDrawLineBlue 48 /* new in 1.10 */
804 # define rtfDrawLineGreen 49 /* new in 1.10 */
805 # define rtfDrawLineRed 50 /* new in 1.10 */
806 # define rtfDrawLinePalette 51 /* new in 1.10 */
807 # define rtfDrawLineDashDot 52 /* new in 1.10 */
808 # define rtfDrawLineDashDotDot 53 /* new in 1.10 */
809 # define rtfDrawLineDash 54 /* new in 1.10 */
810 # define rtfDrawLineDot 55 /* new in 1.10 */
811 # define rtfDrawLineGray 56 /* new in 1.10 */
812 # define rtfDrawLineHollow 57 /* new in 1.10 */
813 # define rtfDrawLineSolid 58 /* new in 1.10 */
814 # define rtfDrawLineWidth 59 /* new in 1.10 */
815
816 # define rtfDrawHollowEndArrow 60 /* new in 1.10 */
817 # define rtfDrawEndArrowLength 61 /* new in 1.10 */
818 # define rtfDrawSolidEndArrow 62 /* new in 1.10 */
819 # define rtfDrawEndArrowWidth 63 /* new in 1.10 */
820 # define rtfDrawHollowStartArrow 64 /* new in 1.10 */
821 # define rtfDrawStartArrowLength 65 /* new in 1.10 */
822 # define rtfDrawSolidStartArrow 66 /* new in 1.10 */
823 # define rtfDrawStartArrowWidth 67 /* new in 1.10 */
824
825 # define rtfDrawBgFillBlue 68 /* new in 1.10 */
826 # define rtfDrawBgFillGreen 69 /* new in 1.10 */
827 # define rtfDrawBgFillRed 70 /* new in 1.10 */
828 # define rtfDrawBgFillPalette 71 /* new in 1.10 */
829 # define rtfDrawBgFillGray 72 /* new in 1.10 */
830 # define rtfDrawFgFillBlue 73 /* new in 1.10 */
831 # define rtfDrawFgFillGreen 74 /* new in 1.10 */
832 # define rtfDrawFgFillRed 75 /* new in 1.10 */
833 # define rtfDrawFgFillPalette 76 /* new in 1.10 */
834 # define rtfDrawFgFillGray 77 /* new in 1.10 */
835 # define rtfDrawFillPatIndex 78 /* new in 1.10 */
836
837 # define rtfDrawShadow 79 /* new in 1.10 */
838 # define rtfDrawShadowXOffset 80 /* new in 1.10 */
839 # define rtfDrawShadowYOffset 81 /* new in 1.10 */
840
841 /*
842 * index entry attributes
843 */
844
845 # define rtfIndexAttr 27 /* new in 1.10 */
846 # define rtfIndexNumber 0 /* new in 1.10 */
847 # define rtfIndexBold 1 /* reclassified in 1.10 */
848 # define rtfIndexItalic 2 /* reclassified in 1.10 */
849
850
851 /*
852 * \wmetafile argument values
853 */
854
855 # define rtfWmMmText 1
856 # define rtfWmMmLometric 2
857 # define rtfWmMmHimetric 3
858 # define rtfWmMmLoenglish 4
859 # define rtfWmMmHienglish 5
860 # define rtfWmMmTwips 6
861 # define rtfWmMmIsotropic 7
862 # define rtfWmMmAnisotropic 8
863
864 /*
865 * \pmmetafile argument values
866 */
867
868 # define rtfPmPuArbitrary 4
869 # define rtfPmPuPels 8
870 # define rtfPmPuLometric 12
871 # define rtfPmPuHimetric 16
872 # define rtfPmPuLoenglish 20
873 # define rtfPmPuHienglish 24
874 # define rtfPmPuTwips 28
875
876 /*
877 * \lang argument values
878 */
879
880 # define rtfLangNoLang 0x0400
881 # define rtfLangAlbanian 0x041c
882 # define rtfLangArabic 0x0401
883 # define rtfLangBahasa 0x0421
884 # define rtfLangBelgianDutch 0x0813
885 # define rtfLangBelgianFrench 0x080c
886 # define rtfLangBrazilianPortuguese 0x0416
887 # define rtfLangBulgarian 0x0402
888 # define rtfLangCatalan 0x0403
889 # define rtfLangLatinCroatoSerbian 0x041a
890 # define rtfLangCzech 0x0405
891 # define rtfLangDanish 0x0406
892 # define rtfLangDutch 0x0413
893 # define rtfLangAustralianEnglish 0x0c09
894 # define rtfLangUKEnglish 0x0809
895 # define rtfLangUSEnglish 0x0409
896 # define rtfLangFinnish 0x040b
897 # define rtfLangFrench 0x040c
898 # define rtfLangCanadianFrench 0x0c0c
899 # define rtfLangGerman 0x0407
900 # define rtfLangGreek 0x0408
901 # define rtfLangHebrew 0x040d
902 # define rtfLangHungarian 0x040e
903 # define rtfLangIcelandic 0x040f
904 # define rtfLangItalian 0x0410
905 # define rtfLangJapanese 0x0411
906 # define rtfLangKorean 0x0412
907 # define rtfLangBokmalNorwegian 0x0414
908 # define rtfLangNynorskNorwegian 0x0814
909 # define rtfLangPolish 0x0415
910 # define rtfLangPortuguese 0x0816
911 # define rtfLangRhaetoRomanic 0x0417
912 # define rtfLangRomanian 0x0418
913 # define rtfLangRussian 0x0419
914 # define rtfLangCyrillicSerboCroatian 0x081a
915 # define rtfLangSimplifiedChinese 0x0804
916 # define rtfLangSlovak 0x041b
917 # define rtfLangCastilianSpanish 0x040a
918 # define rtfLangMexicanSpanish 0x080a
919 # define rtfLangSwedish 0x041d
920 # define rtfLangSwissFrench 0x100c
921 # define rtfLangSwissGerman 0x0807
922 # define rtfLangSwissItalian 0x0810
923 # define rtfLangThai 0x041e
924 # define rtfLangTraditionalChinese 0x0404
925 # define rtfLangTurkish 0x041f
926 # define rtfLangUrdu 0x0420
927
928 /*
929 * Style types
930 */
931
932 # define rtfParStyle 0 /* the default */
933 # define rtfCharStyle 1
934 # define rtfSectStyle 2
935
936 /*
937 * RTF font, color and style structures. Used for font table,
938 * color table, and stylesheet processing.
939 */
940
941 typedef struct RTFFont RTFFont;
942 typedef struct RTFColor RTFColor;
943 typedef struct RTFStyle RTFStyle;
944 typedef struct RTFStyleElt RTFStyleElt;
945 typedef struct RTFBorder RTFBorder;
946 typedef struct RTFCell RTFCell;
947 typedef struct RTFTable RTFTable;
948
949 struct RTFFont
950 {
951 char *rtfFName; /* font name */
952 char *rtfFAltName; /* font alternate name */
953 int rtfFNum; /* font number */
954 int rtfFFamily; /* font family */
955 int rtfFCharSet; /* font charset */
956 int rtfFPitch; /* font pitch */
957 int rtfFType; /* font type */
958 int rtfFCodePage; /* font code page */
959 RTFFont *rtfNextFont; /* next font in list */
960 };
961
962
963 /*
964 * Color values are -1 if the default color for the color
965 * number should be used. The default color is writer-dependent.
966 */
967
968 struct RTFColor
969 {
970 int rtfCNum; /* color number */
971 int rtfCRed; /* red value */
972 int rtfCGreen; /* green value */
973 int rtfCBlue; /* blue value */
974 RTFColor *rtfNextColor; /* next color in list */
975 };
976
977
978 struct RTFStyle
979 {
980 char *rtfSName; /* style name */
981 int rtfSType; /* style type */
982 int rtfSAdditive; /* whether or not style is additive */
983 int rtfSNum; /* style number */
984 int rtfSBasedOn; /* style this one's based on */
985 int rtfSNextPar; /* style next paragraph style */
986 RTFStyleElt *rtfSSEList; /* list of style words */
987 int rtfExpanding; /* non-zero = being expanded */
988 RTFStyle *rtfNextStyle; /* next style in style list */
989 };
990
991
992 struct RTFStyleElt
993 {
994 int rtfSEClass; /* token class */
995 int rtfSEMajor; /* token major number */
996 int rtfSEMinor; /* token minor number */
997 int rtfSEParam; /* control symbol parameter */
998 char *rtfSEText; /* text of symbol */
999 RTFStyleElt *rtfNextSE; /* next element in style */
1000 };
1001
1002 struct RTFBorder
1003 {
1004 int width;
1005 int color;
1006 };
1007
1008 struct RTFCell
1009 {
1010 int rightBoundary;
1011 RTFBorder border[4];
1012 };
1013
1014
1015 struct RTFTable
1016 {
1017 RTFCell cells[MAX_TABLE_CELLS];
1018 int numCellsDefined;
1019
1020 int gapH, leftEdge;
1021 /* borders for the table row */
1022 RTFBorder border[6];
1023
1024 /* Used in v1.0 - v3.0 */
1025 int numCellsInserted;
1026
1027 /* v4.1 */
1028 /* tableRowStart may be the start row paragraph of the table row,
1029 * or it may store the end of the previous row if it may still be
1030 * continued, otherwise NULL is stored. */
1031 ME_DisplayItem *tableRowStart;
1032
1033 /* Table definitions are stored as a stack to support nested tables. */
1034 RTFTable *parent;
1035 };
1036
1037
1038 # define RTFBorderTypeNone 0x00
1039 # define RTFBorderTypePara 0x10 /* for \brdrX control words */
1040 # define RTFBorderTypeRow 0x20 /* for \trbrdrX control words */
1041 # define RTFBorderTypeCell 0x30 /* for \clbrdrX control words */
1042 # define RTFBorderTypeMask 0xf0
1043
1044 /* The X in the control words \brdrX \trbrdrX and \clbrdrX mentioned above
1045 * should be one of t, l, b, r which stand for top, left, bottom, right
1046 * respectively. */
1047 # define RTFBorderSideTop 0x00
1048 # define RTFBorderSideLeft 0x01
1049 # define RTFBorderSideBottom 0x02
1050 # define RTFBorderSideRight 0x03
1051 # define RTFBorderSideHorizontal 0x04
1052 # define RTFBorderSideVertical 0x05
1053 # define RTFBorderSideMask 0x0f
1054
1055 /* Here are the values from the border types and sides put together. */
1056 # define RTFBorderParaTop 0x10
1057 # define RTFBorderParaLeft 0x11
1058 # define RTFBorderParaBottom 0x12
1059 # define RTFBorderParaRight 0x13
1060 # define RTFBorderRowTop 0x20
1061 # define RTFBorderRowLeft 0x21
1062 # define RTFBorderRowBottom 0x22
1063 # define RTFBorderRowRight 0x23
1064 # define RTFBorderRowHorizontal 0x24
1065 # define RTFBorderRowVertical 0x25
1066 # define RTFBorderCellTop 0x30
1067 # define RTFBorderCellLeft 0x31
1068 # define RTFBorderCellBottom 0x32
1069 # define RTFBorderCellRight 0x33
1070
1071 /*
1072 * Return pointer to new element of type t, or NULL
1073 * if no memory available.
1074 */
1075
1076 # define New(t) (heap_alloc (sizeof (t)))
1077
1078 /* Parser stack size */
1079
1080 # define maxStack 32
1081
1082 struct _RTF_Info;
1083 typedef struct _RTF_Info RTF_Info;
1084
1085 typedef void (*RTFFuncPtr) (RTF_Info *); /* generic function pointer */
1086
1087
1088 /* RTF parser stack element */
1089 struct tagRTFState {
1090 ME_Style *style;
1091 int codePage;
1092 int unicodeLength;
1093 };
1094 typedef struct tagRTFState RTFState;
1095
1096
1097 struct _RTF_Info {
1098 /*
1099 * Public variables (listed in rtf.h)
1100 */
1101
1102 /*
1103 * Information pertaining to last token read by RTFToken. The
1104 * text is exactly as it occurs in the input file, e.g., "\{"
1105 * will be found in rtfTextBuf as "\{", even though it means "{".
1106 * These variables are also set when styles are reprocessed.
1107 */
1108
1109 int rtfClass;
1110 int rtfMajor;
1111 int rtfMinor;
1112 int rtfParam;
1113 int rtfFormat;
1114 char *rtfTextBuf;
1115 int rtfTextLen;
1116
1117 int rtfLineNum;
1118 int rtfLinePos;
1119
1120
1121 /*
1122 * Private stuff
1123 */
1124
1125 int pushedChar; /* pushback char if read too far */
1126
1127 int pushedClass; /* pushed token info for RTFUngetToken() */
1128 int pushedMajor;
1129 int pushedMinor;
1130 int pushedParam;
1131 char *pushedTextBuf;
1132
1133 int prevChar;
1134 BOOL bumpLine;
1135
1136 /* Document-wide attributes */
1137 RTFFont *fontList; /* these lists MUST be */
1138 RTFColor *colorList; /* initialized to NULL */
1139 RTFStyle *styleList;
1140 int ansiCodePage; /* ANSI codepage used in conversion to Unicode */
1141 int defFont;
1142
1143 /* Character attributes */
1144 int unicodeLength; /* The length of ANSI representation of Unicode characters */
1145 int codePage; /* Current codepage for text conversion */
1146
1147 ME_InStream *stream;
1148
1149 ME_TextEditor *editor;
1150 ME_Style *style;
1151
1152 RTFFuncPtr ccb[rtfMaxClass]; /* class callbacks */
1153
1154 RTFFuncPtr dcb[rtfMaxDestination]; /* destination callbacks */
1155
1156 RTFFuncPtr readHook;
1157
1158 DWORD dwOutputCount;
1159 WCHAR OutputBuffer[0x1000];
1160
1161 DWORD dwCPOutputCount;
1162 DWORD dwMaxCPOutputCount;
1163 char *cpOutputBuffer;
1164
1165 RTFState stack[maxStack];
1166 int stackTop;
1167 BOOL styleChanged;
1168
1169 RTFTable *tableDef;
1170 int nestingLevel;
1171 BOOL canInheritInTbl;
1172 int borderType; /* value corresponds to the RTFBorder constants. */
1173
1174 PARAFORMAT2 fmt; /* Accumulated para fmt for current paragraph. */
1175 };
1176
1177
1178 /*
1179 * Public RTF reader routines
1180 */
1181
1182 void RTFInit (RTF_Info *) DECLSPEC_HIDDEN;
1183 void RTFDestroy(RTF_Info *info) DECLSPEC_HIDDEN;
1184 void RTFSetDestinationCallback (RTF_Info *, int, RTFFuncPtr) DECLSPEC_HIDDEN;
1185 void RTFRead (RTF_Info *) DECLSPEC_HIDDEN;
1186 int RTFGetToken (RTF_Info *) DECLSPEC_HIDDEN; /* writer should rarely need this */
1187 void RTFSetReadHook (RTF_Info *, RTFFuncPtr) DECLSPEC_HIDDEN;
1188 void RTFRouteToken (RTF_Info *) DECLSPEC_HIDDEN;
1189 void RTFSkipGroup (RTF_Info *) DECLSPEC_HIDDEN;
1190 void RTFReadGroup (RTF_Info *) DECLSPEC_HIDDEN;
1191 int RTFCheckCM (const RTF_Info *, int, int) DECLSPEC_HIDDEN;
1192 int RTFCheckCMM (const RTF_Info *, int, int, int) DECLSPEC_HIDDEN;
1193 int RTFCheckMM (const RTF_Info *, int, int) DECLSPEC_HIDDEN;
1194 RTFFont *RTFGetFont (const RTF_Info *, int) DECLSPEC_HIDDEN;
1195 RTFColor *RTFGetColor (const RTF_Info *, int) DECLSPEC_HIDDEN;
1196 int RTFCharToHex ( char) DECLSPEC_HIDDEN;
1197
1198 void RTFFlushOutputBuffer( RTF_Info *info ) DECLSPEC_HIDDEN;
1199 void RTFSetEditStream(RTF_Info *info, ME_InStream *stream) DECLSPEC_HIDDEN;
1200
1201 void WriterInit (RTF_Info *) DECLSPEC_HIDDEN;
1202 int BeginFile (RTF_Info *) DECLSPEC_HIDDEN;
1203
1204 int RTFCharSetToCodePage(RTF_Info *info, int charset) DECLSPEC_HIDDEN;
1205
1206 void LookupInit (void) DECLSPEC_HIDDEN;
1207 void LookupCleanup (void) DECLSPEC_HIDDEN;
1208
1209 #endif