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  = 
27  * outPack = gtk
28  * outFile = TreeDragDestT
29  * strct   = GtkTreeDragDest
30  * realStrct=
31  * ctorStrct=
32  * clss    = TreeDragDestT
33  * interf  = TreeDragDestIF
34  * class Code: No
35  * interface Code: Yes
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gtk_tree_drag_dest_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gtk.SelectionData
48  * 	- gtk.TreeModelIF
49  * 	- gtk.TreePath
50  * structWrap:
51  * 	- GtkSelectionData* -> SelectionData
52  * 	- GtkTreePath* -> TreePath
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gtk.TreeDragDestT;
59 
60 public  import gtkc.gtktypes;
61 
62 public import gtkc.gtk;
63 public import glib.ConstructionException;
64 public import gobject.ObjectG;
65 
66 public import gtk.SelectionData;
67 public import gtk.TreeModelIF;
68 public import gtk.TreePath;
69 
70 
71 
72 /**
73  * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
74  * API.
75  *
76  * The low-level API consists of the GTK+ DND API, augmented by some treeview
77  * utility functions: gtk_tree_view_set_drag_dest_row(),
78  * gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(),
79  * gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and
80  * gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but
81  * nothing is done automatically, and implementing advanced features like
82  * hover-to-open-rows or autoscrolling on top of this API is a lot of work.
83  *
84  * On the other hand, if you write to the high-level API, then all the
85  * bookkeeping of rows is done for you, as well as things like hover-to-open
86  * and auto-scroll, but your models have to implement the
87  * GtkTreeDragSource and GtkTreeDragDest interfaces.
88  */
89 public template TreeDragDestT(TStruct)
90 {
91 	
92 	/** the main Gtk struct */
93 	protected GtkTreeDragDest* gtkTreeDragDest;
94 	
95 	
96 	/** Get the main Gtk struct */
97 	public GtkTreeDragDest* getTreeDragDestTStruct()
98 	{
99 		return cast(GtkTreeDragDest*)getStruct();
100 	}
101 	
102 	
103 	/**
104 	 */
105 	
106 	/**
107 	 * Asks the GtkTreeDragDest to insert a row before the path dest,
108 	 * deriving the contents of the row from selection_data. If dest is
109 	 * outside the tree so that inserting before it is impossible, FALSE
110 	 * will be returned. Also, FALSE may be returned if the new row is
111 	 * not created for some model-specific reason. Should robustly handle
112 	 * a dest no longer found in the model!
113 	 * Params:
114 	 * dest = row to drop in front of
115 	 * selectionData = data to drop
116 	 * Returns: whether a new row was created before position dest
117 	 */
118 	public int dragDataReceived(TreePath dest, SelectionData selectionData)
119 	{
120 		// gboolean gtk_tree_drag_dest_drag_data_received  (GtkTreeDragDest *drag_dest,  GtkTreePath *dest,  GtkSelectionData *selection_data);
121 		return gtk_tree_drag_dest_drag_data_received(getTreeDragDestTStruct(), (dest is null) ? null : dest.getTreePathStruct(), (selectionData is null) ? null : selectionData.getSelectionDataStruct());
122 	}
123 	
124 	/**
125 	 * Determines whether a drop is possible before the given dest_path,
126 	 * at the same depth as dest_path. i.e., can we drop the data in
127 	 * selection_data at that location. dest_path does not have to
128 	 * exist; the return value will almost certainly be FALSE if the
129 	 * parent of dest_path doesn't exist, though.
130 	 * Params:
131 	 * destPath = destination row
132 	 * selectionData = the data being dragged
133 	 * Returns: TRUE if a drop is possible before dest_path
134 	 */
135 	public int rowDropPossible(TreePath destPath, SelectionData selectionData)
136 	{
137 		// gboolean gtk_tree_drag_dest_row_drop_possible  (GtkTreeDragDest *drag_dest,  GtkTreePath *dest_path,  GtkSelectionData *selection_data);
138 		return gtk_tree_drag_dest_row_drop_possible(getTreeDragDestTStruct(), (destPath is null) ? null : destPath.getTreePathStruct(), (selectionData is null) ? null : selectionData.getSelectionDataStruct());
139 	}
140 }