1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5
6#ifndef _RICHEDIT_
7#define _RICHEDIT_
8
9#include <_mingw_unicode.h>
10#include <winapifamily.h>
11#include <wtypes.h>
12#include <objbase.h>
13
14#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
15
16#include <pshpack4.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifndef _RICHEDIT_VER
23#define _RICHEDIT_VER 0x0800
24#endif
25
26#define cchTextLimitDefault 32767
27
28#define MSFTEDIT_CLASS L"RICHEDIT50W"
29
30#define CERICHEDIT_CLASSA "RichEditCEA"
31#define CERICHEDIT_CLASSW L"RichEditCEW"
32
33#define RICHEDIT_CLASSA "RichEdit20A"
34#define RICHEDIT_CLASS10A "RICHEDIT"
35
36#define RICHEDIT_CLASSW L"RichEdit20W"
37
38#if _RICHEDIT_VER >= 0x0200
39#define RICHEDIT_CLASS __MINGW_NAME_AW(RICHEDIT_CLASS)
40#else
41#define RICHEDIT_CLASS RICHEDIT_CLASS10A
42#endif
43
44#ifndef WM_CONTEXTMENU
45#define WM_CONTEXTMENU 0x007b
46#endif
47
48#ifndef WM_UNICHAR
49#define WM_UNICHAR 0x0109
50#endif
51
52#ifndef WM_PRINTCLIENT
53#define WM_PRINTCLIENT 0x0318
54#endif
55
56#ifndef EM_GETLIMITTEXT
57#define EM_GETLIMITTEXT (WM_USER + 37)
58#endif
59
60#ifndef EM_POSFROMCHAR
61#define EM_POSFROMCHAR (WM_USER + 38)
62#define EM_CHARFROMPOS (WM_USER + 39)
63#endif
64
65#ifndef EM_SCROLLCARET
66#define EM_SCROLLCARET (WM_USER + 49)
67#endif
68#define EM_CANPASTE (WM_USER + 50)
69#define EM_DISPLAYBAND (WM_USER + 51)
70#define EM_EXGETSEL (WM_USER + 52)
71#define EM_EXLIMITTEXT (WM_USER + 53)
72#define EM_EXLINEFROMCHAR (WM_USER + 54)
73#define EM_EXSETSEL (WM_USER + 55)
74#define EM_FINDTEXT (WM_USER + 56)
75#define EM_FORMATRANGE (WM_USER + 57)
76#define EM_GETCHARFORMAT (WM_USER + 58)
77#define EM_GETEVENTMASK (WM_USER + 59)
78#define EM_GETOLEINTERFACE (WM_USER + 60)
79#define EM_GETPARAFORMAT (WM_USER + 61)
80#define EM_GETSELTEXT (WM_USER + 62)
81#define EM_HIDESELECTION (WM_USER + 63)
82#define EM_PASTESPECIAL (WM_USER + 64)
83#define EM_REQUESTRESIZE (WM_USER + 65)
84#define EM_SELECTIONTYPE (WM_USER + 66)
85#define EM_SETBKGNDCOLOR (WM_USER + 67)
86#define EM_SETCHARFORMAT (WM_USER + 68)
87#define EM_SETEVENTMASK (WM_USER + 69)
88#define EM_SETOLECALLBACK (WM_USER + 70)
89#define EM_SETPARAFORMAT (WM_USER + 71)
90#define EM_SETTARGETDEVICE (WM_USER + 72)
91#define EM_STREAMIN (WM_USER + 73)
92#define EM_STREAMOUT (WM_USER + 74)
93#define EM_GETTEXTRANGE (WM_USER + 75)
94#define EM_FINDWORDBREAK (WM_USER + 76)
95#define EM_SETOPTIONS (WM_USER + 77)
96#define EM_GETOPTIONS (WM_USER + 78)
97#define EM_FINDTEXTEX (WM_USER + 79)
98#define EM_GETWORDBREAKPROCEX (WM_USER + 80)
99#define EM_SETWORDBREAKPROCEX (WM_USER + 81)
100#define EM_SETUNDOLIMIT (WM_USER + 82)
101#define EM_REDO (WM_USER + 84)
102#define EM_CANREDO (WM_USER + 85)
103#define EM_GETUNDONAME (WM_USER + 86)
104#define EM_GETREDONAME (WM_USER + 87)
105#define EM_STOPGROUPTYPING (WM_USER + 88)
106#define EM_SETTEXTMODE (WM_USER + 89)
107#define EM_GETTEXTMODE (WM_USER + 90)
108
109  typedef enum tagTextMode {
110    TM_PLAINTEXT = 1,
111    TM_RICHTEXT = 2,
112    TM_SINGLELEVELUNDO = 4,
113    TM_MULTILEVELUNDO = 8,
114    TM_SINGLECODEPAGE = 16,
115    TM_MULTICODEPAGE = 32
116  } TEXTMODE;
117
118#define EM_AUTOURLDETECT (WM_USER + 91)
119
120#if _RICHEDIT_VER >= 0x0800
121#define AURL_ENABLEURL 1
122#define AURL_ENABLEEMAILADDR 2
123#define AURL_ENABLETELNO 4
124#define AURL_ENABLEEAURLS 8
125#define AURL_ENABLEDRIVELETTERS 16
126#define AURL_DISABLEMIXEDLGC 32
127#endif
128
129#define EM_GETAUTOURLDETECT (WM_USER + 92)
130#define EM_SETPALETTE (WM_USER + 93)
131#define EM_GETTEXTEX (WM_USER + 94)
132#define EM_GETTEXTLENGTHEX (WM_USER + 95)
133#define EM_SHOWSCROLLBAR (WM_USER + 96)
134#define EM_SETTEXTEX (WM_USER + 97)
135
136#define EM_SETPUNCTUATION (WM_USER + 100)
137#define EM_GETPUNCTUATION (WM_USER + 101)
138#define EM_SETWORDWRAPMODE (WM_USER + 102)
139#define EM_GETWORDWRAPMODE (WM_USER + 103)
140#define EM_SETIMECOLOR (WM_USER + 104)
141#define EM_GETIMECOLOR (WM_USER + 105)
142#define EM_SETIMEOPTIONS (WM_USER + 106)
143#define EM_GETIMEOPTIONS (WM_USER + 107)
144#define EM_CONVPOSITION (WM_USER + 108)
145
146#define EM_SETLANGOPTIONS (WM_USER + 120)
147#define EM_GETLANGOPTIONS (WM_USER + 121)
148#define EM_GETIMECOMPMODE (WM_USER + 122)
149#define EM_FINDTEXTW (WM_USER + 123)
150#define EM_FINDTEXTEXW (WM_USER + 124)
151#define EM_RECONVERSION (WM_USER + 125)
152#define EM_SETIMEMODEBIAS (WM_USER + 126)
153#define EM_GETIMEMODEBIAS (WM_USER + 127)
154
155#define EM_SETBIDIOPTIONS (WM_USER + 200)
156#define EM_GETBIDIOPTIONS (WM_USER + 201)
157#define EM_SETTYPOGRAPHYOPTIONS (WM_USER + 202)
158#define EM_GETTYPOGRAPHYOPTIONS (WM_USER + 203)
159#define EM_SETEDITSTYLE (WM_USER + 204)
160#define EM_GETEDITSTYLE (WM_USER + 205)
161
162#define SES_EMULATESYSEDIT 1
163#define SES_BEEPONMAXTEXT 2
164#define SES_EXTENDBACKCOLOR 4
165#define SES_MAPCPS 8
166#if _RICHEDIT_VER >= 0x0500
167#define SES_HYPERLINKTOOLTIPS 8
168#endif
169#define SES_EMULATE10 16
170#if _RICHEDIT_VER >= 0x0700
171#define SES_DEFAULTLATINLIGA 16
172#endif
173#define SES_USECRLF 32
174#define SES_USEAIMM 64
175#define SES_NOIME 128
176
177#define SES_ALLOWBEEPS 256
178#define SES_UPPERCASE 512
179#define SES_LOWERCASE 1024
180#define SES_NOINPUTSEQUENCECHK 2048
181#define SES_BIDI 4096
182#define SES_SCROLLONKILLFOCUS 8192
183#define SES_XLTCRCRLFTOCR 16384
184#define SES_DRAFTMODE 32768
185
186#define SES_USECTF 0x00010000
187#define SES_HIDEGRIDLINES 0x00020000
188#define SES_USEATFONT 0x00040000
189#define SES_CUSTOMLOOK 0x00080000
190#define SES_LBSCROLLNOTIFY 0x00100000
191#define SES_CTFALLOWEMBED 0x00200000
192#define SES_CTFALLOWSMARTTAG 0x00400000
193#define SES_CTFALLOWPROOFING 0x00800000
194#if _RICHEDIT_VER >= 0x0500
195#define SES_LOGICALCARET 0x01000000
196#define SES_WORDDRAGDROP 0x02000000
197#define SES_SMARTDRAGDROP 0x04000000
198#define SES_MULTISELECT 0x08000000
199#define SES_CTFNOLOCK 0x10000000
200#define SES_NOEALINEHEIGHTADJUST 0x20000000
201#define SES_MAX 0x20000000
202#endif
203
204#define IMF_AUTOKEYBOARD 0x0001
205#define IMF_AUTOFONT 0x0002
206#define IMF_IMECANCELCOMPLETE 0x0004
207#define IMF_IMEALWAYSSENDNOTIFY 0x0008
208#define IMF_AUTOFONTSIZEADJUST 0x0010
209#define IMF_UIFONTS 0x0020
210#if _RICHEDIT_VER >= 0x0800
211#define IMF_NOIMPLICITLANG 0x0040
212#endif
213#define IMF_DUALFONT 0x0080
214#if _RICHEDIT_VER >= 0x0800
215#define IMF_NOKBDLIDFIXUP 0x0200
216#endif
217#define IMF_NORTFFONTSUBSTITUTE 0x0400
218#if _RICHEDIT_VER >= 0x0800
219#define IMF_SPELLCHECKING 0x0800
220#define IMF_TKBPREDICTION 0x1000
221#endif
222
223#define ICM_NOTOPEN 0x0000
224#define ICM_LEVEL3 0x0001
225#define ICM_LEVEL2 0x0002
226#define ICM_LEVEL2_5 0x0003
227#define ICM_LEVEL2_SUI 0x0004
228#define ICM_CTF 0x0005
229
230#define TO_ADVANCEDTYPOGRAPHY 0x0001
231#define TO_SIMPLELINEBREAK 0x0002
232#define TO_DISABLECUSTOMTEXTOUT 0x0004
233#define TO_ADVANCEDLAYOUT 0x0008
234
235#define EM_OUTLINE (WM_USER + 220)
236
237#define EM_GETSCROLLPOS (WM_USER + 221)
238#define EM_SETSCROLLPOS (WM_USER + 222)
239
240#define EM_SETFONTSIZE (WM_USER + 223)
241#define EM_GETZOOM (WM_USER + 224)
242#define EM_SETZOOM (WM_USER + 225)
243#define EM_GETVIEWKIND (WM_USER + 226)
244#define EM_SETVIEWKIND (WM_USER + 227)
245
246#define EM_GETPAGE (WM_USER + 228)
247#define EM_SETPAGE (WM_USER + 229)
248#define EM_GETHYPHENATEINFO (WM_USER + 230)
249#define EM_SETHYPHENATEINFO (WM_USER + 231)
250
251#define EM_GETPAGEROTATE (WM_USER + 235)
252#define EM_SETPAGEROTATE (WM_USER + 236)
253#define EM_GETCTFMODEBIAS (WM_USER + 237)
254#define EM_SETCTFMODEBIAS (WM_USER + 238)
255#define EM_GETCTFOPENSTATUS (WM_USER + 240)
256#define EM_SETCTFOPENSTATUS (WM_USER + 241)
257#define EM_GETIMECOMPTEXT (WM_USER + 242)
258#define EM_ISIME (WM_USER + 243)
259#define EM_GETIMEPROPERTY (WM_USER + 244)
260
261#define EM_GETQUERYRTFOBJ (WM_USER + 269)
262#define EM_SETQUERYRTFOBJ (WM_USER + 270)
263
264#define EPR_0 0
265#define EPR_270 1
266#define EPR_180 2
267#define EPR_90 3
268#if _RICHEDIT_VER >= 0x0800
269#define EPR_SE 5
270#endif
271
272#define CTFMODEBIAS_DEFAULT 0x0000
273#define CTFMODEBIAS_FILENAME 0x0001
274#define CTFMODEBIAS_NAME 0x0002
275#define CTFMODEBIAS_READING 0x0003
276#define CTFMODEBIAS_DATETIME 0x0004
277#define CTFMODEBIAS_CONVERSATION 0x0005
278#define CTFMODEBIAS_NUMERIC 0x0006
279#define CTFMODEBIAS_HIRAGANA 0x0007
280#define CTFMODEBIAS_KATAKANA 0x0008
281#define CTFMODEBIAS_HANGUL 0x0009
282#define CTFMODEBIAS_HALFWIDTHKATAKANA 0x000a
283#define CTFMODEBIAS_FULLWIDTHALPHANUMERIC 0x000b
284#define CTFMODEBIAS_HALFWIDTHALPHANUMERIC 0x000c
285
286#define IMF_SMODE_PLAURALCLAUSE 0x0001
287#define IMF_SMODE_NONE 0x0002
288
289  typedef struct _imecomptext {
290    LONG cb;
291    DWORD flags;
292  } IMECOMPTEXT;
293#define ICT_RESULTREADSTR 1
294
295#define EMO_EXIT 0
296#define EMO_ENTER 1
297#define EMO_PROMOTE 2
298
299#define EMO_EXPAND 3
300
301#define EMO_MOVESELECTION 4
302
303#define EMO_GETVIEWMODE 5
304
305#define EMO_EXPANDSELECTION 0
306#define EMO_EXPANDDOCUMENT 1
307
308#define VM_NORMAL 4
309#define VM_OUTLINE 2
310#define VM_PAGE 9
311
312#if _RICHEDIT_VER >= 0x0800
313
314#define EM_INSERTTABLE (WM_USER + 232)
315
316  typedef struct _tableRowParms {
317    BYTE cbRow;
318    BYTE cbCell;
319    BYTE cCell;
320    BYTE cRow;
321    LONG dxCellMargin;
322    LONG dxIndent;
323    LONG dyHeight;
324    DWORD nAlignment:3;
325    DWORD fRTL:1;
326    DWORD fKeep:1;
327    DWORD fKeepFollow:1;
328    DWORD fWrap:1;
329    DWORD fIdentCells:1;
330    LONG cpStartRow;
331    BYTE bTableLevel;
332    BYTE iCell;
333  } TABLEROWPARMS;
334
335  typedef struct _tableCellParms {
336    LONG dxWidth;
337    WORD nVertAlign:2;
338    WORD fMergeTop:1;
339    WORD fMergePrev:1;
340    WORD fVertical:1;
341    WORD fMergeStart:1;
342    WORD fMergeCont:1;
343    WORD wShading;
344    SHORT dxBrdrLeft;
345    SHORT dyBrdrTop;
346    SHORT dxBrdrRight;
347    SHORT dyBrdrBottom;
348    COLORREF crBrdrLeft;
349    COLORREF crBrdrTop;
350    COLORREF crBrdrRight;
351    COLORREF crBrdrBottom;
352    COLORREF crBackPat;
353    COLORREF crForePat;
354  } TABLECELLPARMS;
355#define EM_GETAUTOCORRECTPROC (WM_USER + 233)
356#define EM_SETAUTOCORRECTPROC (WM_USER + 234)
357#define EM_CALLAUTOCORRECTPROC (WM_USER + 255)
358
359  typedef int (WINAPI *AutoCorrectProc) (LANGID langid, const WCHAR *pszBefore, WCHAR *pszAfter, LONG cchAfter, LONG *pcchReplaced);
360
361#define ATP_NOCHANGE 0
362#define ATP_CHANGE 1
363#define ATP_NODELIMITER 2
364#define ATP_REPLACEALLTEXT 4
365
366#define EM_GETTABLEPARMS (WM_USER + 265)
367
368#define EM_SETEDITSTYLEEX (WM_USER + 275)
369#define EM_GETEDITSTYLEEX (WM_USER + 276)
370
371#define SES_EX_NOTABLE 0x00000004
372#define SES_EX_HANDLEFRIENDLYURL 0x00000100
373#define SES_EX_NOTHEMING 0x00080000
374#define SES_EX_NOACETATESELECTION 0x00100000
375#define SES_EX_USESINGLELINE 0x00200000
376#define SES_EX_MULTITOUCH 0x08000000
377#define SES_EX_HIDETEMPFORMAT 0x10000000
378#define SES_EX_USEMOUSEWPARAM 0x20000000
379
380#define EM_GETSTORYTYPE (WM_USER + 290)
381#define EM_SETSTORYTYPE (WM_USER + 291)
382
383#define EM_GETELLIPSISMODE (WM_USER + 305)
384#define EM_SETELLIPSISMODE (WM_USER + 306)
385
386#define ELLIPSIS_MASK 0x00000003
387#define ELLIPSIS_NONE 0x00000000
388#define ELLIPSIS_END 0x00000001
389#define ELLIPSIS_WORD 0x00000003
390
391#define EM_SETTABLEPARMS (WM_USER + 307)
392
393#define EM_GETTOUCHOPTIONS (WM_USER + 310)
394#define EM_SETTOUCHOPTIONS (WM_USER + 311)
395#define EM_INSERTIMAGE (WM_USER + 314)
396#define EM_SETUIANAME (WM_USER + 320)
397#define EM_GETELLIPSISSTATE (WM_USER + 322)
398
399#define RTO_SHOWHANDLES 1
400#define RTO_DISABLEHANDLES 2
401#define RTO_READINGMODE 3
402
403  typedef struct tagRICHEDIT_IMAGE_PARAMETERS {
404    LONG xWidth;
405    LONG yHeight;
406    LONG Ascent;
407    LONG Type;
408    LPCWSTR pwszAlternateText;
409    IStream *pIStream;
410  } RICHEDIT_IMAGE_PARAMETERS;
411#endif
412
413#define EN_MSGFILTER 0x0700
414#define EN_REQUESTRESIZE 0x0701
415#define EN_SELCHANGE 0x0702
416#define EN_DROPFILES 0x0703
417#define EN_PROTECTED 0x0704
418#define EN_CORRECTTEXT 0x0705
419#define EN_STOPNOUNDO 0x0706
420#define EN_IMECHANGE 0x0707
421#define EN_SAVECLIPBOARD 0x0708
422#define EN_OLEOPFAILED 0x0709
423#define EN_OBJECTPOSITIONS 0x070a
424#define EN_LINK 0x070b
425#define EN_DRAGDROPDONE 0x070c
426#define EN_PARAGRAPHEXPANDED 0x070d
427#define EN_PAGECHANGE 0x070e
428#define EN_LOWFIRTF 0x070f
429#define EN_ALIGNLTR 0x0710
430#define EN_ALIGNRTL 0x0711
431#if _RICHEDIT_VER >= 0x0800
432#define EN_CLIPFORMAT 0x0712
433#define EN_STARTCOMPOSITION 0x0713
434#define EN_ENDCOMPOSITION 0x0714
435
436  typedef struct _endcomposition {
437    NMHDR nmhdr;
438    DWORD dwCode;
439  } ENDCOMPOSITIONNOTIFY;
440
441#define ECN_ENDCOMPOSITION 0x0001
442#define ECN_NEWTEXT 0x0002
443#endif
444
445#define ENM_NONE 0x00000000
446#define ENM_CHANGE 0x00000001
447#define ENM_UPDATE 0x00000002
448#define ENM_SCROLL 0x00000004
449#define ENM_SCROLLEVENTS 0x00000008
450#define ENM_DRAGDROPDONE 0x00000010
451#define ENM_PARAGRAPHEXPANDED 0x00000020
452#define ENM_PAGECHANGE 0x00000040
453#if _RICHEDIT_VER >= 0x0800
454#define ENM_CLIPFORMAT 0x00000080
455#endif
456#define ENM_KEYEVENTS 0x00010000
457#define ENM_MOUSEEVENTS 0x00020000
458#define ENM_REQUESTRESIZE 0x00040000
459#define ENM_SELCHANGE 0x00080000
460#define ENM_DROPFILES 0x00100000
461#define ENM_PROTECTED 0x00200000
462#define ENM_CORRECTTEXT 0x00400000
463#define ENM_IMECHANGE 0x00800000
464#define ENM_LANGCHANGE 0x01000000
465#define ENM_OBJECTPOSITIONS 0x02000000
466#define ENM_LINK 0x04000000
467#define ENM_LOWFIRTF 0x08000000
468#if _RICHEDIT_VER >= 0x0800
469#define ENM_STARTCOMPOSITION 0x10000000
470#define ENM_ENDCOMPOSITION 0x20000000
471#define ENM_GROUPTYPINGCHANGE 0x40000000
472#define ENM_HIDELINKTOOLTIP 0x80000000
473#endif
474
475#define ES_SAVESEL 0x00008000
476#define ES_SUNKEN 0x00004000
477#define ES_DISABLENOSCROLL 0x00002000
478#define ES_SELECTIONBAR 0x01000000
479#define ES_NOOLEDRAGDROP 0x00000008
480#define ES_EX_NOCALLOLEINIT 0x00000000
481#define ES_VERTICAL 0x00400000
482#define ES_NOIME 0x00080000
483#define ES_SELFIME 0x00040000
484
485#define ECO_AUTOWORDSELECTION 0x00000001
486#define ECO_AUTOVSCROLL 0x00000040
487#define ECO_AUTOHSCROLL 0x00000080
488#define ECO_NOHIDESEL 0x00000100
489#define ECO_READONLY 0x00000800
490#define ECO_WANTRETURN 0x00001000
491#define ECO_SAVESEL 0x00008000
492#define ECO_SELECTIONBAR 0x01000000
493#define ECO_VERTICAL 0x00400000
494
495#define ECOOP_SET 0x0001
496#define ECOOP_OR 0x0002
497#define ECOOP_AND 0x0003
498#define ECOOP_XOR 0x0004
499
500#define WB_CLASSIFY 3
501#define WB_MOVEWORDLEFT 4
502#define WB_MOVEWORDRIGHT 5
503#define WB_LEFTBREAK 6
504#define WB_RIGHTBREAK 7
505
506#define WB_MOVEWORDPREV 4
507#define WB_MOVEWORDNEXT 5
508#define WB_PREVBREAK 6
509#define WB_NEXTBREAK 7
510
511#define PC_FOLLOWING 1
512#define PC_LEADING 2
513#define PC_OVERFLOW 3
514#define PC_DELIMITER 4
515#define WBF_WORDWRAP 0x010
516#define WBF_WORDBREAK 0x020
517#define WBF_OVERFLOW 0x040
518#define WBF_LEVEL1 0x080
519#define WBF_LEVEL2 0x100
520#define WBF_CUSTOM 0x200
521
522#define IMF_FORCENONE 0x0001
523#define IMF_FORCEENABLE 0x0002
524#define IMF_FORCEDISABLE 0x0004
525#define IMF_CLOSESTATUSWINDOW 0x0008
526#define IMF_VERTICAL 0x0020
527#define IMF_FORCEACTIVE 0x0040
528#define IMF_FORCEINACTIVE 0x0080
529#define IMF_FORCEREMEMBER 0x0100
530#define IMF_MULTIPLEEDIT 0x0400
531
532#define WBF_CLASS ((BYTE) 0x0f)
533#define WBF_ISWHITE ((BYTE) 0x10)
534#define WBF_BREAKLINE ((BYTE) 0x20)
535#define WBF_BREAKAFTER ((BYTE) 0x40)
536
537  typedef LONG (*EDITWORDBREAKPROCEX)(char *pchText, LONG cchText, BYTE bCharSet, INT action);
538
539  typedef struct _charformat {
540    UINT cbSize;
541    DWORD dwMask;
542    DWORD dwEffects;
543    LONG yHeight;
544    LONG yOffset;
545    COLORREF crTextColor;
546    BYTE bCharSet;
547    BYTE bPitchAndFamily;
548    char szFaceName[LF_FACESIZE];
549  } CHARFORMATA;
550
551  typedef struct _charformatw {
552    UINT cbSize;
553    DWORD dwMask;
554    DWORD dwEffects;
555    LONG yHeight;
556    LONG yOffset;
557    COLORREF crTextColor;
558    BYTE bCharSet;
559    BYTE bPitchAndFamily;
560    WCHAR szFaceName[LF_FACESIZE];
561  } CHARFORMATW;
562
563#if _RICHEDIT_VER >= 0x0200
564#define CHARFORMAT __MINGW_NAME_AW(CHARFORMAT)
565#else
566#define CHARFORMAT CHARFORMATA
567#endif
568
569#if defined (__cplusplus)
570  struct CHARFORMAT2W : _charformatw {
571    WORD wWeight;
572    SHORT sSpacing;
573    COLORREF crBackColor;
574    LCID lcid;
575#if _RICHEDIT_VER >= 0x0500
576    __C89_NAMELESS union {
577      DWORD dwReserved;
578      DWORD dwCookie;
579    };
580#else
581    DWORD dwReserved;
582#endif
583    SHORT sStyle;
584    WORD wKerning;
585    BYTE bUnderlineType;
586    BYTE bAnimation;
587    BYTE bRevAuthor;
588#if _RICHEDIT_VER >= 0x0800
589    BYTE bUnderlineColor;
590#endif
591  };
592
593  struct CHARFORMAT2A : _charformat {
594    WORD wWeight;
595    SHORT sSpacing;
596    COLORREF crBackColor;
597    LCID lcid;
598#if _RICHEDIT_VER >= 0x0500
599    __C89_NAMELESS union {
600      DWORD dwReserved;
601      DWORD dwCookie;
602    };
603#else
604    DWORD dwReserved;
605#endif
606    SHORT sStyle;
607    WORD wKerning;
608    BYTE bUnderlineType;
609    BYTE bAnimation;
610    BYTE bRevAuthor;
611#if _RICHEDIT_VER >= 0x0800
612    BYTE bUnderlineColor;
613#endif
614  };
615#else
616  typedef struct _charformat2w {
617    UINT cbSize;
618    DWORD dwMask;
619    DWORD dwEffects;
620    LONG yHeight;
621    LONG yOffset;
622    COLORREF crTextColor;
623    BYTE bCharSet;
624    BYTE bPitchAndFamily;
625    WCHAR szFaceName[LF_FACESIZE];
626    WORD wWeight;
627    SHORT sSpacing;
628    COLORREF crBackColor;
629    LCID lcid;
630#if _RICHEDIT_VER >= 0x0500
631    __C89_NAMELESS union {
632      DWORD dwReserved;
633      DWORD dwCookie;
634    };
635#else
636    DWORD dwReserved;
637#endif
638    SHORT sStyle;
639    WORD wKerning;
640    BYTE bUnderlineType;
641    BYTE bAnimation;
642    BYTE bRevAuthor;
643#if _RICHEDIT_VER >= 0x0800
644    BYTE bUnderlineColor;
645#endif
646  } CHARFORMAT2W;
647
648  typedef struct _charformat2a {
649    UINT cbSize;
650    DWORD dwMask;
651    DWORD dwEffects;
652    LONG yHeight;
653    LONG yOffset;
654    COLORREF crTextColor;
655    BYTE bCharSet;
656    BYTE bPitchAndFamily;
657    char szFaceName[LF_FACESIZE];
658    WORD wWeight;
659    SHORT sSpacing;
660    COLORREF crBackColor;
661    LCID lcid;
662#if _RICHEDIT_VER >= 0x0500
663    __C89_NAMELESS union {
664      DWORD dwReserved;
665      DWORD dwCookie;
666    };
667#else
668    DWORD dwReserved;
669#endif
670    SHORT sStyle;
671    WORD wKerning;
672    BYTE bUnderlineType;
673    BYTE bAnimation;
674    BYTE bRevAuthor;
675#if _RICHEDIT_VER >= 0x0800
676    BYTE bUnderlineColor;
677#endif
678  } CHARFORMAT2A;
679#endif
680
681#define CHARFORMAT2 __MINGW_NAME_AW(CHARFORMAT2)
682
683#define CHARFORMATDELTA (sizeof (CHARFORMAT2) - sizeof (CHARFORMAT))
684
685#define CFM_BOLD 0x00000001
686#define CFM_ITALIC 0x00000002
687#define CFM_UNDERLINE 0x00000004
688#define CFM_STRIKEOUT 0x00000008
689#define CFM_PROTECTED 0x00000010
690#define CFM_LINK 0x00000020
691#define CFM_SIZE 0x80000000
692#define CFM_COLOR 0x40000000
693#define CFM_FACE 0x20000000
694#define CFM_OFFSET 0x10000000
695#define CFM_CHARSET 0x08000000
696
697#define CFE_BOLD 0x00000001
698#define CFE_ITALIC 0x00000002
699#define CFE_UNDERLINE 0x00000004
700#define CFE_STRIKEOUT 0x00000008
701#define CFE_PROTECTED 0x00000010
702#define CFE_LINK 0x00000020
703#define CFE_AUTOCOLOR 0x40000000
704
705#define CFM_SMALLCAPS 0x00000040
706#define CFM_ALLCAPS 0x00000080
707#define CFM_HIDDEN 0x00000100
708#define CFM_OUTLINE 0x00000200
709#define CFM_SHADOW 0x00000400
710#define CFM_EMBOSS 0x00000800
711#define CFM_IMPRINT 0x00001000
712#define CFM_DISABLED 0x00002000
713#define CFM_REVISED 0x00004000
714
715#define CFM_REVAUTHOR 0x00008000
716#define CFE_SUBSCRIPT 0x00010000
717#define CFE_SUPERSCRIPT 0x00020000
718#define CFM_ANIMATION 0x00040000
719#define CFM_STYLE 0x00080000
720#define CFM_KERNING 0x00100000
721#define CFM_SPACING 0x00200000
722#define CFM_WEIGHT 0x00400000
723#define CFM_UNDERLINETYPE 0x00800000
724#if _RICHEDIT_VER >= 0x0600
725#define CFM_COOKIE 0x01000000
726#endif
727#define CFM_LCID 0x02000000
728#define CFM_BACKCOLOR 0x04000000
729
730#define CFM_SUBSCRIPT (CFE_SUBSCRIPT | CFE_SUPERSCRIPT)
731#define CFM_SUPERSCRIPT CFM_SUBSCRIPT
732
733#define CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK)
734#define CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET)
735
736#define CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS | CFM_HIDDEN | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS | CFM_IMPRINT | CFM_REVISED | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR)
737
738#if _RICHEDIT_VER >= 0x0600
739#define CFM_ALL2 (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION | CFM_COOKIE)
740#else
741#define CFM_ALL2 (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION)
742#endif
743
744#define CFE_SMALLCAPS CFM_SMALLCAPS
745#define CFE_ALLCAPS CFM_ALLCAPS
746#define CFE_HIDDEN CFM_HIDDEN
747#define CFE_OUTLINE CFM_OUTLINE
748#define CFE_SHADOW CFM_SHADOW
749#define CFE_EMBOSS CFM_EMBOSS
750#define CFE_IMPRINT CFM_IMPRINT
751#define CFE_DISABLED CFM_DISABLED
752#define CFE_REVISED CFM_REVISED
753
754#define CFE_AUTOBACKCOLOR CFM_BACKCOLOR
755
756#define CFM_FONTBOUND 0x00100000
757#define CFM_LINKPROTECTED 0x00800000
758#define CFM_EXTENDED 0x02000000
759#define CFM_MATHNOBUILDUP 0x08000000
760#define CFM_MATH 0x10000000
761#define CFM_MATHORDINARY 0x20000000
762
763#define CFM_ALLEFFECTS (CFM_EFFECTS2 | CFM_FONTBOUND | CFM_EXTENDED | CFM_MATHNOBUILDUP | CFM_MATH | CFM_MATHORDINARY)
764
765#define CFE_FONTBOUND 0x00100000
766#define CFE_LINKPROTECTED 0x00800000
767#define CFE_EXTENDED 0x02000000
768#define CFE_MATHNOBUILDUP 0x08000000
769#define CFE_MATH 0x10000000
770#define CFE_MATHORDINARY 0x20000000
771
772#define CFU_CF1UNDERLINE 0xff
773#define CFU_INVERT 0xfe
774#define CFU_UNDERLINETHICKLONGDASH 18
775#define CFU_UNDERLINETHICKDOTTED 17
776#define CFU_UNDERLINETHICKDASHDOTDOT 16
777#define CFU_UNDERLINETHICKDASHDOT 15
778#define CFU_UNDERLINETHICKDASH 14
779#define CFU_UNDERLINELONGDASH 13
780#define CFU_UNDERLINEHEAVYWAVE 12
781#define CFU_UNDERLINEDOUBLEWAVE 11
782#define CFU_UNDERLINEHAIRLINE 10
783#define CFU_UNDERLINETHICK 9
784#define CFU_UNDERLINEWAVE 8
785#define CFU_UNDERLINEDASHDOTDOT 7
786#define CFU_UNDERLINEDASHDOT 6
787#define CFU_UNDERLINEDASH 5
788#define CFU_UNDERLINEDOTTED 4
789#define CFU_UNDERLINEDOUBLE 3
790#define CFU_UNDERLINEWORD 2
791#define CFU_UNDERLINE 1
792#define CFU_UNDERLINENONE 0
793
794#define yHeightCharPtsMost 1638
795
796#define SCF_SELECTION 0x0001
797#define SCF_WORD 0x0002
798#define SCF_DEFAULT 0x0000
799#define SCF_ALL 0x0004
800#define SCF_USEUIRULES 0x0008
801
802#define SCF_ASSOCIATEFONT 0x0010
803
804#define SCF_NOKBUPDATE 0x0020
805
806#define SCF_ASSOCIATEFONT2 0x0040
807#if _RICHEDIT_VER >= 0x0500
808#define SCF_SMARTFONT 0x0080
809#define SCF_CHARREPFROMLCID 0x0100
810
811#define SPF_DONTSETDEFAULT 0x0002
812#define SPF_SETDEFAULT 0x0004
813#endif
814
815  typedef struct _charrange {
816    LONG cpMin;
817    LONG cpMax;
818  } CHARRANGE;
819
820  typedef struct _textrange {
821    CHARRANGE chrg;
822    LPSTR lpstrText;
823  } TEXTRANGEA;
824
825  typedef struct _textrangew {
826    CHARRANGE chrg;
827    LPWSTR lpstrText;
828  } TEXTRANGEW;
829#if _RICHEDIT_VER >= 0x0200
830#define TEXTRANGE __MINGW_NAME_AW(TEXTRANGE)
831#else
832#define TEXTRANGE TEXTRANGEA
833#endif
834
835  typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
836
837  typedef struct _editstream {
838    DWORD_PTR dwCookie;
839    DWORD dwError;
840    EDITSTREAMCALLBACK pfnCallback;
841  } EDITSTREAM;
842
843#define SF_TEXT 0x0001
844#define SF_RTF 0x0002
845#define SF_RTFNOOBJS 0x0003
846#define SF_TEXTIZED 0x0004
847
848#define SF_UNICODE 0x0010
849#define SF_USECODEPAGE 0x0020
850#define SF_NCRFORNONASCII 0x40
851#define SFF_WRITEXTRAPAR 0x80
852#define SFF_SELECTION 0x8000
853#define SFF_PLAINRTF 0x4000
854#define SFF_PERSISTVIEWSCALE 0x2000
855#define SFF_KEEPDOCINFO 0x1000
856#define SFF_PWD 0x0800
857#define SF_RTFVAL 0x0700
858
859  typedef struct _findtext {
860    CHARRANGE chrg;
861    LPCSTR lpstrText;
862  } FINDTEXTA;
863
864  typedef struct _findtextw {
865    CHARRANGE chrg;
866    LPCWSTR lpstrText;
867  } FINDTEXTW;
868
869#if _RICHEDIT_VER >= 0x0200
870#define FINDTEXT __MINGW_NAME_AW(FINDTEXT)
871#else
872#define FINDTEXT FINDTEXTA
873#endif
874
875  typedef struct _findtextexa {
876    CHARRANGE chrg;
877    LPCSTR lpstrText;
878    CHARRANGE chrgText;
879  } FINDTEXTEXA;
880
881  typedef struct _findtextexw {
882    CHARRANGE chrg;
883    LPCWSTR lpstrText;
884    CHARRANGE chrgText;
885  } FINDTEXTEXW;
886
887#if _RICHEDIT_VER >= 0x0200
888#define FINDTEXTEX __MINGW_NAME_AW(FINDTEXTEX)
889#else
890#define FINDTEXTEX FINDTEXTEXA
891#endif
892
893  typedef struct _formatrange {
894    HDC hdc;
895    HDC hdcTarget;
896    RECT rc;
897    RECT rcPage;
898    CHARRANGE chrg;
899  } FORMATRANGE;
900
901#define MAX_TAB_STOPS 32
902#define lDefaultTab 720
903#define MAX_TABLE_CELLS 63
904
905  typedef struct _paraformat {
906    UINT cbSize;
907    DWORD dwMask;
908    WORD wNumbering;
909    __C89_NAMELESS union {
910      WORD wReserved;
911      WORD wEffects;
912    };
913    LONG dxStartIndent;
914    LONG dxRightIndent;
915    LONG dxOffset;
916    WORD wAlignment;
917    SHORT cTabCount;
918    LONG rgxTabs[MAX_TAB_STOPS];
919  } PARAFORMAT;
920
921#ifdef __cplusplus
922  struct PARAFORMAT2 : _paraformat {
923    LONG dySpaceBefore;
924    LONG dySpaceAfter;
925    LONG dyLineSpacing;
926    SHORT sStyle;
927    BYTE bLineSpacingRule;
928    BYTE bOutlineLevel;
929    WORD wShadingWeight;
930    WORD wShadingStyle;
931    WORD wNumberingStart;
932    WORD wNumberingStyle;
933    WORD wNumberingTab;
934    WORD wBorderSpace;
935    WORD wBorderWidth;
936    WORD wBorders;
937  };
938#else
939  typedef struct _paraformat2 {
940    UINT cbSize;
941    DWORD dwMask;
942    WORD wNumbering;
943    __C89_NAMELESS union {
944      WORD wReserved;
945      WORD wEffects;
946    };
947    LONG dxStartIndent;
948    LONG dxRightIndent;
949    LONG dxOffset;
950    WORD wAlignment;
951    SHORT cTabCount;
952    LONG rgxTabs[MAX_TAB_STOPS];
953    LONG dySpaceBefore;
954    LONG dySpaceAfter;
955    LONG dyLineSpacing;
956    SHORT sStyle;
957    BYTE bLineSpacingRule;
958    BYTE bOutlineLevel;
959    WORD wShadingWeight;
960    WORD wShadingStyle;
961    WORD wNumberingStart;
962    WORD wNumberingStyle;
963    WORD wNumberingTab;
964    WORD wBorderSpace;
965    WORD wBorderWidth;
966    WORD wBorders;
967  } PARAFORMAT2;
968#endif
969
970#define PFM_STARTINDENT 0x00000001
971#define PFM_RIGHTINDENT 0x00000002
972#define PFM_OFFSET 0x00000004
973#define PFM_ALIGNMENT 0x00000008
974#define PFM_TABSTOPS 0x00000010
975#define PFM_NUMBERING 0x00000020
976#define PFM_OFFSETINDENT 0x80000000
977
978#define PFM_SPACEBEFORE 0x00000040
979#define PFM_SPACEAFTER 0x00000080
980#define PFM_LINESPACING 0x00000100
981#define PFM_STYLE 0x00000400
982#define PFM_BORDER 0x00000800
983#define PFM_SHADING 0x00001000
984#define PFM_NUMBERINGSTYLE 0x00002000
985#define PFM_NUMBERINGTAB 0x00004000
986#define PFM_NUMBERINGSTART 0x00008000
987
988#define PFM_RTLPARA 0x00010000
989#define PFM_KEEP 0x00020000
990#define PFM_KEEPNEXT 0x00040000
991#define PFM_PAGEBREAKBEFORE 0x00080000
992#define PFM_NOLINENUMBER 0x00100000
993#define PFM_NOWIDOWCONTROL 0x00200000
994#define PFM_DONOTHYPHEN 0x00400000
995#define PFM_SIDEBYSIDE 0x00800000
996
997#define PFM_COLLAPSED 0x01000000
998#define PFM_OUTLINELEVEL 0x02000000
999#define PFM_BOX 0x04000000
1000#define PFM_RESERVED2 0x08000000
1001#define PFM_TABLEROWDELIMITER 0x10000000
1002#define PFM_TEXTWRAPPINGBREAK 0x20000000
1003#define PFM_TABLE 0x40000000
1004
1005#define PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | PFM_ALIGNMENT | PFM_TABSTOPS | PFM_NUMBERING | PFM_OFFSETINDENT| PFM_RTLPARA)
1006
1007#define PFM_EFFECTS (PFM_RTLPARA | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE | PFM_TABLE | PFM_TABLEROWDELIMITER)
1008
1009#define PFM_ALL2 (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE)
1010
1011#define PFE_RTLPARA (PFM_RTLPARA >> 16)
1012#define PFE_KEEP (PFM_KEEP >> 16)
1013#define PFE_KEEPNEXT (PFM_KEEPNEXT >> 16)
1014#define PFE_PAGEBREAKBEFORE (PFM_PAGEBREAKBEFORE >> 16)
1015#define PFE_NOLINENUMBER (PFM_NOLINENUMBER >> 16)
1016#define PFE_NOWIDOWCONTROL (PFM_NOWIDOWCONTROL >> 16)
1017#define PFE_DONOTHYPHEN (PFM_DONOTHYPHEN >> 16)
1018#define PFE_SIDEBYSIDE (PFM_SIDEBYSIDE >> 16)
1019
1020#define PFE_TEXTWRAPPINGBREAK (PFM_TEXTWRAPPINGBREAK>>16)
1021
1022#define PFE_COLLAPSED (PFM_COLLAPSED >> 16)
1023#define PFE_BOX (PFM_BOX >> 16)
1024#define PFE_TABLE (PFM_TABLE >> 16)
1025#define PFE_TABLEROWDELIMITER (PFM_TABLEROWDELIMITER>>16)
1026
1027#define PFN_BULLET 1
1028
1029#define PFN_ARABIC 2
1030#define PFN_LCLETTER 3
1031#define PFN_UCLETTER 4
1032#define PFN_LCROMAN 5
1033#define PFN_UCROMAN 6
1034
1035#define PFNS_PAREN 0x000
1036#define PFNS_PARENS 0x100
1037#define PFNS_PERIOD 0x200
1038#define PFNS_PLAIN 0x300
1039#define PFNS_NONUMBER 0x400
1040
1041#define PFNS_NEWNUMBER 0x8000
1042
1043#define PFA_LEFT 1
1044#define PFA_RIGHT 2
1045#define PFA_CENTER 3
1046
1047#define PFA_JUSTIFY 4
1048#define PFA_FULL_INTERWORD 4
1049
1050#ifndef WM_NOTIFY
1051#define WM_NOTIFY 0x004e
1052
1053  typedef struct _nmhdr {
1054    HWND hwndFrom;
1055    UINT idFrom;
1056    UINT code;
1057  } NMHDR;
1058#endif
1059
1060  typedef struct _msgfilter {
1061    NMHDR nmhdr;
1062    UINT msg;
1063    WPARAM wParam;
1064    LPARAM lParam;
1065  } MSGFILTER;
1066
1067  typedef struct _reqresize {
1068    NMHDR nmhdr;
1069    RECT rc;
1070  } REQRESIZE;
1071
1072  typedef struct _selchange {
1073    NMHDR nmhdr;
1074    CHARRANGE chrg;
1075    WORD seltyp;
1076  } SELCHANGE;
1077
1078#if _RICHEDIT_VER >= 0x0800
1079  typedef struct _grouptypingchange {
1080    NMHDR nmhdr;
1081    WINBOOL fGroupTyping;
1082  } GROUPTYPINGCHANGE;
1083#endif
1084
1085  typedef struct _clipboardformat {
1086    NMHDR nmhdr;
1087    CLIPFORMAT cf;
1088  } CLIPBOARDFORMAT;
1089
1090#define SEL_EMPTY 0x0000
1091#define SEL_TEXT 0x0001
1092#define SEL_OBJECT 0x0002
1093#define SEL_MULTICHAR 0x0004
1094#define SEL_MULTIOBJECT 0x0008
1095
1096#define GCM_RIGHTMOUSEDROP 0x8000
1097
1098#if _RICHEDIT_VER >= 0x0800
1099  typedef struct _getcontextmenuex {
1100    CHARRANGE chrg;
1101    DWORD dwFlags;
1102    POINT pt;
1103    void *pvReserved;
1104  } GETCONTEXTMENUEX;
1105
1106#define GCMF_GRIPPER 0x00000001
1107#define GCMF_SPELLING 0x00000002
1108
1109#define GCMF_TOUCHMENU 0x00004000
1110#define GCMF_MOUSEMENU 0x00002000
1111#endif
1112
1113  typedef struct _endropfiles {
1114    NMHDR nmhdr;
1115    HANDLE hDrop;
1116    LONG cp;
1117    WINBOOL fProtected;
1118  } ENDROPFILES;
1119
1120  typedef struct _enprotected {
1121    NMHDR nmhdr;
1122    UINT msg;
1123    WPARAM wParam;
1124    LPARAM lParam;
1125    CHARRANGE chrg;
1126  } ENPROTECTED;
1127
1128  typedef struct _ensaveclipboard {
1129    NMHDR nmhdr;
1130    LONG cObjectCount;
1131    LONG cch;
1132  } ENSAVECLIPBOARD;
1133
1134#ifndef MACPORT
1135  typedef struct _enoleopfailed {
1136    NMHDR nmhdr;
1137    LONG iob;
1138    LONG lOper;
1139    HRESULT hr;
1140  } ENOLEOPFAILED;
1141#endif
1142
1143#define OLEOP_DOVERB 1
1144
1145  typedef struct _objectpositions {
1146    NMHDR nmhdr;
1147    LONG cObjectCount;
1148    LONG *pcpPositions;
1149  } OBJECTPOSITIONS;
1150
1151  typedef struct _enlink {
1152    NMHDR nmhdr;
1153    UINT msg;
1154    WPARAM wParam;
1155    LPARAM lParam;
1156    CHARRANGE chrg;
1157  } ENLINK;
1158
1159  typedef struct _enlowfirtf {
1160    NMHDR nmhdr;
1161    char *szControl;
1162  } ENLOWFIRTF;
1163
1164  typedef struct _encorrecttext {
1165    NMHDR nmhdr;
1166    CHARRANGE chrg;
1167    WORD seltyp;
1168  } ENCORRECTTEXT;
1169
1170  typedef struct _punctuation {
1171    UINT iSize;
1172    LPSTR szPunctuation;
1173  } PUNCTUATION;
1174
1175  typedef struct _compcolor {
1176    COLORREF crText;
1177    COLORREF crBackground;
1178    DWORD dwEffects;
1179  } COMPCOLOR;
1180
1181#define CF_RTF TEXT ("Rich Text Format")
1182#define CF_RTFNOOBJS TEXT ("Rich Text Format Without Objects")
1183#define CF_RETEXTOBJ TEXT ("RichEdit Text and Objects")
1184
1185  typedef struct _repastespecial {
1186    DWORD dwAspect;
1187    DWORD_PTR dwParam;
1188  } REPASTESPECIAL;
1189
1190  typedef enum _undonameid {
1191    UID_UNKNOWN = 0,
1192    UID_TYPING = 1,
1193    UID_DELETE = 2,
1194    UID_DRAGDROP = 3,
1195    UID_CUT = 4,
1196    UID_PASTE = 5,
1197    UID_AUTOTABLE = 6
1198  } UNDONAMEID;
1199
1200#define ST_DEFAULT 0
1201#define ST_KEEPUNDO 1
1202#define ST_SELECTION 2
1203#define ST_NEWCHARS 4
1204#if _RICHEDIT_VER >= 0x0500
1205#define ST_UNICODE 8
1206#endif
1207
1208  typedef struct _settextex {
1209    DWORD flags;
1210    UINT codepage;
1211  } SETTEXTEX;
1212
1213#define GT_DEFAULT 0
1214#define GT_USECRLF 1
1215#define GT_SELECTION 2
1216#define GT_RAWTEXT 4
1217#define GT_NOHIDDENTEXT 8
1218
1219  typedef struct _gettextex {
1220    DWORD cb;
1221    DWORD flags;
1222    UINT codepage;
1223    LPCSTR lpDefaultChar;
1224    LPBOOL lpUsedDefChar;
1225  } GETTEXTEX;
1226
1227#define GTL_DEFAULT 0
1228#define GTL_USECRLF 1
1229#define GTL_PRECISE 2
1230#define GTL_CLOSE 4
1231#define GTL_NUMCHARS 8
1232#define GTL_NUMBYTES 16
1233
1234  typedef struct _gettextlengthex {
1235    DWORD flags;
1236    UINT codepage;
1237  } GETTEXTLENGTHEX;
1238
1239  typedef struct _bidioptions {
1240    UINT cbSize;
1241    WORD wMask;
1242    WORD wEffects;
1243  } BIDIOPTIONS;
1244
1245#if _RICHEDIT_VER == 0x0100
1246#define BOM_DEFPARADIR 0x0001
1247#define BOM_PLAINTEXT 0x0002
1248#endif
1249#define BOM_NEUTRALOVERRIDE 0x0004
1250#define BOM_CONTEXTREADING 0x0008
1251#define BOM_CONTEXTALIGNMENT 0x0010
1252#define BOM_LEGACYBIDICLASS 0x0040
1253#if _RICHEDIT_VER >= 0x0600
1254#define BOM_UNICODEBIDI 0x0080
1255#endif
1256
1257#if _RICHEDIT_VER == 0x0100
1258#define BOE_RTLDIR 0x0001
1259#define BOE_PLAINTEXT 0x0002
1260#endif
1261#define BOE_NEUTRALOVERRIDE 0x0004
1262#define BOE_CONTEXTREADING 0x0008
1263#define BOE_CONTEXTALIGNMENT 0x0010
1264#if _RICHEDIT_VER >= 0x0800
1265#define BOE_FORCERECALC 0x0020
1266#endif
1267#define BOE_LEGACYBIDICLASS 0x0040
1268#if _RICHEDIT_VER >= 0x0600
1269#define BOE_UNICODEBIDI 0x0080
1270#endif
1271
1272#define FR_MATCHDIAC 0x20000000
1273#define FR_MATCHKASHIDA 0x40000000
1274#define FR_MATCHALEFHAMZA 0x80000000
1275
1276#ifndef WCH_EMBEDDING
1277#define WCH_EMBEDDING (WCHAR)0xfffc
1278#endif
1279
1280  typedef enum tagKHYPH {
1281    khyphNil,
1282    khyphNormal,
1283    khyphAddBefore,
1284    khyphChangeBefore,
1285    khyphDeleteBefore,
1286    khyphChangeAfter,
1287    khyphDelAndChange
1288  } KHYPH;
1289
1290  typedef struct hyphresult {
1291    KHYPH khyph;
1292    __LONG32 ichHyph;
1293    WCHAR chHyph;
1294  } HYPHRESULT;
1295
1296  void WINAPI HyphenateProc (WCHAR *pszWord, LANGID langid, __LONG32 ichExceed, HYPHRESULT *phyphresult);
1297
1298  typedef struct tagHyphenateInfo {
1299    SHORT cbSize;
1300    SHORT dxHyphenateZone;
1301    void (WINAPI *pfnHyphenate) (WCHAR *, LANGID, __LONG32, HYPHRESULT *);
1302  } HYPHENATEINFO;
1303
1304#include <poppack.h>
1305
1306#if _RICHEDIT_VER >= 0x0600
1307#ifndef RICHEDIT60_CLASS
1308#define RICHEDIT60_CLASS L"RICHEDIT60W"
1309#endif
1310#endif
1311
1312#define PFA_FULL_NEWSPAPER 5
1313#define PFA_FULL_INTERLETTER 6
1314#define PFA_FULL_SCALED 7
1315#define PFA_FULL_GLYPHS 8
1316
1317#define AURL_ENABLEEA 1
1318
1319#define GCM_TOUCHMENU 0x4000
1320#define GCM_MOUSEMENU 0x2000
1321
1322#ifdef __cplusplus
1323}
1324#endif
1325
1326#endif
1327#endif
1328