class KDNDDropZone

Drop zone for KDE Drag n Drop. More...

Definition#include <drag.h>
InheritsQObject
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Signals

Protected Methods

Protected Members


Detailed Description

Drop zone for KDE Drag n Drop.

You can create a DropZone for every widget. When the user makes a drop over this widget, the KDNDDropZone takes over control.

The KDE drag and drop classes are based on the Offix Drag and Drop protocol, but are not compatible with it yet.

Currently used types are: DndText, DndURL.

 KDNDDropZone ( QWidget* _parent, int _type )

Create a DropZone for the widget _parent.

Parameters:
_parentThe parent of this dropzone, usually the widget for which you wish to receive drop events.
_typeThe type of Drop events to accept, eg DndURL.

KDNDDropZone ()

[virtual]

Destructor

void  drop ( char *_data, int _size, int _type, int _x, int _y )

[virtual]

This function is called when a drop event occurs.

Parameters:
_dataA pointer to the dropped data.
_sizeThe length of the data dropped.
_typeThe type of the data, eg DndURL means a URL was dropped.
_x,_y The global coordinates of the drop.

void  enter ( char *_data, int _size, int _type, int _x, int _y )

[virtual]

This function is called when an icon is being dragged over this drop zone.

Note that the icon may never have left the drop zone; the user may be dragging it around withing this zone and this function would still be called.

Parameters:
_dataA pointer to the dragged data.
_sizeThe length of the data dragged.
_typeThe type of the data, eg DndURL means a URL is being dragged.
_x,_y The global coordinates of the drag.

void  leave ()

[virtual]

This function is called when the icon being dragged has left this drop zone.

QStrList &  getURLList ()

[virtual]

Decode the dropped data into a list of URLs. This should only be called if the dropped data was of type DndURL.

Note that the contents of this list are only valid till the next drop event.

const char*  getData ()

[virtual]

Get dropped data.

Returns: A pointer to the dropped data.

int  getDataSize ()

[virtual]

Get dropped data length.

Returns: the length of the data that was dropped.

int  getDataType ()

[virtual]

Get drop data type.

Returns: the type of the data dropped.

int  getMouseX ()

[virtual]

Get the mouse position at which the item was dropped.

Returns: the X coordinate at which the item was dropped.

int  getMouseY ()

[virtual]

Get the mouse position at which the item was dropped.

Returns: the Y coordinate at which the item was dropped.

int  getAcceptType ()

[virtual]

The types of dropped data this drop zone will accept.

Returns: the types of drops accepted.

bool  accepts ( int _type )

[virtual]

Tests whether this data type will be accepted.

Parameters:
_typethe data type to be tested.

Returns: TRUE if this type will be accepted, FALSE otherwise.

QWidget*  getWidget ()

Get the parent widget.

Returns: the parent widget for which this object is monitoring drops.

void  dropAction ( KDNDDropZone* )

[signal]

Emitted when a drop has occurred.

The zone into which the drop has occurred is passed as a parameter.

void  dropEnter ( KDNDDropZone* )

[signal]

Emitted when an icon is dragged into and inside this drop zone.

void  dropLeave ( KDNDDropZone* )

[signal]

Emitted when an icon is dragged out of this drop zone.

void  parseURLList ()

[protected]

Fills 'urlList' with the URLs in 'dndData'. Works only if 'dndType' is DndURL.

QWidget * widget

[protected]

The parent widget being monitored.

char * dndData

[protected]

Last drop data. Only valid during a call to 'dropAction'

int dndSize

[protected]

int dndType

[protected]

int dndX

[protected]

Drop/drag X position.

int dndY

[protected]

Drop/drag Y position.

int acceptType

[protected]

Data type mask.

QStrList urlList

[protected]

If 'dndType' is URL, then all URLs in 'dndData' are stored here.