#include <data_transfer.hpp>
|
| enum class | DropEffect { None
, Copy
, Move
, Link
} |
| |
| enum class | EffectAllowed {
None
, Copy
, CopyLink
, CopyMove
,
Link
, LinkMove
, Move
, All
,
Uninitialized
} |
| |
◆ DropEffect
| Enumerator |
|---|
| None | |
| Copy | |
| Move | |
| Link | |
◆ EffectAllowed
| Enumerator |
|---|
| None | |
| Copy | |
| CopyLink | |
| CopyMove | |
| Link | |
| LinkMove | |
| Move | |
| All | |
| Uninitialized | |
◆ DataTransfer() [1/2]
| Nui::WebApi::DataTransfer::DataTransfer |
( |
| ) |
|
◆ DataTransfer() [2/2]
| Nui::WebApi::DataTransfer::DataTransfer |
( |
Nui::val |
dataTransfer | ) |
|
|
explicit |
◆ clearData() [1/2]
| void Nui::WebApi::DataTransfer::clearData |
( |
| ) |
|
Remove the data associated with all types.
◆ clearData() [2/2]
| void Nui::WebApi::DataTransfer::clearData |
( |
std::string const & |
format | ) |
|
Remove the data associated with a given type.
◆ dropEffect()
Gets the type of drag-and-drop operation currently selected or sets the operation to a new type.
◆ effectAllowed()
Provides all of the types of operations that are possible.
◆ files()
| FileList Nui::WebApi::DataTransfer::files |
( |
| ) |
const |
Contains a list of all the local files available on the data transfer.
If the drag operation doesn't involve dragging files, this property is an empty list.
◆ getData()
| std::string Nui::WebApi::DataTransfer::getData |
( |
std::string const & |
format | ) |
const |
The DataTransfer.getData() method retrieves drag data (as a string) for the specified type.
If the drag operation does not include data, this method returns an empty string.
◆ items()
◆ setData()
| void Nui::WebApi::DataTransfer::setData |
( |
std::string const & |
format, |
|
|
std::string const & |
data |
|
) |
| const |
The DataTransfer.setData() method sets the drag operation's drag data to the specified data and type.
If data for the given type does not exist, it is added at the end of the drag data store, such that the last item in the types list will be the new type. If data for the given type already exists, the existing data is replaced in the same position. That is, the order of the types list is not changed when replacing data of the same type. Example data types are text/plain and text/uri-list.
◆ setDragImage()
| void Nui::WebApi::DataTransfer::setDragImage |
( |
Nui::val |
imgElement, |
|
|
long |
xOffset, |
|
|
long |
yOffset |
|
) |
| const |
When a drag occurs, a translucent image is generated from the drag target (the element the dragstart event is fired at), and follows the mouse pointer during the drag.
This image is created automatically, so you do not need to create it yourself. However, if a custom image is desired, the DataTransfer.setDragImage() method can be used to set the custom image to be used. The image will typically be an element but it can also be a <canvas> or any other visible element.
◆ types()
| std::vector< std::string > Nui::WebApi::DataTransfer::types |
( |
| ) |
const |
The DataTransfer.types read-only property returns the available types that exist in the items.
The documentation for this class was generated from the following files: