Public Member Functions

MExternalDropData Class Reference

This reference page is linked to from the following overview topics: Autodesk Maya 2013.


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

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

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

Returns:
the text data, as a string
bool hasUrls ( ) const

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

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

Returns:
the URL data, as an array of strings
bool hasHtml ( ) const

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

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

Returns:
the html data, as a string
bool hasColor ( ) const

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

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

Returns:
the color data, as an MColor
bool hasImage ( ) const

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

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

Returns:
the image data, as an MImage
MStringArray formats ( ) const

Obtain the list of data formats contained in the drop.

Returns:
the formats, as an array of strings
bool hasFormat ( const MString format) const

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]formatThe 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

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

Parameters:
[in]formatThe 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

This method is not available in Python.

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

Parameters:
[in]formatThe format to look for.
[in]bufferThe buffer to which to copy the data.
[in]bufferSizeThe size of the buffer (in bytes).
Returns:
status code
Status Codes:
int mouseButtons ( ) const

Return the mouse button state for this drop.

Use MExternalDropData::MouseButtons bitmask to distinguish the states.

Returns:
the mouse button state
int keyboardModifiers ( ) const

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