1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.TreeDragSourceIF;
26 
27 private import gobject.ObjectG;
28 private import gtk.SelectionData;
29 private import gtk.TreeModel;
30 private import gtk.TreeModelIF;
31 private import gtk.TreePath;
32 private import gtkc.gtk;
33 public  import gtkc.gtktypes;
34 
35 
36 /** */
37 public interface TreeDragSourceIF{
38 	/** Get the main Gtk struct */
39 	public GtkTreeDragSource* getTreeDragSourceStruct(bool transferOwnership = false);
40 
41 	/** the main Gtk struct as a void* */
42 	protected void* getStruct();
43 
44 
45 	/**
46 	 * Asks the #GtkTreeDragSource to delete the row at @path, because
47 	 * it was moved somewhere else via drag-and-drop. Returns %FALSE
48 	 * if the deletion fails because @path no longer exists, or for
49 	 * some model-specific reason. Should robustly handle a @path no
50 	 * longer found in the model!
51 	 *
52 	 * Params:
53 	 *     path = row that was being dragged
54 	 *
55 	 * Returns: %TRUE if the row was successfully deleted
56 	 */
57 	public bool dragDataDelete(TreePath path);
58 
59 	/**
60 	 * Asks the #GtkTreeDragSource to fill in @selection_data with a
61 	 * representation of the row at @path. @selection_data->target gives
62 	 * the required type of the data.  Should robustly handle a @path no
63 	 * longer found in the model!
64 	 *
65 	 * Params:
66 	 *     path = row that was dragged
67 	 *     selectionData = a #GtkSelectionData to fill with data
68 	 *         from the dragged row
69 	 *
70 	 * Returns: %TRUE if data of the required type was provided
71 	 */
72 	public bool dragDataGet(TreePath path, SelectionData selectionData);
73 
74 	/**
75 	 * Asks the #GtkTreeDragSource whether a particular row can be used as
76 	 * the source of a DND operation. If the source doesn’t implement
77 	 * this interface, the row is assumed draggable.
78 	 *
79 	 * Params:
80 	 *     path = row on which user is initiating a drag
81 	 *
82 	 * Returns: %TRUE if the row can be dragged
83 	 */
84 	public bool rowDraggable(TreePath path);
85 
86 	/**
87 	 * Obtains a @tree_model and @path from selection data of target type
88 	 * %GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.
89 	 * This function can only be used if @selection_data originates from the same
90 	 * process that’s calling this function, because a pointer to the tree model
91 	 * is being passed around. If you aren’t in the same process, then you'll
92 	 * get memory corruption. In the #GtkTreeDragDest drag_data_received handler,
93 	 * you can assume that selection data of type %GTK_TREE_MODEL_ROW is
94 	 * in from the current process. The returned path must be freed with
95 	 * gtk_tree_path_free().
96 	 *
97 	 * Params:
98 	 *     selectionData = a #GtkSelectionData
99 	 *     treeModel = a #GtkTreeModel
100 	 *     path = row in @tree_model
101 	 *
102 	 * Returns: %TRUE if @selection_data had target type %GTK_TREE_MODEL_ROW and
103 	 *     is otherwise valid
104 	 */
105 	public static bool getRowDragData(SelectionData selectionData, out TreeModelIF treeModel, out TreePath path);
106 
107 	/**
108 	 * Sets selection data of target type %GTK_TREE_MODEL_ROW. Normally used
109 	 * in a drag_data_get handler.
110 	 *
111 	 * Params:
112 	 *     selectionData = some #GtkSelectionData
113 	 *     treeModel = a #GtkTreeModel
114 	 *     path = a row in @tree_model
115 	 *
116 	 * Returns: %TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row
117 	 */
118 	public static bool setRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path);
119 }