Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1342 lines
43 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ole2.h - Main OLE2 header; includes all subcomponents *
  4. * *
  5. * OLE Version 2.01 for Win16 and Win32 *
  6. * *
  7. * Copyright (c) 1992-1993, Microsoft Corp. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #if !defined( _OLE2_H_ )
  11. #define _OLE2_H_
  12. #ifndef RC_INVOKED
  13. #pragma warning(disable:4001)
  14. #endif /* RC_INVOKED */
  15. #include <string.h>
  16. /****** Standard Object Definitions *****************************************/
  17. #include <compobj.h>
  18. // *************** FACILITY_ITF scodes common to all interfaces ************
  19. //
  20. // By convention, OLE interfaces divide the FACILITY_ITF range of errors
  21. // into nonoverlapping subranges. If an interface returns a FACILITY_ITF
  22. // scode, it must be from the range associated with that interface or from
  23. // the shared range: OLE_E_FIRST...OLE_E_LAST.
  24. //
  25. // error codes
  26. #define OLE_E_OLEVERB (OLE_E_FIRST)
  27. // invalid OLEVERB structure
  28. #define OLE_E_ADVF (OLE_E_FIRST+1)
  29. // invalid advise flags
  30. #define OLE_E_ENUM_NOMORE (OLE_E_FIRST+2)
  31. // you can't enuemrate any more, because the associated data is missing
  32. #define OLE_E_ADVISENOTSUPPORTED (OLE_E_FIRST+3)
  33. // this implementation doesn't take advises
  34. #define OLE_E_NOCONNECTION (OLE_E_FIRST+4)
  35. // there is no connection for this connection id
  36. #define OLE_E_NOTRUNNING (OLE_E_FIRST+5)
  37. // need run the object to perform this operation
  38. #define OLE_E_NOCACHE (OLE_E_FIRST+6)
  39. // there is no cache to operate on
  40. #define OLE_E_BLANK (OLE_E_FIRST+7)
  41. // Uninitialized object
  42. #define OLE_E_CLASSDIFF (OLE_E_FIRST+8)
  43. // linked object's source class has changed
  44. #define OLE_E_CANT_GETMONIKER (OLE_E_FIRST+9)
  45. // not able to get the moniker of the object
  46. #define OLE_E_CANT_BINDTOSOURCE (OLE_E_FIRST+10)
  47. // not able to bind to the source
  48. #define OLE_E_STATIC (OLE_E_FIRST+11)
  49. // object is static, operation not allowed
  50. #define OLE_E_PROMPTSAVECANCELLED (OLE_E_FIRST+12)
  51. // user cancelled out of save dialog
  52. #define OLE_E_INVALIDRECT (OLE_E_FIRST+13)
  53. // invalid rectangle
  54. #define OLE_E_WRONGCOMPOBJ (OLE_E_FIRST+14)
  55. // compobj.dll is too old for the ole2.dll initialized
  56. #define OLE_E_INVALIDHWND (OLE_E_FIRST+15)
  57. // invalid window handle
  58. #define OLE_E_NOT_INPLACEACTIVE (OLE_E_FIRST+16)
  59. // object is not in any of the inplace active states
  60. #define OLE_E_CANTCONVERT (OLE_E_FIRST+17)
  61. // not able to convert the object
  62. #define OLE_E_NOSTORAGE (OLE_E_FIRST+18)
  63. // not able to perform the operation because object is not given storage yet.
  64. #define DVGEN_E_FIRST (OLE_E_FIRST+100)
  65. #define DV_E_FORMATETC (DVGEN_E_FIRST)
  66. // invalid FORMATETC structure
  67. #define DV_E_DVTARGETDEVICE (DVGEN_E_FIRST+1)
  68. // invalid DVTARGETDEVICE structure
  69. #define DV_E_STGMEDIUM (DVGEN_E_FIRST+2)
  70. // invalid STDGMEDIUM structure
  71. #define DV_E_STATDATA (DVGEN_E_FIRST+3)
  72. // invalid STATDATA structure
  73. #define DV_E_LINDEX (DVGEN_E_FIRST+4)
  74. // invalid lindex
  75. #define DV_E_TYMED (DVGEN_E_FIRST+5)
  76. // invalid tymed
  77. #define DV_E_CLIPFORMAT (DVGEN_E_FIRST+6)
  78. // invalid clipboard format
  79. #define DV_E_DVASPECT (DVGEN_E_FIRST+7)
  80. // invalid aspect(s)
  81. #define DV_E_DVTARGETDEVICE_SIZE (DVGEN_E_FIRST+8)
  82. // tdSize paramter of the DVTARGETDEVICE structure is invalid
  83. #define DV_E_NOIVIEWOBJECT (DVGEN_E_FIRST+9)
  84. // object doesn't support IViewObject interface
  85. // Success codes
  86. #define OLE_S_USEREG (OLE_S_FIRST)
  87. // use the reg database to provide the requested info
  88. #define OLE_S_STATIC (OLE_S_FIRST+1)
  89. // success, but static
  90. #define OLE_S_MAC_CLIPFORMAT (OLE_S_FIRST+2)
  91. // macintosh clipboard format
  92. //*************************** Interface or API specific scodes *************
  93. // Errors for OleConvertOLESTREAMToIStorage and OleConvertIStorageToOLESTREAM
  94. // OLESTREAM Get method failed
  95. #define CONVERT10_E_OLESTREAM_GET (CONVERT10_E_FIRST + 0)
  96. // OLESTREAM Put method failed
  97. #define CONVERT10_E_OLESTREAM_PUT (CONVERT10_E_FIRST + 1)
  98. // Contents of the OLESTREAM not in correct format
  99. #define CONVERT10_E_OLESTREAM_FMT (CONVERT10_E_FIRST + 2)
  100. // There was in an error in a Windows GDI call while converting the bitmap
  101. // to a DIB.
  102. #define CONVERT10_E_OLESTREAM_BITMAP_TO_DIB (CONVERT10_E_FIRST + 3)
  103. // Contents of the IStorage not in correct format
  104. #define CONVERT10_E_STG_FMT (CONVERT10_E_FIRST + 4)
  105. // Contents of IStorage is missing one of the standard streams ("\1CompObj",
  106. // "\1Ole", "\2OlePres000"). This may be the storage for a DLL object, or a
  107. // class that does not use the def handler.
  108. #define CONVERT10_E_STG_NO_STD_STREAM (CONVERT10_E_FIRST + 5)
  109. // There was in an error in a Windows GDI call while converting the DIB
  110. // to a bitmap.
  111. #define CONVERT10_E_STG_DIB_TO_BITMAP (CONVERT10_E_FIRST + 6)
  112. // Returned by either API, this scode indicates that the original object
  113. // had no presentation, therefore the converted object does not either.
  114. #define CONVERT10_S_NO_PRESENTATION (CONVERT10_S_FIRST + 0)
  115. // Errors for Clipboard functions
  116. // OpenClipboard Failed
  117. #define CLIPBRD_E_CANT_OPEN (CLIPBRD_E_FIRST + 0)
  118. // EmptyClipboard Failed
  119. #define CLIPBRD_E_CANT_EMPTY (CLIPBRD_E_FIRST + 1)
  120. // SetClipboard Failed
  121. #define CLIPBRD_E_CANT_SET (CLIPBRD_E_FIRST + 2)
  122. // Data on clipboard is invalid
  123. #define CLIPBRD_E_BAD_DATA (CLIPBRD_E_FIRST + 3)
  124. // CloseClipboard Failed
  125. #define CLIPBRD_E_CANT_CLOSE (CLIPBRD_E_FIRST + 4)
  126. /****** OLE value types *****************************************************/
  127. /* rendering options */
  128. typedef enum tagOLERENDER
  129. {
  130. OLERENDER_NONE = 0,
  131. OLERENDER_DRAW = 1,
  132. OLERENDER_FORMAT = 2,
  133. OLERENDER_ASIS = 3
  134. } OLERENDER;
  135. typedef OLERENDER FAR* LPOLERENDER;
  136. // OLE verb; returned by IEnumOLEVERB
  137. typedef struct FARSTRUCT tagOLEVERB
  138. {
  139. LONG lVerb;
  140. LPXSTR lpszVerbName;
  141. DWORD fuFlags;
  142. DWORD grfAttribs;
  143. } OLEVERB, FAR* LPOLEVERB;
  144. // Bitwise verb attributes used in OLEVERB.grfAttribs
  145. typedef enum tagOLEVERBATTRIB // bitwise
  146. {
  147. OLEVERBATTRIB_NEVERDIRTIES = 1,
  148. OLEVERBATTRIB_ONCONTAINERMENU = 2
  149. } OLEVERBATTRIB;
  150. // IOleObject::GetUserType optons; determines which form of the string to use
  151. typedef enum tagUSERCLASSTYPE
  152. {
  153. USERCLASSTYPE_FULL = 1,
  154. USERCLASSTYPE_SHORT= 2,
  155. USERCLASSTYPE_APPNAME= 3,
  156. } USERCLASSTYPE;
  157. // bits returned from IOleObject::GetMistStatus
  158. typedef enum tagOLEMISC // bitwise
  159. {
  160. OLEMISC_RECOMPOSEONRESIZE = 1,
  161. OLEMISC_ONLYICONIC = 2,
  162. OLEMISC_INSERTNOTREPLACE = 4,
  163. OLEMISC_STATIC = 8,
  164. OLEMISC_CANTLINKINSIDE = 16,
  165. OLEMISC_CANLINKBYOLE1 = 32,
  166. OLEMISC_ISLINKOBJECT = 64,
  167. OLEMISC_INSIDEOUT = 128,
  168. OLEMISC_ACTIVATEWHENVISIBLE = 256,
  169. OLEMISC_RENDERINGISDEVICEINDEPENDENT = 512
  170. } OLEMISC;
  171. // IOleObject::Close options
  172. typedef enum tagOLECLOSE
  173. {
  174. OLECLOSE_SAVEIFDIRTY = 0,
  175. OLECLOSE_NOSAVE = 1,
  176. OLECLOSE_PROMPTSAVE = 2
  177. } OLECLOSE;
  178. // IOleObject::GetMoniker and IOleClientSite::GetMoniker options; determines
  179. // if and how monikers should be assigned.
  180. typedef enum tagOLEGETMONIKER
  181. {
  182. OLEGETMONIKER_ONLYIFTHERE=1,
  183. OLEGETMONIKER_FORCEASSIGN=2,
  184. OLEGETMONIKER_UNASSIGN=3,
  185. OLEGETMONIKER_TEMPFORUSER=4
  186. } OLEGETMONIKER;
  187. // IOleObject::GetMoniker, IOleObject::SetMoniker and
  188. // IOleClientSite::GetMoniker options; determines which moniker to use
  189. typedef enum tagOLEWHICHMK
  190. {
  191. OLEWHICHMK_CONTAINER=1,
  192. OLEWHICHMK_OBJREL=2,
  193. OLEWHICHMK_OBJFULL=3
  194. } OLEWHICHMK;
  195. #ifdef WIN32
  196. #define LPSIZEL PSIZEL
  197. #else
  198. typedef struct FARSTRUCT tagSIZEL
  199. {
  200. long cx;
  201. long cy;
  202. } SIZEL, FAR* LPSIZEL;
  203. #endif
  204. #ifdef WIN32
  205. #define LPRECTL PRECTL
  206. #else
  207. typedef struct FARSTRUCT tagRECTL
  208. {
  209. long left;
  210. long top;
  211. long right;
  212. long bottom;
  213. } RECTL, FAR* LPRECTL;
  214. typedef struct FARSTRUCT tagPOINTL {
  215. LONG x;
  216. LONG y;
  217. } POINTL;
  218. #endif
  219. #ifndef LPCRECT
  220. typedef const RECT FAR* LPCRECT;
  221. #endif
  222. #ifndef LPCRECTL
  223. typedef const RECTL FAR* LPCRECTL;
  224. #endif
  225. // for OleCreateEmbeddingHelper flags; roles in low word; options in high word
  226. #define EMBDHLP_INPROC_HANDLER 0x0000L // role is handler; implementation is
  227. // default handler; pCF can be NULL
  228. #define EMBDHLP_INPROC_SERVER 0x0001L // role is server; pCF can't be NULL
  229. #define EMBDHLP_CREATENOW 0x00000000L // create using pCF immediately; if pCF
  230. // is NULL, uses std remoting handler
  231. #define EMBDHLP_DELAYCREATE 0x00010000L // delayed create; must supply pCF
  232. // NOTE: OleCreateEmbeddingHelper(clsid, pUnkOuter,
  233. // EMBDHLP_INPROC_HANDLER | EMBDHLP_CREATENOW, NULL, riid, lplpObj)
  234. // is the same as OleCreateDefaultHandler(clsid, pUnkOuter, riid, lplpObj);
  235. // i.e., the embedding helper is the default handler in various roles.
  236. //Win32 OLE does not support Ole1.0-Ole2.0 interoperability
  237. #ifndef WIN32
  238. /***** OLE 1.0 OLESTREAM declarations *************************************/
  239. typedef struct _OLESTREAM FAR* LPOLESTREAM;
  240. typedef struct _OLESTREAMVTBL
  241. {
  242. DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
  243. DWORD (CALLBACK* Put)(LPOLESTREAM, const void FAR*, DWORD);
  244. } OLESTREAMVTBL;
  245. typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
  246. typedef struct _OLESTREAM
  247. {
  248. LPOLESTREAMVTBL lpstbl;
  249. } OLESTREAM;
  250. #endif // !WIN32
  251. /****** Clipboard Data structures *****************************************/
  252. typedef struct tagOBJECTDESCRIPTOR
  253. {
  254. ULONG cbSize; // Size of structure in bytes
  255. CLSID clsid; // CLSID of data being transferred
  256. DWORD dwDrawAspect; // Display aspect of the object
  257. // normally DVASPECT_CONTENT or ICON.
  258. // dwDrawAspect will be 0 (which is NOT
  259. // DVASPECT_CONTENT) if the copier or
  260. // dragsource didn't draw the object to
  261. // begin with.
  262. SIZEL sizel; // size of the object in HIMETRIC
  263. // sizel is opt.: will be (0,0) for apps
  264. // which don't draw the object being
  265. // transferred
  266. POINTL pointl; // Offset in HIMETRIC units from the
  267. // upper-left corner of the obj where the
  268. // mouse went down for the drag.
  269. // NOTE: y coordinates increase downward.
  270. // x coordinates increase to right
  271. // pointl is opt.; it is only meaningful
  272. // if object is transfered via drag/drop.
  273. // (0, 0) if mouse position is unspecified
  274. // (eg. when obj transfered via clipboard)
  275. DWORD dwStatus; // Misc. status flags for object. Flags are
  276. // defined by OLEMISC enum. these flags
  277. // are as would be returned
  278. // by IOleObject::GetMiscStatus.
  279. DWORD dwFullUserTypeName; // Offset from beginning of structure to
  280. // null-terminated string that specifies
  281. // Full User Type Name of the object.
  282. // 0 indicates string not present.
  283. DWORD dwSrcOfCopy; // Offset from beginning of structure to
  284. // null-terminated string that specifies
  285. // source of the transfer.
  286. // dwSrcOfCOpy is normally implemented as
  287. // the display name of the temp-for-user
  288. // moniker which identifies the source of
  289. // the data.
  290. // 0 indicates string not present.
  291. // NOTE: moniker assignment is NOT forced.
  292. // see IOleObject::GetMoniker(
  293. // OLEGETMONIKER_TEMPFORUSER)
  294. /* variable sized string data may appear here */
  295. } OBJECTDESCRIPTOR, *POBJECTDESCRIPTOR, FAR *LPOBJECTDESCRIPTOR,
  296. LINKSRCDESCRIPTOR, *PLINKSRCDESCRIPTOR, FAR *LPLINKSRCDESCRIPTOR;
  297. /* verbs */
  298. #define OLEIVERB_PRIMARY (0L)
  299. #define OLEIVERB_SHOW (-1L)
  300. #define OLEIVERB_OPEN (-2L)
  301. #define OLEIVERB_HIDE (-3L)
  302. #define OLEIVERB_UIACTIVATE (-4L)
  303. #define OLEIVERB_INPLACEACTIVATE (-5L)
  304. #define OLEIVERB_DISCARDUNDOSTATE (-6L)
  305. // forward type declarations
  306. #if defined(__cplusplus)
  307. interface IOleClientSite;
  308. interface IOleContainer;
  309. interface IOleObject;
  310. #else
  311. typedef interface IOleClientSite IOleClientSite;
  312. typedef interface IOleContainer IOleContainer;
  313. typedef interface IOleObject IOleObject;
  314. #endif
  315. typedef IOleObject FAR* LPOLEOBJECT;
  316. typedef IOleClientSite FAR* LPOLECLIENTSITE;
  317. typedef IOleContainer FAR* LPOLECONTAINER;
  318. /****** OLE GUIDs *********************************************************/
  319. #ifndef INITGUID
  320. #include "oleguid.h"
  321. #endif
  322. /****** Other Major Interfaces ********************************************/
  323. #include <dvobj.h>
  324. #include <storage.h>
  325. /****** IDrop??? Interfaces ********************************************/
  326. #define MK_ALT 0x0020
  327. #define DROPEFFECT_NONE 0
  328. #define DROPEFFECT_COPY 1
  329. #define DROPEFFECT_MOVE 2
  330. #define DROPEFFECT_LINK 4
  331. #define DROPEFFECT_SCROLL 0x80000000
  332. // default inset-width of the hot zone, in pixels
  333. // typical use: GetProfileInt("windows","DragScrollInset",DD_DEFSCROLLINSET)
  334. #define DD_DEFSCROLLINSET 11
  335. // default delay before scrolling, in milliseconds
  336. // typical use: GetProfileInt("windows","DragScrollDelay",DD_DEFSCROLLDELAY)
  337. #define DD_DEFSCROLLDELAY 50
  338. // default scroll interval, in milliseconds
  339. // typical use: GetProfileInt("windows","DragScrollInterval",
  340. // DD_DEFSCROLLINTERVAL)
  341. #define DD_DEFSCROLLINTERVAL 50
  342. // default delay before dragging should start, in milliseconds
  343. // typical use: GetProfileInt("windows", "DragDelay", DD_DEFDRAGDELAY)
  344. #define DD_DEFDRAGDELAY 200
  345. // default minimum distance (radius) before dragging should start, in pixels
  346. // typical use: GetProfileInt("windows", "DragMinDist", DD_DEFDRAGMINDIST)
  347. #define DD_DEFDRAGMINDIST 2
  348. /* Dragdrop specific error codes */
  349. #define DRAGDROP_E_NOTREGISTERED (DRAGDROP_E_FIRST)
  350. // trying to revoke a drop target that has not been registered
  351. #define DRAGDROP_E_ALREADYREGISTERED (DRAGDROP_E_FIRST+1)
  352. // this window has already been registered as a drop target
  353. #define DRAGDROP_E_INVALIDHWND (DRAGDROP_E_FIRST+2)
  354. // invalid HWND
  355. #define DRAGDROP_S_DROP (DRAGDROP_S_FIRST + 0)
  356. // successful drop took place
  357. #define DRAGDROP_S_CANCEL (DRAGDROP_S_FIRST + 1)
  358. // drag-drop operation canceled
  359. #define DRAGDROP_S_USEDEFAULTCURSORS (DRAGDROP_S_FIRST + 2)
  360. // use the default cursor
  361. #undef INTERFACE
  362. #define INTERFACE IDropTarget
  363. DECLARE_INTERFACE_(IDropTarget, IUnknown)
  364. {
  365. // *** IUnknown methods ***
  366. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  367. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  368. STDMETHOD_(ULONG,Release) (THIS) PURE;
  369. // *** IDropTarget methods ***
  370. STDMETHOD(DragEnter) (THIS_ LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) PURE;
  371. STDMETHOD(DragOver) (THIS_ DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) PURE;
  372. STDMETHOD(DragLeave) (THIS) PURE;
  373. STDMETHOD(Drop) (THIS_ LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) PURE;
  374. };
  375. typedef IDropTarget FAR* LPDROPTARGET;
  376. #undef INTERFACE
  377. #define INTERFACE IDropSource
  378. DECLARE_INTERFACE_(IDropSource, IUnknown)
  379. {
  380. // *** IUnknown methods ***
  381. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  382. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  383. STDMETHOD_(ULONG,Release) (THIS) PURE;
  384. // *** IDropSource methods ***
  385. STDMETHOD(QueryContinueDrag) (THIS_ BOOL fEscapePressed, DWORD grfKeyState) PURE;
  386. STDMETHOD(GiveFeedback) (THIS_ DWORD dwEffect) PURE;
  387. };
  388. typedef IDropSource FAR* LPDROPSOURCE;
  389. /****** IPersist??? Interfaces ********************************************/
  390. #undef INTERFACE
  391. #define INTERFACE IPersist
  392. DECLARE_INTERFACE_(IPersist, IUnknown)
  393. {
  394. // *** IUnknown methods ***
  395. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  396. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  397. STDMETHOD_(ULONG,Release) (THIS) PURE;
  398. // *** IPersist methods ***
  399. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  400. };
  401. typedef IPersist FAR* LPPERSIST;
  402. #undef INTERFACE
  403. #define INTERFACE IPersistStorage
  404. DECLARE_INTERFACE_(IPersistStorage, IPersist)
  405. {
  406. // *** IUnknown methods ***
  407. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  408. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  409. STDMETHOD_(ULONG,Release) (THIS) PURE;
  410. // *** IPersist methods ***
  411. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  412. // *** IPersistStorage methods ***
  413. STDMETHOD(IsDirty) (THIS) PURE;
  414. STDMETHOD(InitNew) (THIS_ LPSTORAGE pStg) PURE;
  415. STDMETHOD(Load) (THIS_ LPSTORAGE pStg) PURE;
  416. STDMETHOD(Save) (THIS_ LPSTORAGE pStgSave, BOOL fSameAsLoad) PURE;
  417. STDMETHOD(SaveCompleted) (THIS_ LPSTORAGE pStgNew) PURE;
  418. STDMETHOD(HandsOffStorage) (THIS) PURE;
  419. };
  420. typedef IPersistStorage FAR* LPPERSISTSTORAGE;
  421. #undef INTERFACE
  422. #define INTERFACE IPersistStream
  423. DECLARE_INTERFACE_(IPersistStream, IPersist)
  424. {
  425. // *** IUnknown methods ***
  426. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  427. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  428. STDMETHOD_(ULONG,Release) (THIS) PURE;
  429. // *** IPersist methods ***
  430. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  431. // *** IPersistStream methods ***
  432. STDMETHOD(IsDirty) (THIS) PURE;
  433. STDMETHOD(Load) (THIS_ LPSTREAM pStm) PURE;
  434. STDMETHOD(Save) (THIS_ LPSTREAM pStm,
  435. BOOL fClearDirty) PURE;
  436. STDMETHOD(GetSizeMax) (THIS_ ULARGE_INTEGER FAR* pcbSize) PURE;
  437. };
  438. typedef IPersistStream FAR* LPPERSISTSTREAM;
  439. #undef INTERFACE
  440. #define INTERFACE IPersistFile
  441. DECLARE_INTERFACE_(IPersistFile, IPersist)
  442. {
  443. // *** IUnknown methods ***
  444. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  445. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  446. STDMETHOD_(ULONG,Release) (THIS) PURE;
  447. // *** IPersist methods ***
  448. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  449. // *** IPersistFile methods ***
  450. STDMETHOD(IsDirty) (THIS) PURE;
  451. STDMETHOD(Load) (THIS_ LPCXSTR lpszFileName, DWORD grfMode) PURE;
  452. STDMETHOD(Save) (THIS_ LPCXSTR lpszFileName, BOOL fRemember) PURE;
  453. STDMETHOD(SaveCompleted) (THIS_ LPCXSTR lpszFileName) PURE;
  454. STDMETHOD(GetCurFile) (THIS_ LPXSTR FAR* lplpszFileName) PURE;
  455. };
  456. typedef IPersistFile FAR* LPPERSISTFILE;
  457. /****** Moniker Object Interfaces ******************************************/
  458. #include <moniker.h>
  459. /****** OLE Object Interfaces ******************************************/
  460. #undef INTERFACE
  461. #define INTERFACE IEnumOLEVERB
  462. DECLARE_INTERFACE_(IEnumOLEVERB, IUnknown)
  463. {
  464. // *** IUnknown methods ***
  465. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  466. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  467. STDMETHOD_(ULONG,Release) (THIS) PURE;
  468. // *** IEnumOLEVERB methods ***
  469. STDMETHOD(Next) (THIS_ ULONG celt, LPOLEVERB rgelt, ULONG FAR* pceltFetched) PURE;
  470. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  471. STDMETHOD(Reset) (THIS) PURE;
  472. STDMETHOD(Clone) (THIS_ IEnumOLEVERB FAR* FAR* ppenm) PURE;
  473. };
  474. typedef IEnumOLEVERB FAR* LPENUMOLEVERB;
  475. #undef INTERFACE
  476. #define INTERFACE IOleObject
  477. #define OLEOBJ_E_NOVERBS (OLEOBJ_E_FIRST + 0)
  478. #define OLEOBJ_E_INVALIDVERB (OLEOBJ_E_FIRST + 1)
  479. #define OLEOBJ_S_INVALIDVERB (OLEOBJ_S_FIRST + 0)
  480. #define OLEOBJ_S_CANNOT_DOVERB_NOW (OLEOBJ_S_FIRST + 1)
  481. // verb number is valid but verb cannot be done now, for instance
  482. // hiding a link or hiding a visible OLE 1.0 server
  483. #define OLEOBJ_S_INVALIDHWND (OLEOBJ_S_FIRST + 2)
  484. // invalid hwnd passed
  485. DECLARE_INTERFACE_(IOleObject, IUnknown)
  486. {
  487. // *** IUnknown methods ***
  488. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  489. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  490. STDMETHOD_(ULONG,Release) (THIS) PURE;
  491. // *** IOleObject methods ***
  492. STDMETHOD(SetClientSite) (THIS_ LPOLECLIENTSITE pClientSite) PURE;
  493. STDMETHOD(GetClientSite) (THIS_ LPOLECLIENTSITE FAR* ppClientSite) PURE;
  494. STDMETHOD(SetHostNames) (THIS_ LPCXSTR szContainerApp, LPCXSTR szContainerObj) PURE;
  495. STDMETHOD(Close) (THIS_ DWORD dwSaveOption) PURE;
  496. STDMETHOD(SetMoniker) (THIS_ DWORD dwWhichMoniker, LPMONIKER pmk) PURE;
  497. STDMETHOD(GetMoniker) (THIS_ DWORD dwAssign, DWORD dwWhichMoniker,
  498. LPMONIKER FAR* ppmk) PURE;
  499. STDMETHOD(InitFromData) (THIS_ LPDATAOBJECT pDataObject,
  500. BOOL fCreation,
  501. DWORD dwReserved) PURE;
  502. STDMETHOD(GetClipboardData) (THIS_ DWORD dwReserved,
  503. LPDATAOBJECT FAR* ppDataObject) PURE;
  504. STDMETHOD(DoVerb) (THIS_ LONG iVerb,
  505. LPMSG lpmsg,
  506. LPOLECLIENTSITE pActiveSite,
  507. LONG lindex,
  508. HWND hwndParent,
  509. LPCRECT lprcPosRect) PURE;
  510. STDMETHOD(EnumVerbs) (THIS_ LPENUMOLEVERB FAR* ppenumOleVerb) PURE;
  511. STDMETHOD(Update) (THIS) PURE;
  512. STDMETHOD(IsUpToDate) (THIS) PURE;
  513. STDMETHOD(GetUserClassID) (THIS_ CLSID FAR* pClsid) PURE;
  514. STDMETHOD(GetUserType) (THIS_ DWORD dwFormOfType, LPXSTR FAR* pszUserType) PURE;
  515. STDMETHOD(SetExtent) (THIS_ DWORD dwDrawAspect, LPSIZEL lpsizel) PURE;
  516. STDMETHOD(GetExtent) (THIS_ DWORD dwDrawAspect, LPSIZEL lpsizel) PURE;
  517. STDMETHOD(Advise)(THIS_ LPADVISESINK pAdvSink, DWORD FAR* pdwConnection) PURE;
  518. STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
  519. STDMETHOD(EnumAdvise) (THIS_ LPENUMSTATDATA FAR* ppenumAdvise) PURE;
  520. STDMETHOD(GetMiscStatus) (THIS_ DWORD dwAspect, DWORD FAR* pdwStatus) PURE;
  521. STDMETHOD(SetColorScheme) (THIS_ LPLOGPALETTE lpLogpal) PURE;
  522. };
  523. typedef IOleObject FAR* LPOLEOBJECT;
  524. #undef INTERFACE
  525. #define INTERFACE IOleClientSite
  526. DECLARE_INTERFACE_(IOleClientSite, IUnknown)
  527. {
  528. // *** IUnknown methods ***
  529. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  530. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  531. STDMETHOD_(ULONG,Release) (THIS) PURE;
  532. // *** IOleClientSite methods ***
  533. STDMETHOD(SaveObject) (THIS) PURE;
  534. STDMETHOD(GetMoniker) (THIS_ DWORD dwAssign, DWORD dwWhichMoniker,
  535. LPMONIKER FAR* ppmk) PURE;
  536. STDMETHOD(GetContainer) (THIS_ LPOLECONTAINER FAR* ppContainer) PURE;
  537. STDMETHOD(ShowObject) (THIS) PURE;
  538. STDMETHOD(OnShowWindow) (THIS_ BOOL fShow) PURE;
  539. STDMETHOD(RequestNewObjectLayout) (THIS) PURE;
  540. };
  541. typedef IOleClientSite FAR* LPOLECLIENTSITE;
  542. /****** OLE Runnable Object Interface **********************************/
  543. #undef INTERFACE
  544. #define INTERFACE IRunnableObject
  545. DECLARE_INTERFACE_(IRunnableObject, IUnknown)
  546. {
  547. // *** IUnknown methods ***
  548. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  549. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  550. STDMETHOD_(ULONG,Release) (THIS) PURE;
  551. // *** IRunnableObject methods ***
  552. STDMETHOD(GetRunningClass) (THIS_ LPCLSID lpClsid) PURE;
  553. STDMETHOD(Run) (THIS_ LPBINDCTX pbc) PURE;
  554. STDMETHOD_(BOOL, IsRunning) (THIS) PURE;
  555. STDMETHOD(LockRunning)(THIS_ BOOL fLock, BOOL fLastUnlockCloses) PURE;
  556. STDMETHOD(SetContainedObject)(THIS_ BOOL fContained) PURE;
  557. };
  558. typedef IRunnableObject FAR* LPRUNNABLEOBJECT;
  559. /****** OLE Container Interfaces ***************************************/
  560. #undef INTERFACE
  561. #define INTERFACE IParseDisplayName
  562. DECLARE_INTERFACE_(IParseDisplayName, IUnknown)
  563. {
  564. // *** IUnknown methods ***
  565. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  566. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  567. STDMETHOD_(ULONG,Release) (THIS) PURE;
  568. // *** IParseDisplayName method ***
  569. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPXSTR lpszDisplayName,
  570. ULONG FAR* pchEaten, LPMONIKER FAR* ppmkOut) PURE;
  571. };
  572. typedef IParseDisplayName FAR* LPPARSEDISPLAYNAME;
  573. #undef INTERFACE
  574. #define INTERFACE IOleContainer
  575. DECLARE_INTERFACE_(IOleContainer, IParseDisplayName)
  576. {
  577. // *** IUnknown methods ***
  578. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  579. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  580. STDMETHOD_(ULONG,Release) (THIS) PURE;
  581. // *** IParseDisplayName method ***
  582. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPXSTR lpszDisplayName,
  583. ULONG FAR* pchEaten, LPMONIKER FAR* ppmkOut) PURE;
  584. // *** IOleContainer methods ***
  585. STDMETHOD(EnumObjects) ( DWORD grfFlags, LPENUMUNKNOWN FAR* ppenumUnknown) PURE;
  586. STDMETHOD(LockContainer) (THIS_ BOOL fLock) PURE;
  587. };
  588. typedef IOleContainer FAR* LPOLECONTAINER;
  589. typedef enum tagBINDSPEED
  590. {
  591. BINDSPEED_INDEFINITE = 1,
  592. BINDSPEED_MODERATE = 2,
  593. BINDSPEED_IMMEDIATE = 3
  594. } BINDSPEED;
  595. typedef enum tagOLECONTF
  596. {
  597. OLECONTF_EMBEDDINGS = 1,
  598. OLECONTF_LINKS = 2,
  599. OLECONTF_OTHERS = 4,
  600. OLECONTF_ONLYUSER = 8,
  601. OLECONTF_ONLYIFRUNNING = 16
  602. } OLECONTF;
  603. #undef INTERFACE
  604. #define INTERFACE IOleItemContainer
  605. DECLARE_INTERFACE_(IOleItemContainer, IOleContainer)
  606. {
  607. // *** IUnknown methods ***
  608. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  609. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  610. STDMETHOD_(ULONG,Release) (THIS) PURE;
  611. // *** IParseDisplayName method ***
  612. STDMETHOD(ParseDisplayName) (THIS_ LPBC pbc, LPXSTR lpszDisplayName,
  613. ULONG FAR* pchEaten, LPMONIKER FAR* ppmkOut) PURE;
  614. // *** IOleContainer methods ***
  615. STDMETHOD(EnumObjects) (THIS_ DWORD grfFlags, LPENUMUNKNOWN FAR* ppenumUnknown) PURE;
  616. STDMETHOD(LockContainer) (THIS_ BOOL fLock) PURE;
  617. // *** IOleItemContainer methods ***
  618. STDMETHOD(GetObject) (THIS_ LPXSTR lpszItem, DWORD dwSpeedNeeded,
  619. LPBINDCTX pbc, REFIID riid, LPVOID FAR* ppvObject) PURE;
  620. STDMETHOD(GetObjectStorage) (THIS_ LPXSTR lpszItem, LPBINDCTX pbc,
  621. REFIID riid, LPVOID FAR* ppvStorage) PURE;
  622. STDMETHOD(IsRunning) (THIS_ LPXSTR lpszItem) PURE;
  623. };
  624. typedef IOleItemContainer FAR* LPOLEITEMCONTAINER;
  625. /****** OLE Advise Holder Interface ***************************************/
  626. #undef INTERFACE
  627. #define INTERFACE IOleAdviseHolder
  628. DECLARE_INTERFACE_(IOleAdviseHolder, IUnknown)
  629. {
  630. // *** IUnknown methods ***
  631. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppv) PURE;
  632. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  633. STDMETHOD_(ULONG,Release) (THIS) PURE;
  634. // *** IOleAdviseHolder methods ***
  635. STDMETHOD(Advise)(THIS_ LPADVISESINK pAdvise, DWORD FAR* pdwConnection) PURE;
  636. STDMETHOD(Unadvise)(THIS_ DWORD dwConnection) PURE;
  637. STDMETHOD(EnumAdvise)(THIS_ LPENUMSTATDATA FAR* ppenumAdvise) PURE;
  638. STDMETHOD(SendOnRename)(THIS_ LPMONIKER pmk) PURE;
  639. STDMETHOD(SendOnSave)(THIS) PURE;
  640. STDMETHOD(SendOnClose)(THIS) PURE;
  641. };
  642. typedef IOleAdviseHolder FAR* LPOLEADVISEHOLDER;
  643. /****** OLE Link Interface ************************************************/
  644. /* Link update options */
  645. typedef enum tagOLEUPDATE
  646. {
  647. OLEUPDATE_ALWAYS=1,
  648. OLEUPDATE_ONCALL=3
  649. } OLEUPDATE;
  650. typedef OLEUPDATE FAR* LPOLEUPDATE;
  651. // for IOleLink::BindToSource
  652. typedef enum tagOLELINKBIND
  653. {
  654. OLELINKBIND_EVENIFCLASSDIFF = 1,
  655. } OLELINKBIND;
  656. #undef INTERFACE
  657. #define INTERFACE IOleLink
  658. DECLARE_INTERFACE_(IOleLink, IUnknown)
  659. {
  660. // *** IUnknown methods ***
  661. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  662. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  663. STDMETHOD_(ULONG,Release) (THIS) PURE;
  664. // *** IOleLink methods ***
  665. STDMETHOD(SetUpdateOptions) (THIS_ DWORD dwUpdateOpt) PURE;
  666. STDMETHOD(GetUpdateOptions) (THIS_ LPDWORD pdwUpdateOpt) PURE;
  667. STDMETHOD(SetSourceMoniker) (THIS_ LPMONIKER pmk, REFCLSID rclsid) PURE;
  668. STDMETHOD(GetSourceMoniker) (THIS_ LPMONIKER FAR* ppmk) PURE;
  669. STDMETHOD(SetSourceDisplayName) (THIS_ LPCXSTR lpszDisplayName) PURE;
  670. STDMETHOD(GetSourceDisplayName) (THIS_ LPXSTR FAR* lplpszDisplayName) PURE;
  671. STDMETHOD(BindToSource) (THIS_ DWORD bindflags, LPBINDCTX pbc) PURE;
  672. STDMETHOD(BindIfRunning) (THIS) PURE;
  673. STDMETHOD(GetBoundSource) (THIS_ LPUNKNOWN FAR* ppUnk) PURE;
  674. STDMETHOD(UnbindSource) (THIS) PURE;
  675. STDMETHOD(Update) (THIS_ LPBINDCTX pbc) PURE;
  676. };
  677. typedef IOleLink FAR* LPOLELINK;
  678. /****** OLE InPlace Editing Interfaces ************************************/
  679. #ifdef _MAC
  680. typedef Handle HOLEMENU;
  681. typedef long SIZE;
  682. typedef long HACCEL;
  683. #else
  684. DECLARE_HANDLE(HOLEMENU);
  685. #endif
  686. typedef struct FARSTRUCT tagOIFI // OleInPlaceFrameInfo
  687. {
  688. UINT cb;
  689. BOOL fMDIApp;
  690. HWND hwndFrame;
  691. HACCEL haccel;
  692. int cAccelEntries;
  693. } OLEINPLACEFRAMEINFO, FAR* LPOLEINPLACEFRAMEINFO;
  694. typedef struct FARSTRUCT tagOleMenuGroupWidths
  695. {
  696. LONG width[6];
  697. } OLEMENUGROUPWIDTHS, FAR* LPOLEMENUGROUPWIDTHS;
  698. typedef RECT BORDERWIDTHS;
  699. typedef LPRECT LPBORDERWIDTHS;
  700. typedef LPCRECT LPCBORDERWIDTHS;
  701. /* Inplace editing specific error codes */
  702. #define INPLACE_E_NOTUNDOABLE (INPLACE_E_FIRST)
  703. // undo is not avaiable
  704. #define INPLACE_E_NOTOOLSPACE (INPLACE_E_FIRST+1)
  705. // Space for tools is not available
  706. #define INPLACE_S_TRUNCATED (INPLACE_S_FIRST)
  707. // Message is too long, some of it had to be truncated before displaying
  708. //misc definitions
  709. #define INPLACE_DEFBORDERWIDTH 4
  710. // forward type declarations
  711. #if defined(__cplusplus)
  712. interface IOleInPlaceUIWindow;
  713. #else
  714. typedef interface IOleInPlaceUIWindow IOleInPlaceUIWindow;
  715. #endif
  716. typedef IOleInPlaceUIWindow FAR* LPOLEINPLACEUIWINDOW;
  717. #undef INTERFACE
  718. #define INTERFACE IOleWindow
  719. DECLARE_INTERFACE_(IOleWindow, IUnknown)
  720. {
  721. // *** IUnknown methods ***
  722. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  723. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  724. STDMETHOD_(ULONG,Release) (THIS) PURE;
  725. // *** IOleWindow methods ***
  726. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  727. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  728. };
  729. typedef IOleWindow FAR* LPOLEWINDOW;
  730. #undef INTERFACE
  731. #define INTERFACE IOleInPlaceObject
  732. DECLARE_INTERFACE_(IOleInPlaceObject, IOleWindow)
  733. {
  734. // *** IUnknown methods ***
  735. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  736. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  737. STDMETHOD_(ULONG,Release) (THIS) PURE;
  738. // *** IOleWindow methods ***
  739. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  740. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  741. // *** IOleInPlaceObject methods ***
  742. STDMETHOD(InPlaceDeactivate) (THIS) PURE;
  743. STDMETHOD(UIDeactivate) (THIS) PURE;
  744. STDMETHOD(SetObjectRects) (THIS_ LPCRECT lprcPosRect,
  745. LPCRECT lprcClipRect) PURE;
  746. STDMETHOD(ReactivateAndUndo) (THIS) PURE;
  747. };
  748. typedef IOleInPlaceObject FAR* LPOLEINPLACEOBJECT;
  749. #undef INTERFACE
  750. #define INTERFACE IOleInPlaceActiveObject
  751. DECLARE_INTERFACE_(IOleInPlaceActiveObject, IOleWindow)
  752. {
  753. // *** IUnknown methods ***
  754. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  755. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  756. STDMETHOD_(ULONG,Release) (THIS) PURE;
  757. // *** IOleWindow methods ***
  758. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  759. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  760. // *** IOleInPlaceActiveObject methods ***
  761. STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE;
  762. STDMETHOD(OnFrameWindowActivate) (THIS_ BOOL fActivate) PURE;
  763. STDMETHOD(OnDocWindowActivate) (THIS_ BOOL fActivate) PURE;
  764. STDMETHOD(ResizeBorder) (THIS_ LPCRECT lprectBorder, LPOLEINPLACEUIWINDOW lpUIWindow, BOOL fFrameWindow) PURE;
  765. STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  766. };
  767. typedef IOleInPlaceActiveObject FAR* LPOLEINPLACEACTIVEOBJECT;
  768. #undef INTERFACE
  769. #define INTERFACE IOleInPlaceUIWindow
  770. DECLARE_INTERFACE_(IOleInPlaceUIWindow, IOleWindow)
  771. {
  772. // *** IUnknown methods ***
  773. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  774. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  775. STDMETHOD_(ULONG,Release) (THIS) PURE;
  776. // *** IOleWindow methods ***
  777. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  778. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  779. // *** IOleInPlaceUIWindow methods ***
  780. STDMETHOD(GetBorder) (THIS_ LPRECT lprectBorder) PURE;
  781. STDMETHOD(RequestBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  782. STDMETHOD(SetBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  783. STDMETHOD(SetActiveObject) (THIS_ LPOLEINPLACEACTIVEOBJECT lpActiveObject,
  784. LPCXSTR lpszObjName) PURE;
  785. };
  786. typedef IOleInPlaceUIWindow FAR* LPOLEINPLACEUIWINDOW;
  787. #undef INTERFACE
  788. #define INTERFACE IOleInPlaceFrame
  789. DECLARE_INTERFACE_(IOleInPlaceFrame, IOleInPlaceUIWindow)
  790. {
  791. // *** IUnknown methods ***
  792. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  793. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  794. STDMETHOD_(ULONG,Release) (THIS) PURE;
  795. // *** IOleWindow methods ***
  796. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  797. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  798. // *** IOleInPlaceUIWindow methods ***
  799. STDMETHOD(GetBorder) (THIS_ LPRECT lprectBorder) PURE;
  800. STDMETHOD(RequestBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  801. STDMETHOD(SetBorderSpace) (THIS_ LPCBORDERWIDTHS lpborderwidths) PURE;
  802. STDMETHOD(SetActiveObject) (THIS_ LPOLEINPLACEACTIVEOBJECT lpActiveObject,
  803. LPCXSTR lpszObjName) PURE;
  804. // *** IOleInPlaceFrame methods ***
  805. STDMETHOD(InsertMenus) (THIS_ HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) PURE;
  806. STDMETHOD(SetMenu) (THIS_ HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject) PURE;
  807. STDMETHOD(RemoveMenus) (THIS_ HMENU hmenuShared) PURE;
  808. STDMETHOD(SetStatusText) (THIS_ LPCXSTR lpszStatusText) PURE;
  809. STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  810. STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg, WORD wID) PURE;
  811. };
  812. typedef IOleInPlaceFrame FAR* LPOLEINPLACEFRAME;
  813. #undef INTERFACE
  814. #define INTERFACE IOleInPlaceSite
  815. DECLARE_INTERFACE_(IOleInPlaceSite, IOleWindow)
  816. {
  817. // *** IUnknown methods ***
  818. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  819. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  820. STDMETHOD_(ULONG,Release) (THIS) PURE;
  821. // *** IOleWindow methods ***
  822. STDMETHOD(GetWindow) (THIS_ HWND FAR* lphwnd) PURE;
  823. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  824. // *** IOleInPlaceSite methods ***
  825. STDMETHOD(CanInPlaceActivate) (THIS) PURE;
  826. STDMETHOD(OnInPlaceActivate) (THIS) PURE;
  827. STDMETHOD(OnUIActivate) (THIS) PURE;
  828. STDMETHOD(GetWindowContext) (THIS_ LPOLEINPLACEFRAME FAR* lplpFrame,
  829. LPOLEINPLACEUIWINDOW FAR* lplpDoc,
  830. LPRECT lprcPosRect,
  831. LPRECT lprcClipRect,
  832. LPOLEINPLACEFRAMEINFO lpFrameInfo) PURE;
  833. STDMETHOD(Scroll) (THIS_ SIZE scrollExtent) PURE;
  834. STDMETHOD(OnUIDeactivate) (THIS_ BOOL fUndoable) PURE;
  835. STDMETHOD(OnInPlaceDeactivate) (THIS) PURE;
  836. STDMETHOD(DiscardUndoState) (THIS) PURE;
  837. STDMETHOD(DeactivateAndUndo) (THIS) PURE;
  838. STDMETHOD(OnPosRectChange) (THIS_ LPCRECT lprcPosRect) PURE;
  839. };
  840. typedef IOleInPlaceSite FAR* LPOLEINPLACESITE;
  841. /****** OLE API Prototypes ************************************************/
  842. STDAPI_(DWORD) OleBuildVersion( VOID );
  843. /* helper functions */
  844. STDAPI ReadClassStg(LPSTORAGE pStg, CLSID FAR* pclsid);
  845. STDAPI WriteClassStg(LPSTORAGE pStg, REFCLSID rclsid);
  846. STDAPI ReadClassStm(LPSTREAM pStm, CLSID FAR* pclsid);
  847. STDAPI WriteClassStm(LPSTREAM pStm, REFCLSID rclsid);
  848. STDAPI WriteFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT cf, LPXSTR lpszUserType);
  849. STDAPI ReadFmtUserTypeStg (LPSTORAGE pstg, CLIPFORMAT FAR* pcf, LPXSTR FAR* lplpszUserType);
  850. /* init/term */
  851. STDAPI OleInitialize(LPMALLOC pMalloc);
  852. STDAPI_(void) OleUninitialize(void);
  853. /* APIs to query whether (Embedded/Linked) object can be created from
  854. the data object */
  855. STDAPI OleQueryLinkFromData(LPDATAOBJECT pSrcDataObject);
  856. STDAPI OleQueryCreateFromData(LPDATAOBJECT pSrcDataObject);
  857. /* Object creation APIs */
  858. STDAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt,
  859. LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite,
  860. LPSTORAGE pStg, LPVOID FAR* ppvObj);
  861. STDAPI OleCreateFromData(LPDATAOBJECT pSrcDataObj, REFIID riid,
  862. DWORD renderopt, LPFORMATETC pFormatEtc,
  863. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg,
  864. LPVOID FAR* ppvObj);
  865. STDAPI OleCreateLinkFromData(LPDATAOBJECT pSrcDataObj, REFIID riid,
  866. DWORD renderopt, LPFORMATETC pFormatEtc,
  867. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg,
  868. LPVOID FAR* ppvObj);
  869. STDAPI OleCreateStaticFromData(LPDATAOBJECT pSrcDataObj, REFIID iid,
  870. DWORD renderopt, LPFORMATETC pFormatEtc,
  871. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg,
  872. LPVOID FAR* ppvObj);
  873. STDAPI OleCreateLink(LPMONIKER pmkLinkSrc, REFIID riid,
  874. DWORD renderopt, LPFORMATETC lpFormatEtc,
  875. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID FAR* ppvObj);
  876. STDAPI OleCreateLinkToFile(LPCXSTR lpszFileName, REFIID riid,
  877. DWORD renderopt, LPFORMATETC lpFormatEtc,
  878. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID FAR* ppvObj);
  879. STDAPI OleCreateFromFile(REFCLSID rclsid, LPCXSTR lpszFileName, REFIID riid,
  880. DWORD renderopt, LPFORMATETC lpFormatEtc,
  881. LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID FAR* ppvObj);
  882. STDAPI OleLoad(LPSTORAGE pStg, REFIID riid, LPOLECLIENTSITE pClientSite,
  883. LPVOID FAR* ppvObj);
  884. STDAPI OleSave(LPPERSISTSTORAGE pPS, LPSTORAGE pStg, BOOL fSameAsLoad);
  885. STDAPI OleLoadFromStream( LPSTREAM pStm, REFIID iidInterface, LPVOID FAR* ppvObj);
  886. STDAPI OleSaveToStream( LPPERSISTSTREAM pPStm, LPSTREAM pStm );
  887. STDAPI OleSetContainedObject(LPUNKNOWN pUnknown, BOOL fContained);
  888. STDAPI OleNoteObjectVisible(LPUNKNOWN pUnknown, BOOL fVisible);
  889. /* Drag/Drop APIs */
  890. STDAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget);
  891. STDAPI RevokeDragDrop(HWND hwnd);
  892. STDAPI DoDragDrop(LPDATAOBJECT pDataObj, LPDROPSOURCE pDropSource,
  893. DWORD dwOKEffects, LPDWORD pdwEffect);
  894. /* Clipboard APIs */
  895. STDAPI OleSetClipboard(LPDATAOBJECT pDataObj);
  896. STDAPI OleGetClipboard(LPDATAOBJECT FAR* ppDataObj);
  897. STDAPI OleFlushClipboard(void);
  898. STDAPI OleIsCurrentClipboard(LPDATAOBJECT pDataObj);
  899. /* InPlace Editing APIs */
  900. STDAPI_(HOLEMENU) OleCreateMenuDescriptor (HMENU hmenuCombined,
  901. LPOLEMENUGROUPWIDTHS lpMenuWidths);
  902. STDAPI OleSetMenuDescriptor (HOLEMENU holemenu, HWND hwndFrame,
  903. HWND hwndActiveObject,
  904. LPOLEINPLACEFRAME lpFrame,
  905. LPOLEINPLACEACTIVEOBJECT lpActiveObj);
  906. STDAPI OleDestroyMenuDescriptor (HOLEMENU holemenu);
  907. STDAPI OleTranslateAccelerator (LPOLEINPLACEFRAME lpFrame,
  908. LPOLEINPLACEFRAMEINFO lpFrameInfo, LPMSG lpmsg);
  909. /* Helper APIs */
  910. STDAPI_(HANDLE) OleDuplicateData (HANDLE hSrc, CLIPFORMAT cfFormat,
  911. UINT uiFlags);
  912. STDAPI OleDraw (LPUNKNOWN pUnknown, DWORD dwAspect, HDC hdcDraw,
  913. LPCRECT lprcBounds);
  914. STDAPI OleRun(LPUNKNOWN pUnknown);
  915. STDAPI_(BOOL) OleIsRunning(LPOLEOBJECT pObject);
  916. STDAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses);
  917. STDAPI_(void) ReleaseStgMedium(LPSTGMEDIUM);
  918. STDAPI CreateOleAdviseHolder(LPOLEADVISEHOLDER FAR* ppOAHolder);
  919. STDAPI OleCreateDefaultHandler(REFCLSID clsid, LPUNKNOWN pUnkOuter,
  920. REFIID riid, LPVOID FAR* lplpObj);
  921. STDAPI OleCreateEmbeddingHelper(REFCLSID clsid, LPUNKNOWN pUnkOuter,
  922. DWORD flags, LPCLASSFACTORY pCF,
  923. REFIID riid, LPVOID FAR* lplpObj);
  924. STDAPI_(BOOL) IsAccelerator(HACCEL hAccel, int cAccelEntries, LPMSG lpMsg,
  925. WORD FAR* lpwCmd);
  926. /* Icon extraction Helper APIs */
  927. STDAPI_(HGLOBAL) OleGetIconOfFile(LPXSTR lpszPath, BOOL fUseFileAsLabel);
  928. STDAPI_(HGLOBAL) OleGetIconOfClass(REFCLSID rclsid, LPXSTR lpszLabel,
  929. BOOL fUseTypeAsLabel);
  930. STDAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(HICON hIcon, LPXSTR lpszLabel,
  931. LPXSTR lpszSourceFile, UINT iIconIndex);
  932. /* Registration Database Helper APIs */
  933. STDAPI OleRegGetUserType (REFCLSID clsid, DWORD dwFormOfType,
  934. LPXSTR FAR* pszUserType);
  935. STDAPI OleRegGetMiscStatus (REFCLSID clsid, DWORD dwAspect,
  936. DWORD FAR* pdwStatus);
  937. STDAPI OleRegEnumFormatEtc (REFCLSID clsid, DWORD dwDirection,
  938. LPENUMFORMATETC FAR* ppenum);
  939. STDAPI OleRegEnumVerbs (REFCLSID clsid, LPENUMOLEVERB FAR* ppenum);
  940. #ifndef WIN32 //Ole 1.0 conversion is not available in 32-bit OLE
  941. /* OLE 1.0 conversion APIS */
  942. STDAPI OleConvertIStorageToOLESTREAM
  943. (LPSTORAGE pstg,
  944. LPOLESTREAM polestm);
  945. STDAPI OleConvertOLESTREAMToIStorage
  946. (LPOLESTREAM polestm,
  947. LPSTORAGE pstg,
  948. const DVTARGETDEVICE FAR* ptd);
  949. STDAPI OleConvertIStorageToOLESTREAMEx
  950. (LPSTORAGE pstg,
  951. // Presentation data to OLESTREAM
  952. CLIPFORMAT cfFormat, // format
  953. LONG lWidth, // width
  954. LONG lHeight, // height
  955. DWORD dwSize, // size in bytes
  956. LPSTGMEDIUM pmedium, // bits
  957. LPOLESTREAM polestm);
  958. STDAPI OleConvertOLESTREAMToIStorageEx
  959. (LPOLESTREAM polestm,
  960. LPSTORAGE pstg,
  961. // Presentation data from OLESTREAM
  962. CLIPFORMAT FAR* pcfFormat, // format
  963. LONG FAR* plwWidth, // width
  964. LONG FAR* plHeight, // height
  965. DWORD FAR* pdwSize, // size in bytes
  966. LPSTGMEDIUM pmedium); // bits
  967. #endif //WIN32
  968. /* Storage Utility APIs */
  969. STDAPI GetHGlobalFromILockBytes (LPLOCKBYTES plkbyt, HGLOBAL FAR* phglobal);
  970. STDAPI CreateILockBytesOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease,
  971. LPLOCKBYTES FAR* pplkbyt);
  972. STDAPI GetHGlobalFromStream (LPSTREAM pstm, HGLOBAL FAR* phglobal);
  973. STDAPI CreateStreamOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease,
  974. LPSTREAM FAR* ppstm);
  975. /* ConvertTo APIS */
  976. STDAPI OleDoAutoConvert(LPSTORAGE pStg, LPCLSID pClsidNew);
  977. STDAPI OleGetAutoConvert(REFCLSID clsidOld, LPCLSID pClsidNew);
  978. STDAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew);
  979. STDAPI GetConvertStg(LPSTORAGE pStg);
  980. STDAPI SetConvertStg(LPSTORAGE pStg, BOOL fConvert);
  981. #endif // _OLE2_H_
  982.