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 = TreeDragDestIF
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  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_tree_drag_dest_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gtk.SelectionData
47  * 	- gtk.TreeModelIF
48  * 	- gtk.TreePath
49  * structWrap:
50  * 	- GtkSelectionData* -> SelectionData
51  * 	- GtkTreePath* -> TreePath
52  * module aliases:
53  * local aliases:
54  * overrides:
55  */
56 
57 module gtk.TreeDragDestIF;
58 
59 public  import gtkc.gtktypes;
60 
61 private import gtkc.gtk;
62 private import glib.ConstructionException;
63 private import gobject.ObjectG;
64 
65 private import gtk.SelectionData;
66 private import gtk.TreeModelIF;
67 private import gtk.TreePath;
68 
69 
70 
71 /**
72  * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
73  * API.
74  *
75  * The low-level API consists of the GTK+ DND API, augmented by some treeview
76  * utility functions: gtk_tree_view_set_drag_dest_row(),
77  * gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(),
78  * gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and
79  * gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but
80  * nothing is done automatically, and implementing advanced features like
81  * hover-to-open-rows or autoscrolling on top of this API is a lot of work.
82  *
83  * On the other hand, if you write to the high-level API, then all the
84  * bookkeeping of rows is done for you, as well as things like hover-to-open
85  * and auto-scroll, but your models have to implement the
86  * GtkTreeDragSource and GtkTreeDragDest interfaces.
87  */
88 public interface TreeDragDestIF
89 {
90 	
91 	
92 	/** Get the main Gtk struct */
93 	public GtkTreeDragDest* getTreeDragDestTStruct();
94 	
95 	/** the main Gtk struct as a void* */
96 	protected void* getStruct();
97 	
98 	
99 	/**
100 	 * Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used
101 	 * in a drag_data_get handler.
102 	 * Params:
103 	 * selectionData =  some GtkSelectionData
104 	 * treeModel =  a GtkTreeModel
105 	 * path =  a row in tree_model
106 	 * Returns: TRUE if the GtkSelectionData had the proper target type to allow us to set a tree row
107 	 */
108 	public static int setRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path);
109 	
110 	/**
111 	 * Obtains a tree_model and path from selection data of target type
112 	 * GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.
113 	 * This function can only be used if selection_data originates from the same
114 	 * process that's calling this function, because a pointer to the tree model
115 	 * is being passed around. If you aren't in the same process, then you'll
116 	 * get memory corruption. In the GtkTreeDragDest drag_data_received handler,
117 	 * you can assume that selection data of type GTK_TREE_MODEL_ROW is
118 	 * in from the current process. The returned path must be freed with
119 	 * gtk_tree_path_free().
120 	 * Params:
121 	 * selectionData =  a GtkSelectionData
122 	 * treeModel =  a GtkTreeModel
123 	 * path =  row in tree_model
124 	 * Returns: TRUE if selection_data had target type GTK_TREE_MODEL_ROW and is otherwise valid
125 	 */
126 	public static int getRowDragData(SelectionData selectionData, out TreeModelIF treeModel, out TreePath path);
127 	
128 	/**
129 	 */
130 	
131 	/**
132 	 * Asks the GtkTreeDragDest to insert a row before the path dest,
133 	 * deriving the contents of the row from selection_data. If dest is
134 	 * outside the tree so that inserting before it is impossible, FALSE
135 	 * will be returned. Also, FALSE may be returned if the new row is
136 	 * not created for some model-specific reason. Should robustly handle
137 	 * a dest no longer found in the model!
138 	 * Params:
139 	 * dest = row to drop in front of
140 	 * selectionData = data to drop
141 	 * Returns: whether a new row was created before position dest
142 	 */
143 	public int dragDataReceived(TreePath dest, SelectionData selectionData);
144 	
145 	/**
146 	 * Determines whether a drop is possible before the given dest_path,
147 	 * at the same depth as dest_path. i.e., can we drop the data in
148 	 * selection_data at that location. dest_path does not have to
149 	 * exist; the return value will almost certainly be FALSE if the
150 	 * parent of dest_path doesn't exist, though.
151 	 * Params:
152 	 * destPath = destination row
153 	 * selectionData = the data being dragged
154 	 * Returns: TRUE if a drop is possible before dest_path
155 	 */
156 	public int rowDropPossible(TreePath destPath, SelectionData selectionData);
157 }