Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::TreeDragDest Class Reference

A GtkTreeDragDest C++ wrapper class. More...

`#include <xfc/gtk/treednd.hh>`

Inheritance diagram for Xfc::Gtk::TreeDragDest:

List of all members.

## Public Member Functions

Accessors

- GtkTreeDragDest * gtk_tree_drag_dest () const
    Get a pointer to the GtkTreeDragDest structure.
- operator GtkTreeDragDest * () const
    Conversion operator; safely converts a TreeDragDest to a GtkTreeDragDest pointer.
- bool row_drop_possible (const TreePath &dest_path, const SelectionData &selection_data) const
    Determines whether a drop is possible before the given dest_path, at the same depth as dest_path, that is, can we drop the data in selection_data at that location.

Methods

- bool drag_data_received (const TreePath &dest, const SelectionData &selection_data)
    Asks the TreeDragDest to insert a row before the path dest, deriving the contents of the row from selection_data.

## Protected Member Functions

Constructors

- TreeDragDest ()
    Constructs a new TreeDragDest object.
- virtual ~TreeDragDest ()=0
    Destructor.

## Detailed Description

A GtkTreeDragDest C++ wrapper class.

GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level API.

The low-level API consists of the GTK+ DND API, augmented by some treeview utility functions: Gtk::TreeView::set_drag_dest_row(), Gtk::TreeView::get_drag_dest_row(), Gtk::TreeView::get_dest_row_at_pos() and Gtk::TreeView::create_row_drag_icon(). This API leaves a lot of flexibility, but nothing is done automatically, and implementing advanced features like hover-to-open-rows or autoscrolling on top of this API is a lot of work.

On the other hand, if you write to the high-level TreeDragSource and TreeDragDest API, then all the bookkeeping of rows is done for you, as well as things like hover-to-open and auto-scroll. The TreeDragSource interface is implemented by Gtk::TreeModelSort, Gtk::TreeStore, Gtk::ListStore and Gtk::TreeModelFilter. The TreeDragDest interface is implemented by Gtk::TreeStore and Gtk::ListStore.

## Member Function Documentation

bool Xfc::Gtk::TreeDragDest::drag_data_received | ( | const TreePath & | dest,
|  | const SelectionData & | selection_data
| ) |

  | Asks the TreeDragDest to insert a row before the path dest, deriving the contents of the row from selection_data. Parameters:
  | dest | The row to drop in front of.
  | selection_data | The data to drop.
Returns: Whether a new row was created before position dest. If dest is outside the tree so that inserting before it is impossible, false will be returned. Also, false may be returned if the new row is not created for some model-specific reason. Should robustly handle a dest no longer found in the model!

bool Xfc::Gtk::TreeDragDest::row_drop_possible | ( | const TreePath & | dest_path,
|  | const SelectionData & | selection_data
| ) | const

  | Determines whether a drop is possible before the given dest_path, at the same depth as dest_path, that is, can we drop the data in selection_data at that location. Parameters:
  | dest_path | The destination row.
  | selection_data | The data being dragged.
Returns: true if a drop is possible before dest_path. Note, dest_path doesn't have to exist but the return value will almost certainly be false if the parent of dest_path doesn't exist, though.

The documentation for this class was generated from the following file:

- treednd.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3