Bug 1855360 - Fix the skip-if syntax. a=bustage-fix
[gecko.git] / widget / windows / nsDragService.h
blob5a86a74f769f3f41c0cf265847a35e9b78fec556
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"
10 #include <windows.h>
11 #include <shlobj.h>
13 struct IDataObject;
14 class nsDataObjCollection;
16 /**
17 * Native Win32 DragService wrapper
20 class nsDragService : public nsBaseDragService {
21 public:
22 nsDragService();
23 virtual ~nsDragService();
25 // nsBaseDragService
26 MOZ_CAN_RUN_SCRIPT virtual nsresult InvokeDragSessionImpl(
27 nsIArray* anArrayTransferables,
28 const mozilla::Maybe<mozilla::CSSIntRegion>& aRegion,
29 uint32_t aActionType);
31 // nsIDragSession
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;
41 // native impl.
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; }
51 protected:
52 nsDataObjCollection* GetDataObjCollection(IDataObject* aDataObj);
54 // determine if we have a single data object or one of our private
55 // collections
56 bool IsCollectionObject(IDataObject* inDataObj);
58 // Create a bitmap for drag operations
59 bool CreateDragImage(nsINode* aDOMNode,
60 const mozilla::Maybe<mozilla::CSSIntRegion>& aRegion,
61 SHDRAGIMAGE* psdi);
63 IDataObject* mDataObject;
64 bool mSentLocalDropEvent;
67 #endif // nsDragService_h__