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 
67 public import gtk.SelectionData;
68 public import gtk.TreeModelIF;
69 public import gtk.TreePath;
70 
71 
72 
73 
74 /**
75  * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
76  * API.
77  *
78  * The low-level API consists of the GTK+ DND API, augmented by some treeview
79  * utility functions: gtk_tree_view_set_drag_dest_row(),
80  * gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(),
81  * gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and
82  * gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but
83  * nothing is done automatically, and implementing advanced features like
84  * hover-to-open-rows or autoscrolling on top of this API is a lot of work.
85  *
86  * On the other hand, if you write to the high-level API, then all the
87  * bookkeeping of rows is done for you, as well as things like hover-to-open
88  * and auto-scroll, but your models have to implement the
89  * GtkTreeDragSource and GtkTreeDragDest interfaces.
90  */
91 public template TreeDragDestT(TStruct)
92 {
93 	
94 	/** the main Gtk struct */
95 	protected GtkTreeDragDest* gtkTreeDragDest;
96 	
97 	
98 	public GtkTreeDragDest* getTreeDragDestTStruct()
99 	{
100 		return cast(GtkTreeDragDest*)getStruct();
101 	}
102 	
103 	
104 	/**
105 	 */
106 	
107 	/**
108 	 * Asks the GtkTreeDragDest to insert a row before the path dest,
109 	 * deriving the contents of the row from selection_data. If dest is
110 	 * outside the tree so that inserting before it is impossible, FALSE
111 	 * will be returned. Also, FALSE may be returned if the new row is
112 	 * not created for some model-specific reason. Should robustly handle
113 	 * a dest no longer found in the model!
114 	 * Params:
115 	 * dest = row to drop in front of
116 	 * selectionData = data to drop
117 	 * Returns: whether a new row was created before position dest
118 	 */
119 	public int dragDataReceived(TreePath dest, SelectionData selectionData)
120 	{
121 		// gboolean gtk_tree_drag_dest_drag_data_received  (GtkTreeDragDest *drag_dest,  GtkTreePath *dest,  GtkSelectionData *selection_data);
122 		return gtk_tree_drag_dest_drag_data_received(getTreeDragDestTStruct(), (dest is null) ? null : dest.getTreePathStruct(), (selectionData is null) ? null : selectionData.getSelectionDataStruct());
123 	}
124 	
125 	/**
126 	 * Determines whether a drop is possible before the given dest_path,
127 	 * at the same depth as dest_path. i.e., can we drop the data in
128 	 * selection_data at that location. dest_path does not have to
129 	 * exist; the return value will almost certainly be FALSE if the
130 	 * parent of dest_path doesn't exist, though.
131 	 * Params:
132 	 * destPath = destination row
133 	 * selectionData = the data being dragged
134 	 * Returns: TRUE if a drop is possible before dest_path
135 	 */
136 	public int rowDropPossible(TreePath destPath, SelectionData selectionData)
137 	{
138 		// gboolean gtk_tree_drag_dest_row_drop_possible  (GtkTreeDragDest *drag_dest,  GtkTreePath *dest_path,  GtkSelectionData *selection_data);
139 		return gtk_tree_drag_dest_row_drop_possible(getTreeDragDestTStruct(), (destPath is null) ? null : destPath.getTreePathStruct(), (selectionData is null) ? null : selectionData.getSelectionDataStruct());
140 	}
141 }