Merge m-c to inbound.
[gecko.git] / widget / nsIDragSessionOS2.h
blobf6260a98cca5c9e45a7ca4dba2162d23a5f28313
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /**
6 * nsIDragSessionOS2 encapsulates support for OS/2 dragover/drop events,
7 * i.e. operations where Mozilla is the target of a drag (nsIDragService
8 * handles source operations). Its public methods correspond to the d&d
9 * messages a PM window receives. Its protected methods recast native
10 * data as nsITransferable flavors during drag-enter and drop events.
12 * nsIDragSessionOS2 supports these native formats: WPS Url objects,
13 * files, the contents of files (Alt-drop), and text from DragText.
14 * Data is presented to Mozilla as URI-text, HTML, and/or plain-text.
15 * Only single-item native drops are supported. If the dropped file
16 * or text does not exist yet, nsIDragSessionOS2 will have the source
17 * render the data asynchronously.
20 #ifndef nsIDragSessionOS2_h__
21 #define nsIDragSessionOS2_h__
23 #include "nsISupports.h"
25 #define INCL_PM
26 #include <os2.h>
28 #define NS_IDRAGSESSIONOS2_IID_STR "bc4258b8-33ce-4624-adcb-4b62bb5164c0"
29 #define NS_IDRAGSESSIONOS2_IID \
30 { 0xbc4258b8, 0x33ce, 0x4624, { 0xad, 0xcb, 0x4b, 0x62, 0xbb, 0x51, 0x64, 0xc0 } }
32 class nsIDragSessionOS2 : public nsISupports
34 public:
35 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDRAGSESSIONOS2_IID)
37 /** the dragFlags returned by most public methods fall into two groups */
39 /** Mozilla's dragover status */
40 enum { DND_NONE = 0 };
41 enum { DND_NATIVEDRAG = 1 };
42 enum { DND_MOZDRAG = 2 };
43 enum { DND_INDROP = 4 };
44 enum { DND_DRAGSTATUS = DND_NATIVEDRAG | DND_MOZDRAG | DND_INDROP };
46 /** tasks the caller should perform */
47 enum { DND_DISPATCHENTEREVENT = 16 };
48 enum { DND_DISPATCHEVENT = 32 };
49 enum { DND_GETDRAGOVERRESULT = 64 };
50 enum { DND_EXITSESSION = 128 };
52 NS_IMETHOD DragOverMsg(PDRAGINFO pdinfo, MRESULT &mr, uint32_t* dragFlags) = 0;
53 NS_IMETHOD GetDragoverResult(MRESULT& mr) = 0;
54 NS_IMETHOD DragLeaveMsg(PDRAGINFO pdinfo, uint32_t* dragFlags) = 0;
55 NS_IMETHOD DropHelpMsg(PDRAGINFO pdinfo, uint32_t* dragFlags) = 0;
56 NS_IMETHOD ExitSession(uint32_t* dragFlags) = 0;
57 NS_IMETHOD DropMsg(PDRAGINFO pdinfo, HWND hwnd, uint32_t* dragFlags) = 0;
58 NS_IMETHOD RenderCompleteMsg(PDRAGTRANSFER pdxfer, USHORT usResult, uint32_t* dragFlags) = 0;
60 protected:
61 NS_IMETHOD NativeDragEnter(PDRAGINFO pdinfo) = 0;
62 NS_IMETHOD NativeDrop(PDRAGINFO pdinfo, HWND hwnd, bool* rendering) = 0;
63 NS_IMETHOD NativeRenderComplete(PDRAGTRANSFER pdxfer, USHORT usResult) = 0;
64 NS_IMETHOD NativeDataToTransferable( PCSZ pszText, PCSZ pszTitle, bool isUrl) = 0;
67 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDragSessionOS2, NS_IDRAGSESSIONOS2_IID)
69 #endif // nsIDragSessionOS2_h__