wine/include/ole.h
Alexandre Julliard 982a223f36 Replaced PTR_SEG_TO_LIN macro by exported MapSL function.
Fixed a few ptr/segptr mismatches.
Moved CONV_RECT/POINT macros to wingdi16.h.
2000-12-13 20:20:09 +00:00

327 lines
11 KiB
C

/*
* ole.h - Declarations for OLESVR and OLECLI
*/
#ifndef __WINE_OLE_H
#define __WINE_OLE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "windef.h"
#include "wine/windef16.h"
#include "wine/obj_base.h"
#include "wine/obj_misc.h"
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "wine/obj_dataobject.h"
#include "wine/obj_dragdrop.h"
struct tagLOGPALETTE;
/* object types */
#define OT_LINK 1
#define OT_EMBEDDED 2
#define OT_STATIC 3
/* activate verbs */
#define OLEVERB_PRIMARY 0
typedef enum
{
OLE_OK,
OLE_WAIT_FOR_RELEASE,
OLE_BUSY,
OLE_ERROR_PROTECT_ONLY,
OLE_ERROR_MEMORY,
OLE_ERROR_STREAM,
OLE_ERROR_STATIC,
OLE_ERROR_BLANK,
OLE_ERROR_DRAW,
OLE_ERROR_METAFILE,
OLE_ERROR_ABORT,
OLE_ERROR_CLIPBOARD,
OLE_ERROR_FORMAT,
OLE_ERROR_OBJECT,
OLE_ERROR_OPTION,
OLE_ERROR_PROTOCOL,
OLE_ERROR_ADDRESS,
OLE_ERROR_NOT_EQUAL,
OLE_ERROR_HANDLE,
OLE_ERROR_GENERIC,
OLE_ERROR_CLASS,
OLE_ERROR_SYNTAX,
OLE_ERROR_DATATYPE,
OLE_ERROR_PALETTE,
OLE_ERROR_NOT_LINK,
OLE_ERROR_NOT_EMPTY,
OLE_ERROR_SIZE,
OLE_ERROR_DRIVE,
OLE_ERROR_NETWORK,
OLE_ERROR_NAME,
OLE_ERROR_TEMPLATE,
OLE_ERROR_NEW,
OLE_ERROR_EDIT,
OLE_ERROR_OPEN,
OLE_ERROR_NOT_OPEN,
OLE_ERROR_LAUNCH,
OLE_ERROR_COMM,
OLE_ERROR_TERMINATE,
OLE_ERROR_COMMAND,
OLE_ERROR_SHOW,
OLE_ERROR_DOVERB,
OLE_ERROR_ADVISE_NATIVE,
OLE_ERROR_ADVISE_PICT,
OLE_ERROR_ADVISE_RENAME,
OLE_ERROR_POKE_NATIVE,
OLE_ERROR_REQUEST_NATIVE,
OLE_ERROR_REQUEST_PICT,
OLE_ERROR_SERVER_BLOCKED,
OLE_ERROR_REGISTRATION,
OLE_ERROR_ALREADY_REGISTERED,
OLE_ERROR_TASK,
OLE_ERROR_OUTOFDATE,
OLE_ERROR_CANT_UPDATE_CLIENT,
OLE_ERROR_UPDATE,
OLE_ERROR_SETDATA_FORMAT,
OLE_ERROR_STATIC_FROM_OTHER_OS,
OLE_WARN_DELETE_DATA = 1000
} OLESTATUS;
typedef enum {
OLE_SERVER_MULTI,
OLE_SERVER_SINGLE
} OLE_SERVER_USE;
typedef enum {
OLE_CHANGED,
OLE_SAVED,
OLE_CLOSED,
OLE_RENAMED,
OLE_QUERY_PAINT,
OLE_RELEASE,
OLE_QUERY_RETRY
} OLE_NOTIFICATION;
typedef enum {
olerender_none,
olerender_draw,
olerender_format
} OLEOPT_RENDER;
typedef enum {
oleupdate_always,
oleupdate_onsave,
oleupdate_oncall,
oleupdate_onclose
} OLEOPT_UPDATE;
typedef LONG LHSERVER;
typedef LONG LHSERVERDOC;
typedef LONG LHCLIENTDOC;
typedef LONG OLECLIPFORMAT;/* dunno about this type, please change/add */
typedef OLEOPT_UPDATE* LPOLEOPT_UPDATE;
typedef enum {
OLE_NONE, /* none */
OLE_DELETE, /* delete object */
OLE_LNKPASTE, /* link paste */
OLE_EMBPASTE, /* paste(and update) */
OLE_SHOW,
OLE_RUN,
OLE_ACTIVATE,
OLE_UPDATE,
OLE_CLOSE,
OLE_RECONNECT,
OLE_SETUPDATEOPTIONS,
OLE_SERVERRUNLAUNCH, /* unlaunch (terminate?) server */
OLE_LOADFROMSTREAM, /* (auto reconnect) */
OLE_SETDATA, /* OleSetData */
OLE_REQUESTDATA, /* OleRequestData */
OLE_OTHER,
OLE_CREATE,
OLE_CREATEFROMTEMPLATE,
OLE_CREATELINKFROMFILE,
OLE_COPYFROMLNK,
OLE_CREATREFROMFILE,
OLE_CREATEINVISIBLE
} OLE_RELEASE_METHOD;
typedef struct _OLETARGETDEVICE {
UINT16 otdDeviceNameOffset;
UINT16 otdDriverNameOffset;
UINT16 otdPortNameOffset;
UINT16 otdExtDevmodeOffset;
UINT16 otdExtDevmodeSize;
UINT16 otdEnvironmentOffset;
UINT16 otdEnvironmentSize;
BYTE otdData[1];
/* ... */
} OLETARGETDEVICE;
typedef struct _OLESERVERDOC* LPOLESERVERDOC;
typedef struct _OLEOBJECT* LPOLEOBJECT;
typedef struct _OLECLIENT* LPOLECLIENT;
typedef struct _OLESERVERDOCVTBL {
OLESTATUS CALLBACK (*Save)(LPOLESERVERDOC);
OLESTATUS CALLBACK (*Close)(LPOLESERVERDOC);
OLESTATUS CALLBACK (*SetHostNames)(LPOLESERVERDOC,LPCOLESTR16,LPCOLESTR16);
OLESTATUS CALLBACK (*SetDocDimensions)(LPOLESERVERDOC,LPRECT16);
#ifdef __WINE__
/* GetObject is a WINELIB_NAME macro so it cannot be used in Wine itself */
OLESTATUS CALLBACK (*pGetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
#else
OLESTATUS CALLBACK (*GetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
#endif
OLESTATUS CALLBACK (*Release)(LPOLESERVERDOC);
OLESTATUS CALLBACK (*SetColorScheme)(LPOLESERVERDOC,struct tagLOGPALETTE*);
OLESTATUS CALLBACK (*Execute)(LPOLESERVERDOC,HGLOBAL16);
} OLESERVERDOCVTBL;
typedef OLESERVERDOCVTBL* LPOLESERVERDOCVTBL;
typedef struct _OLESERVERDOC {
LPOLESERVERDOCVTBL lpvtbl;
/* server provided state info */
} OLESERVERDOC;
typedef struct _OLESERVER* LPOLESERVER;
typedef struct _OLESERVERVTBL {
OLESTATUS CALLBACK (*Open)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPOLESERVERDOC *);
OLESTATUS CALLBACK (*Create)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC*);
OLESTATUS CALLBACK (*CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
OLESTATUS CALLBACK (*Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
OLESTATUS CALLBACK (*Exit)(LPOLESERVER);
OLESTATUS CALLBACK (*Release)(LPOLESERVER);
OLESTATUS CALLBACK (*Execute)(LPOLESERVER);
} OLESERVERVTBL;
typedef OLESERVERVTBL *LPOLESERVERVTBL;
typedef struct _OLESERVER {
LPOLESERVERVTBL lpvtbl;
/* server specific data */
} OLESERVER;
typedef struct _OLECLIENTVTBL {
int CALLBACK (*CallBack)(LPOLECLIENT,OLE_NOTIFICATION,LPOLEOBJECT);
} OLECLIENTVTBL;
typedef OLECLIENTVTBL *LPOLECLIENTVTBL;
typedef struct _OLECLIENT {
LPOLECLIENTVTBL lpvtbl;
/* client data... */
} OLECLIENT;
struct _OLESTREAM;
typedef struct _OLEOBJECTVTBL {
void CALLBACK *(*QueryProtocol)(LPOLEOBJECT,LPCOLESTR16);
OLESTATUS CALLBACK (*Release)(LPOLEOBJECT);
OLESTATUS CALLBACK (*Show)(LPOLEOBJECT,BOOL16);
OLESTATUS CALLBACK (*DoVerb)(LPOLEOBJECT,UINT16,BOOL16,BOOL16);
OLESTATUS CALLBACK (*GetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16 *);
OLESTATUS CALLBACK (*SetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16);
OLESTATUS CALLBACK (*SetTargetDevice)(LPOLEOBJECT,HGLOBAL16);
OLESTATUS CALLBACK (*SetBounds)(LPOLEOBJECT,LPRECT16);
OLESTATUS CALLBACK (*EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
OLESTATUS CALLBACK (*SetColorScheme)(LPOLEOBJECT,struct tagLOGPALETTE*);
OLESTATUS CALLBACK (*Delete)(LPOLEOBJECT);
OLESTATUS CALLBACK (*SetHostNames)(LPOLEOBJECT,LPCOLESTR16,LPCOLESTR16);
OLESTATUS CALLBACK (*SaveToStream)(LPOLEOBJECT,struct _OLESTREAM*);
OLESTATUS CALLBACK (*Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
OLESTATUS CALLBACK (*CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
OLESTATUS CALLBACK (*Equal)(LPOLEOBJECT,LPOLEOBJECT);
OLESTATUS CALLBACK (*CopyToClipBoard)(LPOLEOBJECT);
OLESTATUS CALLBACK (*Draw)(LPOLEOBJECT,HDC16,LPRECT16,LPRECT16,HDC16);
OLESTATUS CALLBACK (*Activate)(LPOLEOBJECT,UINT16,BOOL16,BOOL16,HWND16,LPRECT16);
OLESTATUS CALLBACK (*Execute)(LPOLEOBJECT,HGLOBAL16,UINT16);
OLESTATUS CALLBACK (*Close)(LPOLEOBJECT);
OLESTATUS CALLBACK (*Update)(LPOLEOBJECT);
OLESTATUS CALLBACK (*Reconnect)(LPOLEOBJECT);
OLESTATUS CALLBACK (*ObjectConvert)(LPOLEOBJECT,LPCOLESTR16,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT*);
OLESTATUS CALLBACK (*GetLinkUpdateOptions)(LPOLEOBJECT,LPOLEOPT_UPDATE);
OLESTATUS CALLBACK (*SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE);
OLESTATUS CALLBACK (*Rename)(LPOLEOBJECT,LPCOLESTR16);
OLESTATUS CALLBACK (*QueryName)(LPOLEOBJECT,LPSTR,LPUINT16);
OLESTATUS CALLBACK (*QueryType)(LPOLEOBJECT,LPLONG);
OLESTATUS CALLBACK (*QueryBounds)(LPOLEOBJECT,LPRECT16);
OLESTATUS CALLBACK (*QuerySize)(LPOLEOBJECT,LPDWORD);
OLESTATUS CALLBACK (*QueryOpen)(LPOLEOBJECT);
OLESTATUS CALLBACK (*QueryOutOfDate)(LPOLEOBJECT);
OLESTATUS CALLBACK (*QueryReleaseStatus)(LPOLEOBJECT);
OLESTATUS CALLBACK (*QueryReleaseError)(LPOLEOBJECT);
OLE_RELEASE_METHOD CALLBACK (*QueryReleaseMethod)(LPOLEOBJECT);
OLESTATUS CALLBACK (*RequestData)(LPOLEOBJECT,OLECLIPFORMAT);
OLESTATUS CALLBACK (*ObjectLong)(LPOLEOBJECT,UINT16,LPLONG);
} OLEOBJECTVTBL;
typedef OLEOBJECTVTBL* LPOLEOBJECTVTBL;
typedef struct _OLEOBJECT {
LPOLEOBJECTVTBL lpvtbl;
} OLEOBJECT;
typedef struct IMalloc16 IMalloc16,*LPMALLOC16;
#define ICOM_INTERFACE IMalloc16
#define IMalloc16_METHODS \
ICOM_METHOD1 (LPVOID,Alloc, DWORD,cb) \
ICOM_METHOD2 (LPVOID,Realloc, LPVOID,pv, DWORD,cb) \
ICOM_VMETHOD1( Free, LPVOID,pv) \
ICOM_METHOD1(DWORD, GetSize, LPVOID,pv) \
ICOM_METHOD1(INT16, DidAlloc, LPVOID,pv) \
ICOM_METHOD (LPVOID,HeapMinimize)
#define IMalloc16_IMETHODS \
IUnknown_IMETHODS \
IMalloc16_METHODS
ICOM_DEFINE(IMalloc16,IUnknown)
#undef ICOM_INTERFACE
/*** IUnknown methods ***/
#define IMalloc16_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IMalloc16_AddRef(p) ICOM_CALL (AddRef,p)
#define IMalloc16_Release(p) ICOM_CALL (Release,p)
/*** IMalloc16 methods ***/
#define IMalloc16_Alloc(p,a) ICOM_CALL1(Alloc,p,a)
#define IMalloc16_Realloc(p,a,b) ICOM_CALL2(Realloc,p,a,b)
#define IMalloc16_Free(p,a) ICOM_CALL1(Free,p,a)
#define IMalloc16_GetSize(p,a) ICOM_CALL1(GetSize,p,a)
#define IMalloc16_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a)
#define IMalloc16_HeapMinimize(p) ICOM_CALL (HeapMinimize,p)
HRESULT WINAPI CoCreateStandardMalloc16(DWORD dwMemContext, LPMALLOC16* lpMalloc);
HRESULT WINAPI CoGetMalloc16(DWORD dwMemContext,LPMALLOC16* lpMalloc);
HRESULT WINAPI CoInitialize16(LPVOID lpReserved);
HRESULT WINAPI CoLockObjectExternal16(LPUNKNOWN,BOOL16,BOOL16);
HRESULT WINAPI CoRegisterClassObject16(REFCLSID,LPUNKNOWN,DWORD,DWORD,LPDWORD);
void WINAPI CoUninitialize16(void);
HRESULT WINAPI DoDragDrop16(LPDATAOBJECT,LPDROPSOURCE,DWORD,DWORD*);
OLESTATUS WINAPI OleRegisterServer16(LPCSTR,LPOLESERVER,LHSERVER *,HINSTANCE16,OLE_SERVER_USE);
OLESTATUS WINAPI OleUnblockServer16(LHSERVER,BOOL16 *);
OLESTATUS WINAPI OleRegisterServerDoc16(LHSERVER,LPCSTR,LPOLESERVERDOC,LHSERVERDOC *);
OLESTATUS WINAPI OleRegisterClientDoc16(LPCSTR,LPCSTR,LONG,LHCLIENTDOC *);
OLESTATUS WINAPI OleRenameClientDoc16(LHCLIENTDOC,LPCSTR);
OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC);
OLESTATUS WINAPI OleRevokeClientDoc16(LHCLIENTDOC);
OLESTATUS WINAPI OleRevokeServer16(LHSERVER);
OLESTATUS WINAPI OleRevertClientDoc16(LHCLIENTDOC hServerDoc);
OLESTATUS WINAPI OleEnumObjects16(LHCLIENTDOC hServerDoc, SEGPTR data);
OLESTATUS WINAPI OleCreateLinkFromClip16(LPCSTR,SEGPTR,LHCLIENTDOC,LPCSTR,SEGPTR,UINT16,UINT16);
OLESTATUS WINAPI OleQueryLinkFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat);
OLESTATUS WINAPI OleQueryCreateFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat);
OLESTATUS WINAPI OleQueryType16(LPOLEOBJECT oleob, SEGPTR xlong);
OLESTATUS WINAPI OleCreateFromClip16(LPCSTR,SEGPTR,LHCLIENTDOC,LPCSTR,SEGPTR,UINT16,UINT16);
HRESULT WINAPI RegisterDragDrop16(HWND16,LPDROPTARGET);
HRESULT WINAPI RevokeDragDrop16(HWND16);
BSTR16 WINAPI SysAllocString16(LPCOLESTR16);
INT16 WINAPI SysReAllocString16(LPBSTR16,LPCOLESTR16);
VOID WINAPI SysFreeString16(BSTR16);
BSTR16 WINAPI SysAllocStringLen16(const char*, int);
int WINAPI SysReAllocStringLen16(BSTR16*, const char*, int);
int WINAPI SysStringLen16(BSTR16);
#ifdef __cplusplus
} /*extern*/
#endif
#endif /* __WINE_OLE_H */