1 /***********************************************************************\
2 *                               richole.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.richole;
11 version(Windows):
12 
13 private import win32.objfwd, win32.objidl, win32.ole2, win32.unknwn,
14   win32.windef;
15 private import win32.richedit; // for CHARRANGE
16 
17 align(4):
18 
19 const ULONG
20 	REO_GETOBJ_NO_INTERFACES = 0,
21 	REO_GETOBJ_POLEOBJ = 1,
22 	REO_GETOBJ_PSTG = 2,
23 	REO_GETOBJ_POLESITE = 4,
24 	REO_GETOBJ_ALL_INTERFACES = 7,
25 	REO_CP_SELECTION = -1,
26 	REO_IOB_SELECTION = -1,
27 	REO_IOB_USE_CP = -2,
28 	REO_NULL = 0,
29 	REO_READWRITEMASK = 0x3F,
30 	REO_DONTNEEDPALETTE = 32,
31 	REO_BLANK = 16,
32 	REO_DYNAMICSIZE = 8,
33 	REO_INVERTEDSELECT = 4,
34 	REO_BELOWBASELINE = 2,
35 	REO_RESIZABLE = 1,
36 	REO_LINK = 0x80000000,
37 	REO_STATIC = 0x40000000,
38 	REO_SELECTED = 0x08000000,
39 	REO_OPEN = 0x4000000,
40 	REO_INPLACEACTIVE = 0x2000000,
41 	REO_HILITED = 0x1000000,
42 	REO_LINKAVAILABLE = 0x800000,
43 	REO_GETMETAFILE = 0x400000;
44 
45 enum {
46 	RECO_PASTE = 0,
47 	RECO_DROP,
48 	RECO_COPY,
49 	RECO_CUT,
50 	RECO_DRAG // = 4
51 }
52 
53 extern (C) extern const GUID
54 	IID_IRichEditOle,
55 	IID_IRichEditOleCallback;
56 
57 struct REOBJECT {
58 	DWORD           cbStruct = REOBJECT.sizeof;
59 	LONG            cp;
60 	CLSID           clsid;
61 	LPOLEOBJECT     poleobj;
62 	LPSTORAGE       pstg;
63 	LPOLECLIENTSITE polesite;
64 	SIZEL           sizel;
65 	DWORD           dvaspect;
66 	DWORD           dwFlags;
67 	DWORD           dwUser;
68 }
69 
70 interface IRichEditOle : IUnknown {
71 	HRESULT GetClientSite(LPOLECLIENTSITE*);
72 	LONG GetObjectCount();
73 	LONG GetLinkCount();
74 	HRESULT GetObject(LONG, REOBJECT*, DWORD);
75 	HRESULT InsertObject(REOBJECT*);
76 	HRESULT ConvertObject(LONG, REFCLSID, LPCSTR);
77 	HRESULT ActivateAs(REFCLSID, REFCLSID);
78 	HRESULT SetHostNames(LPCSTR, LPCSTR);
79 	HRESULT SetLinkAvailable(LONG, BOOL);
80 	HRESULT SetDvaspect(LONG, DWORD);
81 	HRESULT HandsOffStorage(LONG);
82 	HRESULT SaveCompleted(LONG, LPSTORAGE);
83 	HRESULT InPlaceDeactivate();
84 	HRESULT ContextSensitiveHelp(BOOL);
85 	HRESULT GetClipboardData(CHARRANGE*, DWORD, LPDATAOBJECT*);
86 	HRESULT ImportDataObject(LPDATAOBJECT, CLIPFORMAT, HGLOBAL);
87 };
88 alias IRichEditOle LPRICHEDITOLE;
89 
90 interface IRichEditOleCallback : IUnknown {
91 	HRESULT GetNewStorage(LPSTORAGE*);
92 	HRESULT GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEUIWINDOW*, LPOLEINPLACEFRAMEINFO);
93 	HRESULT ShowContainerUI(BOOL);
94 	HRESULT QueryInsertObject(LPCLSID, LPSTORAGE, LONG);
95 	HRESULT DeleteObject(LPOLEOBJECT);
96 	HRESULT QueryAcceptData(LPDATAOBJECT, CLIPFORMAT*, DWORD, BOOL, HGLOBAL);
97 	HRESULT ContextSensitiveHelp(BOOL);
98 	HRESULT GetClipboardData(CHARRANGE*, DWORD, LPDATAOBJECT*);
99 	HRESULT GetDragDropEffect(BOOL, DWORD, PDWORD);
100 	HRESULT GetContextMenu(WORD, LPOLEOBJECT, CHARRANGE*, HMENU*);
101 };
102 alias IRichEditOleCallback LPRICHEDITOLECALLBACK;