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 
70 private import gtk.SelectionData;
71 private import gtk.TreeModelIF;
72 private import gtk.TreeModel;
73 private import gtk.TreePath;
74 
75 
76 
77 
78 /**
79  * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
80  * API.
81  *
82  * The low-level API consists of the GTK+ DND API, augmented by some treeview
83  * utility functions: gtk_tree_view_set_drag_dest_row(),
84  * gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(),
85  * gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and
86  * gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but
87  * nothing is done automatically, and implementing advanced features like
88  * hover-to-open-rows or autoscrolling on top of this API is a lot of work.
89  *
90  * On the other hand, if you write to the high-level API, then all the
91  * bookkeeping of rows is done for you, as well as things like hover-to-open
92  * and auto-scroll, but your models have to implement the
93  * GtkTreeDragSource and GtkTreeDragDest interfaces.
94  */
95 public interface TreeDragSourceIF
96 {
97 	
98 	
99 	public GtkTreeDragSource* getTreeDragSourceTStruct();
100 	
101 	/** the main Gtk struct as a void* */
102 	protected void* getStruct();
103 	
104 	
105 	/**
106 	 */
107 	
108 	/**
109 	 * Asks the GtkTreeDragSource to delete the row at path, because
110 	 * it was moved somewhere else via drag-and-drop. Returns FALSE
111 	 * if the deletion fails because path no longer exists, or for
112 	 * some model-specific reason. Should robustly handle a path no
113 	 * longer found in the model!
114 	 * Params:
115 	 * path = row that was being dragged
116 	 * Returns: TRUE if the row was successfully deleted
117 	 */
118 	public int dragDataDelete(TreePath path);
119 	
120 	/**
121 	 * Asks the GtkTreeDragSource to fill in selection_data with a
122 	 * representation of the row at path. selection_data->target gives
123 	 * the required type of the data. Should robustly handle a path no
124 	 * longer found in the model!
125 	 * Params:
126 	 * path = row that was dragged
127 	 * selectionData = a GtkSelectionData to fill with data
128 	 * from the dragged row
129 	 * Returns: TRUE if data of the required type was provided
130 	 */
131 	public int dragDataGet(TreePath path, SelectionData selectionData);
132 	
133 	/**
134 	 * Asks the GtkTreeDragSource whether a particular row can be used as
135 	 * the source of a DND operation. If the source doesn't implement
136 	 * this interface, the row is assumed draggable.
137 	 * Params:
138 	 * path = row on which user is initiating a drag
139 	 * Returns: TRUE if the row can be dragged
140 	 */
141 	public int rowDraggable(TreePath path);
142 	
143 	/**
144 	 * Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used
145 	 * in a drag_data_get handler.
146 	 * Params:
147 	 * selectionData = some GtkSelectionData
148 	 * treeModel = a GtkTreeModel
149 	 * path = a row in tree_model
150 	 * Returns: TRUE if the GtkSelectionData had the proper target type to allow us to set a tree row
151 	 */
152 	public static int setRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path);
153 	
154 	/**
155 	 * Obtains a tree_model and path from selection data of target type
156 	 * GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.
157 	 * This function can only be used if selection_data originates from the same
158 	 * process that's calling this function, because a pointer to the tree model
159 	 * is being passed around. If you aren't in the same process, then you'll
160 	 * get memory corruption. In the GtkTreeDragDest drag_data_received handler,
161 	 * you can assume that selection data of type GTK_TREE_MODEL_ROW is
162 	 * in from the current process. The returned path must be freed with
163 	 * gtk_tree_path_free().
164 	 * Params:
165 	 * selectionData = a GtkSelectionData
166 	 * treeModel = a GtkTreeModel. [out]
167 	 * path = row in tree_model. [out]
168 	 * Returns: TRUE if selection_data had target type GTK_TREE_MODEL_ROW and is otherwise valid
169 	 */
170 	public static int getRowDragData(SelectionData selectionData, out TreeModelIF treeModel, out TreePath path);
171 }