1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsDragService_h__
7 #define nsDragService_h__
9 #include "nsBaseDragService.h"
14 class nsDataObjCollection
;
17 * Native Win32 DragService wrapper
20 class nsDragService
: public nsBaseDragService
{
23 virtual ~nsDragService();
26 MOZ_CAN_RUN_SCRIPT
virtual nsresult
InvokeDragSessionImpl(
27 nsIArray
* anArrayTransferables
,
28 const mozilla::Maybe
<mozilla::CSSIntRegion
>& aRegion
,
29 uint32_t aActionType
);
32 NS_IMETHOD
GetData(nsITransferable
* aTransferable
, uint32_t anItem
) override
;
33 NS_IMETHOD
GetNumDropItems(uint32_t* aNumItems
) override
;
34 NS_IMETHOD
IsDataFlavorSupported(const char* aDataFlavor
,
35 bool* _retval
) override
;
36 MOZ_CAN_RUN_SCRIPT NS_IMETHOD
EndDragSession(bool aDoneDrag
,
37 uint32_t aKeyModifiers
) override
;
38 NS_IMETHOD
UpdateDragImage(nsINode
* aImage
, int32_t aImageX
,
39 int32_t aImageY
) override
;
42 NS_IMETHOD
SetIDataObject(IDataObject
* aDataObj
);
43 MOZ_CAN_RUN_SCRIPT nsresult
StartInvokingDragSession(IDataObject
* aDataObj
,
44 uint32_t aActionType
);
46 // A drop occurred within the application vs. outside of it.
47 void SetDroppedLocal();
49 IDataObject
* GetDataObject() { return mDataObject
; }
52 nsDataObjCollection
* GetDataObjCollection(IDataObject
* aDataObj
);
54 // determine if we have a single data object or one of our private
56 bool IsCollectionObject(IDataObject
* inDataObj
);
58 // Create a bitmap for drag operations
59 bool CreateDragImage(nsINode
* aDOMNode
,
60 const mozilla::Maybe
<mozilla::CSSIntRegion
>& aRegion
,
63 IDataObject
* mDataObject
;
64 bool mSentLocalDropEvent
;
67 #endif // nsDragService_h__