1999-08-31 01:54:23 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-08-25 12:34:46 +04:00
|
|
|
*
|
2012-05-21 15:12:37 +04: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-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nsITransferable.idl"
|
2000-06-22 12:40:37 +04:00
|
|
|
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2019-08-20 15:43:02 +03:00
|
|
|
|
1999-08-25 12:34:46 +04:00
|
|
|
%{ C++
|
|
|
|
#include "nsSize.h"
|
|
|
|
%}
|
2019-08-20 15:43:02 +03:00
|
|
|
interface nsIContentSecurityPolicy;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2020-04-14 20:17:38 +03:00
|
|
|
native nsSize(nsSize);
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2018-04-07 01:32:25 +03:00
|
|
|
webidl DataTransfer;
|
2018-05-11 20:46:15 +03:00
|
|
|
webidl Document;
|
2018-05-30 05:58:48 +03:00
|
|
|
webidl Node;
|
2018-04-07 01:32:25 +03:00
|
|
|
|
2018-03-13 23:23:59 +03:00
|
|
|
[scriptable, builtinclass, uuid(25bce737-73f0-43c7-bc20-c71044a73c5a)]
|
1999-08-25 12:34:46 +04:00
|
|
|
interface nsIDragSession : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2006-09-22 21:08:17 +04:00
|
|
|
* Set the current state of the drag, whether it can be dropped or not.
|
1999-08-25 12:34:46 +04:00
|
|
|
* usually the target "frame" sets this so the native system can render the correct feedback
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
attribute boolean canDrop;
|
2009-10-29 14:11:02 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates if the drop event should be dispatched only to chrome.
|
|
|
|
*/
|
|
|
|
attribute boolean onlyChromeDrop;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
1999-08-25 12:34:46 +04:00
|
|
|
/**
|
|
|
|
* Sets the action (copy, move, link, et.c) for the current drag
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
attribute unsigned long dragAction;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
1999-08-25 12:34:46 +04:00
|
|
|
/**
|
2006-09-22 21:08:17 +04:00
|
|
|
* Get the number of items that were dropped
|
1999-08-25 12:34:46 +04:00
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
readonly attribute unsigned long numDropItems;
|
2019-05-23 01:37:14 +03:00
|
|
|
|
2000-08-01 00:51:42 +04:00
|
|
|
/**
|
|
|
|
* The document where the drag was started, which will be null if the
|
|
|
|
* drag originated outside the application. Useful for determining if a drop
|
|
|
|
* originated in the same document.
|
|
|
|
*/
|
2020-07-13 21:39:52 +03:00
|
|
|
[infallible]
|
2018-05-11 20:46:15 +03:00
|
|
|
readonly attribute Document sourceDocument;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2001-05-20 09:58:25 +04:00
|
|
|
/**
|
|
|
|
* The dom node that was originally dragged to start the session, which will be null if the
|
|
|
|
* drag originated outside the application.
|
|
|
|
*/
|
2018-05-30 05:58:48 +03:00
|
|
|
readonly attribute Node sourceNode;
|
2001-05-20 09:58:25 +04:00
|
|
|
|
2018-02-09 04:43:53 +03:00
|
|
|
/**
|
2019-01-04 06:16:46 +03:00
|
|
|
* the triggering principal. This may be different than sourceNode's
|
|
|
|
* principal when sourceNode is xul:browser and the drag is
|
2018-02-09 04:43:53 +03:00
|
|
|
* triggered in a browsing context inside it.
|
|
|
|
*/
|
2019-01-04 06:16:46 +03:00
|
|
|
attribute nsIPrincipal triggeringPrincipal;
|
2018-02-09 04:43:53 +03:00
|
|
|
|
2019-08-20 15:43:02 +03:00
|
|
|
/**
|
|
|
|
* the triggering csp. This may be different than sourceNode's
|
|
|
|
* csp when sourceNode is xul:browser and the drag is
|
|
|
|
* triggered in a browsing context inside it.
|
|
|
|
*/
|
2020-04-14 20:17:38 +03:00
|
|
|
attribute nsIContentSecurityPolicy csp;
|
2019-08-20 15:43:02 +03:00
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
/**
|
2018-04-07 01:32:25 +03:00
|
|
|
* The data transfer object for the current drag.
|
2008-08-27 16:07:27 +04:00
|
|
|
*/
|
2018-03-13 23:23:59 +03:00
|
|
|
[binaryname(DataTransferXPCOM)]
|
2018-04-07 01:32:25 +03:00
|
|
|
attribute DataTransfer dataTransfer;
|
|
|
|
[notxpcom, nostdcall] DataTransfer getDataTransfer();
|
|
|
|
[notxpcom, nostdcall] void setDataTransfer(in DataTransfer aDataTransfer);
|
2008-08-27 16:07:27 +04:00
|
|
|
|
1999-08-25 12:34:46 +04:00
|
|
|
/**
|
|
|
|
* Get data from a Drag&Drop. Can be called while the drag is in process
|
2018-03-13 23:24:00 +03:00
|
|
|
* or after the drop has completed.
|
1999-08-25 12:34:46 +04:00
|
|
|
*
|
|
|
|
* @param aTransferable the transferable for the data to be put into
|
|
|
|
* @param aItemIndex which of multiple drag items, zero-based
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
void getData ( in nsITransferable aTransferable, in unsigned long aItemIndex ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
2006-09-22 21:08:17 +04:00
|
|
|
* Check to set if any of the native data on the clipboard matches this data flavor
|
1999-08-25 12:34:46 +04:00
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
boolean isDataFlavorSupported ( in string aDataFlavor ) ;
|
2015-04-08 21:48:11 +03:00
|
|
|
|
|
|
|
void userCancelled();
|
|
|
|
|
|
|
|
void dragEventDispatchedToChildProcess();
|
|
|
|
|
|
|
|
// Called when nsIDragSession implementation should update the UI for the
|
|
|
|
// drag-and-drop based on the data got from the child process in response to
|
|
|
|
// NS_DRAGDROP_OVER sent from parent process to child process.
|
|
|
|
void updateDragEffect();
|
2016-12-24 02:09:44 +03:00
|
|
|
|
|
|
|
// Change the drag image, using similar arguments as
|
|
|
|
// nsIDragService::InvokeDragSessionWithImage.
|
2018-05-30 05:58:48 +03:00
|
|
|
void updateDragImage(in Node aImage, in long aImageX, in long aImageY);
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2019-12-21 15:27:06 +03:00
|
|
|
/**
|
|
|
|
* Returns effects allowed at starting the session for tests.
|
|
|
|
*/
|
|
|
|
[notxpcom, nostdcall] unsigned long getEffectAllowedForTests();
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2019-12-21 15:27:06 +03:00
|
|
|
/**
|
|
|
|
* Returns true if current session was started with synthesized drag start.
|
|
|
|
*/
|
|
|
|
[notxpcom, nostdcall] bool isSynthesizedForTests();
|
1999-08-25 12:34:46 +04:00
|
|
|
|
2019-12-21 15:27:06 +03:00
|
|
|
/**
|
|
|
|
* Sets drag end point of synthesized session when the test does not dispatch
|
|
|
|
* "drop" event.
|
|
|
|
*/
|
|
|
|
void setDragEndPointForTests(in long aScreenX, in long aScreenY);
|
|
|
|
};
|