1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_datatransfer_dnd_XDragSource_idl__
25#define __com_sun_star_datatransfer_dnd_XDragSource_idl__
26
27#ifndef __com_sun_star_datatransfer_dnd_InvalidDNDOperationException_idl__
28#include <com/sun/star/datatransfer/dnd/InvalidDNDOperationException.idl>
29#endif
30
31#ifndef __com_sun_star_datatransfer_dnd_DragGestureEvent_idl__
32#include <com/sun/star/datatransfer/dnd/DragGestureEvent.idl>
33#endif
34
35#ifndef __com_sun_star_datatransfer_XTransferable_idl__
36#include <com/sun/star/datatransfer/XTransferable.idl>
37#endif
38
39#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
40#include <com/sun/star/lang/IllegalArgumentException.idl>
41#endif
42
43//=============================================================================
44
45module com { module sun { module star { module datatransfer { module dnd {
46
47 published interface XDragSourceListener;
48
49//=============================================================================
50/** This interface is implemented by a view or window that supports drag
51	operations and will be received as part of a <type>DragGestureEvent</type>
52	through a <member scope="com::sun::star::datatransfer::dnd">XDragGestureListener::dragGestureRecognized()</member>
53	callback.
54
55	<p>Differently to Java, the association between view and interface is fixed
56	and can not be changed. Otherwise, the AWT messaging would have to be
57	implemented for any window supporting Drag and Drop operations, which would
58	be a real performance issue.</p>
59*/
60
61published interface XDragSource: com::sun::star::uno::XInterface
62{
63
64    //-------------------------------------------------------------------------
65	/** In order to query if drag image support is available.
66
67		@returns
68		A boolean indicating whether or not drag image support is
69		available on the underlying platform.
70	*/
71
72	boolean isDragImageSupported();
73
74	//-------------------------------------------------------------------------
75	/** To get the default cursor for a specified drag action.
76
77		@param dragAction
78		A drag action as specified in <type>DNDConstants</type>.
79
80		@returns
81		The default drag cursor for the specified drag action.
82		<p>The returned value may be used as parameter for the method
83		<member scope="com::sun::star::datatransfer::dnd">XDragSourceContext::setCursor()</member>.</p>
84	*/
85
86	long getDefaultCursor( [in] byte dragAction )
87		raises( com::sun::star::lang::IllegalArgumentException );
88
89	//-------------------------------------------------------------------------
90	/** Starts the drag operation.
91
92		<p>Note: this call does <em>not</em> block until the drag and drop
93		operation ends. If the Drag and Drop system is unable to initiate
94		a drag operation or if the user attempts to start a drag while an
95		existing drag operation is still executing, the action fails immediately.
96		This is indicated by calling
97		<member scope="com::sun::star::datatransfer::dnd">XDragSourceListener::dragDropEnd()</member>
98		on the parameter listener with a DragSourceDragEvent showing a failure.</p>
99
100		@param trigger
101		The <type>DragGestureEvent</type> that initiated the drag.
102
103		@param sourceActions
104		The action or actions supported for this transferable as defined
105		in <type>DNDConstants</type>.
106
107		@param cursor
108		The initial drag cursor id or 0 as default.
109
110		@param image
111		The initial drag image id or 0 as default.
112
113		@param trans
114		The transferable object dragged.
115
116		@param listener
117		The <type>XDragSourceListener</type>.
118
119		@see com::sun::star::datatransfer::XTransferable
120	*/
121
122	[oneway] void startDrag(
123		[in] DragGestureEvent trigger,
124		[in] byte sourceActions,
125		[in] long cursor,
126		[in] long image,
127		[in] com::sun::star::datatransfer::XTransferable trans,
128		[in] XDragSourceListener listener );
129};
130
131//=============================================================================
132
133}; }; }; }; };
134
135#endif
136