/delphi/lib/RichEdit.pas

http://delphi-miranda-plugins.googlecode.com/ · Pascal · 861 lines · 630 code · 135 blank · 96 comment · 0 complexity · 529c8a7808d4e2d81a0af2b2c117629f MD5 · raw file

  1. {*******************************************************}
  2. { }
  3. { Borland Delphi Run-time Library }
  4. { Win32 Rich Edit control Interface Unit }
  5. { }
  6. { Copyright (c) 1985-1999, Microsoft Corporation }
  7. { }
  8. { Translator: Inprise Corporation }
  9. { }
  10. {*******************************************************}
  11. unit RichEdit;
  12. interface
  13. uses Messages, Windows;
  14. const
  15. cchTextLimitDefault = 32767;
  16. RICHEDIT_CLASSA = 'RichEdit20A'; { Richedit2.0 Window Class. }
  17. RICHEDIT_CLASSW = 'RichEdit20W'; { Richedit2.0 Window Class. }
  18. RICHEDIT_CLASS = RICHEDIT_CLASSA;
  19. RICHEDIT_CLASS10A = 'RICHEDIT'; { Richedit 1.0 }
  20. { RichEdit messages }
  21. WM_CONTEXTMENU = $007B;
  22. WM_PRINTCLIENT = $0318;
  23. EM_GETLIMITTEXT = WM_USER + 37;
  24. // EM_POSFROMCHAR = WM_USER + 38;
  25. // EM_CHARFROMPOS = WM_USER + 39;
  26. EM_SCROLLCARET = WM_USER + 49;
  27. EM_CANPASTE = WM_USER + 50;
  28. EM_DISPLAYBAND = WM_USER + 51;
  29. EM_EXGETSEL = WM_USER + 52;
  30. EM_EXLIMITTEXT = WM_USER + 53;
  31. EM_EXLINEFROMCHAR = WM_USER + 54;
  32. EM_EXSETSEL = WM_USER + 55;
  33. EM_FINDTEXT = WM_USER + 56;
  34. EM_FORMATRANGE = WM_USER + 57;
  35. EM_GETCHARFORMAT = WM_USER + 58;
  36. EM_GETEVENTMASK = WM_USER + 59;
  37. EM_GETOLEINTERFACE = WM_USER + 60;
  38. EM_GETPARAFORMAT = WM_USER + 61;
  39. EM_GETSELTEXT = WM_USER + 62;
  40. EM_HIDESELECTION = WM_USER + 63;
  41. EM_PASTESPECIAL = WM_USER + 64;
  42. EM_REQUESTRESIZE = WM_USER + 65;
  43. EM_SELECTIONTYPE = WM_USER + 66;
  44. EM_SETBKGNDCOLOR = WM_USER + 67;
  45. EM_SETCHARFORMAT = WM_USER + 68;
  46. EM_SETEVENTMASK = WM_USER + 69;
  47. EM_SETOLECALLBACK = WM_USER + 70;
  48. EM_SETPARAFORMAT = WM_USER + 71;
  49. EM_SETTARGETDEVICE = WM_USER + 72;
  50. EM_STREAMIN = WM_USER + 73;
  51. EM_STREAMOUT = WM_USER + 74;
  52. EM_GETTEXTRANGE = WM_USER + 75;
  53. EM_FINDWORDBREAK = WM_USER + 76;
  54. EM_SETOPTIONS = WM_USER + 77;
  55. EM_GETOPTIONS = WM_USER + 78;
  56. EM_FINDTEXTEX = WM_USER + 79;
  57. EM_GETWORDBREAKPROCEX = WM_USER + 80;
  58. EM_SETWORDBREAKPROCEX = WM_USER + 81;
  59. { Richedit v2.0 messages }
  60. EM_SETUNDOLIMIT = WM_USER + 82;
  61. EM_REDO = WM_USER + 84;
  62. EM_CANREDO = WM_USER + 85;
  63. EM_GETUNDONAME = WM_USER + 86;
  64. EM_GETREDONAME = WM_USER + 87;
  65. EM_STOPGROUPTYPING = WM_USER + 88;
  66. EM_SETTEXTMODE = WM_USER + 89;
  67. EM_GETTEXTMODE = WM_USER + 90;
  68. { for use with EM_GET/SETTEXTMODE }
  69. TM_PLAINTEXT = 1;
  70. TM_RICHTEXT = 2; { default behavior }
  71. TM_SINGLELEVELUNDO = 4;
  72. TM_MULTILEVELUNDO = 8; { default behavior }
  73. TM_SINGLECODEPAGE = 16;
  74. TM_MULTICODEPAGE = 32; { default behavior }
  75. EM_AUTOURLDETECT = WM_USER + 91;
  76. EM_GETAUTOURLDETECT = WM_USER + 92;
  77. EM_SETPALETTE = WM_USER + 93;
  78. EM_GETTEXTEX = WM_USER + 94;
  79. EM_GETTEXTLENGTHEX = WM_USER + 95;
  80. { Far East specific messages }
  81. EM_SETPUNCTUATION = WM_USER + 100;
  82. EM_GETPUNCTUATION = WM_USER + 101;
  83. EM_SETWORDWRAPMODE = WM_USER + 102;
  84. EM_GETWORDWRAPMODE = WM_USER + 103;
  85. EM_SETIMECOLOR = WM_USER + 104;
  86. EM_GETIMECOLOR = WM_USER + 105;
  87. EM_SETIMEOPTIONS = WM_USER + 106;
  88. EM_GETIMEOPTIONS = WM_USER + 107;
  89. EM_CONVPOSITION = WM_USER + 108;
  90. EM_SETLANGOPTIONS = WM_USER + 120;
  91. EM_GETLANGOPTIONS = WM_USER + 121;
  92. EM_GETIMECOMPMODE = WM_USER + 122;
  93. { Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS }
  94. IMF_AUTOKEYBOARD = $0001;
  95. IMF_AUTOFONT = $0002;
  96. IMF_IMECANCELCOMPLETE = $0004; { high completes the comp string when aborting, low cancels. }
  97. IMF_IMEALWAYSSENDNOTIFY = $0008;
  98. { Values for EM_GETIMECOMPMODE }
  99. ICM_NOTOPEN = $0000;
  100. ICM_LEVEL3 = $0001;
  101. ICM_LEVEL2 = $0002;
  102. ICM_LEVEL2_5 = $0003;
  103. ICM_LEVEL2_SUI = $0004;
  104. { New notifications }
  105. EN_MSGFILTER = $0700;
  106. EN_REQUESTRESIZE = $0701;
  107. EN_SELCHANGE = $0702;
  108. EN_DROPFILES = $0703;
  109. EN_PROTECTED = $0704;
  110. EN_CORRECTTEXT = $0705; { PenWin specific }
  111. EN_STOPNOUNDO = $0706;
  112. EN_IMECHANGE = $0707; { Far East specific }
  113. EN_SAVECLIPBOARD = $0708;
  114. EN_OLEOPFAILED = $0709;
  115. EN_OBJECTPOSITIONS = $070a;
  116. EN_LINK = $070b;
  117. EN_DRAGDROPDONE = $070c;
  118. { Event notification masks }
  119. ENM_NONE = $00000000;
  120. ENM_CHANGE = $00000001;
  121. ENM_UPDATE = $00000002;
  122. ENM_SCROLL = $00000004;
  123. ENM_KEYEVENTS = $00010000;
  124. ENM_MOUSEEVENTS = $00020000;
  125. ENM_REQUESTRESIZE = $00040000;
  126. ENM_SELCHANGE = $00080000;
  127. ENM_DROPFILES = $00100000;
  128. ENM_PROTECTED = $00200000;
  129. ENM_CORRECTTEXT = $00400000; { PenWin specific }
  130. ENM_SCROLLEVENTS = $00000008;
  131. ENM_DRAGDROPDONE = $00000010;
  132. { Far East specific notification mask }
  133. ENM_IMECHANGE = $00800000; { unused by RE2.0 }
  134. ENM_LANGCHANGE = $01000000;
  135. ENM_OBJECTPOSITIONS = $02000000;
  136. ENM_LINK = $04000000;
  137. { New edit control styles }
  138. ES_SAVESEL = $00008000;
  139. ES_SUNKEN = $00004000;
  140. ES_DISABLENOSCROLL = $00002000;
  141. { same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value }
  142. ES_SELECTIONBAR = $01000000;
  143. { same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop }
  144. ES_NOOLEDRAGDROP = $00000008;
  145. { New edit control extended style }
  146. ES_EX_NOCALLOLEINIT = $01000000;
  147. { These flags are used in FE Windows }
  148. ES_VERTICAL = $00400000;
  149. ES_NOIME = $00080000;
  150. ES_SELFIME = $00040000;
  151. { Edit control options }
  152. ECO_AUTOWORDSELECTION = $00000001;
  153. ECO_AUTOVSCROLL = $00000040;
  154. ECO_AUTOHSCROLL = $00000080;
  155. ECO_NOHIDESEL = $00000100;
  156. ECO_READONLY = $00000800;
  157. ECO_WANTRETURN = $00001000;
  158. ECO_SAVESEL = $00008000;
  159. ECO_SELECTIONBAR = $01000000;
  160. ECO_VERTICAL = $00400000; { FE specific }
  161. { ECO operations }
  162. ECOOP_SET = $0001;
  163. ECOOP_OR = $0002;
  164. ECOOP_AND = $0003;
  165. ECOOP_XOR = $0004;
  166. { new word break function actions }
  167. WB_CLASSIFY = 3;
  168. WB_MOVEWORDLEFT = 4;
  169. WB_MOVEWORDRIGHT = 5;
  170. WB_LEFTBREAK = 6;
  171. WB_RIGHTBREAK = 7;
  172. { Far East specific flags }
  173. WB_MOVEWORDPREV = 4;
  174. WB_MOVEWORDNEXT = 5;
  175. WB_PREVBREAK = 6;
  176. WB_NEXTBREAK = 7;
  177. PC_FOLLOWING = 1;
  178. PC_LEADING = 2;
  179. PC_OVERFLOW = 3;
  180. PC_DELIMITER = 4;
  181. WBF_WORDWRAP = $010;
  182. WBF_WORDBREAK = $020;
  183. WBF_OVERFLOW = $040;
  184. WBF_LEVEL1 = $080;
  185. WBF_LEVEL2 = $100;
  186. WBF_CUSTOM = $200;
  187. { Far East specific flags }
  188. IMF_FORCENONE = $0001;
  189. IMF_FORCEENABLE = $0002;
  190. IMF_FORCEDISABLE = $0004;
  191. IMF_CLOSESTATUSWINDOW = $0008;
  192. IMF_VERTICAL = $0020;
  193. IMF_FORCEACTIVE = $0040;
  194. IMF_FORCEINACTIVE = $0080;
  195. IMF_FORCEREMEMBER = $0100;
  196. IMF_MULTIPLEEDIT = $0400;
  197. { Word break flags (used with WB_CLASSIFY) }
  198. WBF_CLASS = $0F;
  199. WBF_ISWHITE = $10;
  200. WBF_BREAKLINE = $20;
  201. WBF_BREAKAFTER = $40;
  202. { all character format measurements are in twips }
  203. type
  204. TCharFormatA = record
  205. cbSize: UINT;
  206. dwMask: Longint;
  207. dwEffects: Longint;
  208. yHeight: Longint;
  209. yOffset: Longint;
  210. crTextColor: TColorRef;
  211. bCharSet: Byte;
  212. bPitchAndFamily: Byte;
  213. szFaceName: array[0..LF_FACESIZE - 1] of AnsiChar;
  214. end;
  215. TCharFormatW = record
  216. cbSize: UINT;
  217. dwMask: Longint;
  218. dwEffects: Longint;
  219. yHeight: Longint;
  220. yOffset: Longint;
  221. crTextColor: TColorRef;
  222. bCharSet: Byte;
  223. bPitchAndFamily: Byte;
  224. szFaceName: array[0..LF_FACESIZE - 1] of WideChar;
  225. end;
  226. TCharFormat = TCharFormatA;
  227. { CHARFORMAT masks }
  228. const
  229. CFM_BOLD = $00000001;
  230. CFM_ITALIC = $00000002;
  231. CFM_UNDERLINE = $00000004;
  232. CFM_STRIKEOUT = $00000008;
  233. CFM_PROTECTED = $00000010;
  234. CFM_LINK = $00000020; { Exchange hyperlink extension }
  235. CFM_SIZE = $80000000;
  236. CFM_COLOR = $40000000;
  237. CFM_FACE = $20000000;
  238. CFM_OFFSET = $10000000;
  239. CFM_CHARSET = $08000000;
  240. { CHARFORMAT effects }
  241. CFE_BOLD = $0001;
  242. CFE_ITALIC = $0002;
  243. CFE_UNDERLINE = $0004;
  244. CFE_STRIKEOUT = $0008;
  245. CFE_PROTECTED = $0010;
  246. CFE_LINK = $0020;
  247. CFE_AUTOCOLOR = $40000000; { NOTE: this corresponds to CFM_COLOR, }
  248. { which controls it }
  249. yHeightCharPtsMost = 1638;
  250. { EM_SETCHARFORMAT wParam masks }
  251. SCF_SELECTION = $0001;
  252. SCF_WORD = $0002;
  253. SCF_DEFAULT = $0000; { set the default charformat or paraformat }
  254. SCF_ALL = $0004; { not valid with SCF_SELECTION or SCF_WORD }
  255. SCF_USEUIRULES = $0008; { modifier for SCF_SELECTION; says that }
  256. { the format came from a toolbar, etc. and }
  257. { therefore UI formatting rules should be }
  258. { used instead of strictly formatting the }
  259. { selection. }
  260. type
  261. _charrange = record
  262. cpMin: Longint;
  263. cpMax: LongInt;
  264. end;
  265. TCharRange = _charrange;
  266. CHARRANGE = _charrange;
  267. TEXTRANGEA = record
  268. chrg: TCharRange;
  269. lpstrText: PAnsiChar;
  270. end;
  271. TTextRangeA = TEXTRANGEA;
  272. TEXTRANGEW = record
  273. chrg: TCharRange;
  274. lpstrText: PWideChar;
  275. end;
  276. TTextRangeW = TEXTRANGEW;
  277. TEXTRANGE = TEXTRANGEA;
  278. type
  279. TEditStreamCallBack = function (dwCookie: Longint; pbBuff: PByte;
  280. cb: Longint; var pcb: Longint): Longint; stdcall;
  281. _editstream = record
  282. dwCookie: Longint;
  283. dwError: Longint;
  284. pfnCallback: TEditStreamCallBack;
  285. end;
  286. TEditStream = _editstream;
  287. EDITSTREAM = _editstream;
  288. { stream formats }
  289. const
  290. SF_TEXT = $0001;
  291. SF_RTF = $0002;
  292. SF_RTFNOOBJS = $0003; { outbound only }
  293. SF_TEXTIZED = $0004; { outbound only }
  294. SF_UNICODE = $0010; { Unicode file of some kind }
  295. { Flag telling stream operations to operate on the selection only }
  296. { EM_STREAMIN will replace the current selection }
  297. { EM_STREAMOUT will stream out the current selection }
  298. SFF_SELECTION = $8000;
  299. { Flag telling stream operations to operate on the common RTF keyword only }
  300. { EM_STREAMIN will accept the only common RTF keyword }
  301. { EM_STREAMOUT will stream out the only common RTF keyword }
  302. SFF_PLAINRTF = $4000;
  303. { EM_FINDTEXT flags (removed in 3.0 SDK - leave in!) }
  304. FT_MATCHCASE = 4;
  305. FT_WHOLEWORD = 2;
  306. type
  307. FINDTEXTA = record
  308. chrg: TCharRange;
  309. lpstrText: PAnsiChar;
  310. end;
  311. FINDTEXTW = record
  312. chrg: TCharRange;
  313. lpstrText: PWideChar;
  314. end;
  315. FINDTEXT = FINDTEXTA;
  316. TFindTextA = FINDTEXTA;
  317. TFindTextW = FINDTEXTW;
  318. TFindText = TFindTextA;
  319. FINDTEXTEXA = record
  320. chrg: TCharRange;
  321. lpstrText: PAnsiChar;
  322. chrgText: TCharRange;
  323. end;
  324. FINDTEXTEXW = record
  325. chrg: TCharRange;
  326. lpstrText: PWideChar;
  327. chrgText: TCharRange;
  328. end;
  329. FINDTEXTEX = FINDTEXTEXA;
  330. TFindTextExA = FINDTEXTEXA;
  331. TFindTextExW = FINDTEXTEXW;
  332. TFindTextEx = TFindTextExA;
  333. _formatrange = record
  334. hdc: HDC;
  335. hdcTarget: HDC;
  336. rc: TRect;
  337. rcPage: TRect;
  338. chrg: TCharRange;
  339. end;
  340. TFormatRange = _formatrange;
  341. FORMATRANGE = _formatrange;
  342. { all paragraph measurements are in twips }
  343. const
  344. MAX_TAB_STOPS = 32;
  345. lDefaultTab = 720;
  346. type
  347. _paraformat = record
  348. cbSize: UINT;
  349. dwMask: DWORD;
  350. wNumbering: Word;
  351. wReserved: Word;
  352. dxStartIndent: Longint;
  353. dxRightIndent: Longint;
  354. dxOffset: Longint;
  355. wAlignment: Word;
  356. cTabCount: Smallint;
  357. rgxTabs: array [0..MAX_TAB_STOPS - 1] of Longint;
  358. end;
  359. TParaFormat = _paraformat;
  360. PARAFORMAT = _paraformat;
  361. { PARAFORMAT mask values }
  362. const
  363. PFM_STARTINDENT = $00000001;
  364. PFM_RIGHTINDENT = $00000002;
  365. PFM_OFFSET = $00000004;
  366. PFM_ALIGNMENT = $00000008;
  367. PFM_TABSTOPS = $00000010;
  368. PFM_NUMBERING = $00000020;
  369. PFM_OFFSETINDENT = $80000000;
  370. { PARAFORMAT numbering options }
  371. PFN_BULLET = $0001;
  372. { PARAFORMAT alignment options }
  373. PFA_LEFT = $0001;
  374. PFA_RIGHT = $0002;
  375. PFA_CENTER = $0003;
  376. type
  377. CHARFORMAT2A = record
  378. cbSize: UINT;
  379. dwMask: DWORD;
  380. dwEffects: DWORD;
  381. yHeight: Longint;
  382. yOffset: Longint;
  383. crTextColor: TColorRef;
  384. bCharSet: Byte;
  385. bPitchAndFamily: Byte;
  386. szFaceName: array[0..LF_FACESIZE - 1] of AnsiChar;
  387. wWeight: Word; { Font weight (LOGFONT value) }
  388. sSpacing: Smallint; { Amount to space between letters }
  389. crBackColor: TColorRef; { Background color }
  390. lid: LCID; { Locale ID }
  391. dwReserved: DWORD; { Reserved. Must be 0 }
  392. sStyle: Smallint; { Style handle }
  393. wKerning: Word; { Twip size above which to kern char pair }
  394. bUnderlineType: Byte; { Underline type }
  395. bAnimation: Byte; { Animated text like marching ants }
  396. bRevAuthor: Byte; { Revision author index }
  397. bReserved1: Byte;
  398. end;
  399. CHARFORMAT2W = record
  400. cbSize: UINT;
  401. dwMask: DWORD;
  402. dwEffects: DWORD;
  403. yHeight: Longint;
  404. yOffset: Longint;
  405. crTextColor: TColorRef;
  406. bCharSet: Byte;
  407. bPitchAndFamily: Byte;
  408. szFaceName: array[0..LF_FACESIZE - 1] of WideChar;
  409. wWeight: Word; { Font weight (LOGFONT value) }
  410. sSpacing: Smallint; { Amount to space between letters }
  411. crBackColor: TColorRef; { Background color }
  412. lid: LCID; { Locale ID }
  413. dwReserved: DWORD; { Reserved. Must be 0 }
  414. sStyle: Smallint; { Style handle }
  415. wKerning: Word; { Twip size above which to kern char pair }
  416. bUnderlineType: Byte; { Underline type }
  417. bAnimation: Byte; { Animated text like marching ants }
  418. bRevAuthor: Byte; { Revision author index }
  419. bReserved1: Byte;
  420. end;
  421. CHARFORMAT2 = CHARFORMAT2A;
  422. TCharFormat2A = CHARFORMAT2A;
  423. TCharFormat2W = CHARFORMAT2W;
  424. TCharFormat2 = TCharFormat2A;
  425. { CHARFORMAT and PARAFORMAT "ALL" masks
  426. CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor }
  427. const
  428. CFM_EFFECTS = CFM_BOLD or CFM_ITALIC or CFM_UNDERLINE or CFM_COLOR or
  429. CFM_STRIKEOUT or CFE_PROTECTED or CFM_LINK;
  430. CFM_ALL = CFM_EFFECTS or CFM_SIZE or CFM_FACE or CFM_OFFSET or CFM_CHARSET;
  431. PFM_ALL = PFM_STARTINDENT or PFM_RIGHTINDENT or PFM_OFFSET or
  432. PFM_ALIGNMENT or PFM_TABSTOPS or PFM_NUMBERING or PFM_OFFSETINDENT;
  433. { New masks and effects -- a parenthesized asterisk indicates that
  434. the data is stored by RichEdit2.0, but not displayed }
  435. CFM_SMALLCAPS = $0040; { (*) }
  436. CFM_ALLCAPS = $0080; { (*) }
  437. CFM_HIDDEN = $0100; { (*) }
  438. CFM_OUTLINE = $0200; { (*) }
  439. CFM_SHADOW = $0400; { (*) }
  440. CFM_EMBOSS = $0800; { (*) }
  441. CFM_IMPRINT = $1000; { (*) }
  442. CFM_DISABLED = $2000;
  443. CFM_REVISED = $4000;
  444. CFM_BACKCOLOR = $04000000;
  445. CFM_LCID = $02000000;
  446. CFM_UNDERLINETYPE = $00800000; { (*) }
  447. CFM_WEIGHT = $00400000;
  448. CFM_SPACING = $00200000; { (*) }
  449. CFM_KERNING = $00100000; { (*) }
  450. CFM_STYLE = $00080000; { (*) }
  451. CFM_ANIMATION = $00040000; { (*) }
  452. CFM_REVAUTHOR = $00008000;
  453. CFE_SUBSCRIPT = $00010000; { Superscript and subscript are }
  454. CFE_SUPERSCRIPT = $00020000; { mutually exclusive }
  455. CFM_SUBSCRIPT = CFE_SUBSCRIPT or CFE_SUPERSCRIPT;
  456. CFM_SUPERSCRIPT = CFM_SUBSCRIPT;
  457. CFM_EFFECTS2 = CFM_EFFECTS or CFM_DISABLED or CFM_SMALLCAPS or CFM_ALLCAPS or
  458. CFM_HIDDEN or CFM_OUTLINE or CFM_SHADOW or CFM_EMBOSS or
  459. CFM_IMPRINT or CFM_DISABLED or CFM_REVISED or
  460. CFM_SUBSCRIPT or CFM_SUPERSCRIPT or CFM_BACKCOLOR;
  461. CFM_ALL2 = CFM_ALL or CFM_EFFECTS2 or CFM_BACKCOLOR or CFM_LCID or
  462. CFM_UNDERLINETYPE or CFM_WEIGHT or CFM_REVAUTHOR or
  463. CFM_SPACING or CFM_KERNING or CFM_STYLE or CFM_ANIMATION;
  464. CFE_SMALLCAPS = CFM_SMALLCAPS;
  465. CFE_ALLCAPS = CFM_ALLCAPS;
  466. CFE_HIDDEN = CFM_HIDDEN;
  467. CFE_OUTLINE = CFM_OUTLINE;
  468. CFE_SHADOW = CFM_SHADOW;
  469. CFE_EMBOSS = CFM_EMBOSS;
  470. CFE_IMPRINT = CFM_IMPRINT;
  471. CFE_DISABLED = CFM_DISABLED;
  472. CFE_REVISED = CFM_REVISED;
  473. { NOTE: CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
  474. CFM_BACKCOLOR, respectively, which control them }
  475. CFE_AUTOBACKCOLOR = CFM_BACKCOLOR;
  476. { Underline types }
  477. CFU_CF1UNDERLINE = $FF; { map charformat's bit underline to CF2. }
  478. CFU_INVERT = $FE; { For IME composition fake a selection. }
  479. CFU_UNDERLINEDOTTED = $4; { (*) displayed as ordinary underline }
  480. CFU_UNDERLINEDOUBLE = $3; { (*) displayed as ordinary underline }
  481. CFU_UNDERLINEWORD = $2; { (*) displayed as ordinary underline }
  482. CFU_UNDERLINE = $1;
  483. CFU_UNDERLINENONE = 0;
  484. type
  485. PARAFORMAT2 = record
  486. cbSize: UINT;
  487. dwMask: DWORD;
  488. wNumbering: Word;
  489. wReserved: Word;
  490. dxStartIndent: Longint;
  491. dxRightIndent: Longint;
  492. dxOffset: Longint;
  493. wAlignment: Word;
  494. cTabCount: Smallint;
  495. rgxTabs: array [0..MAX_TAB_STOPS - 1] of Longint;
  496. dySpaceBefore: Longint; { Vertical spacing before para }
  497. dySpaceAfter: Longint; { Vertical spacing after para }
  498. dyLineSpacing: Longint; { Line spacing depending on Rule }
  499. sStyle: Smallint; { Style handle }
  500. bLineSpacingRule: Byte; { Rule for line spacing (see tom.doc) }
  501. bCRC: Byte; { Reserved for CRC for rapid searching }
  502. wShadingWeight: Word; { Shading in hundredths of a per cent }
  503. wShadingStyle: Word; { Nibble 0: style, 1: cfpat, 2: cbpat }
  504. wNumberingStart: Word; { Starting value for numbering }
  505. wNumberingStyle: Word; { Alignment, roman/arabic, (), ), ., etc. }
  506. wNumberingTab: Word; { Space bet 1st indent and 1st-line text }
  507. wBorderSpace: Word; { Space between border and text (twips) }
  508. wBorderWidth: Word; { Border pen width (twips) }
  509. wBorders: Word; { Byte 0: bits specify which borders }
  510. { Nibble 2: border style, 3: color index }
  511. end;
  512. TParaFormat2 = PARAFORMAT2;
  513. { PARAFORMAT 2.0 masks and effects }
  514. const
  515. PFM_SPACEBEFORE = $00000040;
  516. PFM_SPACEAFTER = $00000080;
  517. PFM_LINESPACING = $00000100;
  518. PFM_STYLE = $00000400;
  519. PFM_BORDER = $00000800; { (*) }
  520. PFM_SHADING = $00001000; { (*) }
  521. PFM_NUMBERINGSTYLE = $00002000; { (*) }
  522. PFM_NUMBERINGTAB = $00004000; { (*) }
  523. PFM_NUMBERINGSTART = $00008000; { (*) }
  524. PFM_RTLPARA = $00010000;
  525. PFM_KEEP = $00020000; { (*) }
  526. PFM_KEEPNEXT = $00040000; { (*) }
  527. PFM_PAGEBREAKBEFORE = $00080000; { (*) }
  528. PFM_NOLINENUMBER = $00100000; { (*) }
  529. PFM_NOWIDOWCONTROL = $00200000; { (*) }
  530. PFM_DONOTHYPHEN = $00400000; { (*) }
  531. PFM_SIDEBYSIDE = $00800000; { (*) }
  532. PFM_TABLE = $c0000000; { (*) }
  533. { Note: PARAFORMAT has no effects }
  534. PFM_EFFECTS = PFM_RTLPARA or PFM_KEEP or PFM_KEEPNEXT or PFM_TABLE or
  535. PFM_PAGEBREAKBEFORE or PFM_NOLINENUMBER or
  536. PFM_NOWIDOWCONTROL or PFM_DONOTHYPHEN or PFM_SIDEBYSIDE or PFM_TABLE;
  537. PFM_ALL2 = PFM_ALL or PFM_EFFECTS or PFM_SPACEBEFORE or PFM_SPACEAFTER or
  538. PFM_LINESPACING or PFM_STYLE or PFM_SHADING or PFM_BORDER or
  539. PFM_NUMBERINGTAB or PFM_NUMBERINGSTART or PFM_NUMBERINGSTYLE;
  540. PFE_RTLPARA = PFM_RTLPARA shr 16;
  541. PFE_KEEP = PFM_KEEP shr 16; { (*) }
  542. PFE_KEEPNEXT = PFM_KEEPNEXT shr 16; { (*) }
  543. PFE_PAGEBREAKBEFORE = PFM_PAGEBREAKBEFORE shr 16; { (*) }
  544. PFE_NOLINENUMBER = PFM_NOLINENUMBER shr 16; { (*) }
  545. PFE_NOWIDOWCONTROL = PFM_NOWIDOWCONTROL shr 16; { (*) }
  546. PFE_DONOTHYPHEN = PFM_DONOTHYPHEN shr 16; { (*) }
  547. PFE_SIDEBYSIDE = PFM_SIDEBYSIDE shr 16; { (*) }
  548. PFE_TABLEROW = $c000; { These 3 options are mutually }
  549. PFE_TABLECELLEND = $8000; { exclusive and each imply }
  550. PFE_TABLECELL = $4000; { that para is part of a table }
  551. {
  552. * PARAFORMAT numbering options (values for wNumbering):
  553. *
  554. * Numbering Type Value Meaning
  555. * tomNoNumbering 0 Turn off paragraph numbering
  556. * tomNumberAsLCLetter 1 a, b, c, ...
  557. * tomNumberAsUCLetter 2 A, B, C, ...
  558. * tomNumberAsLCRoman 3 i, ii, iii, ...
  559. * tomNumberAsUCRoman 4 I, II, III, ...
  560. * tomNumberAsSymbols 5 default is bullet
  561. * tomNumberAsNumber 6 0, 1, 2, ...
  562. * tomNumberAsSequence 7 tomNumberingStart is first Unicode to use
  563. *
  564. * Other valid Unicode chars are Unicodes for bullets.
  565. }
  566. PFA_JUSTIFY = 4; { New paragraph-alignment option 2.0 (*) }
  567. { notification structures }
  568. type
  569. PMsgFilter = ^TMsgFilter;
  570. _msgfilter = record
  571. nmhdr: TNMHdr;
  572. msg: UINT;
  573. wParam: WPARAM;
  574. lParam: LPARAM;
  575. end;
  576. TMsgFilter = _msgfilter;
  577. MSGFILTER = _msgfilter;
  578. PReqSize = ^TReqSize;
  579. TReqSize = record
  580. nmhdr: TNMHdr;
  581. rc: TRect;
  582. end;
  583. PSelChange = ^TSelChange;
  584. _selchange = record
  585. nmhdr: TNMHdr;
  586. chrg: TCharRange;
  587. seltyp: Word;
  588. end;
  589. TSelChange = _selchange;
  590. SELCHANGE = _selchange;
  591. const
  592. SEL_EMPTY = $0000;
  593. SEL_TEXT = $0001;
  594. SEL_OBJECT = $0002;
  595. SEL_MULTICHAR = $0004;
  596. SEL_MULTIOBJECT = $0008;
  597. { used with IRichEditOleCallback::GetContextMenu, this flag will be
  598. passed as a "selection type". It indicates that a context menu for
  599. a right-mouse drag drop should be generated. The IOleObject parameter
  600. will really be the IDataObject for the drop
  601. }
  602. GCM_RIGHTMOUSEDROP = $8000;
  603. type
  604. TEndDropFiles = record
  605. nmhdr: TNMHdr;
  606. hDrop: THandle;
  607. cp: Longint;
  608. fProtected: Bool;
  609. end;
  610. PENProtected = ^TENProtected;
  611. _enprotected = record
  612. nmhdr: TNMHdr;
  613. msg: UINT;
  614. wParam: WPARAM;
  615. lParam: LPARAM;
  616. chrg: TCharRange;
  617. end;
  618. TENProtected = _enprotected;
  619. ENPROTECTED = _enprotected;
  620. PENSaveClipboard = ^TENSaveClipboard;
  621. _ensaveclipboard = record
  622. nmhdr: TNMHdr;
  623. cObjectCount: Longint;
  624. cch: Longint;
  625. end;
  626. TENSaveClipboard = _ensaveclipboard;
  627. ENSAVECLIPBOARD = _ensaveclipboard;
  628. ENOLEOPFAILED = packed record
  629. nmhdr: TNMHdr;
  630. iob: Longint;
  631. lOper: Longint;
  632. hr: HRESULT;
  633. end;
  634. TENOleOpFailed = ENOLEOPFAILED;
  635. const
  636. OLEOP_DOVERB = 1;
  637. type
  638. OBJECTPOSITIONS = packed record
  639. nmhdr: TNMHdr;
  640. cObjectCount: Longint;
  641. pcpPositions: PLongint;
  642. end;
  643. TObjectPositions = OBJECTPOSITIONS;
  644. ENLINK = record
  645. nmhdr: TNMHdr;
  646. msg: UINT;
  647. wParam: WPARAM;
  648. lParam: LPARAM;
  649. chrg: TCharRange;
  650. end;
  651. TENLink = ENLINK;
  652. { PenWin specific }
  653. _encorrecttext = record
  654. nmhdr: TNMHdr;
  655. chrg: TCharRange;
  656. seltyp: Word;
  657. end;
  658. TENCorrectText = _encorrecttext;
  659. ENCORRECTTEXT = _encorrecttext;
  660. { Far East specific }
  661. _punctuation = record
  662. iSize: UINT;
  663. szPunctuation: PChar;
  664. end;
  665. TPunctuation = _punctuation;
  666. PUNCTUATION = _punctuation;
  667. { Far East specific }
  668. _compcolor = record
  669. crText: TColorRef;
  670. crBackground: TColorRef;
  671. dwEffects: Longint;
  672. end;
  673. TCompColor = _compcolor;
  674. COMPCOLOR = _compcolor;
  675. { clipboard formats - use as parameter to RegisterClipboardFormat }
  676. const
  677. CF_RTF = 'Rich Text Format';
  678. CF_RTFNOOBJS = 'Rich Text Format Without Objects';
  679. CF_RETEXTOBJ = 'RichEdit Text and Objects';
  680. type
  681. _repastespecial = record
  682. dwAspect: DWORD;
  683. dwParam: DWORD;
  684. end;
  685. TRepasteSpecial = _repastespecial;
  686. REPASTESPECIAL = _repastespecial;
  687. { UndoName info }
  688. UNDONAMEID = (UID_UNKNOWN, UID_TYPING, UID_DELETE, UID_DRAGDROP, UID_CUT,
  689. UID_PASTE);
  690. { flags for the GETEXTEX data structure }
  691. const
  692. GT_DEFAULT = 0;
  693. GT_USECRLF = 1;
  694. { EM_GETTEXTEX info; this struct is passed in the wparam of the message }
  695. type
  696. PBOOL = ^BOOL;
  697. GETTEXTEX = record
  698. cb: DWORD; { count of bytes in the string }
  699. flags: DWORD; { flags (see the GT_XXX defines }
  700. codepage: UINT; { code page for translation (CP_ACP for default,
  701. 1200 for Unicode }
  702. lpDefaultChar: LPCSTR; { replacement for unmappable chars }
  703. lpUsedDefChar: PBOOL; { pointer to flag set when def char used }
  704. end;
  705. TGetTextEx = GETTEXTEX;
  706. { flags for the GETTEXTLENGTHEX data structure }
  707. const
  708. GTL_DEFAULT = 0; { do the default (return # of chars) }
  709. GTL_USECRLF = 1; { compute answer using CRLFs for paragraphs }
  710. GTL_PRECISE = 2; { compute a precise answer }
  711. GTL_CLOSE = 4; { fast computation of a "close" answer }
  712. GTL_NUMCHARS = 8; { return the number of characters }
  713. GTL_NUMBYTES = 16; { return the number of _bytes_ }
  714. { EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg }
  715. type
  716. GETTEXTLENGTHEX = record
  717. flags: DWORD; { flags (see GTL_XXX defines) }
  718. codepage: UINT; { code page for translation (CP_ACP for default,
  719. 1200 for Unicode }
  720. end;
  721. TGetTextLengthEx = GETTEXTLENGTHEX;
  722. { UNICODE embedding character }
  723. const
  724. WCH_EMBEDDING = $FFFC;
  725. implementation
  726. end.