2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEDRAGSOURCE_H
4 #define _GTKMM_TREEDRAGSOURCE_H
11 /* Copyright (C) 1998-2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <glibmm/interface.h>
29 #include <gtkmm/treemodel.h>
30 #include <gtkmm/selectiondata.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
37 typedef struct _GtkSelectionData GtkSelectionData;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 typedef struct _GtkTreeDragSource GtkTreeDragSource;
44 typedef struct _GtkTreeDragSourceClass GtkTreeDragSourceClass;
45 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
49 { class TreeDragSource_Class; } // namespace Gtk
57 class TreeDragSource : public Glib::Interface
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 typedef TreeDragSource CppObjectType;
64 typedef TreeDragSource_Class CppClassType;
65 typedef GtkTreeDragSource BaseObjectType;
66 typedef GtkTreeDragSourceIface BaseClassType;
69 friend class TreeDragSource_Class;
70 static CppClassType treedragsource_class_;
73 TreeDragSource(const TreeDragSource&);
74 TreeDragSource& operator=(const TreeDragSource&);
77 TreeDragSource(); // you must derive from this class
80 // This is public so that C++ wrapper instances can be
81 // created for C instances of unwrapped types.
82 // For instance, if an unexpected C type implements the C interface.
83 explicit TreeDragSource(GtkTreeDragSource* castitem);
86 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
89 virtual ~TreeDragSource();
91 static void add_interface(GType gtype_implementer);
93 #ifndef DOXYGEN_SHOULD_SKIP_THIS
94 static GType get_type() G_GNUC_CONST;
95 static GType get_base_type() G_GNUC_CONST;
98 ///Provides access to the underlying C GObject.
99 GtkTreeDragSource* gobj() { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
101 ///Provides access to the underlying C GObject.
102 const GtkTreeDragSource* gobj() const { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
109 /** Asks the Gtk::TreeDragSource whether a particular row can be used as
110 * the source of a DND operation. If the source doesn't implement
111 * this interface, the row is assumed draggable.
112 * @param path Row on which user is initiating a drag.
113 * @return <tt>true</tt> if the row can be dragged.
115 bool row_draggable(const TreeModel::Path& path) const;
118 /** Asks the Gtk::TreeDragSource to fill in @a selection_data with a
119 * representation of the row at @a path . @a selection_data ->target gives
120 * the required type of the data. Should robustly handle a @a path no
121 * longer found in the model!
122 * @param path Row that was dragged.
123 * @param selection_data A Gtk::SelectionData to fill with data from the dragged row.
124 * @return <tt>true</tt> if data of the required type was provided.
126 bool drag_data_get(const TreeModel::Path& path, SelectionData& selection_data);
129 /** Asks the Gtk::TreeDragSource to delete the row at @a path , because
130 * it was moved somewhere else via drag-and-drop. Returns <tt>false</tt>
131 * if the deletion fails because @a path no longer exists, or for
132 * some model-specific reason. Should robustly handle a @a path no
133 * longer found in the model!
134 * @param path Row that was being dragged.
135 * @return <tt>true</tt> if the row was successfully deleted.
137 bool drag_data_delete(const TreeModel::Path& path);
142 #ifdef GLIBMM_VFUNCS_ENABLED
143 virtual bool row_draggable_vfunc(const TreeModel::Path& path) const;
144 #endif //GLIBMM_VFUNCS_ENABLED
147 //We hand-code this so that we can use a temporary instance for the SelectionData& output parameter:
148 #ifdef GLIBMM_VFUNCS_ENABLED
149 virtual bool drag_data_get_vfunc(const TreeModel::Path& path, SelectionData& selection_data) const;
150 #endif //GLIBMM_VFUNCS_ENABLED
152 #ifdef GLIBMM_VFUNCS_ENABLED
153 virtual bool drag_data_delete_vfunc(const TreeModel::Path& path);
154 #endif //GLIBMM_VFUNCS_ENABLED
160 //C++ methods used to invoke GTK+ virtual functions:
161 #ifdef GLIBMM_VFUNCS_ENABLED
162 #endif //GLIBMM_VFUNCS_ENABLED
165 //GTK+ Virtual Functions (override these to change behaviour):
166 #ifdef GLIBMM_VFUNCS_ENABLED
167 #endif //GLIBMM_VFUNCS_ENABLED
169 //Default Signal Handlers::
170 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
171 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
181 /** A Glib::wrap() method for this object.
183 * @param object The C instance.
184 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
185 * @result A C++ instance that wraps this C instance.
187 * @relates Gtk::TreeDragSource
189 Glib::RefPtr<Gtk::TreeDragSource> wrap(GtkTreeDragSource* object, bool take_copy = false);
194 #endif /* _GTKMM_TREEDRAGSOURCE_H */