1 /***********************************************************************\
2 *                                 ole2.d                                *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.ole2;
11 pragma(lib, "ole32.lib");
12 
13 public import win32.basetyps, win32.objbase, win32.oleauto, win32.olectlid,
14   win32.oleidl, win32.unknwn, win32.winerror, win32.uuid;
15 private import win32.objfwd, win32.objidl, win32.windef, win32.wtypes;
16 private import win32.winuser; // for LPMSG
17 
18 const E_DRAW = VIEW_E_DRAW;
19 
20 const DATA_E_FORMATETC = DV_E_FORMATETC;
21 
22 enum {
23 	OLEIVERB_PRIMARY = 0,
24 	OLEIVERB_SHOW = -1,
25 	OLEIVERB_OPEN = -2,
26 	OLEIVERB_HIDE = -3,
27 	OLEIVERB_UIACTIVATE = -4,
28 	OLEIVERB_INPLACEACTIVATE = -5,
29 	OLEIVERB_DISCARDUNDOSTATE = -6
30 }
31 
32 const EMBDHLP_INPROC_HANDLER = 0x0000L;
33 const EMBDHLP_INPROC_SERVER  = 0x0001L;
34 const EMBDHLP_CREATENOW      = 0x00000000L;
35 const EMBDHLP_DELAYCREATE    = 0x00010000L;
36 
37 align(8):
38 struct OLESTREAM {
39 	LPOLESTREAMVTBL lpstbl;
40 }
41 alias OLESTREAM* LPOLESTREAM;
42 
43 extern (Windows) {
44 	struct OLESTREAMVTBL {
45 		DWORD function (LPOLESTREAM, void*, DWORD) Get;
46 		DWORD function (LPOLESTREAM, CPtr!(void), DWORD) Put;
47 	}
48 }
49 alias OLESTREAMVTBL* LPOLESTREAMVTBL;
50 
51 extern (Windows) {
52 	HRESULT CreateDataAdviseHolder(LPDATAADVISEHOLDER*);
53 	DWORD OleBuildVersion();
54 	HRESULT ReadClassStg(LPSTORAGE, CLSID*);
55 	HRESULT WriteClassStg(LPSTORAGE, REFCLSID);
56 	HRESULT ReadClassStm(LPSTREAM, CLSID*);
57 	HRESULT WriteClassStm(LPSTREAM, REFCLSID);
58 	HRESULT WriteFmtUserTypeStg(LPSTORAGE, CLIPFORMAT, LPOLESTR);
59 	HRESULT ReadFmtUserTypeStg(LPSTORAGE, CLIPFORMAT*, LPOLESTR*);
60 	HRESULT OleInitialize(PVOID);
61 	void OleUninitialize();
62 	HRESULT OleQueryLinkFromData(LPDATAOBJECT);
63 	HRESULT OleQueryCreateFromData(LPDATAOBJECT);
64 	HRESULT OleCreate(REFCLSID, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
65 	HRESULT OleCreateFromData(LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
66 	HRESULT OleCreateLinkFromData(LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
67 	HRESULT OleCreateStaticFromData(LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
68 	HRESULT OleCreateLink(LPMONIKER, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
69 	HRESULT OleCreateLinkToFile(LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
70 	HRESULT OleCreateFromFile(REFCLSID, LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, PVOID*);
71 	HRESULT OleLoad(LPSTORAGE, REFIID, LPOLECLIENTSITE, PVOID*);
72 	HRESULT OleSave(LPPERSISTSTORAGE, LPSTORAGE, BOOL);
73 	HRESULT OleLoadFromStream(LPSTREAM, REFIID, PVOID*);
74 	HRESULT OleSaveToStream(LPPERSISTSTREAM, LPSTREAM);
75 	HRESULT OleSetContainedObject(LPUNKNOWN, BOOL);
76 	HRESULT OleNoteObjectVisible(LPUNKNOWN, BOOL);
77 	HRESULT RegisterDragDrop(HWND, LPDROPTARGET);
78 	HRESULT RevokeDragDrop(HWND);
79 	HRESULT DoDragDrop(LPDATAOBJECT, LPDROPSOURCE, DWORD, PDWORD);
80 	HRESULT OleSetClipboard(LPDATAOBJECT);
81 	HRESULT OleGetClipboard(LPDATAOBJECT*);
82 	HRESULT OleFlushClipboard();
83 	HRESULT OleIsCurrentClipboard(LPDATAOBJECT);
84 	HOLEMENU OleCreateMenuDescriptor(HMENU, LPOLEMENUGROUPWIDTHS);
85 	HRESULT OleSetMenuDescriptor(HOLEMENU, HWND, HWND, LPOLEINPLACEFRAME, LPOLEINPLACEACTIVEOBJECT);
86 	HRESULT OleDestroyMenuDescriptor(HOLEMENU);
87 	HRESULT OleTranslateAccelerator(LPOLEINPLACEFRAME, LPOLEINPLACEFRAMEINFO, LPMSG);
88 	HANDLE OleDuplicateData(HANDLE, CLIPFORMAT, UINT);
89 	HRESULT OleDraw(LPUNKNOWN, DWORD, HDC, LPCRECT);
90 	HRESULT OleRun(LPUNKNOWN);
91 	BOOL OleIsRunning(LPOLEOBJECT);
92 	HRESULT OleLockRunning(LPUNKNOWN, BOOL, BOOL);
93 	void ReleaseStgMedium(LPSTGMEDIUM);
94 	HRESULT CreateOleAdviseHolder(LPOLEADVISEHOLDER*);
95 	HRESULT OleCreateDefaultHandler(REFCLSID, LPUNKNOWN, REFIID, PVOID*);
96 	HRESULT OleCreateEmbeddingHelper(REFCLSID, LPUNKNOWN, DWORD, LPCLASSFACTORY, REFIID, PVOID*);
97 	BOOL IsAccelerator(HACCEL, int, LPMSG, WORD*);
98 	HGLOBAL OleGetIconOfFile(LPOLESTR, BOOL);
99 	HGLOBAL OleGetIconOfClass(REFCLSID, LPOLESTR, BOOL);
100 	HGLOBAL OleMetafilePictFromIconAndLabel(HICON, LPOLESTR, LPOLESTR, UINT);
101 	HRESULT OleRegGetUserType(REFCLSID, DWORD, LPOLESTR*);
102 	HRESULT OleRegGetMiscStatus(REFCLSID, DWORD, DWORD*);
103 	HRESULT OleRegEnumFormatEtc (REFCLSID, DWORD, LPENUMFORMATETC*);
104 	HRESULT OleRegEnumVerbs (REFCLSID, LPENUMOLEVERB*);
105 	HRESULT OleConvertOLESTREAMToIStorage(LPOLESTREAM, LPSTORAGE, CPtr!(DVTARGETDEVICE));
106 	HRESULT OleConvertIStorageToOLESTREAM(LPSTORAGE, LPOLESTREAM);
107 	HRESULT GetHGlobalFromILockBytes(LPLOCKBYTES, HGLOBAL*);
108 	HRESULT CreateILockBytesOnHGlobal(HGLOBAL, BOOL, LPLOCKBYTES*);
109 	HRESULT GetHGlobalFromStream(LPSTREAM, HGLOBAL*);
110 	HRESULT CreateStreamOnHGlobal(HGLOBAL, BOOL, LPSTREAM*);
111 	HRESULT OleDoAutoConvert(LPSTORAGE, LPCLSID);
112 	HRESULT OleGetAutoConvert(REFCLSID, LPCLSID);
113 	HRESULT OleSetAutoConvert(REFCLSID, REFCLSID);
114 	HRESULT GetConvertStg(LPSTORAGE);
115 	HRESULT SetConvertStg(LPSTORAGE, BOOL);
116 	HRESULT OleConvertIStorageToOLESTREAMEx(LPSTORAGE, CLIPFORMAT, LONG, LONG, DWORD, LPSTGMEDIUM, LPOLESTREAM);
117 	HRESULT OleConvertOLESTREAMToIStorageEx(LPOLESTREAM, LPSTORAGE, CLIPFORMAT*, LONG*, LONG*, DWORD*, LPSTGMEDIUM);
118 }