1 /***********************************************************************\
2 *                                ocidl.d                                *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                 Part of the Internet Development SDK                  *
6 *                                                                       *
7 *                 Translated from MinGW Windows headers                 *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.ocidl;
12 
13 private import win32.ole2, win32.oleidl, win32.oaidl, win32.objfwd,
14   win32.windef, win32.wtypes;
15 private import win32.objidl;  // for CLIPFORMAT
16 private import win32.wingdi;  // for TEXTMETRICW
17 private import win32.winuser; // for LPMSG
18 
19 interface IBindHost : IUnknown {}
20 
21 interface IServiceProvider : IUnknown{
22 	HRESULT QueryService(REFGUID,REFIID,void**);
23 }
24 
25 /*
26 // TODO:
27 //private import win32.servprov; // for IServiceProvider
28 // private import win32.urlmon; // for IBindHost. This is not included in MinGW.
29 
30 // win32.urlmon should contain:
31 interface IBindHost : IUnknown
32 {
33 	HRESULT CreateMoniker(LPOLESTR szName, IBindCtx* pBC, IMoniker** ppmk, DWORD);
34 	HRESULT MonikerBindToObject(IMoniker* pMk, IBindCtx* pBC, IBindStatusCallback* pBSC, REFIID, void** );
35 	HRESULT MonikerBindToStorage(IMoniker* pMk, IBindCtx* pBC, IBindStatusCallback* pBSC, REFIID, void** );
36 }
37 */
38 
39 
40 
41 
42 //[Yes] #ifndef OLE2ANSI
43 alias TEXTMETRICW TEXTMETRICOLE;
44 //} else {
45 //alias TEXTMETRIC TEXTMETRICOLE;
46 //}
47 alias TEXTMETRICOLE* LPTEXTMETRICOLE;
48 
49 alias DWORD OLE_COLOR;
50 alias UINT OLE_HANDLE;
51 alias int OLE_XPOS_HIMETRIC;
52 alias int OLE_YPOS_HIMETRIC;
53 alias int OLE_XSIZE_HIMETRIC;
54 alias int OLE_YSIZE_HIMETRIC;
55 
56 enum READYSTATE {
57 	READYSTATE_UNINITIALIZED = 0,
58 	READYSTATE_LOADING = 1,
59 	READYSTATE_LOADED = 2,
60 	READYSTATE_INTERACTIVE = 3,
61 	READYSTATE_COMPLETE = 4
62 }
63 
64 enum PROPBAG2_TYPE {
65 	PROPBAG2_TYPE_UNDEFINED,
66 	PROPBAG2_TYPE_DATA,
67 	PROPBAG2_TYPE_URL,
68 	PROPBAG2_TYPE_OBJECT,
69 	PROPBAG2_TYPE_STREAM,
70 	PROPBAG2_TYPE_STORAGE,
71 	PROPBAG2_TYPE_MONIKER // = 6
72 }
73 
74 struct PROPBAG2 {
75 	DWORD dwType;
76 	VARTYPE vt;
77 	CLIPFORMAT cfType;
78 	DWORD dwHint;
79 	LPOLESTR pstrName;
80 	CLSID clsid;
81 }
82 
83 enum QACONTAINERFLAGS {
84 	QACONTAINER_SHOWHATCHING = 1,
85 	QACONTAINER_SHOWGRABHANDLES = 2,
86 	QACONTAINER_USERMODE = 4,
87 	QACONTAINER_DISPLAYASDEFAULT = 8,
88 	QACONTAINER_UIDEAD = 16,
89 	QACONTAINER_AUTOCLIP = 32,
90 	QACONTAINER_MESSAGEREFLECT = 64,
91 	QACONTAINER_SUPPORTSMNEMONICS = 128
92 }
93 
94 struct QACONTAINER {
95 	ULONG cbSize = this.sizeof;
96 	IOleClientSite* pClientSite;
97 	IAdviseSinkEx* pAdviseSink;
98 	IPropertyNotifySink* pPropertyNotifySink;
99 	IUnknown* pUnkEventSink;
100 	DWORD dwAmbientFlags;
101 	OLE_COLOR colorFore;
102 	OLE_COLOR colorBack;
103 	IFont* pFont;
104 	IOleUndoManager* pUndoMgr;
105 	DWORD dwAppearance;
106 	LONG lcid;
107 	HPALETTE hpal;
108 	IBindHost* pBindHost;
109 	IOleControlSite* pOleControlSite;
110 	IServiceProvider* pServiceProvider;
111 }
112 
113 struct QACONTROL {
114 	ULONG cbSize = this.sizeof;
115 	DWORD dwMiscStatus;
116 	DWORD dwViewStatus;
117 	DWORD dwEventCookie;
118 	DWORD dwPropNotifyCookie;
119 	DWORD dwPointerActivationPolicy;
120 }
121 
122 struct POINTF {
123 	float x;
124 	float y;
125 }
126 alias POINTF* LPPOINTF;
127 
128 struct CONTROLINFO {
129 	ULONG cb;
130 	HACCEL hAccel;
131 	USHORT cAccel;
132 	DWORD dwFlags;
133 }
134 alias CONTROLINFO* LPCONTROLINFO;
135 
136 struct CONNECTDATA {
137 	LPUNKNOWN pUnk;
138 	DWORD dwCookie;
139 }
140 alias CONNECTDATA* LPCONNECTDATA;
141 
142 struct LICINFO {
143 	int cbLicInfo;
144 	BOOL fRuntimeKeyAvail;
145 	BOOL fLicVerified;
146 }
147 alias LICINFO* LPLICINFO;
148 
149 struct CAUUID {
150 	ULONG cElems;
151 	GUID* pElems;
152 }
153 alias CAUUID* LPCAUUID;
154 
155 struct CALPOLESTR {
156 	ULONG cElems;
157 	LPOLESTR* pElems;
158 }
159 alias CALPOLESTR* LPCALPOLESTR;
160 
161 struct CADWORD {
162 	ULONG cElems;
163 	DWORD* pElems;
164 }
165 alias CADWORD* LPCADWORD;
166 
167 struct PROPPAGEINFO {
168 	ULONG cb;
169 	LPOLESTR pszTitle;
170 	SIZE size;
171 	LPOLESTR pszDocString;
172 	LPOLESTR pszHelpFile;
173 	DWORD dwHelpContext;
174 }
175 alias PROPPAGEINFO* LPPROPPAGEINFO;
176 
177 interface IOleControl : IUnknown {
178 	HRESULT GetControlInfo(LPCONTROLINFO);
179 	HRESULT OnMnemonic(LPMSG);
180 	HRESULT OnAmbientPropertyChange(DISPID);
181 	HRESULT FreezeEvents(BOOL);
182 }
183 
184 interface IOleControlSite : IUnknown {
185 	HRESULT OnControlInfoChanged();
186 	HRESULT LockInPlaceActive(BOOL);
187 	HRESULT GetExtendedControl(LPDISPATCH*);
188 	HRESULT TransformCoords(POINTL*, POINTF*, DWORD);
189 	HRESULT TranslateAccelerator(LPMSG, DWORD);
190 	HRESULT OnFocus(BOOL);
191 	HRESULT ShowPropertyFrame();
192 }
193 
194 interface ISimpleFrameSite : IUnknown {
195 	HRESULT PreMessageFilter(HWND, UINT, WPARAM, LPARAM, LRESULT*, PDWORD);
196 	HRESULT PostMessageFilter(HWND, UINT, WPARAM, LPARAM, LRESULT*, DWORD);
197 }
198 
199 interface IErrorLog : IUnknown {
200 	HRESULT AddError(LPCOLESTR, LPEXCEPINFO);
201 }
202 alias IErrorLog LPERRORLOG;
203 
204 interface IPropertyBag : IUnknown {
205 	HRESULT Read(LPCOLESTR, LPVARIANT, LPERRORLOG);
206 	HRESULT Write(LPCOLESTR, LPVARIANT);
207 }
208 alias IPropertyBag LPPROPERTYBAG;
209 
210 interface IPropertyBag2 : IUnknown {
211 	HRESULT Read(ULONG, PROPBAG2*, LPERRORLOG, VARIANT*, HRESULT*);
212 	HRESULT Write(ULONG, PROPBAG2*, VARIANT*);
213 	HRESULT CountProperties(ULONG*);
214 	HRESULT GetPropertyInfo(ULONG, ULONG, PROPBAG2*, ULONG*);
215 	HRESULT LoadObject(LPCOLESTR, DWORD, IUnknown*, LPERRORLOG);
216 }
217 alias IPropertyBag2 LPPROPERTYBAG2;
218 
219 interface IPersistPropertyBag : IPersist {
220 	HRESULT InitNew();
221 	HRESULT Load(LPPROPERTYBAG, LPERRORLOG);
222 	HRESULT Save(LPPROPERTYBAG, BOOL, BOOL);
223 }
224 
225 interface IPersistPropertyBag2 : IPersist {
226 	HRESULT InitNew();
227 	HRESULT Load(LPPROPERTYBAG2, LPERRORLOG);
228 	HRESULT Save(LPPROPERTYBAG2, BOOL, BOOL);
229 	HRESULT IsDirty();
230 }
231 
232 interface IPersistStreamInit : IPersist {
233 	HRESULT IsDirty();
234 	HRESULT Load(LPSTREAM);
235 	HRESULT Save(LPSTREAM, BOOL);
236 	HRESULT GetSizeMax(PULARGE_INTEGER);
237 	HRESULT InitNew();
238 }
239 
240 interface IPersistMemory : IPersist {
241 	HRESULT IsDirty();
242 	HRESULT Load(PVOID, ULONG);
243 	HRESULT Save(PVOID, BOOL, ULONG);
244 	HRESULT GetSizeMax(PULONG);
245 	HRESULT InitNew();
246 }
247 
248 interface IPropertyNotifySink : IUnknown {
249 	HRESULT OnChanged(DISPID);
250 	HRESULT OnRequestEdit(DISPID);
251 }
252 
253 interface IProvideClassInfo : IUnknown {
254 	HRESULT GetClassInfo(LPTYPEINFO*);
255 }
256 
257 interface IProvideClassInfo2 : IProvideClassInfo {
258 	HRESULT GetGUID(DWORD, GUID*);
259 }
260 
261 interface IConnectionPointContainer : IUnknown {
262 	HRESULT EnumConnectionPoints(LPENUMCONNECTIONPOINTS*);
263 	HRESULT FindConnectionPoint(REFIID, LPCONNECTIONPOINT*);
264 }
265 
266 interface IEnumConnectionPoints : IUnknown {
267 	HRESULT Next(ULONG, LPCONNECTIONPOINT*, ULONG*);
268 	HRESULT Skip(ULONG);
269 	HRESULT Reset();
270 	HRESULT Clone(LPENUMCONNECTIONPOINTS*);
271 }
272 alias IEnumConnectionPoints LPENUMCONNECTIONPOINTS;
273 
274 interface IConnectionPoint : IUnknown {
275 	HRESULT GetConnectionInterface(IID*);
276 	HRESULT GetConnectionPointContainer(IConnectionPointContainer**);
277 	HRESULT Advise(LPUNKNOWN, PDWORD);
278 	HRESULT Unadvise(DWORD);
279 	HRESULT EnumConnections(LPENUMCONNECTIONS*);
280 }
281 alias IConnectionPoint LPCONNECTIONPOINT;
282 
283 interface IEnumConnections : IUnknown {
284 	HRESULT Next(ULONG, LPCONNECTDATA, PULONG);
285 	HRESULT Skip(ULONG);
286 	HRESULT Reset();
287 	HRESULT Clone(LPENUMCONNECTIONS*);
288 }
289 alias IEnumConnections LPENUMCONNECTIONS;
290 
291 interface IClassFactory2 : IClassFactory {
292 	HRESULT GetLicInfo(LPLICINFO);
293 	HRESULT RequestLicKey(DWORD, BSTR*);
294 	HRESULT CreateInstanceLic(LPUNKNOWN, LPUNKNOWN, REFIID, BSTR, PVOID*);
295 }
296 
297 interface ISpecifyPropertyPages : IUnknown {
298 	HRESULT GetPages(CAUUID*);
299 }
300 
301 interface IPerPropertyBrowsing : IUnknown {
302 	HRESULT GetDisplayString(DISPID, BSTR*);
303 	HRESULT MapPropertyToPage(DISPID, LPCLSID);
304 	HRESULT GetPredefinedStrings(DISPID, CALPOLESTR*, CADWORD*);
305 	HRESULT GetPredefinedValue(DISPID, DWORD, VARIANT*);
306 }
307 
308 interface IPropertyPageSite : IUnknown {
309 	HRESULT OnStatusChange(DWORD);
310 	HRESULT GetLocaleID(LCID*);
311 	HRESULT GetPageContainer(LPUNKNOWN*);
312 	HRESULT TranslateAccelerator(LPMSG);
313 }
314 alias IPropertyPageSite LPPROPERTYPAGESITE;
315 
316 interface IPropertyPage : IUnknown {
317 	HRESULT SetPageSite(LPPROPERTYPAGESITE);
318 	HRESULT Activate(HWND, LPCRECT, BOOL);
319 	HRESULT Deactivate();
320 	HRESULT GetPageInfo(LPPROPPAGEINFO);
321 	HRESULT SetObjects(ULONG, LPUNKNOWN*);
322 	HRESULT Show(UINT);
323 	HRESULT Move(LPCRECT);
324 	HRESULT IsPageDirty();
325 	HRESULT Apply();
326 	HRESULT Help(LPCOLESTR);
327 	HRESULT TranslateAccelerator(LPMSG);
328 }
329 
330 
331 interface IPropertyPage2 : IPropertyPage
332 { HRESULT EditProperty(DISPID);
333 }
334 
335 interface IFont : IUnknown {
336 	HRESULT get_Name(BSTR*);
337 	HRESULT put_Name(BSTR);
338 	HRESULT get_Size(CY*);
339 	HRESULT put_Size(CY);
340 	HRESULT get_Bold(BOOL*);
341 	HRESULT put_Bold(BOOL);
342 	HRESULT get_Italic(BOOL*);
343 	HRESULT put_Italic(BOOL);
344 	HRESULT get_Underline(BOOL*);
345 	HRESULT put_Underline(BOOL);
346 	HRESULT get_Strikethrough(BOOL*);
347 	HRESULT put_Strikethrough(BOOL);
348 	HRESULT get_Weight(short*);
349 	HRESULT put_Weight(short);
350 	HRESULT get_Charset(short*);
351 	HRESULT put_Charset(short);
352 	HRESULT get_hFont(HFONT*);
353 	HRESULT Clone(IFont**);
354 	HRESULT IsEqual(IFont*);
355 	HRESULT SetRatio(int, int);
356 	HRESULT QueryTextMetrics(LPTEXTMETRICOLE);
357 	HRESULT AddRefHfont(HFONT);
358 	HRESULT ReleaseHfont(HFONT);
359 	HRESULT SetHdc(HDC);
360 }
361 alias IFont LPFONT;
362 
363 interface IFontDisp : IDispatch {
364 }
365 alias IFontDisp LPFONTDISP;
366 
367 interface IPicture : IUnknown {
368 	HRESULT get_Handle(OLE_HANDLE*);
369 	HRESULT get_hPal(OLE_HANDLE*);
370 	HRESULT get_Type(short*);
371 	HRESULT get_Width(OLE_XSIZE_HIMETRIC*);
372 	HRESULT get_Height(OLE_YSIZE_HIMETRIC*);
373 	HRESULT Render(HDC, int, int, int, int, OLE_XPOS_HIMETRIC,
374 	  OLE_YPOS_HIMETRIC, OLE_XSIZE_HIMETRIC, OLE_YSIZE_HIMETRIC, LPCRECT);
375 	HRESULT set_hPal(OLE_HANDLE);
376 	HRESULT get_CurDC(HDC*);
377 	HRESULT SelectPicture(HDC, HDC*, OLE_HANDLE*);
378 	HRESULT get_KeepOriginalFormat(BOOL*);
379 	HRESULT put_KeepOriginalFormat(BOOL);
380 	HRESULT PictureChanged();
381 	HRESULT SaveAsFile(LPSTREAM, BOOL, LONG*);
382 	HRESULT get_Attributes(PDWORD);
383 }
384 
385 interface IPictureDisp : IDispatch {
386 }
387 
388 interface IOleInPlaceSiteEx : IOleInPlaceSite {
389 	HRESULT OnInPlaceActivateEx(BOOL*, DWORD);
390 	HRESULT OnInPlaceDeactivateEx(BOOL);
391 	HRESULT RequestUIActivate();
392 }
393 
394 interface IObjectWithSite : IUnknown {
395 	HRESULT SetSite(IUnknown*);
396 	HRESULT GetSite(REFIID, void**);
397 }
398 
399 interface IOleInPlaceSiteWindowless : IOleInPlaceSiteEx {
400 	HRESULT CanWindowlessActivate();
401 	HRESULT GetCapture();
402 	HRESULT SetCapture(BOOL);
403 	HRESULT GetFocus();
404 	HRESULT SetFocus(BOOL);
405 	HRESULT GetDC(LPCRECT, DWORD, HDC*);
406 	HRESULT ReleaseDC(HDC);
407 	HRESULT InvalidateRect(LPCRECT, BOOL);
408 	HRESULT InvalidateRgn(HRGN, BOOL);
409 	HRESULT ScrollRect(INT, INT, LPCRECT, LPCRECT);
410 	HRESULT AdjustRect(LPCRECT);
411 	HRESULT OnDefWindowMessage(UINT, WPARAM, LPARAM, LRESULT*);
412 }
413 
414 interface IAdviseSinkEx : IUnknown {
415 	void OnDataChange(FORMATETC*, STGMEDIUM*);
416 	void OnViewChange(DWORD, LONG);
417 	void OnRename(IMoniker*);
418 	void OnSave();
419 	void OnClose();
420 	HRESULT OnViewStatusChange(DWORD);
421 }
422 
423 interface IPointerInactive : IUnknown {
424 	HRESULT GetActivationPolicy(DWORD*);
425 	HRESULT OnInactiveMouseMove(LPCRECT, LONG, LONG, DWORD);
426 	HRESULT OnInactiveSetCursor(LPCRECT, LONG, LONG, DWORD, BOOL);
427 }
428 
429 interface IOleUndoUnit : IUnknown {
430 	HRESULT Do(LPOLEUNDOMANAGER);
431 	HRESULT GetDescription(BSTR*);
432 	HRESULT GetUnitType(CLSID*, LONG*);
433 	HRESULT OnNextAdd();
434 }
435 
436 interface IOleParentUndoUnit : IOleUndoUnit {
437 	HRESULT Open(IOleParentUndoUnit*);
438 	HRESULT Close(IOleParentUndoUnit*, BOOL);
439 	HRESULT Add(IOleUndoUnit*);
440 	HRESULT FindUnit(IOleUndoUnit*);
441 	HRESULT GetParentState(DWORD*);
442 }
443 
444 interface IEnumOleUndoUnits : IUnknown {
445 	HRESULT Next(ULONG, IOleUndoUnit**, ULONG*);
446 	HRESULT Skip(ULONG);
447 	HRESULT Reset();
448 	HRESULT Clone(IEnumOleUndoUnits**);
449 }
450 
451 interface IOleUndoManager : IUnknown {
452 	HRESULT Open(IOleParentUndoUnit*);
453 	HRESULT Close(IOleParentUndoUnit*, BOOL);
454 	HRESULT Add(IOleUndoUnit*);
455 	HRESULT GetOpenParentState(DWORD*);
456 	HRESULT DiscardFrom(IOleUndoUnit*);
457 	HRESULT UndoTo(IOleUndoUnit*);
458 	HRESULT RedoTo(IOleUndoUnit*);
459 	HRESULT EnumUndoable(IEnumOleUndoUnits**);
460 	HRESULT EnumRedoable(IEnumOleUndoUnits**);
461 	HRESULT GetLastUndoDescription(BSTR*);
462 	HRESULT GetLastRedoDescription(BSTR*);
463 	HRESULT Enable(BOOL);
464 }
465 alias IOleUndoManager LPOLEUNDOMANAGER;
466 
467 interface IQuickActivate : IUnknown {
468 	HRESULT QuickActivate(QACONTAINER*, QACONTROL*);
469 	HRESULT SetContentExtent(LPSIZEL);
470 	HRESULT GetContentExtent(LPSIZEL);
471 }