LibreOffice
LibreOffice 24.2 SDK API Reference
Public Member Functions | List of all members
XDragSource Interface Referencepublished

This interface is implemented by a view or window that supports drag operations and will be received as part of a DragGestureEvent through a com::sun::star::datatransfer::dnd::XDragGestureListener::dragGestureRecognized() callback. More...

import"XDragSource.idl";

Inheritance diagram for XDragSource:
XInterface OleDragSource X11DragSource

Public Member Functions

boolean isDragImageSupported ()
 In order to query if drag image support is available. More...
 
long getDefaultCursor ([in] byte dragAction) raises ( com::sun::star::lang::IllegalArgumentException )
 To get the default cursor for a specified drag action. More...
 
void startDrag ([in] DragGestureEvent trigger, [in] byte sourceActions, [in] long cursor, [in] long image, [in] com::sun::star::datatransfer::XTransferable trans, [in] XDragSourceListener listener)
 Starts the drag operation. More...
 
- Public Member Functions inherited from XInterface
any queryInterface ([in] type aType)
 queries for a new interface to an existing UNO object. More...
 
void acquire ()
 increases the reference counter by one. More...
 
void release ()
 decreases the reference counter by one. More...
 

Detailed Description

This interface is implemented by a view or window that supports drag operations and will be received as part of a DragGestureEvent through a com::sun::star::datatransfer::dnd::XDragGestureListener::dragGestureRecognized() callback.

Differently to Java, the association between view and interface is fixed and can not be changed. Otherwise, the AWT messaging would have to be implemented for any window supporting Drag and Drop operations, which would be a real performance issue.

Member Function Documentation

◆ getDefaultCursor()

long getDefaultCursor ( [in] byte  dragAction)
raises (com::sun::star::lang::IllegalArgumentException
)

To get the default cursor for a specified drag action.

Parameters
dragActionA drag action as specified in DNDConstants.
Returns
The default drag cursor for the specified drag action.

The returned value may be used as parameter for the method com::sun::star::datatransfer::dnd::XDragSourceContext::setCursor().

◆ isDragImageSupported()

boolean isDragImageSupported ( )

In order to query if drag image support is available.

Returns
A boolean indicating whether or not drag image support is available on the underlying platform.

◆ startDrag()

void startDrag ( [in] DragGestureEvent  trigger,
[in] byte  sourceActions,
[in] long  cursor,
[in] long  image,
[in] com::sun::star::datatransfer::XTransferable  trans,
[in] XDragSourceListener  listener 
)

Starts the drag operation.

Note: this call does not block until the drag and drop operation ends. If the Drag and Drop system is unable to initiate a drag operation or if the user attempts to start a drag while an existing drag operation is still executing, the action fails immediately. This is indicated by calling com::sun::star::datatransfer::dnd::XDragSourceListener::dragDropEnd() on the parameter listener with a DragSourceDragEvent showing a failure.

Parameters
triggerThe DragGestureEvent that initiated the drag.
sourceActionsThe action or actions supported for this transferable as defined in DNDConstants.
cursorThe initial drag cursor id or 0 as default.
imageThe initial drag image id or 0 as default.
transThe transferable object dragged.
listenerThe XDragSourceListener.
See also
com::sun::star::datatransfer::XTransferable

The documentation for this interface was generated from the following file: