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.TreeDragSourceT;
26 
27 public  import gobject.ObjectG;
28 public  import gtk.SelectionData;
29 public  import gtk.TreeModelIF;
30 public  import gtk.TreePath;
31 public  import gtk.c.functions;
32 public  import gtk.c.types;
33 public  import gtkc.gtktypes;
34 
35 
36 /** */
37 public template TreeDragSourceT(TStruct)
38 {
39 	/** Get the main Gtk struct */
40 	public GtkTreeDragSource* getTreeDragSourceStruct(bool transferOwnership = false)
41 	{
42 		if (transferOwnership)
43 			ownedRef = false;
44 		return cast(GtkTreeDragSource*)getStruct();
45 	}
46 
47 
48 	/**
49 	 * Asks the #GtkTreeDragSource to delete the row at @path, because
50 	 * it was moved somewhere else via drag-and-drop. Returns %FALSE
51 	 * if the deletion fails because @path no longer exists, or for
52 	 * some model-specific reason. Should robustly handle a @path no
53 	 * longer found in the model!
54 	 *
55 	 * Params:
56 	 *     path = row that was being dragged
57 	 *
58 	 * Returns: %TRUE if the row was successfully deleted
59 	 */
60 	public bool dragDataDelete(TreePath path)
61 	{
62 		return gtk_tree_drag_source_drag_data_delete(getTreeDragSourceStruct(), (path is null) ? null : path.getTreePathStruct()) != 0;
63 	}
64 
65 	/**
66 	 * Asks the #GtkTreeDragSource to fill in @selection_data with a
67 	 * representation of the row at @path. @selection_data->target gives
68 	 * the required type of the data.  Should robustly handle a @path no
69 	 * longer found in the model!
70 	 *
71 	 * Params:
72 	 *     path = row that was dragged
73 	 *     selectionData = a #GtkSelectionData to fill with data
74 	 *         from the dragged row
75 	 *
76 	 * Returns: %TRUE if data of the required type was provided
77 	 */
78 	public bool dragDataGet(TreePath path, SelectionData selectionData)
79 	{
80 		return gtk_tree_drag_source_drag_data_get(getTreeDragSourceStruct(), (path is null) ? null : path.getTreePathStruct(), (selectionData is null) ? null : selectionData.getSelectionDataStruct()) != 0;
81 	}
82 
83 	/**
84 	 * Asks the #GtkTreeDragSource whether a particular row can be used as
85 	 * the source of a DND operation. If the source doesn’t implement
86 	 * this interface, the row is assumed draggable.
87 	 *
88 	 * Params:
89 	 *     path = row on which user is initiating a drag
90 	 *
91 	 * Returns: %TRUE if the row can be dragged
92 	 */
93 	public bool rowDraggable(TreePath path)
94 	{
95 		return gtk_tree_drag_source_row_draggable(getTreeDragSourceStruct(), (path is null) ? null : path.getTreePathStruct()) != 0;
96 	}
97 }