1 /*
2  * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package sun.awt.X11;
27 
28 interface XDragSourceProtocolListener {
29     /**
30      * Called when a reply from the current drop target is received.
31      *
32      * @param action is the drop action selected by the drop target
33      */
handleDragReply(int action)34     void handleDragReply(int action);
35 
36     /**
37      * Called when a reply from the current drop target is received.
38      *
39      * @param action the drop action selected by the drop target
40      * @param x the x coordinate of the pointer location in screen coordinates
41      *        for the reply
42      * @param y the x coordinate of the pointer location in screen coordinates
43      *        for the reply
44      */
handleDragReply(int action, int x, int y)45     void handleDragReply(int action, int x, int y);
46 
47     /**
48      * Called when a reply from the current drop target is received.
49      *
50      * @param action the drop action selected by the drop target
51      * @param x the x coordinate of the pointer location in screen coordinates
52      *        for the reply
53      * @param y the x coordinate of the pointer location in screen coordinates
54      *        for the reply
55      * @param modifiers the keyboard modifiers state for the reply
56      */
handleDragReply(int action, int x, int y, int modifiers)57     void handleDragReply(int action, int x, int y, int modifiers);
58 
59     /**
60      * Called when the current drop target signals that the drag-and-drop
61      * operation is finished.
62      */
handleDragFinished()63     void handleDragFinished();
64 
65     /**
66      * Called when the current drop target signals that the drag-and-drop
67      * operation is finished.
68      *
69      * @param success true if the drop target successfully performed the drop
70      *                action
71      */
handleDragFinished(boolean success)72     void handleDragFinished(boolean success);
73 
74     /**
75      * Called when the current drop target signals that the drag-and-drop
76      * operation is finished.
77      *
78      * @param action the drop action performed by the drop target
79      * @param success true if the drop target successfully performed the drop
80      *                action
81      */
handleDragFinished(boolean success, int action)82     void handleDragFinished(boolean success, int action);
83 
84     /**
85      * Called when the current drop target signals that the drag-and-drop
86      * operation is finished.
87      *
88      * @param action the drop action performed by the drop target
89      * @param success true if the drop target successfully performed the drop
90      *                action
91      * @param x the x coordinate of the pointer location in screen coordinates
92      *          for the signal
93      * @param y the x coordinate of the pointer location in screen coordinates
94      *          for the signal
95      */
handleDragFinished(boolean success, int action, int x, int y)96     void handleDragFinished(boolean success, int action, int x, int y);
97 
98     /**
99      * Terminates the current drag-and-drop operation (if any) and performs
100      * the necessary cleanup.
101      * @param time the time stamp of the event that triggered drag termination
102      *             or XlibWrapper.CurrentTime
103      */
cleanup(long time)104     void cleanup(long time);
105 }
106