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