Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treedragsource.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEDRAGSOURCE_H
4 #define _GTKMM_TREEDRAGSOURCE_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* Copyright (C) 1998-2002 The gtkmm Development Team
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 #include <glibmm/interface.h>
29 #include <gtkmm/treemodel.h>
30 #include <gtkmm/selectiondata.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 extern "C"
35 {
36 typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
37 typedef struct _GtkSelectionData GtkSelectionData;
38 }
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40
41
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 typedef struct _GtkTreeDragSource GtkTreeDragSource;
44 typedef struct _GtkTreeDragSourceClass GtkTreeDragSourceClass;
45 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
46
47
48 namespace Gtk
49 { class TreeDragSource_Class; } // namespace Gtk
50 namespace Gtk
51 {
52
53 /**
54  * @ingroup TreeView
55 */
56
57 class TreeDragSource : public Glib::Interface
58 {
59   
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61
62 public:
63   typedef TreeDragSource CppObjectType;
64   typedef TreeDragSource_Class CppClassType;
65   typedef GtkTreeDragSource BaseObjectType;
66   typedef GtkTreeDragSourceIface BaseClassType;
67
68 private:
69   friend class TreeDragSource_Class;
70   static CppClassType treedragsource_class_;
71
72   // noncopyable
73   TreeDragSource(const TreeDragSource&);
74   TreeDragSource& operator=(const TreeDragSource&);
75
76 protected:
77   TreeDragSource(); // you must derive from this class
78
79 public:
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);
84
85 protected:
86 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
87
88 public:
89   virtual ~TreeDragSource();
90
91   static void add_interface(GType gtype_implementer);
92
93 #ifndef DOXYGEN_SHOULD_SKIP_THIS
94   static GType get_type()      G_GNUC_CONST;
95   static GType get_base_type() G_GNUC_CONST;
96 #endif
97
98   ///Provides access to the underlying C GObject.
99   GtkTreeDragSource*       gobj()       { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
100
101   ///Provides access to the underlying C GObject.  
102   const GtkTreeDragSource* gobj() const { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
103
104 private:
105
106
107 public:
108   
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.
114    */
115   bool row_draggable(const TreeModel::Path& path) const;
116
117   
118   /** Asks the Gtk::TreeDragSource to fill in @a selection_data  with a
119    * representation of the row at @a path . @a selection_data -&gt;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.
125    */
126   bool drag_data_get(const TreeModel::Path& path, SelectionData& selection_data);
127                
128   
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.
136    */
137   bool drag_data_delete(const TreeModel::Path& path);
138
139 protected:
140
141
142   #ifdef GLIBMM_VFUNCS_ENABLED
143   virtual bool row_draggable_vfunc(const TreeModel::Path& path) const;
144 #endif //GLIBMM_VFUNCS_ENABLED
145
146
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
151    
152   #ifdef GLIBMM_VFUNCS_ENABLED
153   virtual bool drag_data_delete_vfunc(const TreeModel::Path& path);
154 #endif //GLIBMM_VFUNCS_ENABLED
155
156
157 public:
158
159 public:
160   //C++ methods used to invoke GTK+ virtual functions:
161 #ifdef GLIBMM_VFUNCS_ENABLED
162 #endif //GLIBMM_VFUNCS_ENABLED
163
164 protected:
165   //GTK+ Virtual Functions (override these to change behaviour):
166 #ifdef GLIBMM_VFUNCS_ENABLED
167 #endif //GLIBMM_VFUNCS_ENABLED
168
169   //Default Signal Handlers::
170 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
171 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
172
173
174 };
175
176 } // namespace Gtk
177
178
179 namespace Glib
180 {
181   /** A Glib::wrap() method for this object.
182    * 
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.
186    *
187    * @relates Gtk::TreeDragSource
188    */
189   Glib::RefPtr<Gtk::TreeDragSource> wrap(GtkTreeDragSource* object, bool take_copy = false);
190
191 } // namespace Glib
192
193
194 #endif /* _GTKMM_TREEDRAGSOURCE_H */
195