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