2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-03-23 15:37:34 +00:00
|
|
|
|
|
|
|
#ifndef nsDragService_h__
|
|
|
|
#define nsDragService_h__
|
|
|
|
|
1999-04-17 13:49:39 +00:00
|
|
|
#include "nsBaseDragService.h"
|
2006-02-20 20:48:35 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <shlobj.h>
|
1999-03-23 15:37:34 +00:00
|
|
|
|
1999-04-17 13:49:39 +00:00
|
|
|
struct IDataObject;
|
2002-06-14 11:28:13 +00:00
|
|
|
class nsDataObjCollection;
|
2006-02-20 20:48:35 +00:00
|
|
|
|
1999-03-23 15:37:34 +00:00
|
|
|
/**
|
|
|
|
* Native Win32 DragService wrapper
|
|
|
|
*/
|
|
|
|
|
1999-04-17 13:49:39 +00:00
|
|
|
class nsDragService : public nsBaseDragService {
|
1999-03-23 15:37:34 +00:00
|
|
|
public:
|
|
|
|
nsDragService();
|
|
|
|
virtual ~nsDragService();
|
2018-11-30 10:46:48 +00:00
|
|
|
|
2015-10-21 09:16:40 +00:00
|
|
|
// nsBaseDragService
|
2019-05-09 20:21:28 +00:00
|
|
|
MOZ_CAN_RUN_SCRIPT virtual nsresult InvokeDragSessionImpl(
|
2016-10-18 18:56:20 +00:00
|
|
|
nsIArray* anArrayTransferables,
|
2018-08-07 13:32:08 +00:00
|
|
|
const mozilla::Maybe<mozilla::CSSIntRegion>& aRegion,
|
2015-10-21 09:16:40 +00:00
|
|
|
uint32_t aActionType);
|
1999-05-07 19:55:00 +00:00
|
|
|
|
|
|
|
// nsIDragSession
|
2017-11-06 03:37:28 +00:00
|
|
|
NS_IMETHOD GetData(nsITransferable* aTransferable, uint32_t anItem) override;
|
|
|
|
NS_IMETHOD GetNumDropItems(uint32_t* aNumItems) override;
|
|
|
|
NS_IMETHOD IsDataFlavorSupported(const char* aDataFlavor,
|
|
|
|
bool* _retval) override;
|
2019-05-09 20:21:28 +00:00
|
|
|
MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndDragSession(bool aDoneDrag,
|
|
|
|
uint32_t aKeyModifiers) override;
|
2018-05-30 02:58:48 +00:00
|
|
|
NS_IMETHOD UpdateDragImage(nsINode* aImage, int32_t aImageX,
|
|
|
|
int32_t aImageY) override;
|
1999-03-23 15:37:34 +00:00
|
|
|
|
1999-04-23 14:35:26 +00:00
|
|
|
// native impl.
|
2005-03-15 00:26:15 +00:00
|
|
|
NS_IMETHOD SetIDataObject(IDataObject* aDataObj);
|
2019-05-09 20:21:28 +00:00
|
|
|
MOZ_CAN_RUN_SCRIPT nsresult StartInvokingDragSession(IDataObject* aDataObj,
|
|
|
|
uint32_t aActionType);
|
1999-03-23 15:37:34 +00:00
|
|
|
|
2010-05-13 12:19:50 +00:00
|
|
|
// A drop occurred within the application vs. outside of it.
|
2008-09-28 20:57:33 +00:00
|
|
|
void SetDroppedLocal();
|
|
|
|
|
2016-12-23 23:09:44 +00:00
|
|
|
IDataObject* GetDataObject() { return mDataObject; }
|
|
|
|
|
1999-03-23 15:37:34 +00:00
|
|
|
protected:
|
2005-03-15 00:26:15 +00:00
|
|
|
nsDataObjCollection* GetDataObjCollection(IDataObject* aDataObj);
|
2000-06-05 00:34:11 +00:00
|
|
|
|
2005-03-15 00:26:15 +00:00
|
|
|
// determine if we have a single data object or one of our private
|
|
|
|
// collections
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsCollectionObject(IDataObject* inDataObj);
|
2000-06-05 00:34:11 +00:00
|
|
|
|
2007-11-17 04:31:32 +00:00
|
|
|
// Create a bitmap for drag operations
|
2018-05-30 02:58:48 +00:00
|
|
|
bool CreateDragImage(nsINode* aDOMNode,
|
2018-08-07 13:32:08 +00:00
|
|
|
const mozilla::Maybe<mozilla::CSSIntRegion>& aRegion,
|
2018-05-30 02:58:48 +00:00
|
|
|
SHDRAGIMAGE* psdi);
|
2007-11-17 04:31:32 +00:00
|
|
|
|
2005-03-15 00:26:15 +00:00
|
|
|
IDataObject* mDataObject;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mSentLocalDropEvent;
|
1999-03-23 15:37:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDragService_h__
|