Backed out changeset 3fe07c50c854 (bug 946316) for bustage. a=backout
[gecko.git] / widget / os2 / nsDragService.h
blob95948d4e1bd25ffc57017e06e44a40ebef0dc7ca
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 #ifndef nsDragService_h__
6 #define nsDragService_h__
8 #include "nsBaseDragService.h"
9 #include "nsIDragSessionOS2.h"
11 #define INCL_PM
12 #include <os2.h>
14 // forward declarations
15 class nsIURI;
16 class nsIURL;
17 class nsISupportsString;
19 class nsDragService : public nsBaseDragService, public nsIDragSessionOS2
21 public:
22 nsDragService();
23 virtual ~nsDragService();
25 NS_DECL_ISUPPORTS_INHERITED
27 // nsIDragService
28 NS_IMETHOD InvokeDragSession (nsIDOMNode* aDOMNode,
29 nsISupportsArray* aTransferables,
30 nsIScriptableRegion* aRegion,
31 uint32_t aActionType);
32 NS_IMETHOD StartDragSession();
33 NS_IMETHOD EndDragSession(bool aDoneDrag);
35 // nsIDragSession
36 NS_IMETHOD GetNumDropItems(uint32_t* aNumDropItems);
37 NS_IMETHOD GetData(nsITransferable* aTransferable, uint32_t aItemIndex);
38 NS_IMETHOD IsDataFlavorSupported(const char* aDataFlavor, bool* _retval);
40 // nsIDragSessionOS2
41 NS_IMETHOD DragOverMsg(PDRAGINFO pdinfo, MRESULT& mr, uint32_t* dragFlags);
42 NS_IMETHOD GetDragoverResult(MRESULT& mr);
43 NS_IMETHOD DragLeaveMsg(PDRAGINFO pdinfo, uint32_t* dragFlags);
44 NS_IMETHOD DropHelpMsg(PDRAGINFO pdinfo, uint32_t* dragFlags);
45 NS_IMETHOD ExitSession(uint32_t* dragFlags);
46 NS_IMETHOD DropMsg(PDRAGINFO pdinfo, HWND hwnd, uint32_t* dragFlags);
47 NS_IMETHOD RenderCompleteMsg(PDRAGTRANSFER pdxfer, USHORT usResult,
48 uint32_t* dragFlags);
50 protected:
51 // nsIDragSessionOS2
52 NS_IMETHOD NativeDragEnter(PDRAGINFO pdinfo);
53 NS_IMETHOD NativeDrop(PDRAGINFO pdinfo, HWND hwnd, bool* rendering);
54 NS_IMETHOD NativeRenderComplete(PDRAGTRANSFER pdxfer, USHORT usResult);
55 NS_IMETHOD NativeDataToTransferable( PCSZ pszText, PCSZ pszTitle,
56 bool isUrl);
58 nsresult SaveAsContents(PCSZ szDest, nsIURL* aURL);
59 nsresult SaveAsURL(PCSZ szDest, nsIURI* aURI);
60 nsresult SaveAsText(PCSZ szDest, nsISupportsString* aString);
61 nsresult GetUrlAndTitle(nsISupports* aGenericData, char** aTargetName);
62 nsresult GetUniTextTitle(nsISupports* aGenericData, char** aTargetName);
64 HWND mDragWnd;
65 const char* mMimeType;
66 nsCOMPtr<nsISupportsArray> mSourceDataItems;
67 nsCOMPtr<nsISupports> mSourceData;
69 friend MRESULT EXPENTRY nsDragWindowProc( HWND, ULONG, MPARAM, MPARAM);
72 #endif // nsDragService_h__