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  * Conversion parameters:
26  * inFile  = gtk3-GtkTreeView-drag-and-drop.html
27  * outPack = gtk
28  * outFile = TreeDragSourceIF
29  * strct   = GtkTreeDragSource
30  * realStrct=
31  * ctorStrct=
32  * clss    = TreeDragSourceT
33  * interf  = TreeDragSourceIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_tree_drag_source_
41  * 	- gtk_tree_
42  * omit structs:
43  * omit prefixes:
44  * 	- gtk_tree_drag_dest_
45  * omit code:
46  * omit signals:
47  * imports:
48  * 	- gtk.SelectionData
49  * 	- gtk.TreeModelIF
50  * 	- gtk.TreeModel
51  * 	- gtk.TreePath
52  * structWrap:
53  * 	- GtkSelectionData* -> SelectionData
54  * 	- GtkTreeModel* -> TreeModelIF
55  * 	- GtkTreePath* -> TreePath
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60 
61 module gtk.TreeDragSourceIF;
62 
63 public  import gtkc.gtktypes;
64 
65 private import gtkc.gtk;
66 private import glib.ConstructionException;
67 private import gobject.ObjectG;
68 
69 private import gtk.SelectionData;
70 private import gtk.TreeModelIF;
71 private import gtk.TreeModel;
72 private import gtk.TreePath;
73 
74 
75 
76 /**
77  * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
78  * API.
79  *
80  * The low-level API consists of the GTK+ DND API, augmented by some treeview
81  * utility functions: gtk_tree_view_set_drag_dest_row(),
82  * gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(),
83  * gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and
84  * gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but
85  * nothing is done automatically, and implementing advanced features like
86  * hover-to-open-rows or autoscrolling on top of this API is a lot of work.
87  *
88  * On the other hand, if you write to the high-level API, then all the
89  * bookkeeping of rows is done for you, as well as things like hover-to-open
90  * and auto-scroll, but your models have to implement the
91  * GtkTreeDragSource and GtkTreeDragDest interfaces.
92  */
93 public interface TreeDragSourceIF
94 {
95 	
96 	
97 	/** Get the main Gtk struct */
98 	public GtkTreeDragSource* getTreeDragSourceTStruct();
99 	
100 	/** the main Gtk struct as a void* */
101 	protected void* getStruct();
102 	
103 	
104 	/**
105 	 */
106 	
107 	/**
108 	 * Asks the GtkTreeDragSource to delete the row at path, because
109 	 * it was moved somewhere else via drag-and-drop. Returns FALSE
110 	 * if the deletion fails because path no longer exists, or for
111 	 * some model-specific reason. Should robustly handle a path no
112 	 * longer found in the model!
113 	 * Params:
114 	 * path = row that was being dragged
115 	 * Returns: TRUE if the row was successfully deleted
116 	 */
117 	public int dragDataDelete(TreePath path);
118 	
119 	/**
120 	 * Asks the GtkTreeDragSource to fill in selection_data with a
121 	 * representation of the row at path. selection_data->target gives
122 	 * the required type of the data. Should robustly handle a path no
123 	 * longer found in the model!
124 	 * Params:
125 	 * path = row that was dragged
126 	 * selectionData = a GtkSelectionData to fill with data
127 	 * from the dragged row
128 	 * Returns: TRUE if data of the required type was provided
129 	 */
130 	public int dragDataGet(TreePath path, SelectionData selectionData);
131 	
132 	/**
133 	 * Asks the GtkTreeDragSource whether a particular row can be used as
134 	 * the source of a DND operation. If the source doesn't implement
135 	 * this interface, the row is assumed draggable.
136 	 * Params:
137 	 * path = row on which user is initiating a drag
138 	 * Returns: TRUE if the row can be dragged
139 	 */
140 	public int rowDraggable(TreePath path);
141 	
142 	/**
143 	 * Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used
144 	 * in a drag_data_get handler.
145 	 * Params:
146 	 * selectionData = some GtkSelectionData
147 	 * treeModel = a GtkTreeModel
148 	 * path = a row in tree_model
149 	 * Returns: TRUE if the GtkSelectionData had the proper target type to allow us to set a tree row
150 	 */
151 	public static int setRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path);
152 	
153 	/**
154 	 * Obtains a tree_model and path from selection data of target type
155 	 * GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.
156 	 * This function can only be used if selection_data originates from the same
157 	 * process that's calling this function, because a pointer to the tree model
158 	 * is being passed around. If you aren't in the same process, then you'll
159 	 * get memory corruption. In the GtkTreeDragDest drag_data_received handler,
160 	 * you can assume that selection data of type GTK_TREE_MODEL_ROW is
161 	 * in from the current process. The returned path must be freed with
162 	 * gtk_tree_path_free().
163 	 * Params:
164 	 * selectionData = a GtkSelectionData
165 	 * treeModel = a GtkTreeModel. [out]
166 	 * path = row in tree_model. [out]
167 	 * Returns: TRUE if selection_data had target type GTK_TREE_MODEL_ROW and is otherwise valid
168 	 */
169 	public static int getRowDragData(SelectionData selectionData, out TreeModelIF treeModel, out TreePath path);
170 }