org.kde.koala

Class KMultipleDrag

public class KMultipleDrag extends QDragObject

This class makes it easy for applications to provide a drag object (for drag-n-drop or for clipboard) that has several representations of the same data, under different formats. Instead of creating a specific class for each case (as would otherwise be necessary), you can simply create independent drag objects (e.g. a QImageDrag object and a KURLDrag object), and bundle them together using KMultipleDrag. Sample code for this:
 KMultipleDrag drag = new KMultipleDrag( parentWidget );
 drag.addDragObject( new QImageDrag( someQImage, 0 ) );
 drag.addDragObject( new KURLDrag( someKURL, 0 ) );
 drag.drag();
 
Note that the drag objects added to the multiple drag become owned by it. For that reason their parent should be 0.

Author: David Faure

UNKNOWN: This class makes it easy for applications to provide a drag object (for drag-n-drop or for clipboard) that has several representations of the same data, under different formats.

Constructor Summary
protected KMultipleDrag(Class dummy)
KMultipleDrag(QWidget dragSource, String name)
Create a new KMultipleDrag object.
KMultipleDrag(QWidget dragSource)
KMultipleDrag()
Method Summary
voidaddDragObject(QDragObject dragObject)
Call this to add each underlying drag object to the multiple drag object.
StringclassName()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
byte[]encodedData(String mime)
Returns the data of a drag object with that supports the given mime type.
protected voidfinalize()
Deletes the wrapped C++ instance
Stringformat(int i)
Returns the i'th supported format, or 0.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()

Constructor Detail

KMultipleDrag

protected KMultipleDrag(Class dummy)

KMultipleDrag

public KMultipleDrag(QWidget dragSource, String name)
Create a new KMultipleDrag object.

Parameters: dragSource the parent object which is the source of the data, 0 for a parent-less object name the name of the object, can be 0

UNKNOWN: Create a new KMultipleDrag object.

KMultipleDrag

public KMultipleDrag(QWidget dragSource)

KMultipleDrag

public KMultipleDrag()

Method Detail

addDragObject

public void addDragObject(QDragObject dragObject)
Call this to add each underlying drag object to the multiple drag object. The drag object should not have a parent because the multiple drag object will own it.

Parameters: dragObject the drag object to add. Should have no parent object.

UNKNOWN: Call this to add each underlying drag object to the multiple drag object.

className

public String className()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

encodedData

public byte[] encodedData(String mime)
Returns the data of a drag object with that supports the given mime type.

Parameters: mime the mime type to search

Returns: the data, or a null byte array if not found

UNKNOWN: Returns the data of a drag object with that supports the given mime type.

finalize

protected void finalize()
Deletes the wrapped C++ instance

format

public String format(int i)
Returns the i'th supported format, or 0.

Parameters: i the number of the format to check

Returns: the format with the number i, or 0 otherwise

UNKNOWN: Returns the i'th supported format, or 0.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()