home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / RICHEDIT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  31.0 KB  |  1,080 lines

  1. /*
  2.  *    RICHEDIT.H
  3.  *    
  4.  *    Purpose:
  5.  *        RICHEDIT v2.0 public definitions.  Note that there is additional
  6.  *        functionality available for v2.0 that is not in the original
  7.  *        Windows 95 release.
  8.  *    
  9.  *    Copyright (c) 1985-1996, Microsoft Corporation
  10.  */
  11.  
  12. #ifndef _RICHEDIT_
  13. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  14. #define    _RICHEDIT_
  15.  
  16. #ifdef _WIN32
  17. #include <pshpack4.h>
  18. #elif !defined(RC_INVOKED)
  19. #pragma pack(4)
  20. #endif
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif /* __cplusplus */
  25.  
  26. /* To mimic older RichEdit behavior, simply set _RICHEDIT_VER to the appropriate value */
  27. /*        Version 1.0        0x0100    */
  28. /*        Version 2.0        0x0200    */
  29. #ifndef _RICHEDIT_VER
  30. #define _RICHEDIT_VER    0x0210
  31. #endif
  32.  
  33. /*
  34.  *    To make some structures which can be passed between 16 and 32 bit windows
  35.  *    almost compatible, padding is introduced to the 16 bit versions of the
  36.  *    structure.
  37.  */
  38. #ifdef _WIN32
  39. #    define    _WPAD    /##/
  40. #else
  41. #    define    _WPAD    WORD
  42. #endif
  43.  
  44. #define cchTextLimitDefault 32767
  45.  
  46. /* Richedit2.0 Window Class. */
  47.  
  48. #define RICHEDIT_CLASSA        "RichEdit20A"
  49. #define RICHEDIT_CLASS10A    "RICHEDIT"            // Richedit 1.0
  50.  
  51. #ifndef MACPORT
  52. #define RICHEDIT_CLASSW        L"RichEdit20W"
  53. #else    /*----------------------MACPORT */
  54. #define RICHEDIT_CLASSW        TEXT("RichEdit20W")    /* MACPORT change */
  55. #endif /* MACPORT  */
  56.  
  57. #if (_RICHEDIT_VER >= 0x0200 )
  58. #ifdef UNICODE
  59. #define RICHEDIT_CLASS        RICHEDIT_CLASSW
  60. #else
  61. #define RICHEDIT_CLASS        RICHEDIT_CLASSA
  62. #endif /* UNICODE */
  63. #else
  64. #define RICHEDIT_CLASS        RICHEDIT_CLASS10A
  65. #endif /* _RICHEDIT_VER >= 0x0200 */
  66.  
  67. /* RichEdit messages */
  68.  
  69. #ifndef WM_CONTEXTMENU
  70. #define WM_CONTEXTMENU            0x007B
  71. #endif
  72.  
  73. #ifndef WM_PRINTCLIENT
  74. #define WM_PRINTCLIENT            0x0318
  75. #endif
  76.  
  77. #ifndef EM_GETLIMITTEXT
  78. #define EM_GETLIMITTEXT            (WM_USER + 37)
  79. #endif
  80.  
  81. #ifndef EM_POSFROMCHAR    
  82. #define EM_POSFROMCHAR            (WM_USER + 38)
  83. #define EM_CHARFROMPOS            (WM_USER + 39)
  84. #endif
  85.  
  86. #ifndef EM_SCROLLCARET
  87. #define EM_SCROLLCARET            (WM_USER + 49)
  88. #endif
  89. #define EM_CANPASTE                (WM_USER + 50)
  90. #define EM_DISPLAYBAND            (WM_USER + 51)
  91. #define EM_EXGETSEL                (WM_USER + 52)
  92. #define EM_EXLIMITTEXT            (WM_USER + 53)
  93. #define EM_EXLINEFROMCHAR        (WM_USER + 54)
  94. #define EM_EXSETSEL                (WM_USER + 55)
  95. #define EM_FINDTEXT                (WM_USER + 56)
  96. #define EM_FORMATRANGE            (WM_USER + 57)
  97. #define EM_GETCHARFORMAT        (WM_USER + 58)
  98. #define EM_GETEVENTMASK            (WM_USER + 59)
  99. #define EM_GETOLEINTERFACE        (WM_USER + 60)
  100. #define EM_GETPARAFORMAT        (WM_USER + 61)
  101. #define EM_GETSELTEXT            (WM_USER + 62)
  102. #define EM_HIDESELECTION        (WM_USER + 63)
  103. #define EM_PASTESPECIAL            (WM_USER + 64)
  104. #define EM_REQUESTRESIZE        (WM_USER + 65)
  105. #define EM_SELECTIONTYPE        (WM_USER + 66)
  106. #define EM_SETBKGNDCOLOR        (WM_USER + 67)
  107. #define EM_SETCHARFORMAT        (WM_USER + 68)
  108. #define EM_SETEVENTMASK            (WM_USER + 69)
  109. #define EM_SETOLECALLBACK        (WM_USER + 70)
  110. #define EM_SETPARAFORMAT        (WM_USER + 71)
  111. #define EM_SETTARGETDEVICE        (WM_USER + 72)
  112. #define EM_STREAMIN                (WM_USER + 73)
  113. #define EM_STREAMOUT            (WM_USER + 74)
  114. #define EM_GETTEXTRANGE            (WM_USER + 75)
  115. #define EM_FINDWORDBREAK        (WM_USER + 76)
  116. #define EM_SETOPTIONS            (WM_USER + 77)
  117. #define EM_GETOPTIONS            (WM_USER + 78)
  118. #define EM_FINDTEXTEX            (WM_USER + 79)
  119. #ifdef _WIN32
  120. #define EM_GETWORDBREAKPROCEX    (WM_USER + 80)
  121. #define EM_SETWORDBREAKPROCEX    (WM_USER + 81)
  122. #endif
  123.  
  124. /* Richedit v2.0 messages */
  125. #define    EM_SETUNDOLIMIT            (WM_USER + 82)
  126. #define EM_REDO                    (WM_USER + 84)
  127. #define EM_CANREDO                (WM_USER + 85)
  128. #define EM_GETUNDONAME            (WM_USER + 86)
  129. #define EM_GETREDONAME            (WM_USER + 87)
  130. #define EM_STOPGROUPTYPING        (WM_USER + 88)
  131.  
  132. #define EM_SETTEXTMODE            (WM_USER + 89)
  133. #define EM_GETTEXTMODE            (WM_USER + 90)
  134.  
  135. /* enum for use with EM_GET/SETTEXTMODE */
  136. typedef enum tagTextMode
  137. {
  138.     TM_PLAINTEXT            = 1,
  139.     TM_RICHTEXT                = 2,    /* default behavior */
  140.     TM_SINGLELEVELUNDO        = 4,
  141.     TM_MULTILEVELUNDO        = 8,    /* default behavior */
  142.     TM_SINGLECODEPAGE        = 16,
  143.     TM_MULTICODEPAGE        = 32    /* default behavior */
  144. } TEXTMODE;
  145.  
  146. #define EM_AUTOURLDETECT        (WM_USER + 91)
  147. #define EM_GETAUTOURLDETECT        (WM_USER + 92)
  148. #define EM_SETPALETTE            (WM_USER + 93)
  149. #define EM_GETTEXTEX            (WM_USER + 94)
  150. #define EM_GETTEXTLENGTHEX        (WM_USER + 95)
  151.  
  152. /* Far East specific messages */
  153. #define EM_SETPUNCTUATION        (WM_USER + 100)
  154. #define EM_GETPUNCTUATION        (WM_USER + 101)
  155. #define EM_SETWORDWRAPMODE        (WM_USER + 102)
  156. #define EM_GETWORDWRAPMODE        (WM_USER + 103)
  157. #define EM_SETIMECOLOR            (WM_USER + 104)
  158. #define EM_GETIMECOLOR            (WM_USER + 105)
  159. #define EM_SETIMEOPTIONS        (WM_USER + 106)
  160. #define EM_GETIMEOPTIONS        (WM_USER + 107)
  161. #define EM_CONVPOSITION         (WM_USER + 108)
  162.  
  163. #define EM_SETLANGOPTIONS        (WM_USER + 120)
  164. #define EM_GETLANGOPTIONS        (WM_USER + 121)
  165. #define EM_GETIMECOMPMODE        (WM_USER + 122)
  166.  
  167. #define EM_FINDTEXTW            (WM_USER + 123)
  168. #define EM_FINDTEXTEXW            (WM_USER + 124)
  169.  
  170. /* BiDi specific messages */
  171. #define EM_SETBIDIOPTIONS        (WM_USER + 200)
  172. #define EM_GETBIDIOPTIONS        (WM_USER + 201)
  173.  
  174. /* Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS */
  175. #define IMF_AUTOKEYBOARD        0x0001
  176. #define IMF_AUTOFONT            0x0002
  177. #define IMF_IMECANCELCOMPLETE    0x0004    // high completes the comp string when aborting, low cancels.
  178. #define IMF_IMEALWAYSSENDNOTIFY 0x0008
  179.  
  180. /* Values for EM_GETIMECOMPMODE */
  181. #define ICM_NOTOPEN                0x0000
  182. #define ICM_LEVEL3                0x0001
  183. #define ICM_LEVEL2                0x0002
  184. #define ICM_LEVEL2_5            0x0003
  185. #define ICM_LEVEL2_SUI            0x0004
  186.  
  187. /* New notifications */
  188.  
  189. #define EN_MSGFILTER            0x0700
  190. #define EN_REQUESTRESIZE        0x0701
  191. #define EN_SELCHANGE            0x0702
  192. #define EN_DROPFILES            0x0703
  193. #define EN_PROTECTED            0x0704
  194. #define EN_CORRECTTEXT            0x0705            /* PenWin specific */
  195. #define EN_STOPNOUNDO            0x0706
  196. #define EN_IMECHANGE            0x0707            /* Far East specific */
  197. #define EN_SAVECLIPBOARD        0x0708
  198. #define EN_OLEOPFAILED            0x0709
  199. #define EN_OBJECTPOSITIONS        0x070a
  200. #define EN_LINK                    0x070b
  201. #define EN_DRAGDROPDONE            0x070c
  202.  
  203. /* BiDi specific notifications */
  204.  
  205. #define EN_ALIGN_LTR            0x0710
  206. #define EN_ALIGN_RTL            0x0711
  207.  
  208. /* Event notification masks */
  209.  
  210. #define ENM_NONE                0x00000000
  211. #define ENM_CHANGE                0x00000001
  212. #define ENM_UPDATE                0x00000002
  213. #define ENM_SCROLL                0x00000004
  214. #define ENM_KEYEVENTS            0x00010000
  215. #define ENM_MOUSEEVENTS            0x00020000
  216. #define ENM_REQUESTRESIZE        0x00040000
  217. #define ENM_SELCHANGE            0x00080000
  218. #define ENM_DROPFILES            0x00100000
  219. #define ENM_PROTECTED            0x00200000
  220. #define ENM_CORRECTTEXT            0x00400000        /* PenWin specific */
  221. #define ENM_SCROLLEVENTS        0x00000008
  222. #define ENM_DRAGDROPDONE        0x00000010
  223.  
  224. /* Far East specific notification mask */
  225. #define ENM_IMECHANGE            0x00800000        /* unused by RE2.0 */
  226. #define ENM_LANGCHANGE            0x01000000
  227. #define ENM_OBJECTPOSITIONS        0x02000000
  228. #define ENM_LINK                0x04000000
  229.  
  230. /* New edit control styles */
  231.  
  232. #define ES_SAVESEL                0x00008000
  233. #define ES_SUNKEN                0x00004000
  234. #define ES_DISABLENOSCROLL        0x00002000
  235. /* same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value */
  236. #define ES_SELECTIONBAR            0x01000000
  237. /* same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop */
  238. #define ES_NOOLEDRAGDROP        0x00000008
  239.  
  240. /* New edit control extended style */
  241. #ifdef    _WIN32
  242. #define ES_EX_NOCALLOLEINIT        0x01000000
  243. #endif    
  244.  
  245. /* These flags are used in FE Windows */
  246. #define ES_VERTICAL                0x00400000
  247. #define    ES_NOIME                0x00080000
  248. #define ES_SELFIME                0x00040000
  249.  
  250. /* Edit control options */
  251. #define ECO_AUTOWORDSELECTION    0x00000001
  252. #define ECO_AUTOVSCROLL            0x00000040
  253. #define ECO_AUTOHSCROLL            0x00000080
  254. #define ECO_NOHIDESEL            0x00000100
  255. #define ECO_READONLY            0x00000800
  256. #define ECO_WANTRETURN            0x00001000
  257. #define ECO_SAVESEL                0x00008000
  258. #define ECO_SELECTIONBAR        0x01000000
  259. #define ECO_VERTICAL            0x00400000        /* FE specific */
  260.  
  261.  
  262. /* ECO operations */
  263. #define ECOOP_SET                0x0001
  264. #define ECOOP_OR                0x0002
  265. #define ECOOP_AND                0x0003
  266. #define ECOOP_XOR                0x0004
  267.  
  268. /* new word break function actions */
  269. #define WB_CLASSIFY            3
  270. #define WB_MOVEWORDLEFT        4
  271. #define WB_MOVEWORDRIGHT    5
  272. #define WB_LEFTBREAK        6
  273. #define WB_RIGHTBREAK        7
  274.  
  275. /* Far East specific flags */
  276. #define WB_MOVEWORDPREV        4
  277. #define WB_MOVEWORDNEXT        5
  278. #define WB_PREVBREAK        6
  279. #define WB_NEXTBREAK        7
  280.  
  281. #define PC_FOLLOWING        1
  282. #define    PC_LEADING            2
  283. #define    PC_OVERFLOW            3
  284. #define    PC_DELIMITER        4
  285. #define WBF_WORDWRAP        0x010
  286. #define WBF_WORDBREAK        0x020
  287. #define    WBF_OVERFLOW        0x040    
  288. #define WBF_LEVEL1            0x080
  289. #define    WBF_LEVEL2            0x100
  290. #define    WBF_CUSTOM            0x200
  291.  
  292. /* Far East specific flags */
  293. #define IMF_FORCENONE           0x0001
  294. #define IMF_FORCEENABLE         0x0002
  295. #define IMF_FORCEDISABLE        0x0004
  296. #define IMF_CLOSESTATUSWINDOW   0x0008
  297. #define IMF_VERTICAL            0x0020
  298. #define IMF_FORCEACTIVE         0x0040
  299. #define IMF_FORCEINACTIVE       0x0080
  300. #define IMF_FORCEREMEMBER       0x0100
  301. #define IMF_MULTIPLEEDIT        0x0400
  302.  
  303. /* Word break flags (used with WB_CLASSIFY) */
  304. #define WBF_CLASS            ((BYTE) 0x0F)
  305. #define WBF_ISWHITE            ((BYTE) 0x10)
  306. #define WBF_BREAKLINE        ((BYTE) 0x20)
  307. #define WBF_BREAKAFTER        ((BYTE) 0x40)
  308.  
  309.  
  310. /* new data types */
  311.  
  312. #ifdef _WIN32
  313. /* extended edit word break proc (character set aware) */
  314. typedef LONG (*EDITWORDBREAKPROCEX)(char *pchText, LONG cchText, BYTE bCharSet, INT action);
  315. #endif
  316.  
  317. /* all character format measurements are in twips */
  318. typedef struct _charformat
  319. {
  320.     UINT        cbSize;
  321.     _WPAD        _wPad1;
  322.     DWORD        dwMask;
  323.     DWORD        dwEffects;
  324.     LONG        yHeight;
  325.     LONG        yOffset;
  326.     COLORREF    crTextColor;
  327.     BYTE        bCharSet;
  328.     BYTE        bPitchAndFamily;
  329.     char        szFaceName[LF_FACESIZE];
  330.     _WPAD        _wPad2;
  331. } CHARFORMATA;
  332.  
  333. typedef struct _charformatw
  334. {
  335.     UINT        cbSize;
  336.     _WPAD        _wPad1;
  337.     DWORD        dwMask;
  338.     DWORD        dwEffects;
  339.     LONG        yHeight;
  340.     LONG        yOffset;
  341.     COLORREF    crTextColor;
  342.     BYTE        bCharSet;
  343.     BYTE        bPitchAndFamily;
  344.     WCHAR        szFaceName[LF_FACESIZE];
  345.     _WPAD        _wPad2;
  346. } CHARFORMATW;
  347.  
  348. #if (_RICHEDIT_VER >= 0x0200)
  349. #ifdef UNICODE
  350. #define CHARFORMAT CHARFORMATW
  351. #else
  352. #define CHARFORMAT CHARFORMATA
  353. #endif /* UNICODE */
  354. #else
  355. #define CHARFORMAT CHARFORMATA
  356. #endif /* _RICHEDIT_VER >= 0x0200 */
  357.  
  358. /* CHARFORMAT masks */
  359. #define CFM_BOLD        0x00000001
  360. #define CFM_ITALIC        0x00000002
  361. #define CFM_UNDERLINE    0x00000004
  362. #define CFM_STRIKEOUT    0x00000008
  363. #define CFM_PROTECTED    0x00000010
  364. #define CFM_LINK        0x00000020        /* Exchange hyperlink extension */
  365. #define CFM_SIZE        0x80000000
  366. #define CFM_COLOR        0x40000000
  367. #define CFM_FACE        0x20000000
  368. #define CFM_OFFSET        0x10000000
  369. #define CFM_CHARSET        0x08000000
  370.  
  371. /* CHARFORMAT effects */
  372. #define CFE_BOLD        0x0001
  373. #define CFE_ITALIC        0x0002
  374. #define CFE_UNDERLINE    0x0004
  375. #define CFE_STRIKEOUT    0x0008
  376. #define CFE_PROTECTED    0x0010
  377. #define CFE_LINK        0x0020
  378. #define CFE_AUTOCOLOR    0x40000000        /* NOTE: this corresponds to */
  379.                                         /* CFM_COLOR, which controls it */
  380. #define yHeightCharPtsMost 1638
  381.  
  382. /* EM_SETCHARFORMAT wParam masks */
  383. #define SCF_SELECTION    0x0001
  384. #define SCF_WORD        0x0002
  385. #define SCF_DEFAULT        0x0000        // set the default charformat or paraformat
  386. #define SCF_ALL            0x0004        // not valid with SCF_SELECTION or SCF_WORD
  387. #define SCF_USEUIRULES    0x0008        // modifier for SCF_SELECTION; says that
  388.                                     // the format came from a toolbar, etc. and
  389.                                     // therefore UI formatting rules should be
  390.                                     // used instead of strictly formatting the
  391.                                     // selection.
  392.  
  393.  
  394. typedef struct _charrange
  395. {
  396.     LONG    cpMin;
  397.     LONG    cpMax;
  398. } CHARRANGE;
  399.  
  400. typedef struct _textrange
  401. {
  402.     CHARRANGE chrg;
  403.     LPSTR lpstrText;    /* allocated by caller, zero terminated by RichEdit */
  404. } TEXTRANGEA;
  405.  
  406. typedef struct _textrangew
  407. {
  408.     CHARRANGE chrg;
  409.     LPWSTR lpstrText;    /* allocated by caller, zero terminated by RichEdit */
  410. } TEXTRANGEW;
  411.  
  412. #if (_RICHEDIT_VER >= 0x0200)
  413. #ifdef UNICODE
  414. #define TEXTRANGE     TEXTRANGEW
  415. #else
  416. #define TEXTRANGE    TEXTRANGEA
  417. #endif /* UNICODE */
  418. #else
  419. #define TEXTRANGE    TEXTRANGEA
  420. #endif /* _RICHEDIT_VER >= 0x0200 */
  421.  
  422.  
  423. typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
  424.  
  425. typedef struct _editstream
  426. {
  427.     DWORD dwCookie;        /* user value passed to callback as first parameter */
  428.     DWORD dwError;        /* last error */
  429.     EDITSTREAMCALLBACK pfnCallback;
  430. } EDITSTREAM;
  431.  
  432. /* stream formats */
  433.  
  434. #define SF_TEXT            0x0001
  435. #define SF_RTF            0x0002
  436. #define SF_RTFNOOBJS    0x0003        /* outbound only */
  437. #define SF_TEXTIZED        0x0004        /* outbound only */
  438. #define SF_UNICODE        0x0010        /* Unicode file of some kind */
  439.  
  440. /* Flag telling stream operations to operate on the selection only */
  441. /* EM_STREAMIN will replace the current selection */
  442. /* EM_STREAMOUT will stream out the current selection */
  443. #define SFF_SELECTION    0x8000
  444.  
  445. /* Flag telling stream operations to operate on the common RTF keyword only */
  446. /* EM_STREAMIN will accept the only common RTF keyword */
  447. /* EM_STREAMOUT will stream out the only common RTF keyword */
  448. #define SFF_PLAINRTF    0x4000
  449.  
  450. typedef struct _findtext
  451. {
  452.     CHARRANGE chrg;
  453.     LPSTR lpstrText;
  454. } FINDTEXTA;
  455.  
  456. typedef struct _findtextw
  457. {
  458.     CHARRANGE chrg;
  459.     LPWSTR lpstrText;
  460. } FINDTEXTW;
  461.  
  462. #if (_RICHEDIT_VER >= 0x0200)
  463. #ifdef UNICODE
  464. #define FINDTEXT    FINDTEXTW
  465. #else
  466. #define FINDTEXT    FINDTEXTA
  467. #endif /* UNICODE */
  468. #else
  469. #define FINDTEXT    FINDTEXTA
  470. #endif /* _RICHEDIT_VER >= 0x0200 */
  471.  
  472. typedef struct _findtextexa
  473. {
  474.     CHARRANGE chrg;
  475.     LPSTR lpstrText;
  476.     CHARRANGE chrgText;
  477. } FINDTEXTEXA;
  478.  
  479. typedef struct _findtextexw
  480. {
  481.     CHARRANGE chrg;
  482.     LPWSTR lpstrText;
  483.     CHARRANGE chrgText;
  484. } FINDTEXTEXW;
  485.  
  486. #if (_RICHEDIT_VER >= 0x0200)
  487. #ifdef UNICODE
  488. #define FINDTEXTEX    FINDTEXTEXW
  489. #else
  490. #define FINDTEXTEX    FINDTEXTEXA
  491. #endif /* UNICODE */
  492. #else
  493. #define FINDTEXTEX    FINDTEXTEXA
  494. #endif /* _RICHEDIT_VER >= 0x0200 */
  495.  
  496.  
  497. typedef struct _formatrange
  498. {
  499.     HDC hdc;
  500.     HDC hdcTarget;
  501.     RECT rc;
  502.     RECT rcPage;
  503.     CHARRANGE chrg;
  504. } FORMATRANGE;
  505.  
  506. /* all paragraph measurements are in twips */
  507.  
  508. #define MAX_TAB_STOPS 32
  509. #define lDefaultTab 720
  510.  
  511. typedef struct _paraformat
  512. {
  513.     UINT    cbSize;
  514.     _WPAD    _wPad1;
  515.     DWORD    dwMask;
  516.     WORD    wNumbering;
  517. #if (_RICHEDIT_VER >= 0x0210)
  518.     WORD    wEffects;
  519. #else
  520.     WORD    wReserved;
  521. #endif /* _RICHEDIT_VER >= 0x0210 */
  522.     LONG    dxStartIndent;
  523.     LONG    dxRightIndent;
  524.     LONG    dxOffset;
  525.     WORD    wAlignment;
  526.     SHORT    cTabCount;
  527.     LONG    rgxTabs[MAX_TAB_STOPS];
  528. } PARAFORMAT;
  529.  
  530. /* PARAFORMAT mask values */
  531. #define PFM_STARTINDENT            0x00000001
  532. #define PFM_RIGHTINDENT            0x00000002
  533. #define PFM_OFFSET                0x00000004
  534. #define PFM_ALIGNMENT            0x00000008
  535. #define PFM_TABSTOPS            0x00000010
  536. #define PFM_NUMBERING            0x00000020
  537. #define PFM_OFFSETINDENT        0x80000000
  538.  
  539. /* PARAFORMAT numbering options */
  540. #define PFN_BULLET        0x0001
  541.  
  542. /* PARAFORMAT alignment options */
  543. #define PFA_LEFT    0x0001
  544. #define PFA_RIGHT    0x0002
  545. #define PFA_CENTER    0x0003
  546.  
  547. /* CHARFORMAT2 and PARAFORMAT2 structures */
  548.  
  549. #ifdef __cplusplus
  550.  
  551. struct CHARFORMAT2W : _charformatw
  552. {
  553.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  554.     SHORT        sSpacing;            /* Amount to space between letters    */
  555.     COLORREF    crBackColor;        /* Background color                    */
  556.     LCID        lcid;                /* Locale ID                        */
  557.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  558.     SHORT        sStyle;                /* Style handle                        */
  559.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  560.     BYTE        bUnderlineType;        /* Underline type                    */
  561.     BYTE        bAnimation;            /* Animated text like marching ants */
  562.     BYTE        bRevAuthor;            /* Revision author index            */
  563. };
  564.  
  565. struct CHARFORMAT2A : _charformat
  566. {
  567.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  568.     SHORT        sSpacing;            /* Amount to space between letters    */
  569.     COLORREF    crBackColor;        /* Background color                    */
  570.     LCID        lcid;                /* Locale ID                        */
  571.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  572.     SHORT        sStyle;                /* Style handle                        */
  573.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  574.     BYTE        bUnderlineType;        /* Underline type                    */
  575.     BYTE        bAnimation;            /* Animated text like marching ants    */
  576.     BYTE        bRevAuthor;            /* Revision author index            */
  577. };
  578.  
  579. #else    /* regular C-style  */
  580.  
  581. typedef struct _charformat2w
  582. {
  583.     UINT        cbSize;
  584.     _WPAD        _wPad1;
  585.     DWORD        dwMask;
  586.     DWORD        dwEffects;
  587.     LONG        yHeight;
  588.     LONG        yOffset;            /* > 0 for superscript, < 0 for subscript */
  589.     COLORREF    crTextColor;
  590.     BYTE        bCharSet;
  591.     BYTE        bPitchAndFamily;
  592.     WCHAR        szFaceName[LF_FACESIZE];
  593.     _WPAD        _wPad2;
  594.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  595.     SHORT        sSpacing;            /* Amount to space between letters    */
  596.     COLORREF    crBackColor;        /* Background color                    */
  597.     LCID        lcid;                /* Locale ID                        */
  598.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  599.     SHORT        sStyle;                /* Style handle                        */
  600.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  601.     BYTE        bUnderlineType;        /* Underline type                    */
  602.     BYTE        bAnimation;            /* Animated text like marching ants    */
  603.     BYTE        bRevAuthor;            /* Revision author index            */
  604.     BYTE        bReserved1;
  605. } CHARFORMAT2W;
  606.  
  607. typedef struct _charformat2a
  608. {
  609.     UINT        cbSize;
  610.     _WPAD        _wPad1;
  611.     DWORD        dwMask;
  612.     DWORD        dwEffects;
  613.     LONG        yHeight;
  614.     LONG        yOffset;            /* > 0 for superscript, < 0 for subscript */
  615.     COLORREF    crTextColor;
  616.     BYTE        bCharSet;
  617.     BYTE        bPitchAndFamily;
  618.     char        szFaceName[LF_FACESIZE];
  619.     _WPAD        _wPad2;
  620.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  621.     SHORT        sSpacing;            /* Amount to space between letters    */
  622.     COLORREF    crBackColor;        /* Background color                    */
  623.     LCID        lcid;                /* Locale ID                        */
  624.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  625.     SHORT        sStyle;                /* Style handle                        */
  626.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  627.     BYTE        bUnderlineType;        /* Underline type                    */
  628.     BYTE        bAnimation;            /* Animated text like marching ants    */
  629.     BYTE        bRevAuthor;            /* Revision author index            */
  630. } CHARFORMAT2A;
  631.  
  632. #endif /* C++ */
  633.  
  634. #ifdef UNICODE
  635. #define CHARFORMAT2    CHARFORMAT2W
  636. #else
  637. #define CHARFORMAT2 CHARFORMAT2A
  638. #endif
  639.  
  640. #define CHARFORMATDELTA        (sizeof(CHARFORMAT2) - sizeof(CHARFORMAT))
  641.  
  642.  
  643. /* CHARFORMAT and PARAFORMAT "ALL" masks
  644.    CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor*/
  645.  
  646. #define CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | \
  647.                      CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK)
  648. #define CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET)
  649.  
  650. #define    PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET    | \
  651.                  PFM_ALIGNMENT   | PFM_TABSTOPS    | PFM_NUMBERING | \
  652.                  PFM_OFFSETINDENT| PFM_DIR)
  653.  
  654. /* New masks and effects -- a parenthesized asterisk indicates that
  655.    the data is stored by RichEdit2.0, but not displayed */
  656.  
  657. #define CFM_SMALLCAPS        0x0040            /* (*)    */
  658. #define    CFM_ALLCAPS            0x0080            /* (*)    */
  659. #define    CFM_HIDDEN            0x0100            /* (*)    */
  660. #define    CFM_OUTLINE            0x0200            /* (*)    */
  661. #define    CFM_SHADOW            0x0400            /* (*)    */
  662. #define    CFM_EMBOSS            0x0800            /* (*)    */
  663. #define    CFM_IMPRINT            0x1000            /* (*)    */
  664. #define CFM_DISABLED        0x2000
  665. #define    CFM_REVISED            0x4000
  666.  
  667. #define CFM_BACKCOLOR        0x04000000
  668. #define CFM_LCID            0x02000000
  669. #define    CFM_UNDERLINETYPE    0x00800000        /* (*)    */
  670. #define    CFM_WEIGHT            0x00400000
  671. #define CFM_SPACING            0x00200000        /* (*)    */
  672. #define CFM_KERNING            0x00100000        /* (*)    */
  673. #define CFM_STYLE            0x00080000        /* (*)    */
  674. #define CFM_ANIMATION        0x00040000        /* (*)    */
  675. #define CFM_REVAUTHOR        0x00008000
  676.  
  677. #define CFE_SUBSCRIPT        0x00010000        /* Superscript and subscript are */
  678. #define CFE_SUPERSCRIPT        0x00020000        /*  mutually exclusive             */
  679.  
  680. #define CFM_SUBSCRIPT        CFE_SUBSCRIPT | CFE_SUPERSCRIPT
  681. #define CFM_SUPERSCRIPT        CFM_SUBSCRIPT
  682.  
  683. #define    CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS \
  684.                     | CFM_HIDDEN  | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS \
  685.                     | CFM_IMPRINT | CFM_DISABLED | CFM_REVISED \
  686.                     | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR)
  687.  
  688. #define CFM_ALL2     (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID \
  689.                     | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR \
  690.                     | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION)
  691.  
  692. #define    CFE_SMALLCAPS        CFM_SMALLCAPS
  693. #define    CFE_ALLCAPS            CFM_ALLCAPS
  694. #define    CFE_HIDDEN            CFM_HIDDEN
  695. #define    CFE_OUTLINE            CFM_OUTLINE
  696. #define    CFE_SHADOW            CFM_SHADOW
  697. #define    CFE_EMBOSS            CFM_EMBOSS
  698. #define    CFE_IMPRINT            CFM_IMPRINT
  699. #define    CFE_DISABLED        CFM_DISABLED
  700. #define    CFE_REVISED            CFM_REVISED
  701.  
  702. /* NOTE: CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
  703.    CFM_BACKCOLOR, respectively, which control them */
  704. #define CFE_AUTOBACKCOLOR    CFM_BACKCOLOR
  705.  
  706. /* Underline types */
  707. #define CFU_CF1UNDERLINE    0xFF    /* map charformat's bit underline to CF2.*/
  708. #define CFU_INVERT            0xFE    /* For IME composition fake a selection.*/    
  709. #define    CFU_UNDERLINEDOTTED    0x4        /* (*) displayed as ordinary underline    */
  710. #define    CFU_UNDERLINEDOUBLE    0x3        /* (*) displayed as ordinary underline    */
  711. #define CFU_UNDERLINEWORD    0x2        /* (*) displayed as ordinary underline    */
  712. #define CFU_UNDERLINE        0x1
  713. #define CFU_UNDERLINENONE    0
  714.  
  715. #ifdef __cplusplus
  716. struct PARAFORMAT2 : _paraformat
  717. {
  718.     LONG    dySpaceBefore;            /* Vertical spacing before para            */
  719.     LONG    dySpaceAfter;            /* Vertical spacing after para            */    
  720.     LONG    dyLineSpacing;            /* Line spacing depending on Rule        */
  721.     SHORT    sStyle;                    /* Style handle                            */
  722.     BYTE    bLineSpacingRule;        /* Rule for line spacing (see tom.doc)    */
  723.     BYTE    bCRC;                    /* Reserved for CRC for rapid searching    */
  724.     WORD    wShadingWeight;            /* Shading in hundredths of a per cent    */
  725.     WORD    wShadingStyle;            /* Nibble 0: style, 1: cfpat, 2: cbpat    */
  726.     WORD    wNumberingStart;        /* Starting value for numbering            */
  727.     WORD    wNumberingStyle;        /* Alignment, roman/arabic, (), ), ., etc.*/
  728.     WORD    wNumberingTab;            /* Space bet FirstIndent and 1st-line text*/
  729.     WORD    wBorderSpace;            /* Space between border and text (twips)*/
  730.     WORD    wBorderWidth;            /* Border pen width (twips)                */
  731.     WORD    wBorders;                /* Byte 0: bits specify which borders    */
  732.                                     /* Nibble 2: border style, 3: color index*/
  733. };
  734.  
  735. #else    /* regular C-style    */
  736.  
  737. typedef struct _paraformat2
  738. {
  739.     UINT    cbSize;
  740.     _WPAD    _wPad1;
  741.     DWORD    dwMask;
  742.     WORD    wNumbering;
  743. #if (_RICHEDIT_VER >= 0x0210)
  744.     WORD    wEffects;
  745. #else
  746.     WORD    wReserved;
  747. #endif /* _RICHEDIT_VER >= 0x0210 */
  748.     LONG    dxStartIndent;
  749.     LONG    dxRightIndent;
  750.     LONG    dxOffset;
  751.     WORD    wAlignment;
  752.     SHORT    cTabCount;
  753.     LONG    rgxTabs[MAX_TAB_STOPS];
  754.      LONG    dySpaceBefore;            /* Vertical spacing before para            */
  755.     LONG    dySpaceAfter;            /* Vertical spacing after para            */
  756.     LONG    dyLineSpacing;            /* Line spacing depending on Rule        */
  757.     SHORT    sStyle;                    /* Style handle                            */
  758.     BYTE    bLineSpacingRule;        /* Rule for line spacing (see tom.doc)    */
  759.     BYTE    bCRC;                    /* Reserved for CRC for rapid searching    */
  760.     WORD    wShadingWeight;            /* Shading in hundredths of a per cent    */
  761.     WORD    wShadingStyle;            /* Nibble 0: style, 1: cfpat, 2: cbpat    */
  762.     WORD    wNumberingStart;        /* Starting value for numbering            */    
  763.     WORD    wNumberingStyle;        /* Alignment, roman/arabic, (), ), ., etc.*/
  764.     WORD    wNumberingTab;            /* Space bet 1st indent and 1st-line text*/
  765.     WORD    wBorderSpace;            /* Space between border and text (twips)*/
  766.     WORD    wBorderWidth;            /* Border pen width (twips)                */
  767.     WORD    wBorders;                /* Byte 0: bits specify which borders    */
  768.                                     /* Nibble 2: border style, 3: color index*/
  769. } PARAFORMAT2;
  770.  
  771. #endif /* C++    */
  772.  
  773. /* PARAFORMAT 2.0 masks and effects */
  774.  
  775. #define PFM_SPACEBEFORE            0x00000040
  776. #define PFM_SPACEAFTER            0x00000080
  777. #define PFM_LINESPACING            0x00000100
  778. #define    PFM_STYLE                0x00000400
  779. #define PFM_BORDER                0x00000800    /* (*)    */
  780. #define PFM_SHADING                0x00001000    /* (*)    */
  781. #define PFM_NUMBERINGSTYLE        0x00002000    /* (*)    */
  782. #define PFM_NUMBERINGTAB        0x00004000    /* (*)    */
  783. #define PFM_NUMBERINGSTART        0x00008000    /* (*)    */
  784.  
  785. #define PFM_DIR                    0x00010000
  786. #define PFM_RTLPARA                0x00010000    /* (Version 1.0 flag) */
  787. #define PFM_KEEP                0x00020000    /* (*)    */
  788. #define PFM_KEEPNEXT            0x00040000    /* (*)    */
  789. #define PFM_PAGEBREAKBEFORE        0x00080000    /* (*)    */
  790. #define PFM_NOLINENUMBER        0x00100000    /* (*)    */
  791. #define PFM_NOWIDOWCONTROL        0x00200000    /* (*)    */
  792. #define PFM_DONOTHYPHEN            0x00400000    /* (*)    */
  793. #define PFM_SIDEBYSIDE            0x00800000    /* (*)    */
  794.  
  795. #define PFM_TABLE                0xc0000000    /* (*)    */
  796.  
  797. /* Note: PARAFORMAT has no effects */
  798. #define PFM_EFFECTS  (PFM_DIR | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE \
  799.                     | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER  \
  800.                     | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE \
  801.                     | PFM_TABLE)
  802.  
  803. #define PFM_ALL2    (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER \
  804.                     | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER \
  805.                     | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE)
  806.  
  807. #define PFE_RTLPARA                (PFM_DIR             >> 16)
  808. #define PFE_RTLPAR                (PFM_RTLPARA         >> 16)    /* (Version 1.0 flag) */
  809. #define PFE_KEEP                (PFM_KEEP             >> 16)    /* (*)    */
  810. #define PFE_KEEPNEXT            (PFM_KEEPNEXT         >> 16)    /* (*)    */
  811. #define PFE_PAGEBREAKBEFORE        (PFM_PAGEBREAKBEFORE >> 16)    /* (*)    */
  812. #define PFE_NOLINENUMBER        (PFM_NOLINENUMBER     >> 16)    /* (*)    */
  813. #define PFE_NOWIDOWCONTROL        (PFM_NOWIDOWCONTROL     >> 16)    /* (*)    */
  814. #define PFE_DONOTHYPHEN            (PFM_DONOTHYPHEN      >> 16)    /* (*)    */
  815. #define PFE_SIDEBYSIDE            (PFM_SIDEBYSIDE         >> 16)    /* (*)    */
  816.  
  817. #define PFE_TABLEROW            0xc000        /* These 3 options are mutually    */
  818. #define PFE_TABLECELLEND        0x8000        /*  exclusive and each imply    */
  819. #define PFE_TABLECELL            0x4000        /*  that para is part of a table*/
  820.  
  821. /*
  822.  *    PARAFORMAT numbering options (values for wNumbering):
  823.  *
  824.  *        Numbering Type        Value    Meaning
  825.  *        tomNoNumbering          0        Turn off paragraph numbering
  826.  *        tomNumberAsLCLetter      1        a, b, c, ...
  827.  *        tomNumberAsUCLetter      2        A, B, C, ...
  828.  *        tomNumberAsLCRoman      3        i, ii, iii, ...
  829.  *        tomNumberAsUCRoman      4        I, II, III, ...
  830.  *        tomNumberAsSymbols      5        default is bullet
  831.  *        tomNumberAsNumber      6        0, 1, 2, ...
  832.  *        tomNumberAsSequence      7        tomNumberingStart is first Unicode to use
  833.  *
  834.  *    Other valid Unicode chars are Unicodes for bullets.
  835.  */
  836.  
  837.  
  838. #define    PFA_JUSTIFY            4    /* New paragraph-alignment option 2.0 (*)
  839.  
  840.  
  841. /* notification structures */
  842.  
  843. #ifndef WM_NOTIFY
  844. #define WM_NOTIFY                0x004E
  845.  
  846. typedef struct _nmhdr
  847. {
  848.     HWND    hwndFrom;
  849.     _WPAD    _wPad1;
  850.     UINT    idFrom;
  851.     _WPAD    _wPad2;
  852.     UINT    code;
  853.     _WPAD    _wPad3;
  854. } NMHDR;
  855. #endif  /* !WM_NOTIFY */
  856.  
  857. typedef struct _msgfilter
  858. {
  859.     NMHDR    nmhdr;
  860.     UINT    msg;
  861.     _WPAD    _wPad1;
  862.     WPARAM    wParam;
  863.     _WPAD    _wPad2;
  864.     LPARAM    lParam;
  865. } MSGFILTER;
  866.  
  867. typedef struct _reqresize
  868. {
  869.     NMHDR nmhdr;
  870.     RECT rc;
  871. } REQRESIZE;
  872.  
  873. typedef struct _selchange
  874. {
  875.     NMHDR nmhdr;
  876.     CHARRANGE chrg;
  877.     WORD seltyp;
  878. } SELCHANGE;
  879.  
  880. #define SEL_EMPTY        0x0000
  881. #define SEL_TEXT        0x0001
  882. #define SEL_OBJECT        0x0002
  883. #define SEL_MULTICHAR    0x0004
  884. #define SEL_MULTIOBJECT    0x0008
  885.  
  886. /* used with IRichEditOleCallback::GetContextMenu, this flag will be
  887.    passed as a "selection type".  It indicates that a context menu for
  888.    a right-mouse drag drop should be generated.  The IOleObject parameter
  889.    will really be the IDataObject for the drop
  890.  */
  891. #define GCM_RIGHTMOUSEDROP  0x8000
  892.  
  893. typedef struct _endropfiles
  894. {
  895.     NMHDR nmhdr;
  896.     HANDLE hDrop;
  897.     LONG cp;
  898.     BOOL fProtected;
  899. } ENDROPFILES;
  900.  
  901. typedef struct _enprotected
  902. {
  903.     NMHDR nmhdr;
  904.     UINT msg;
  905.     _WPAD    _wPad1;
  906.     WPARAM wParam;
  907.     _WPAD    _wPad2;
  908.     LPARAM lParam;
  909.     CHARRANGE chrg;
  910. } ENPROTECTED;
  911.  
  912. typedef struct _ensaveclipboard
  913. {
  914.     NMHDR nmhdr;
  915.     LONG cObjectCount;
  916.     LONG cch;
  917. } ENSAVECLIPBOARD;
  918.  
  919. #ifndef MACPORT
  920. typedef struct _enoleopfailed
  921. {
  922.     NMHDR nmhdr;
  923.     LONG iob;
  924.     LONG lOper;
  925.     HRESULT hr;
  926. } ENOLEOPFAILED;
  927. #endif
  928.  
  929. #define    OLEOP_DOVERB    1
  930.  
  931. typedef struct _objectpositions
  932. {
  933.     NMHDR nmhdr;
  934.     LONG cObjectCount;
  935.     LONG *pcpPositions;
  936. } OBJECTPOSITIONS;
  937.  
  938. typedef struct _enlink
  939. {
  940.     NMHDR nmhdr;
  941.     UINT msg;
  942.     _WPAD   _wPad1;
  943.     WPARAM wParam;
  944.     _WPAD   _wPad2;
  945.     LPARAM lParam;
  946.     CHARRANGE chrg;
  947. } ENLINK;
  948.  
  949. /* PenWin specific */
  950. typedef struct _encorrecttext
  951. {
  952.     NMHDR nmhdr;
  953.     CHARRANGE chrg;
  954.     WORD seltyp;
  955. } ENCORRECTTEXT;
  956.  
  957. /* Far East specific */
  958. typedef struct _punctuation
  959. {
  960.     UINT    iSize;
  961.     LPSTR    szPunctuation;
  962. } PUNCTUATION;
  963.  
  964. /* Far East specific */
  965. typedef struct _compcolor
  966. {
  967.     COLORREF crText;
  968.     COLORREF crBackground;
  969.     DWORD dwEffects;
  970. }COMPCOLOR;
  971.  
  972.  
  973. /* clipboard formats - use as parameter to RegisterClipboardFormat() */
  974. #define CF_RTF             TEXT("Rich Text Format")
  975. #define CF_RTFNOOBJS     TEXT("Rich Text Format Without Objects")
  976. #define CF_RETEXTOBJ     TEXT("RichEdit Text and Objects")
  977.  
  978. /* Paste Special */
  979. typedef struct _repastespecial
  980. {
  981.     DWORD    dwAspect;
  982.     DWORD    dwParam;
  983. } REPASTESPECIAL;
  984.  
  985. /*    UndoName info */
  986. typedef enum _undonameid
  987. {
  988.     UID_UNKNOWN     = 0,
  989.     UID_TYPING        = 1,
  990.     UID_DELETE         = 2,
  991.     UID_DRAGDROP    = 3,
  992.     UID_CUT            = 4,
  993.     UID_PASTE        = 5
  994. } UNDONAMEID;
  995.  
  996. /* flags for the GETEXTEX data structure */
  997. #define GT_DEFAULT        0
  998. #define GT_USECRLF        1
  999.  
  1000. /* EM_GETTEXTEX info; this struct is passed in the wparam of the message */
  1001. typedef struct _gettextex
  1002. {
  1003.     DWORD    cb;                /* count of bytes in the string                */
  1004.     DWORD    flags;            /* flags (see the GT_XXX defines            */
  1005.     UINT    codepage;        /* code page for translation (CP_ACP for default,
  1006.                                1200 for Unicode                            */
  1007.     LPCSTR    lpDefaultChar;    /* replacement for unmappable chars            */
  1008.     LPBOOL    lpUsedDefChar;    /* pointer to flag set when def char used    */
  1009. } GETTEXTEX;
  1010.  
  1011. /* flags for the GETTEXTLENGTHEX data structure                            */
  1012. #define GTL_DEFAULT        0    /* do the default (return # of chars)        */
  1013. #define GTL_USECRLF        1    /* compute answer using CRLFs for paragraphs*/
  1014. #define GTL_PRECISE        2    /* compute a precise answer                    */
  1015. #define GTL_CLOSE        4    /* fast computation of a "close" answer        */
  1016. #define GTL_NUMCHARS    8    /* return the number of characters            */
  1017. #define GTL_NUMBYTES    16    /* return the number of _bytes_                */
  1018.  
  1019. /* EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg */
  1020. typedef struct _gettextlengthex
  1021. {
  1022.     DWORD    flags;            /* flags (see GTL_XXX defines)                */
  1023.     UINT    codepage;        /* code page for translation (CP_ACP for default,
  1024.                                1200 for Unicode                            */
  1025. } GETTEXTLENGTHEX;
  1026.     
  1027. /* BiDi specific features */
  1028. typedef struct _bidioptions
  1029. {
  1030.     UINT    cbSize;
  1031.     _WPAD    _wPad1;
  1032.     WORD    wMask;
  1033.     WORD    wEffects; 
  1034. } BIDIOPTIONS;
  1035.  
  1036. /* BIDIOPTIONS masks */
  1037. #if (_RICHEDIT_VER == 0x0100)
  1038. #define BOM_DEFPARADIR            0x0001    /* Default paragraph direction (implies alignment) (obsolete) */
  1039. #define BOM_PLAINTEXT            0x0002    /* Use plain text layout (obsolete) */
  1040. #define BOM_NEUTRALOVERRIDE        0x0004    /* Override neutral layout (obsolete) */
  1041. #endif /* _RICHEDIT_VER == 0x0100 */
  1042. #define BOM_CONTEXTREADING        0x0008    /* Context reading order */
  1043. #define BOM_CONTEXTALIGNMENT    0x0010    /* Context alignment */
  1044.  
  1045. /* BIDIOPTIONS effects */
  1046. #if (_RICHEDIT_VER == 0x0100)
  1047. #define BOE_RTLDIR                0x0001    /* Default paragraph direction (implies alignment) (obsolete) */
  1048. #define BOE_PLAINTEXT            0x0002    /* Use plain text layout (obsolete) */
  1049. #define BOE_NEUTRALOVERRIDE        0x0004    /* Override neutral layout (obsolete) */
  1050. #endif /* _RICHEDIT_VER == 0x0100 */
  1051. #define BOE_CONTEXTREADING        0x0008    /* Context reading order */
  1052. #define BOE_CONTEXTALIGNMENT    0x0010    /* Context alignment */
  1053.  
  1054. /* Additional EM_FINDTEXT[EX] flags */
  1055. #define FR_MATCHDIAC                    0x20000000
  1056. #define FR_MATCHKASHIDA                 0x40000000
  1057. #define FR_MATCHALEFHAMZA               0x80000000
  1058.  
  1059. /* UNICODE embedding character */
  1060. #ifndef WCH_EMBEDDING
  1061. #define WCH_EMBEDDING (WCHAR)0xFFFC
  1062. #endif /* WCH_EMBEDDING */
  1063.         
  1064.  
  1065. #undef _WPAD
  1066.  
  1067. #ifdef _WIN32
  1068. #include <poppack.h>
  1069. #elif !defined(RC_INVOKED)
  1070. #pragma pack()
  1071. #endif
  1072.  
  1073. #ifdef __cplusplus
  1074. }
  1075. #endif  /* __cplusplus */
  1076.  
  1077. #pragma option pop /*P_O_Pop*/
  1078. #endif /* !_RICHEDIT_ */
  1079.  
  1080.