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