Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

648 lines
16 KiB

  1. /*
  2. * @doc INTERNAL
  3. *
  4. * @module _TOKENS.H -- All the tokens and then some |
  5. *
  6. * Authors: <nl>
  7. * Original RichEdit 1.0 RTF converter: Anthony Francisco <nl>
  8. * Conversion to C++ and RichEdit 2.0: Murray Sargent
  9. *
  10. * @devnote
  11. * The Text Object Model (TOM) keywords come first followed by picture
  12. * and object keywords. The order within a group can matter, since it
  13. * may be used to simplify the input process. Token values <lt> 256
  14. * (tokenMin) are used for target character Unicodes as are token values
  15. * greater than tokenMax.
  16. *
  17. * Copyright (c) 1995-1998, Microsoft Corporation. All rights reserved.
  18. */
  19. #ifndef _TOKEN_H
  20. #define _TOKEN_H
  21. typedef WORD TOKEN;
  22. /*
  23. * Keyword --> Token table
  24. */
  25. typedef struct _keyword
  26. {
  27. CHAR * szKeyword; // The RTF keyword sans '\\'
  28. TOKEN token;
  29. } KEYWORD;
  30. // @enum TOKENS | RichEdit RTF Control Word Tokens
  31. enum TOKENS // Keyword tokens
  32. {
  33. // Tokens for internal use
  34. tokenMin = 256, // Lower tokens treated as Unicode chars
  35. tokenText = tokenMin, // A string of characters
  36. tokenASCIIText, // A string of characters with values <= 0x7F
  37. tokenUnknownKeyword, // A keyword we don't recognize
  38. tokenError, // Error condition token
  39. #ifdef UNUSED_TOKENS
  40. tokenUnknown, // Unknown token
  41. #endif
  42. tokenEOF, // End-of-file token
  43. tokenStartGroup, // Start group token
  44. tokenEndGroup, // End group token
  45. tokenObjectDataValue, // Data for object
  46. tokenPictureDataValue, // Data for picture
  47. // RTF control word tokens from here to end of enumeration
  48. tokenURtf, // @emem urtf
  49. tokenPocketWord, // @emem pwd
  50. tokenRtf, // @emem rtf
  51. tokenCharSetAnsi, // @emem ansi
  52. tokenAnsiCodePage, // @emem ansicpg
  53. tokenViewKind, // @emem viewkind
  54. tokenViewScale, // @emem viewscale
  55. tokenDefaultFont, // @emem deff
  56. tokenDefaultBiDiFont, // @emem adeff
  57. tokenDefaultLanguage, // @emem deflang
  58. tokenDefaultLanguageFE, // @emem deflangfe
  59. tokenDefaultTabWidth, // @emem deftab
  60. tokenParagraphDefault, // @emem pard
  61. tokenCharacterDefault, // @emem plain
  62. // Fonts
  63. tokenFontTable, // @emem fonttbl
  64. tokenFontSelect, // @emem f
  65. tokenAssocFontSelect, // @emem af
  66. // Keep next 8 in order
  67. tokenFontFamilyDefault, // @emem fnil
  68. tokenFontFamilyRoman, // @emem froman
  69. tokenFontFamilySwiss, // @emem fswiss
  70. tokenFontFamilyModern, // @emem fmodern
  71. tokenFontFamilyScript, // @emem fscript
  72. tokenFontFamilyDecorative, // @emem fdecor
  73. tokenFontFamilyTechnical, // @emem ftech
  74. tokenFontFamilyBidi, // @emem fbidi
  75. tokenCharSet, // @emem fcharset
  76. tokenPitch, // @emem fprq
  77. tokenRealFontName, // @emem fname
  78. tokenCodePage, // @emem cpg
  79. tokenFontSize, // @emem fs
  80. // Colors
  81. tokenColorTable, // @emem colortbl
  82. tokenColorBackground, // @emem highlight (used to be cb)
  83. tokenColorForeground, // @emem cf
  84. // Keep next 3 in order
  85. tokenColorRed, // @emem red
  86. tokenColorGreen, // @emem green
  87. tokenColorBlue, // @emem blue
  88. // Character formatting Keep next 15 effects in order
  89. tokenBold, // @emem b
  90. tokenItalic, // @emem i
  91. tokenUnderline, // @emem ul
  92. tokenStrikeOut, // @emem strike
  93. tokenProtect, // @emem protect
  94. tokenLink, // @emem link (check this...)
  95. tokenSmallCaps, // @emem scaps
  96. tokenCaps, // @emem caps
  97. tokenHiddenText, // @emem v
  98. tokenOutline, // @emem outl
  99. tokenShadow, // @emem shad
  100. tokenEmboss, // @emem embo
  101. tokenImprint, // @emem impr
  102. tokenDisabled, // @emem disabled
  103. tokenRevised, // @emem revised
  104. tokenDeleted, // @emem deleted
  105. tokenStopUnderline, // @emem ulnone Keep next 10 in order
  106. tokenUnderlineWord, // @emem ulw This thru uld are standard
  107. tokenUnderlineDouble, // @emem uldb Word underlines
  108. tokenUnderlineDotted, // @emem uld
  109. tokenUnderlineDash, // @emem uldash
  110. tokenUnderlineDashDotted, // @emem uldashd
  111. tokenUnderlineDashDotDotted, // @emem uldashdd
  112. tokenUnderlineWave, // @emem ulwave This down thru uldash are
  113. tokenUnderlineThick, // @emem ulth for FE
  114. tokenUnderlineHairline, // @emem ulhair
  115. tokenDown, // @emem dn
  116. tokenUp, // @emem up
  117. // Keep next 3 in order
  118. tokenSubscript, // @emem sub
  119. tokenNoSuperSub, // @emem nosupersub
  120. tokenSuperscript, // @emem super
  121. tokenAnimText, // @emem animtext
  122. tokenExpand, // @emem expndtw
  123. tokenKerning, // @emem kerning
  124. tokenLanguage, // @emem lang
  125. tokenCharStyle, // @emem cs
  126. // Paragraph Formatting
  127. tokenEndParagraph, // @emem par
  128. tokenLineBreak, // @emem line
  129. tokenIndentFirst, // @emem fi
  130. tokenIndentLeft, // @emem li
  131. tokenIndentRight, // @emem ri
  132. // Keep next 4 in order
  133. tokenAlignLeft, // @emem ql PFA_LEFT
  134. tokenAlignRight, // @emem qr PFA_RIGHT
  135. tokenAlignCenter, // @emem qc PFA_CENTER
  136. tokenAlignJustify, // @emem qj PFA_JUSTIFY
  137. tokenSpaceBefore, // @emem sb
  138. tokenSpaceAfter, // @emem sa
  139. tokenLineSpacing, // @emem sl
  140. tokenLineSpacingRule, // @emem slmult
  141. tokenDropCapLines, // @emem dropcapli
  142. tokenStyle, // @emem s
  143. tokenLToRPara, // @emem ltrpar
  144. tokenBox,
  145. // keep next 8 in order
  146. tokenRToLPara, // @emem rtlpar
  147. tokenKeep, // @emem keep
  148. tokenKeepNext, // @emem keepn
  149. tokenPageBreakBefore, // @emem pagebb
  150. tokenNoLineNumber, // @emem noline
  151. tokenNoWidCtlPar, // @emem nowidctlpar
  152. tokenHyphPar, // @emem hyphpar
  153. tokenSideBySide, // @emem sbys
  154. tokenCollapsed, // @emem collapsed
  155. // Keep following 8 together
  156. tokenBorderTop, // @emem brdrt
  157. tokenBorderLeft, // @emem brdrl
  158. tokenBorderBottom, // @emem brdrb
  159. tokenBorderRight, // @emem brdrr
  160. tokenCellBorderTop, // @emem clbrdrt
  161. tokenCellBorderLeft, // @emem clbrdrl
  162. tokenCellBorderBottom, // @emem clbrdrb
  163. tokenCellBorderRight, // @emem clbrdrr
  164. // Keep following 3 together
  165. tokenBorderShadow, // @emem brdrsh
  166. tokenBorderBetween, // @emem brdrbtw
  167. tokenBorderOutside, // @emem brdrbar
  168. // Keep following 8 together
  169. tokenBorderDash, // @emem brdrdash
  170. tokenBorderDashSmall, // @emem brdrdashsm
  171. tokenBorderDouble, // @emem brdrdb
  172. tokenBorderDot, // @emem brdrdot
  173. tokenBorderHairline, // @emem brdrhair
  174. tokenBorderSingleThick, // @emem brdrs
  175. tokenBorderDoubleThick, // @emem brdrth
  176. tokenBorderTriple, // @emem brdrtriple
  177. tokenBorderColor, // @emem brdrcf
  178. tokenBorderWidth, // @emem brdrw
  179. tokenBorderSpace, // @emem brsp
  180. tokenColorBckgrndPat, // @emem cbpat
  181. tokenColorForgrndPat, // @emem cfpat
  182. tokenShading, // @emem shading
  183. // keep next 12 in order
  184. tokenBckgrndBckDiag, // @emem bgbdiag
  185. tokenBckgrndCross, // @emem bgcross
  186. tokenBckgrndDiagCross, // @emem bgdcross
  187. tokenBckgrndDrkBckDiag, // @emem bgdkbdiag
  188. tokenBckgrndDrkCross, // @emem bgdkcross
  189. tokenBckgrndDrkDiagCross, // @emem bgdkdcross
  190. tokenBckgrndDrkFwdDiag, // @emem bgdkfdiag
  191. tokenBckgrndDrkHoriz, // @emem bgdkhoriz
  192. tokenBckgrndDrkVert, // @emem bgdkvert
  193. tokenBckgrndFwdDiag, // @emem bgfdiag
  194. tokenBckgrndHoriz, // @emem bghoriz
  195. tokenBckgrndVert, // @emem bgvert
  196. tokenTabPosition, // @emem tx
  197. tokenTabBar, // @emem tb
  198. // keep next 5 in order
  199. tokenTabLeaderDots, // @emem tldot
  200. tokenTabLeaderHyphen, // @emem tlhyph
  201. tokenTabLeaderUnderline, // @emem tlul
  202. tokenTabLeaderThick, // @emem tlth
  203. tokenTabLeaderEqual, // @emem tleq
  204. // keep next 4 in order
  205. tokenCenterTab, // @emem tqc
  206. tokenFlushRightTab, // @emem tqr
  207. tokenDecimalTab, // @emem tqdec
  208. tokenParaNum, // @emem pn
  209. tokenParaNumIndent, // @emem pnindent
  210. tokenParaNumBody, // @emem pnlvlbody
  211. tokenParaNumCont, // @emem pnlvlcont
  212. tokenParaNumAlignCenter, // @emem pnqc
  213. tokenParaNumAlignRight, // @emem pnqr
  214. // keep next 6 in order
  215. tokenParaNumBullet, // @emem pnlvlblt
  216. tokenParaNumDecimal, // @emem pndec
  217. tokenParaNumLCLetter, // @emem pnlcltr
  218. tokenParaNumUCLetter, // @emem pnucltr
  219. tokenParaNumLCRoman, // @emem pnlcrm
  220. tokenParaNumUCRoman, // @emem pnucrm
  221. tokenParaNumText, // @emem pntext
  222. tokenParaNumStart, // @emem pnstart
  223. tokenParaNumAfter, // @emem pntxta
  224. tokenParaNumBefore, // @emem pntxtb
  225. tokenOptionalDestination, // @emem *
  226. tokenField, // @emem field
  227. tokenFieldResult, // @emem fldrslt
  228. tokenFieldInstruction, // @emem fldinst
  229. tokenStyleSheet, // @emem stylesheet
  230. tokenEndSection, // @emem sect
  231. tokenSectionDefault, // @emem sectd
  232. tokenDocumentArea, // @emem info
  233. // Tables
  234. tokenInTable, // @emem intbl
  235. tokenCell, // @emem cell
  236. tokenCellHalfGap, // @emem trgaph
  237. tokenCellX, // @emem cellx
  238. tokenRow, // @emem row
  239. tokenRowDefault, // @emem trowd
  240. tokenRowLeft, // @emem trleft
  241. tokenRowAlignRight, // @emem trqr (trqc must follow trqr)
  242. tokenRowAlignCenter, // @emem trqc
  243. tokenUnicode, // @emem u
  244. tokenUnicodeCharByteCount, // @emem uc
  245. // Special characters
  246. tokenFormulaCharacter, // |
  247. tokenIndexSubentry, // :
  248. tokenLToRChars, // @emem ltrch
  249. tokenLToRDocument, // @emem ltrdoc
  250. tokenDisplayLToR, // @emem ltrmark See also ltrpar
  251. tokenRToLChars, // @emem rtlch
  252. tokenRToLDocument, // @emem rtldoc
  253. tokenDisplayRToL, // @emem rtlmark
  254. tokenZeroWidthJoiner, // @emem zwj
  255. tokenZeroWidthNonJoiner, // @emem zwnj
  256. tokenDBChars, // @emem dbch
  257. // T3J keywords
  258. tokenFollowingPunct, // @emem fchars
  259. tokenLeadingPunct, // @emem lchars
  260. #ifdef FE
  261. tokenHorizontalRender, // @emem horzdoc
  262. tokenVerticalRender, // @emem vertdoc
  263. tokenNoOverflow, // @emem nooverflow
  264. tokenNoWordBreak, // @emem nocwrap
  265. tokenNoWordWrap, // @emem nowwrap
  266. #endif
  267. tokenPicture, // @emem pict
  268. tokenObject, // @emem object
  269. // Pictures Keep next 4 in RECT order
  270. tokenPicFirst,
  271. tokenCropLeft = tokenPicFirst, // @emem piccropl
  272. tokenCropTop, // @emem piccropt
  273. tokenCropBottom, // @emem piccropb
  274. tokenCropRight, // @emem piccropr
  275. tokenHeight, // @emem pich
  276. tokenWidth, // @emem picw
  277. tokenScaleX, // @emem picscalex
  278. tokenScaleY, // @emem picscaley
  279. tokenDesiredHeight, // @emem pichgoal
  280. tokenDesiredWidth, // @emem picwgoal
  281. // Keep next 3 in order
  282. tokenPictureWindowsBitmap, // @emem wbitmap
  283. tokenPictureWindowsMetafile, // @emem wmetafile
  284. tokenPictureWindowsDIB, // @emem dibitmap
  285. tokenBinaryData, // @emem bin
  286. tokenPictureQuickDraw, // @emem macpict
  287. tokenPictureOS2Metafile, // @emem pmmetafile
  288. tokenBitmapBitsPerPixel, // @emem wbmbitspixel
  289. tokenBitmapNumPlanes, // @emem wbmplanes
  290. tokenBitmapWidthBytes, // @emem wbmwidthbytes
  291. // Objects
  292. // tokenCropLeft, // @emem objcropl (see // Pictures)
  293. // tokenCropTop, // @emem objcropt
  294. // tokenCropRight, // @emem objcropr
  295. // tokenCropBottom, // @emem objcropb
  296. // tokenHeight, // @emem objh
  297. // tokenWidth, // @emem objw
  298. // tokenScaleX, // @emem objscalex
  299. // tokenScaleY, // @emem objscaley
  300. // Keep next 3 in order
  301. tokenObjectEmbedded, // @emem objemb
  302. tokenObjectLink, // @emem objlink
  303. tokenObjectAutoLink, // @emem objautlink
  304. tokenObjectClass, // @emem objclass
  305. tokenObjectData, // @emem objdata
  306. tokenObjectMacICEmbedder, // @emem objicemb
  307. tokenObjectName, // @emem objname
  308. tokenObjectMacPublisher, // @emem objpub
  309. tokenObjectSetSize, // @emem objsetsize
  310. tokenObjectMacSubscriber, // @emem objsub
  311. tokenObjectResult, // @emem result
  312. tokenObjLast = tokenObjectResult,
  313. // Document info and layout
  314. tokenRevAuthor, // @emem revauth
  315. #ifdef UNUSED_TOKENS
  316. tokenTimeSecond, // @emem sec
  317. tokenTimeMinute, // @emem min
  318. tokenTimeHour, // @emem hr
  319. tokenTimeDay, // @emem dy
  320. tokenTimeMonth, // @emem mo
  321. tokenTimeYear, // @emem yr
  322. tokenMarginLeft, // @emem margl
  323. tokenMarginRight, // @emem margr
  324. tokenSectionMarginLeft, // @emem marglsxn
  325. tokenSectionMarginRight, // @emem margrsxn
  326. #endif
  327. tokenObjectPlaceholder, // @emem objattph
  328. tokenPage, // @emem page
  329. tokenNullDestination, // @emem ??various??
  330. tokenMax // Larger tokens treated as Unicode chars
  331. };
  332. // @enum TOKENINDEX | RTFWrite Indices into rgKeyword[]
  333. enum TOKENINDEX // rgKeyword[] indices
  334. { // MUST be in exact 1-to-1 with rgKeyword
  335. i_adeff, // entries (see tokens.c). Names consist
  336. i_af,
  337. i_animtext,
  338. i_ansi,
  339. i_ansicpg,
  340. i_b,
  341. i_bgbdiag,
  342. i_bgcross,
  343. i_bgdcross,
  344. i_bgdkbdiag,
  345. i_bgdkcross,
  346. i_bgdkdcross,
  347. i_bgdkfdiag,
  348. i_bgdkhoriz,
  349. i_bgdkvert,
  350. i_bgfdiag,
  351. i_bghoriz,
  352. i_bgvert,
  353. i_bin,
  354. i_blue,
  355. i_box,
  356. i_brdrb,
  357. i_brdrbar,
  358. i_brdrbtw,
  359. i_brdrcf,
  360. i_brdrdash,
  361. i_brdrdashsm,
  362. i_brdrdb,
  363. i_brdrdot,
  364. i_brdrhair,
  365. i_brdrl,
  366. i_brdrr,
  367. i_brdrs,
  368. i_brdrsh,
  369. i_brdrt,
  370. i_brdrth,
  371. i_brdrtriple,
  372. i_brdrw,
  373. i_brsp,
  374. i_bullet,
  375. i_caps,
  376. i_cbpat,
  377. i_cell,
  378. i_cellx,
  379. i_cf,
  380. i_cfpat,
  381. i_clbrdrb,
  382. i_clbrdrl,
  383. i_clbrdrr,
  384. i_clbrdrt,
  385. i_collapsed,
  386. i_colortbl,
  387. i_cpg,
  388. i_cs,
  389. i_dbch,
  390. i_deff,
  391. i_deflang,
  392. i_deflangfe,
  393. i_deftab,
  394. i_deleted,
  395. i_dibitmap,
  396. i_disabled,
  397. i_dn,
  398. i_dropcapli,
  399. i_embo,
  400. i_emdash,
  401. i_emspace,
  402. i_endash,
  403. i_enspace,
  404. i_expndtw,
  405. i_f,
  406. i_fbidi,
  407. i_fchars,
  408. i_fcharset,
  409. i_fdecor,
  410. i_fi,
  411. i_field,
  412. i_fldinst,
  413. i_fldrslt,
  414. i_fmodern,
  415. i_fname,
  416. i_fnil,
  417. i_fonttbl,
  418. i_footer,
  419. i_footerf,
  420. i_footerl,
  421. i_footerr,
  422. i_footnote,
  423. i_fprq,
  424. i_froman,
  425. i_fs,
  426. i_fscript,
  427. i_fswiss,
  428. i_ftech,
  429. i_ftncn,
  430. i_ftnsep,
  431. i_ftnsepc,
  432. i_green,
  433. i_header,
  434. i_headerf,
  435. i_headerl,
  436. i_headerr,
  437. i_highlight,
  438. i_hyphpar,
  439. i_i,
  440. i_impr,
  441. i_info,
  442. i_intbl,
  443. i_keep,
  444. i_keepn,
  445. i_kerning,
  446. i_lang,
  447. i_lchars,
  448. i_ldblquote,
  449. i_li,
  450. i_line,
  451. i_lnkd,
  452. i_lquote,
  453. i_ltrch,
  454. i_ltrdoc,
  455. i_ltrmark,
  456. i_ltrpar,
  457. i_macpict,
  458. i_noline,
  459. i_nosupersub,
  460. i_nowidctlpar,
  461. i_objattph,
  462. i_objautlink,
  463. i_objclass,
  464. i_objcropb,
  465. i_objcropl,
  466. i_objcropr,
  467. i_objcropt,
  468. i_objdata,
  469. i_object,
  470. i_objemb,
  471. i_objh,
  472. i_objicemb,
  473. i_objlink,
  474. i_objname,
  475. i_objpub,
  476. i_objscalex,
  477. i_objscaley,
  478. i_objsetsize,
  479. i_objsub,
  480. i_objw,
  481. i_outl,
  482. i_page,
  483. i_pagebb,
  484. i_par,
  485. i_pard,
  486. i_piccropb,
  487. i_piccropl,
  488. i_piccropr,
  489. i_piccropt,
  490. i_pich,
  491. i_pichgoal,
  492. i_picscalex,
  493. i_picscaley,
  494. i_pict,
  495. i_picw,
  496. i_picwgoal,
  497. i_plain,
  498. i_pmmetafile,
  499. i_pn,
  500. i_pndec,
  501. i_pnindent,
  502. i_pnlcltr,
  503. i_pnlcrm,
  504. i_pnlvlblt,
  505. i_pnlvlbody,
  506. i_pnlvlcont,
  507. i_pnqc,
  508. i_pnqr,
  509. i_pnstart,
  510. i_pntext,
  511. i_pntxta,
  512. i_pntxtb,
  513. i_pnucltr,
  514. i_pnucrm,
  515. i_protect,
  516. i_pwd,
  517. i_qc,
  518. i_qj,
  519. i_ql,
  520. i_qr,
  521. i_rdblquote,
  522. i_red,
  523. i_result,
  524. i_revauth,
  525. i_revised,
  526. i_ri,
  527. i_row,
  528. i_rquote,
  529. i_rtf,
  530. i_rtlch,
  531. i_rtldoc,
  532. i_rtlmark,
  533. i_rtlpar,
  534. i_s,
  535. i_sa,
  536. i_sb,
  537. i_sbys,
  538. i_scaps,
  539. i_sect,
  540. i_sectd,
  541. i_shad,
  542. i_shading,
  543. i_sl,
  544. i_slmult,
  545. i_strike,
  546. i_stylesheet,
  547. i_sub,
  548. i_super,
  549. i_tab,
  550. i_tb,
  551. i_tc,
  552. i_tldot,
  553. i_tleq,
  554. i_tlhyph,
  555. i_tlth,
  556. i_tlul,
  557. i_tqc,
  558. i_tqdec,
  559. i_tqr,
  560. i_trbrdrb,
  561. i_trbrdrl,
  562. i_trbrdrr,
  563. i_trbrdrt,
  564. i_trgaph,
  565. i_trleft,
  566. i_trowd,
  567. i_trqc,
  568. i_trqr,
  569. i_tx,
  570. i_u,
  571. i_uc,
  572. i_ul,
  573. i_uld,
  574. i_uldash,
  575. i_uldashd,
  576. i_uldashdd,
  577. i_uldb,
  578. i_ulhair,
  579. i_ulnone,
  580. i_ulth,
  581. i_ulw,
  582. i_ulwave,
  583. i_up,
  584. i_urtf,
  585. i_v,
  586. i_viewkind,
  587. i_viewscale,
  588. i_wbitmap,
  589. i_wbmbitspixel,
  590. i_wbmplanes,
  591. i_wbmwidthbytes,
  592. i_wmetafile,
  593. i_xe,
  594. i_zwj,
  595. i_zwnj,
  596. i_TokenIndexMax
  597. };
  598. #endif