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.

503 lines
25 KiB

  1. /*****************************************************************************\
  2. * *
  3. * ole.h - Object Linking and Embedding functions, types, and definitions*
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * NOTE: windows.h must be #included first *
  8. * *
  9. * Copyright (c) 1990-1995, Microsoft Corp. All rights reserved.*
  10. * *
  11. \*****************************************************************************/
  12. #ifndef _INC_OLE
  13. #define _INC_OLE
  14. #ifdef WIN16
  15. #include <pshpack1.h> /* Assume byte packing throughout */
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" { /* Assume C declarations for C++ */
  19. #endif /* __cplusplus */
  20. #ifndef WINAPI /* If not included with 3.1 headers... */
  21. #define WINAPI FAR PASCAL
  22. #define CALLBACK FAR PASCAL
  23. #define LPCSTR LPSTR
  24. #define LRESULT LONG
  25. #define HGLOBAL HANDLE
  26. #endif /* _INC_WINDOWS */
  27. #ifdef STRICT
  28. #define OLE_LPCSTR LPCSTR
  29. #define OLE_CONST const
  30. #else /* STRICT */
  31. #define OLE_LPCSTR LPSTR
  32. #define OLE_CONST
  33. #endif /* !STRICT */
  34. #define LRESULT LONG
  35. #define HGLOBAL HANDLE
  36. /* Object types */
  37. #define OT_LINK 1L
  38. #define OT_EMBEDDED 2L
  39. #define OT_STATIC 3L
  40. /* activate verbs */
  41. #define OLEVERB_PRIMARY 0
  42. /* target device info structure */
  43. typedef struct _OLETARGETDEVICE
  44. {
  45. USHORT otdDeviceNameOffset;
  46. USHORT otdDriverNameOffset;
  47. USHORT otdPortNameOffset;
  48. USHORT otdExtDevmodeOffset;
  49. USHORT otdExtDevmodeSize;
  50. USHORT otdEnvironmentOffset;
  51. USHORT otdEnvironmentSize;
  52. BYTE otdData[1];
  53. } OLETARGETDEVICE;
  54. typedef OLETARGETDEVICE FAR* LPOLETARGETDEVICE;
  55. /* flags used in some methods */
  56. #define OF_SET 0x0001
  57. #define OF_GET 0x0002
  58. #define OF_HANDLER 0x0004
  59. /* return codes for OLE functions */
  60. typedef enum
  61. {
  62. OLE_OK, /* 0 Function operated correctly */
  63. OLE_WAIT_FOR_RELEASE, /* 1 Command has been initiated, client */
  64. /* must wait for release. keep dispatching */
  65. /* messages till OLE_RELESE in callback */
  66. OLE_BUSY, /* 2 Tried to execute a method while another */
  67. /* method is in progress. */
  68. OLE_ERROR_PROTECT_ONLY, /* 3 Ole APIs are called in real mode */
  69. OLE_ERROR_MEMORY, /* 4 Could not alloc or lock memory */
  70. OLE_ERROR_STREAM, /* 5 (OLESTREAM) stream error */
  71. OLE_ERROR_STATIC, /* 6 Non static object expected */
  72. OLE_ERROR_BLANK, /* 7 Critical data missing */
  73. OLE_ERROR_DRAW, /* 8 Error while drawing */
  74. OLE_ERROR_METAFILE, /* 9 Invalid metafile */
  75. OLE_ERROR_ABORT, /* 10 Client chose to abort metafile drawing */
  76. OLE_ERROR_CLIPBOARD, /* 11 Failed to get/set clipboard data */
  77. OLE_ERROR_FORMAT, /* 12 Requested format is not available */
  78. OLE_ERROR_OBJECT, /* 13 Not a valid object */
  79. OLE_ERROR_OPTION, /* 14 Invalid option(link update / render) */
  80. OLE_ERROR_PROTOCOL, /* 15 Invalid protocol */
  81. OLE_ERROR_ADDRESS, /* 16 One of the pointers is invalid */
  82. OLE_ERROR_NOT_EQUAL, /* 17 Objects are not equal */
  83. OLE_ERROR_HANDLE, /* 18 Invalid handle encountered */
  84. OLE_ERROR_GENERIC, /* 19 Some general error */
  85. OLE_ERROR_CLASS, /* 20 Invalid class */
  86. OLE_ERROR_SYNTAX, /* 21 Command syntax is invalid */
  87. OLE_ERROR_DATATYPE, /* 22 Data format is not supported */
  88. OLE_ERROR_PALETTE, /* 23 Invalid color palette */
  89. OLE_ERROR_NOT_LINK, /* 24 Not a linked object */
  90. OLE_ERROR_NOT_EMPTY, /* 25 Client doc contains objects. */
  91. OLE_ERROR_SIZE, /* 26 Incorrect buffer size passed to the api */
  92. /* that places some string in caller's */
  93. /* buffer */
  94. OLE_ERROR_DRIVE, /* 27 Drive letter in doc name is invalid */
  95. OLE_ERROR_NETWORK, /* 28 Failed to establish connection to a */
  96. /* network share on which the document */
  97. /* is located */
  98. OLE_ERROR_NAME, /* 29 Invalid name(doc name, object name), */
  99. /* etc.. passed to the APIs */
  100. OLE_ERROR_TEMPLATE, /* 30 Server failed to load template */
  101. OLE_ERROR_NEW, /* 31 Server failed to create new doc */
  102. OLE_ERROR_EDIT, /* 32 Server failed to create embedded */
  103. /* instance */
  104. OLE_ERROR_OPEN, /* 33 Server failed to open document, */
  105. /* possible invalid link */
  106. OLE_ERROR_NOT_OPEN, /* 34 Object is not open for editing */
  107. OLE_ERROR_LAUNCH, /* 35 Failed to launch server */
  108. OLE_ERROR_COMM, /* 36 Failed to communicate with server */
  109. OLE_ERROR_TERMINATE, /* 37 Error in termination */
  110. OLE_ERROR_COMMAND, /* 38 Error in execute */
  111. OLE_ERROR_SHOW, /* 39 Error in show */
  112. OLE_ERROR_DOVERB, /* 40 Error in sending do verb, or invalid */
  113. /* verb */
  114. OLE_ERROR_ADVISE_NATIVE, /* 41 Item could be missing */
  115. OLE_ERROR_ADVISE_PICT, /* 42 Item could be missing or server doesn't */
  116. /* this format. */
  117. OLE_ERROR_ADVISE_RENAME, /* 43 Server doesn't support rename */
  118. OLE_ERROR_POKE_NATIVE, /* 44 Failure of poking native data to server */
  119. OLE_ERROR_REQUEST_NATIVE, /* 45 Server failed to render native data */
  120. OLE_ERROR_REQUEST_PICT, /* 46 Server failed to render presentation */
  121. /* data */
  122. OLE_ERROR_SERVER_BLOCKED, /* 47 Trying to block a blocked server or */
  123. /* trying to revoke a blocked server */
  124. /* or document */
  125. OLE_ERROR_REGISTRATION, /* 48 Server is not registered in regestation */
  126. /* data base */
  127. OLE_ERROR_ALREADY_REGISTERED,/*49 Trying to register same doc multiple */
  128. /* times */
  129. OLE_ERROR_TASK, /* 50 Server or client task is invalid */
  130. OLE_ERROR_OUTOFDATE, /* 51 Object is out of date */
  131. OLE_ERROR_CANT_UPDATE_CLIENT,/* 52 Embed doc's client doesn't accept */
  132. /* updates */
  133. OLE_ERROR_UPDATE, /* 53 erorr while trying to update */
  134. OLE_ERROR_SETDATA_FORMAT, /* 54 Server app doesn't understand the */
  135. /* format given to its SetData method */
  136. OLE_ERROR_STATIC_FROM_OTHER_OS,/* 55 trying to load a static object created */
  137. /* on another Operating System */
  138. OLE_ERROR_FILE_VER,
  139. /* Following are warnings */
  140. OLE_WARN_DELETE_DATA = 1000 /* Caller must delete the data when he is */
  141. /* done with it. */
  142. } OLESTATUS;
  143. /* Codes for CallBack events */
  144. typedef enum
  145. {
  146. OLE_CHANGED, /* 0 */
  147. OLE_SAVED, /* 1 */
  148. OLE_CLOSED, /* 2 */
  149. OLE_RENAMED, /* 3 */
  150. OLE_QUERY_PAINT, /* 4 Interruptible paint support */
  151. OLE_RELEASE, /* 5 Object is released(asynchronous operation */
  152. /* is completed) */
  153. OLE_QUERY_RETRY /* 6 Query for retry when server sends busy ACK */
  154. } OLE_NOTIFICATION;
  155. typedef enum
  156. {
  157. OLE_NONE, /* 0 no method active */
  158. OLE_DELETE, /* 1 object delete */
  159. OLE_LNKPASTE, /* 2 PasteLink(auto reconnect) */
  160. OLE_EMBPASTE, /* 3 paste(and update) */
  161. OLE_SHOW, /* 4 Show */
  162. OLE_RUN, /* 5 Run */
  163. OLE_ACTIVATE, /* 6 Activate */
  164. OLE_UPDATE, /* 7 Update */
  165. OLE_CLOSE, /* 8 Close */
  166. OLE_RECONNECT, /* 9 Reconnect */
  167. OLE_SETUPDATEOPTIONS, /* 10 setting update options */
  168. OLE_SERVERUNLAUNCH, /* 11 server is being unlaunched */
  169. OLE_LOADFROMSTREAM, /* 12 LoadFromStream(auto reconnect) */
  170. OLE_SETDATA, /* 13 OleSetData */
  171. OLE_REQUESTDATA, /* 14 OleRequestData */
  172. OLE_OTHER, /* 15 other misc async operations */
  173. OLE_CREATE, /* 16 create */
  174. OLE_CREATEFROMTEMPLATE, /* 17 CreatefromTemplate */
  175. OLE_CREATELINKFROMFILE, /* 18 CreateLinkFromFile */
  176. OLE_COPYFROMLNK, /* 19 CopyFromLink(auto reconnect) */
  177. OLE_CREATEFROMFILE, /* 20 CreateFromFile */
  178. OLE_CREATEINVISIBLE /* 21 CreateInvisible */
  179. } OLE_RELEASE_METHOD;
  180. /* rendering options */
  181. typedef enum
  182. {
  183. olerender_none,
  184. olerender_draw,
  185. olerender_format
  186. } OLEOPT_RENDER;
  187. /* standard clipboard format type */
  188. typedef WORD OLECLIPFORMAT;
  189. /* Link update options */
  190. typedef enum
  191. {
  192. oleupdate_always,
  193. oleupdate_onsave,
  194. #ifdef OLE_INTERNAL
  195. oleupdate_oncall,
  196. oleupdate_onclose
  197. #else
  198. oleupdate_oncall
  199. #endif /* OLE_INTERNAL */
  200. } OLEOPT_UPDATE;
  201. typedef HANDLE HOBJECT;
  202. typedef LONG LHSERVER;
  203. typedef LONG LHCLIENTDOC;
  204. typedef LONG LHSERVERDOC;
  205. typedef struct _OLEOBJECT FAR* LPOLEOBJECT;
  206. typedef struct _OLESTREAM FAR* LPOLESTREAM;
  207. typedef struct _OLECLIENT FAR* LPOLECLIENT;
  208. /* object method table definitions. */
  209. typedef struct _OLEOBJECTVTBL
  210. {
  211. void FAR* (CALLBACK* QueryProtocol) (LPOLEOBJECT, OLE_LPCSTR);
  212. OLESTATUS (CALLBACK* Release) (LPOLEOBJECT);
  213. OLESTATUS (CALLBACK* Show) (LPOLEOBJECT, BOOL);
  214. OLESTATUS (CALLBACK* DoVerb) (LPOLEOBJECT, UINT, BOOL, BOOL);
  215. OLESTATUS (CALLBACK* GetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
  216. OLESTATUS (CALLBACK* SetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  217. OLESTATUS (CALLBACK* SetTargetDevice) (LPOLEOBJECT, HGLOBAL);
  218. OLESTATUS (CALLBACK* SetBounds) (LPOLEOBJECT, OLE_CONST RECT FAR*);
  219. OLECLIPFORMAT (CALLBACK* EnumFormats) (LPOLEOBJECT, OLECLIPFORMAT);
  220. OLESTATUS (CALLBACK* SetColorScheme) (LPOLEOBJECT, OLE_CONST LOGPALETTE FAR*);
  221. /* Server has to implement only the above methods. */
  222. #ifndef SERVERONLY
  223. /* Extra methods required for client. */
  224. OLESTATUS (CALLBACK* Delete) (LPOLEOBJECT);
  225. OLESTATUS (CALLBACK* SetHostNames) (LPOLEOBJECT, OLE_LPCSTR, OLE_LPCSTR);
  226. OLESTATUS (CALLBACK* SaveToStream) (LPOLEOBJECT, LPOLESTREAM);
  227. OLESTATUS (CALLBACK* Clone) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  228. OLESTATUS (CALLBACK* CopyFromLink) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  229. OLESTATUS (CALLBACK* Equal) (LPOLEOBJECT, LPOLEOBJECT);
  230. OLESTATUS (CALLBACK* CopyToClipboard) (LPOLEOBJECT);
  231. OLESTATUS (CALLBACK* Draw) (LPOLEOBJECT, HDC, OLE_CONST RECT FAR*, OLE_CONST RECT FAR*, HDC);
  232. OLESTATUS (CALLBACK* Activate) (LPOLEOBJECT, UINT, BOOL, BOOL, HWND, OLE_CONST RECT FAR*);
  233. OLESTATUS (CALLBACK* Execute) (LPOLEOBJECT, HGLOBAL, UINT);
  234. OLESTATUS (CALLBACK* Close) (LPOLEOBJECT);
  235. OLESTATUS (CALLBACK* Update) (LPOLEOBJECT);
  236. OLESTATUS (CALLBACK* Reconnect) (LPOLEOBJECT);
  237. OLESTATUS (CALLBACK* ObjectConvert) (LPOLEOBJECT, OLE_LPCSTR, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
  238. OLESTATUS (CALLBACK* GetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE FAR*);
  239. OLESTATUS (CALLBACK* SetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE);
  240. OLESTATUS (CALLBACK* Rename) (LPOLEOBJECT, OLE_LPCSTR);
  241. OLESTATUS (CALLBACK* QueryName) (LPOLEOBJECT, LPSTR, UINT FAR*);
  242. OLESTATUS (CALLBACK* QueryType) (LPOLEOBJECT, LONG FAR*);
  243. OLESTATUS (CALLBACK* QueryBounds) (LPOLEOBJECT, RECT FAR*);
  244. OLESTATUS (CALLBACK* QuerySize) (LPOLEOBJECT, DWORD FAR*);
  245. OLESTATUS (CALLBACK* QueryOpen) (LPOLEOBJECT);
  246. OLESTATUS (CALLBACK* QueryOutOfDate) (LPOLEOBJECT);
  247. OLESTATUS (CALLBACK* QueryReleaseStatus) (LPOLEOBJECT);
  248. OLESTATUS (CALLBACK* QueryReleaseError) (LPOLEOBJECT);
  249. OLE_RELEASE_METHOD (CALLBACK* QueryReleaseMethod)(LPOLEOBJECT);
  250. OLESTATUS (CALLBACK* RequestData) (LPOLEOBJECT, OLECLIPFORMAT);
  251. OLESTATUS (CALLBACK* ObjectLong) (LPOLEOBJECT, UINT, LONG FAR*);
  252. /* This method is internal only */
  253. OLESTATUS (CALLBACK* ChangeData) (LPOLEOBJECT, HANDLE, LPOLECLIENT, BOOL);
  254. #endif /* !SERVERONLY */
  255. } OLEOBJECTVTBL;
  256. typedef OLEOBJECTVTBL FAR* LPOLEOBJECTVTBL;
  257. #ifndef OLE_INTERNAL
  258. typedef struct _OLEOBJECT
  259. {
  260. LPOLEOBJECTVTBL lpvtbl;
  261. } OLEOBJECT;
  262. #endif
  263. /* ole client definitions */
  264. typedef struct _OLECLIENTVTBL
  265. {
  266. int (CALLBACK* CallBack)(LPOLECLIENT, OLE_NOTIFICATION, LPOLEOBJECT);
  267. } OLECLIENTVTBL;
  268. typedef OLECLIENTVTBL FAR* LPOLECLIENTVTBL;
  269. typedef struct _OLECLIENT
  270. {
  271. LPOLECLIENTVTBL lpvtbl;
  272. } OLECLIENT;
  273. /* Stream definitions */
  274. typedef struct _OLESTREAMVTBL
  275. {
  276. DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
  277. DWORD (CALLBACK* Put)(LPOLESTREAM, OLE_CONST void FAR*, DWORD);
  278. } OLESTREAMVTBL;
  279. typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
  280. typedef struct _OLESTREAM
  281. {
  282. LPOLESTREAMVTBL lpstbl;
  283. } OLESTREAM;
  284. /* Public Function Prototypes */
  285. OLESTATUS WINAPI OleDelete(LPOLEOBJECT);
  286. OLESTATUS WINAPI OleRelease(LPOLEOBJECT);
  287. OLESTATUS WINAPI OleSaveToStream(LPOLEOBJECT, LPOLESTREAM);
  288. OLESTATUS WINAPI OleEqual(LPOLEOBJECT, LPOLEOBJECT );
  289. OLESTATUS WINAPI OleCopyToClipboard(LPOLEOBJECT);
  290. OLESTATUS WINAPI OleSetHostNames(LPOLEOBJECT, LPCSTR, LPCSTR);
  291. OLESTATUS WINAPI OleSetTargetDevice(LPOLEOBJECT, HGLOBAL);
  292. OLESTATUS WINAPI OleSetBounds(LPOLEOBJECT, const RECT FAR*);
  293. OLESTATUS WINAPI OleSetColorScheme(LPOLEOBJECT, const LOGPALETTE FAR*);
  294. OLESTATUS WINAPI OleQueryBounds(LPOLEOBJECT, RECT FAR*);
  295. OLESTATUS WINAPI OleQuerySize(LPOLEOBJECT, DWORD FAR*);
  296. OLESTATUS WINAPI OleDraw(LPOLEOBJECT, HDC, const RECT FAR*, const RECT FAR*, HDC);
  297. OLESTATUS WINAPI OleQueryOpen(LPOLEOBJECT);
  298. OLESTATUS WINAPI OleActivate(LPOLEOBJECT, UINT, BOOL, BOOL, HWND, const RECT FAR*);
  299. OLESTATUS WINAPI OleExecute(LPOLEOBJECT, HGLOBAL, UINT);
  300. OLESTATUS WINAPI OleClose(LPOLEOBJECT);
  301. OLESTATUS WINAPI OleUpdate(LPOLEOBJECT);
  302. OLESTATUS WINAPI OleReconnect(LPOLEOBJECT);
  303. OLESTATUS WINAPI OleGetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE FAR*);
  304. OLESTATUS WINAPI OleSetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE);
  305. void FAR* WINAPI OleQueryProtocol(LPOLEOBJECT, LPCSTR);
  306. /* Routines related to asynchronous operations. */
  307. OLESTATUS WINAPI OleQueryReleaseStatus(LPOLEOBJECT);
  308. OLESTATUS WINAPI OleQueryReleaseError(LPOLEOBJECT);
  309. OLE_RELEASE_METHOD WINAPI OleQueryReleaseMethod(LPOLEOBJECT);
  310. OLESTATUS WINAPI OleQueryType(LPOLEOBJECT, LONG FAR*);
  311. /* LOWORD is major version, HIWORD is minor version */
  312. DWORD WINAPI OleQueryClientVersion(void);
  313. DWORD WINAPI OleQueryServerVersion(void);
  314. /* Converting to format (as in clipboard): */
  315. OLECLIPFORMAT WINAPI OleEnumFormats(LPOLEOBJECT, OLECLIPFORMAT);
  316. OLESTATUS WINAPI OleGetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
  317. OLESTATUS WINAPI OleSetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
  318. OLESTATUS WINAPI OleQueryOutOfDate(LPOLEOBJECT);
  319. OLESTATUS WINAPI OleRequestData(LPOLEOBJECT, OLECLIPFORMAT);
  320. /* Query apis for creation from clipboard */
  321. OLESTATUS WINAPI OleQueryLinkFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
  322. OLESTATUS WINAPI OleQueryCreateFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
  323. /* Object creation functions */
  324. OLESTATUS WINAPI OleCreateFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  325. OLESTATUS WINAPI OleCreateLinkFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  326. OLESTATUS WINAPI OleCreateFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  327. OLESTATUS WINAPI OleCreateLinkFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  328. OLESTATUS WINAPI OleLoadFromStream(LPOLESTREAM, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  329. OLESTATUS WINAPI OleCreate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  330. OLESTATUS WINAPI OleCreateInvisible(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
  331. OLESTATUS WINAPI OleCreateFromTemplate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
  332. OLESTATUS WINAPI OleClone(LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  333. OLESTATUS WINAPI OleCopyFromLink(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  334. OLESTATUS WINAPI OleObjectConvert(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
  335. OLESTATUS WINAPI OleRename(LPOLEOBJECT, LPCSTR);
  336. OLESTATUS WINAPI OleQueryName(LPOLEOBJECT, LPSTR, UINT FAR*);
  337. OLESTATUS WINAPI OleRevokeObject(LPOLECLIENT);
  338. BOOL WINAPI OleIsDcMeta(HDC);
  339. /* client document API */
  340. OLESTATUS WINAPI OleRegisterClientDoc(LPCSTR, LPCSTR, LONG, LHCLIENTDOC FAR*);
  341. OLESTATUS WINAPI OleRevokeClientDoc(LHCLIENTDOC);
  342. OLESTATUS WINAPI OleRenameClientDoc(LHCLIENTDOC, LPCSTR);
  343. OLESTATUS WINAPI OleRevertClientDoc(LHCLIENTDOC);
  344. OLESTATUS WINAPI OleSavedClientDoc(LHCLIENTDOC);
  345. OLESTATUS WINAPI OleEnumObjects(LHCLIENTDOC, LPOLEOBJECT FAR*);
  346. /* server usage definitions */
  347. typedef enum {
  348. OLE_SERVER_MULTI, /* multiple instances */
  349. OLE_SERVER_SINGLE /* single instance(multiple document) */
  350. } OLE_SERVER_USE;
  351. /* Server API */
  352. typedef struct _OLESERVER FAR* LPOLESERVER;
  353. OLESTATUS WINAPI OleRegisterServer(LPCSTR, LPOLESERVER, LHSERVER FAR*, HINSTANCE, OLE_SERVER_USE);
  354. OLESTATUS WINAPI OleRevokeServer(LHSERVER);
  355. OLESTATUS WINAPI OleBlockServer(LHSERVER);
  356. OLESTATUS WINAPI OleUnblockServer(LHSERVER, BOOL FAR*);
  357. /* APIs to keep server open */
  358. OLESTATUS WINAPI OleLockServer(LPOLEOBJECT, LHSERVER FAR*);
  359. OLESTATUS WINAPI OleUnlockServer(LHSERVER);
  360. /* Server document API */
  361. typedef struct _OLESERVERDOC FAR* LPOLESERVERDOC;
  362. OLESTATUS WINAPI OleRegisterServerDoc(LHSERVER, LPCSTR, LPOLESERVERDOC, LHSERVERDOC FAR*);
  363. OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
  364. OLESTATUS WINAPI OleRenameServerDoc(LHSERVERDOC, LPCSTR);
  365. OLESTATUS WINAPI OleRevertServerDoc(LHSERVERDOC);
  366. OLESTATUS WINAPI OleSavedServerDoc(LHSERVERDOC);
  367. typedef struct _OLESERVERVTBL
  368. {
  369. OLESTATUS (CALLBACK* Open) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  370. /* long handle to doc(privtate to DLL) */
  371. /* lp to OLESERVER */
  372. /* document name */
  373. /* place holder for returning oledoc. */
  374. OLESTATUS (CALLBACK* Create)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  375. /* long handle to doc(privtate to DLL) */
  376. /* lp to OLESERVER */
  377. /* lp class name */
  378. /* lp doc name */
  379. /* place holder for returning oledoc. */
  380. OLESTATUS (CALLBACK* CreateFromTemplate)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  381. /* long handle to doc(privtate to DLL) */
  382. /* lp to OLESERVER */
  383. /* lp class name */
  384. /* lp doc name */
  385. /* lp template name */
  386. /* place holder for returning oledoc. */
  387. OLESTATUS (CALLBACK* Edit) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
  388. /* long handle to doc(privtate to DLL) */
  389. /* lp to OLESERVER */
  390. /* lp class name */
  391. /* lp doc name */
  392. /* place holder for returning oledoc. */
  393. OLESTATUS (CALLBACK* Exit) (LPOLESERVER);
  394. /* lp OLESERVER */
  395. OLESTATUS (CALLBACK* Release) (LPOLESERVER);
  396. /* lp OLESERVER */
  397. OLESTATUS (CALLBACK* Execute)(LPOLESERVER, HGLOBAL);
  398. /* lp OLESERVER */
  399. /* handle to command strings */
  400. } OLESERVERVTBL;
  401. typedef OLESERVERVTBL FAR* LPOLESERVERVTBL;
  402. typedef struct _OLESERVER
  403. {
  404. LPOLESERVERVTBL lpvtbl;
  405. } OLESERVER;
  406. typedef struct _OLESERVERDOCVTBL
  407. {
  408. OLESTATUS (CALLBACK* Save) (LPOLESERVERDOC);
  409. OLESTATUS (CALLBACK* Close) (LPOLESERVERDOC);
  410. OLESTATUS (CALLBACK* SetHostNames)(LPOLESERVERDOC, OLE_LPCSTR, OLE_LPCSTR);
  411. OLESTATUS (CALLBACK* SetDocDimensions)(LPOLESERVERDOC, OLE_CONST RECT FAR*);
  412. OLESTATUS (CALLBACK* GetObject) (LPOLESERVERDOC, OLE_LPCSTR, LPOLEOBJECT FAR*, LPOLECLIENT);
  413. OLESTATUS (CALLBACK* Release) (LPOLESERVERDOC);
  414. OLESTATUS (CALLBACK* SetColorScheme)(LPOLESERVERDOC, OLE_CONST LOGPALETTE FAR*);
  415. OLESTATUS (CALLBACK* Execute) (LPOLESERVERDOC, HGLOBAL);
  416. } OLESERVERDOCVTBL;
  417. typedef OLESERVERDOCVTBL FAR* LPOLESERVERDOCVTBL;
  418. typedef struct _OLESERVERDOC
  419. {
  420. LPOLESERVERDOCVTBL lpvtbl;
  421. } OLESERVERDOC;
  422. #ifdef __cplusplus
  423. }
  424. #endif /* __cplusplus */
  425. #ifdef WIN16
  426. #include <poppack.h>
  427. #endif
  428. #endif /* !_INC_OLE */