- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# MExternalDropData Class Reference

# OpenMayaUI - API module for user interface

Search for all occurrences

## Detailed Description

Drag-and-drop data, used with MExternalDropCallback.

MExternalDropData is the data that a drag-and-drop operation carries if dragging from an external application and dropping onto Maya.

It typically arrives from a MExternalDropCallback callback method.

`#include <MExternalDropData.h>`

List of all members.

## Public Member Functions
bool | hasText () const
| Query whether the drop contains text data.
MString | text () const
| Obtain the text data contained in the drop, if any.
bool | hasUrls () const
| Query whether the drop contains URL data.
MStringArray | urls () const
| Obtain the URL data contained in the drop, if any.
bool | hasHtml () const
| Query whether the drop contains html data.
MString | html () const
| Obtain the html data contained in the drop, if any.
bool | hasColor () const
| Query whether the drop contains color data.
MColor | color () const
| Obtain the color data contained in the drop, if any.
bool | hasImage () const
| Query whether the drop contains image data.
MImage | image () const
| Obtain the image data contained in the drop, if any.
MStringArray | formats () const
| Obtain the list of data formats contained in the drop.
bool | hasFormat (const MString &format) const
| Query whether the drop contains data in a given format.
unsigned int | dataSize (const MString &format) const
| Return the size (in bytes) of the data with the given format contained in the drop.
MStatus | copyData (const MString &format, void *buffer, unsigned int bufferSize) const
| This method is not available in Python.
int | mouseButtons () const
| Return the mouse button state for this drop.
int | keyboardModifiers () const
| Return the modifier state for this drop.

## Member Function Documentation

bool hasText | ( |  | ) | const

Search for all occurrences

Query whether the drop contains text data.

Returns:
  - true the drop contains text data
  - false the drop does not contain text data

MString text | ( |  | ) | const

Search for all occurrences

Obtain the text data contained in the drop, if any.

Returns:
  the text data, as a string

bool hasUrls | ( |  | ) | const

Search for all occurrences

Query whether the drop contains URL data.

Returns:
  - true the drop contains URL data
  - false the drop does not contain URL data

MStringArray urls | ( |  | ) | const

Search for all occurrences

Obtain the URL data contained in the drop, if any.

Returns:
  the URL data, as an array of strings

bool hasHtml | ( |  | ) | const

Search for all occurrences

Query whether the drop contains html data.

Returns:
  - true the drop contains html data
  - false the drop does not contain html data

MString html | ( |  | ) | const

Search for all occurrences

Obtain the html data contained in the drop, if any.

Returns:
  the html data, as a string

bool hasColor | ( |  | ) | const

Search for all occurrences

Query whether the drop contains color data.

Returns:
  - true the drop contains color data
  - false the drop does not contain color data

MColor color | ( |  | ) | const

Search for all occurrences

Obtain the color data contained in the drop, if any.

Returns:
  the color data, as an MColor

bool hasImage | ( |  | ) | const

Search for all occurrences

Query whether the drop contains image data.

Returns:
  - true the drop contains image data
  - false the drop does not contain image data

MImage image | ( |  | ) | const

Search for all occurrences

Obtain the image data contained in the drop, if any.

Returns:
  the image data, as an MImage

MStringArray formats | ( |  | ) | const

Search for all occurrences

Obtain the list of data formats contained in the drop.

Returns:
  the formats, as an array of strings

bool hasFormat | ( | const MString & | format | ) | const

Search for all occurrences

Query whether the drop contains data in a given format.

The result will be true iff the format is contained in the result of the formats() method.

Parameters:

  [in] | format | The format to look for.

Returns:
  - true the drop contains data with the given format
  - false the drop does not contain data with the given format

unsigned int dataSize | ( | const MString & | format | ) | const

Search for all occurrences

Return the size (in bytes) of the data with the given format contained in the drop.

Parameters:

  [in] | format | The format to look for.

Returns:
  the size of the data, in bytes (zero if the format is not present)

MStatus copyData | ( | const MString & | format,
|  | void * | buffer,
|  | unsigned int | bufferSize
| ) |  | const

Search for all occurrences

This method is not available in Python.

Copy the data with the given format contained in the drop to a buffer.

Parameters:

  [in] | format | The format to look for.
  [in] | buffer | The buffer to which to copy the data.
  [in] | bufferSize | The size of the buffer (in bytes).

Returns:
  status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed - the buffer was not large enough to contain the data
  - MS::kInvalidParameter the given format was not present

int mouseButtons | ( |  | ) | const

Search for all occurrences

Return the mouse button state for this drop.

Use MExternalDropData::MouseButtons bitmask to distinguish the states.

Returns:
  the mouse button state

int keyboardModifiers | ( |  | ) | const

Search for all occurrences

Return the modifier state for this drop.

Use MExternalDropData::KeyboardModifiers bitmask to distinguish the states.

Returns:
  the modifier state

MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData
MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData MExternalDropData