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 module gtk.TreeDragSourceIF; 26 27 private import gobject.ObjectG; 28 private import gtk.SelectionData; 29 private import gtk.TreeModel; 30 private import gtk.TreeModelIF; 31 private import gtk.TreePath; 32 private import gtkc.gtk; 33 public import gtkc.gtktypes; 34 35 36 public interface TreeDragSourceIF{ 37 /** Get the main Gtk struct */ 38 public GtkTreeDragSource* getTreeDragSourceStruct(); 39 40 /** the main Gtk struct as a void* */ 41 protected void* getStruct(); 42 43 /** 44 */ 45 46 /** 47 * Asks the #GtkTreeDragSource to delete the row at @path, because 48 * it was moved somewhere else via drag-and-drop. Returns %FALSE 49 * if the deletion fails because @path no longer exists, or for 50 * some model-specific reason. Should robustly handle a @path no 51 * longer found in the model! 52 * 53 * Params: 54 * path = row that was being dragged 55 * 56 * Return: %TRUE if the row was successfully deleted 57 */ 58 public bool dragDataDelete(TreePath path); 59 60 /** 61 * Asks the #GtkTreeDragSource to fill in @selection_data with a 62 * representation of the row at @path. @selection_data->target gives 63 * the required type of the data. Should robustly handle a @path no 64 * longer found in the model! 65 * 66 * Params: 67 * path = row that was dragged 68 * selectionData = a #GtkSelectionData to fill with data 69 * from the dragged row 70 * 71 * Return: %TRUE if data of the required type was provided 72 */ 73 public bool dragDataGet(TreePath path, SelectionData selectionData); 74 75 /** 76 * Asks the #GtkTreeDragSource whether a particular row can be used as 77 * the source of a DND operation. If the source doesn’t implement 78 * this interface, the row is assumed draggable. 79 * 80 * Params: 81 * path = row on which user is initiating a drag 82 * 83 * Return: %TRUE if the row can be dragged 84 */ 85 public bool rowDraggable(TreePath path); 86 87 /** 88 * Obtains a @tree_model and @path from selection data of target type 89 * %GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. 90 * This function can only be used if @selection_data originates from the same 91 * process that’s calling this function, because a pointer to the tree model 92 * is being passed around. If you aren’t in the same process, then you'll 93 * get memory corruption. In the #GtkTreeDragDest drag_data_received handler, 94 * you can assume that selection data of type %GTK_TREE_MODEL_ROW is 95 * in from the current process. The returned path must be freed with 96 * gtk_tree_path_free(). 97 * 98 * Params: 99 * selectionData = a #GtkSelectionData 100 * treeModel = a #GtkTreeModel 101 * path = row in @tree_model 102 * 103 * Return: %TRUE if @selection_data had target type %GTK_TREE_MODEL_ROW and 104 * is otherwise valid 105 */ 106 public static bool getRowDragData(SelectionData selectionData, out TreeModelIF treeModel, out TreePath path); 107 108 /** 109 * Sets selection data of target type %GTK_TREE_MODEL_ROW. Normally used 110 * in a drag_data_get handler. 111 * 112 * Params: 113 * selectionData = some #GtkSelectionData 114 * treeModel = a #GtkTreeModel 115 * path = a row in @tree_model 116 * 117 * Return: %TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row 118 */ 119 public static bool setRowDragData(SelectionData selectionData, TreeModelIF treeModel, TreePath path); 120 }