Install ardour as a binary, a script and a set of shared
[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 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright (C) 1998-2002 The gtkmm Development Team
11  *
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.
16  *
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.
21  *
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.
25  */
26
27 #include <glibmm/interface.h>
28 #include <gtkmm/treemodel.h>
29 #include <gtkmm/selectiondata.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 extern "C"
34 {
35 typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
36 typedef struct _GtkSelectionData GtkSelectionData;
37 }
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39
40
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 typedef struct _GtkTreeDragSource GtkTreeDragSource;
43 typedef struct _GtkTreeDragSourceClass GtkTreeDragSourceClass;
44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
45
46
47 namespace Gtk
48 { class TreeDragSource_Class; } // namespace Gtk
49 namespace Gtk
50 {
51
52 /**
53  * @ingroup TreeView
54 */
55
56 class TreeDragSource : public Glib::Interface
57 {
58   
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60
61 public:
62   typedef TreeDragSource CppObjectType;
63   typedef TreeDragSource_Class CppClassType;
64   typedef GtkTreeDragSource BaseObjectType;
65   typedef GtkTreeDragSourceIface BaseClassType;
66
67 private:
68   friend class TreeDragSource_Class;
69   static CppClassType treedragsource_class_;
70
71   // noncopyable
72   TreeDragSource(const TreeDragSource&);
73   TreeDragSource& operator=(const TreeDragSource&);
74
75 protected:
76   TreeDragSource(); // you must derive from this class
77   explicit TreeDragSource(GtkTreeDragSource* castitem);
78
79 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
80
81 public:
82   virtual ~TreeDragSource();
83
84   static void add_interface(GType gtype_implementer);
85
86 #ifndef DOXYGEN_SHOULD_SKIP_THIS
87   static GType get_type()      G_GNUC_CONST;
88   static GType get_base_type() G_GNUC_CONST;
89 #endif
90
91   ///Provides access to the underlying C GObject.
92   GtkTreeDragSource*       gobj()       { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
93
94   ///Provides access to the underlying C GObject.  
95   const GtkTreeDragSource* gobj() const { return reinterpret_cast<GtkTreeDragSource*>(gobject_); }
96
97 private:
98
99
100 public:
101   
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.
107    */
108   bool row_draggable(const TreeModel::Path& path) const;
109
110   
111   /** Asks the Gtk::TreeDragSource to fill in @a selection_data  with a
112    * representation of the row at @a path . @a selection_data -&gt;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.
118    */
119   bool drag_data_get(const TreeModel::Path& path, SelectionData& selection_data);
120                
121   
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.
129    */
130   bool drag_data_delete(const TreeModel::Path& path);
131
132 protected:
133
134
135     virtual bool row_draggable_vfunc(const TreeModel::Path& path) const;
136
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;
139    
140     virtual bool drag_data_delete_vfunc(const TreeModel::Path& path);
141
142
143 public:
144
145 public:
146   //C++ methods used to invoke GTK+ virtual functions:
147
148 protected:
149   //GTK+ Virtual Functions (override these to change behaviour):
150
151   //Default Signal Handlers::
152
153
154 };
155
156 } // namespace Gtk
157
158
159 namespace Glib
160 {
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.
165    */
166   Glib::RefPtr<Gtk::TreeDragSource> wrap(GtkTreeDragSource* object, bool take_copy = false);
167
168 } // namespace Glib
169
170 #endif /* _GTKMM_TREEDRAGSOURCE_H */
171