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.TreeModelIF 48 * - gtk.TreePath 49 * structWrap: 50 * - GtkTreePath* -> TreePath 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gtk.TreeDragDestT; 57 58 public import gtkc.gtktypes; 59 60 public import gtkc.gtk; 61 public import glib.ConstructionException; 62 public import gobject.ObjectG; 63 64 65 public import gtk.TreeModelIF; 66 public import gtk.TreePath; 67 68 69 70 71 /** 72 * Description 73 * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level 74 * API. 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 * On the other hand, if you write to the high-level API, then all the 83 * bookkeeping of rows is done for you, as well as things like hover-to-open 84 * and auto-scroll, but your models have to implement the 85 * GtkTreeDragSource and GtkTreeDragDest interfaces. 86 */ 87 public template TreeDragDestT(TStruct) 88 { 89 90 /** the main Gtk struct */ 91 protected GtkTreeDragDest* gtkTreeDragDest; 92 93 94 public GtkTreeDragDest* getTreeDragDestTStruct() 95 { 96 return cast(GtkTreeDragDest*)getStruct(); 97 } 98 99 100 /** 101 */ 102 103 /** 104 * Asks the GtkTreeDragDest to insert a row before the path dest, 105 * deriving the contents of the row from selection_data. If dest is 106 * outside the tree so that inserting before it is impossible, FALSE 107 * will be returned. Also, FALSE may be returned if the new row is 108 * not created for some model-specific reason. Should robustly handle 109 * a dest no longer found in the model! 110 * Params: 111 * dest = row to drop in front of 112 * selectionData = data to drop 113 * Returns: whether a new row was created before position dest 114 */ 115 public int dragDataReceived(TreePath dest, GtkSelectionData* selectionData) 116 { 117 // gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest, GtkTreePath *dest, GtkSelectionData *selection_data); 118 return gtk_tree_drag_dest_drag_data_received(getTreeDragDestTStruct(), (dest is null) ? null : dest.getTreePathStruct(), selectionData); 119 } 120 121 /** 122 * Determines whether a drop is possible before the given dest_path, 123 * at the same depth as dest_path. i.e., can we drop the data in 124 * selection_data at that location. dest_path does not have to 125 * exist; the return value will almost certainly be FALSE if the 126 * parent of dest_path doesn't exist, though. 127 * Params: 128 * destPath = destination row 129 * selectionData = the data being dragged 130 * Returns: TRUE if a drop is possible before dest_path 131 */ 132 public int rowDropPossible(TreePath destPath, GtkSelectionData* selectionData) 133 { 134 // gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest, GtkTreePath *dest_path, GtkSelectionData *selection_data); 135 return gtk_tree_drag_dest_row_drop_possible(getTreeDragDestTStruct(), (destPath is null) ? null : destPath.getTreePathStruct(), selectionData); 136 } 137 }