c8a7cb08fe42c512d225b48f3e8add998a6452f1
[reactos.git] / include / ole32 / obj_dragdrop.h
1 /*
2  * Defines the COM interfaces and APIs related to OLE Drag and Drop.
3  */
4
5 #ifndef __WINE_WINE_OBJ_DRAGDROP_H
6 #define __WINE_WINE_OBJ_DRAGDROP_H
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif /* defined(__cplusplus) */
11
12 /*****************************************************************************
13  * Predeclare the interfaces
14  */
15 DEFINE_OLEGUID(IID_IDropSource, 0x00000121L, 0, 0);
16 typedef struct IDropSource IDropSource,*LPDROPSOURCE;
17
18 DEFINE_OLEGUID(IID_IDropTarget, 0x00000122L, 0, 0);
19 typedef struct IDropTarget IDropTarget,*LPDROPTARGET;
20
21 /*****************************************************************************
22  * DROPEFFECT enumeration
23  */
24 #define MK_ALT (0x20)
25 #define DROPEFFECT_NONE         0
26 #define DROPEFFECT_COPY         1
27 #define DROPEFFECT_MOVE         2
28 #define DROPEFFECT_LINK         4
29 #define DROPEFFECT_SCROLL       0x80000000
30 #define DD_DEFSCROLLINSET 11
31 #define DD_DEFSCROLLDELAY 50
32 #define DD_DEFSCROLLINTERVAL 50
33 #define DD_DEFDRAGDELAY   50
34 #define DD_DEFDRAGMINDIST  2
35
36 /*****************************************************************************
37  * IDropSource interface
38  */
39 #define ICOM_INTERFACE IDropSource
40 #define IDropSource_METHODS \
41     ICOM_METHOD2(HRESULT, QueryContinueDrag, BOOL, fEscapePressed, DWORD, grfKeyState) \
42     ICOM_METHOD1(HRESULT, GiveFeedback, DWORD, dwEffect)
43 #define IDropSource_IMETHODS \
44         IUnknown_IMETHODS \
45         IDropSource_METHODS
46 ICOM_DEFINE(IDropSource,IUnknown)
47 #undef ICOM_INTERFACE
48
49 /*** IUnknown methods ***/
50 #define IDropSource_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
51 #define IDropSource_AddRef(p)             ICOM_CALL (AddRef,p)
52 #define IDropSource_Release(p)            ICOM_CALL (Release,p)
53 /*** IDropSource methods ***/
54 #define IDropSource_QueryContinueDrag(p,a,b) ICOM_CALL2(QueryContinueDrag,p,a,b)
55 #define IDropSource_GiveFeedback(p,a)        ICOM_CALL1(GiveFeedback,p,a)
56
57 /*****************************************************************************
58  * IDropTarget interface
59  */
60 #define ICOM_INTERFACE IDropTarget
61 #define IDropTarget_METHODS \
62     ICOM_METHOD4(HRESULT, DragEnter, IDataObject*, pDataObject, DWORD, grfKeyState, POINTL, pt, DWORD*, pdwEffect) \
63     ICOM_METHOD3(HRESULT, DragOver, DWORD, grfKeyState, POINTL, pt, DWORD*, pdwEffect) \
64     ICOM_METHOD(HRESULT, DragLeave) \
65     ICOM_METHOD4(HRESULT, Drop, IDataObject*, pDataObject, DWORD, grfKeyState, POINTL, pt, DWORD*, pdwEffect)
66 #define IDropTarget_IMETHODS \
67         IUnknown_IMETHODS \
68         IDropTarget_METHODS
69 ICOM_DEFINE(IDropTarget,IUnknown)
70 #undef ICOM_INTERFACE
71
72 /*** IUnknown methods ***/
73 #define IDropTarget_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
74 #define IDropTarget_AddRef(p)             ICOM_CALL (AddRef,p)
75 #define IDropTarget_Release(p)            ICOM_CALL (Release,p)
76 /*** IDropTarget methods ***/
77 #define IDropTarget_DragEnter(p,a,b,c,d)  ICOM_CALL4(DragEnter,p,a,b,c,d)
78 #define IDropTarget_DragOver(p,a,b,c)     ICOM_CALL3(DragOver,p,a,b,c)
79 #define IDropTarget_DragLeave(p)          ICOM_CALL(DragLeave,p)
80 #define IDropTarget_Drop(p,a,b,c,d)       ICOM_CALL4(Drop,p,a,b,c,d)
81
82 #if _WIN32_IE >= 0x0500
83
84 #pragma pack(push,8)
85
86 typedef struct
87 {
88         SIZE            sizeDragImage;
89         POINT           ptOffset;
90         HBITMAP         hbmpDragImage;
91         COLORREF        crColorKey;
92 } SHDRAGIMAGE, *LPSHDRAGIMAGE;
93
94 #pragma pack(pop)
95
96 #undef INTERFACE
97 #define INTERFACE IDragSourceHelper
98
99 DECLARE_INTERFACE_(IDragSourceHelper, IUnknown)
100 {
101         STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
102         STDMETHOD_(ULONG, AddRef) (THIS) PURE;
103         STDMETHOD_(ULONG, Release) (THIS) PURE;
104         STDMETHOD (InitializeFromBitmap)(THIS_ LPSHDRAGIMAGE pshdi, IDataObject* pDataObject) PURE;
105         STDMETHOD (InitializeFromWindow)(THIS_ HWND hwnd, POINT* ppt, IDataObject* pDataObject) PURE;
106 };
107
108 DEFINE_GUID(CLSID_DragDropHelper, 0x4657278AL, 0x411B, 0x11D2, 0x83, 0x9A, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0);
109 DEFINE_GUID(IID_IDropTargetHelper, 0x4657278BL, 0x411B, 0x11D2, 0x83, 0x9A, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0);
110 DEFINE_GUID(IID_IDragSourceHelper, 0xDE5BF786L, 0x477A, 0x11D2, 0x83, 0x9D, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0);
111
112 #endif /* _WIN32_IE >= 0x0500 */
113
114 #ifdef __cplusplus
115 } /* extern "C" */
116 #endif /* defined(__cplusplus) */
117
118 #endif /*  __WINE_WINE_OBJ_DRAGDROP_H */
119
120
121
122
123