2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEDRAGSOURCE_H
4 #define _GTKMM_TREEDRAGSOURCE_H
10 /* Copyright (C) 1998-2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <glibmm/interface.h>
28 #include <gtkmm/treemodel.h>
29 #include <gtkmm/selectiondata.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
36 typedef struct _GtkSelectionData GtkSelectionData;
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 typedef struct _GtkTreeDragSource GtkTreeDragSource;
43 typedef struct _GtkTreeDragSourceClass GtkTreeDragSourceClass;
44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
48 { class TreeDragSource_Class; } // namespace Gtk
56 class TreeDragSource : public Glib::Interface
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62 typedef TreeDragSource CppObjectType;
63 typedef TreeDragSource_Class CppClassType;
64 typedef GtkTreeDragSource BaseObjectType;
65 typedef GtkTreeDragSourceIface BaseClassType;
68 friend class TreeDragSource_Class;
69 static CppClassType treedragsource_class_;
72 TreeDragSource(const TreeDragSource&);
73 TreeDragSource& operator=(const TreeDragSource&);
76 TreeDragSource(); // you must derive from this class
77 explicit TreeDragSource(GtkTreeDragSource* castitem);
79 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 virtual ~TreeDragSource();
84 static void add_interface(GType gtype_implementer);
86 #ifndef DOXYGEN_SHOULD_SKIP_THIS
87 static GType get_type() G_GNUC_CONST;
88 static GType get_base_type() G_GNUC_CONST;
91 ///Provides access to the underlying C GObject.
92 GtkTreeDragSource* gobj() { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
94 ///Provides access to the underlying C GObject.
95 const GtkTreeDragSource* gobj() const { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
102 /** Asks the Gtk::TreeDragSource whether a particular row can be used as
103 * the source of a DND operation. If the source doesn't implement
104 * this interface, the row is assumed draggable.
105 * @param path Row on which user is initiating a drag.
106 * @return <tt>true</tt> if the row can be dragged.
108 bool row_draggable(const TreeModel::Path& path) const;
111 /** Asks the Gtk::TreeDragSource to fill in @a selection_data with a
112 * representation of the row at @a path . @a selection_data ->target gives
113 * the required type of the data. Should robustly handle a @a path no
114 * longer found in the model!
115 * @param path Row that was dragged.
116 * @param selection_data A Gtk::SelectionData to fill with data from the dragged row.
117 * @return <tt>true</tt> if data of the required type was provided.
119 bool drag_data_get(const TreeModel::Path& path, SelectionData& selection_data);
122 /** Asks the Gtk::TreeDragSource to delete the row at @a path , because
123 * it was moved somewhere else via drag-and-drop. Returns <tt>false</tt>
124 * if the deletion fails because @a path no longer exists, or for
125 * some model-specific reason. Should robustly handle a @a path no
126 * longer found in the model!
127 * @param path Row that was being dragged.
128 * @return <tt>true</tt> if the row was successfully deleted.
130 bool drag_data_delete(const TreeModel::Path& path);
135 virtual bool row_draggable_vfunc(const TreeModel::Path& path) const;
137 //We hand-code this so that we can use a temporary instance for teh SelectionData& output parameter:
138 virtual bool drag_data_get_vfunc(const TreeModel::Path& path, SelectionData& selection_data) const;
140 virtual bool drag_data_delete_vfunc(const TreeModel::Path& path);
146 //C++ methods used to invoke GTK+ virtual functions:
149 //GTK+ Virtual Functions (override these to change behaviour):
151 //Default Signal Handlers::
161 /** @relates Gtk::TreeDragSource
162 * @param object The C instance
163 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
164 * @result A C++ instance that wraps this C instance.
166 Glib::RefPtr<Gtk::TreeDragSource> wrap(GtkTreeDragSource* object, bool take_copy = false);
170 #endif /* _GTKMM_TREEDRAGSOURCE_H */