Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / handlebox.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_HANDLEBOX_H
4 #define _GTKMM_HANDLEBOX_H
5
6 #include <glibmm.h>
7
8  /* $Id$ */
9
10 /* handlebox.h
11  * 
12  * Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28
29 #include <gtkmm/eventbox.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkHandleBox GtkHandleBox;
34 typedef struct _GtkHandleBoxClass GtkHandleBoxClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class HandleBox_Class; } // namespace Gtk
40 namespace Gtk
41 {
42
43 /** A widget for detachable window portions.
44  *
45  * The Gtk::HandleBox widget allows a portion of a window to be "torn off".
46  * It displays its child and a handle that the user can drag to tear off a separate window (the float window) containing the child widget. A thin ghost is drawn in the original location of the handlebox. By dragging the separate window back to its original location, it can be reattached.
47  * When reattaching, the ghost and float window must be aligned along one of the edges, the snap edge. This can be specified by the application programmer explicitely, or GTK+ will pick a reasonable default based on the handle position.
48  * To make detaching and reattaching the handlebox as minimally confusing as possible to the user, it is important to set the snap edge so that the snap edge does not move when the handlebox is deattached.
49  * For instance, if the handlebox is packed at the bottom of a VBox, then when the handlebox is detached, the bottom edge of the handlebox's allocation will remain fixed as the height of the handlebox shrinks, so the snap edge should be set to GTK_POS_BOTTOM.
50  *
51  * @ingroup Widgets
52  * @ingroup Containers
53  */
54
55 class HandleBox : public Bin
56 {
57   public:
58 #ifndef DOXYGEN_SHOULD_SKIP_THIS
59   typedef HandleBox CppObjectType;
60   typedef HandleBox_Class CppClassType;
61   typedef GtkHandleBox BaseObjectType;
62   typedef GtkHandleBoxClass BaseClassType;
63 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
64
65   virtual ~HandleBox();
66
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68
69 private:
70   friend class HandleBox_Class;
71   static CppClassType handlebox_class_;
72
73   // noncopyable
74   HandleBox(const HandleBox&);
75   HandleBox& operator=(const HandleBox&);
76
77 protected:
78   explicit HandleBox(const Glib::ConstructParams& construct_params);
79   explicit HandleBox(GtkHandleBox* castitem);
80
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82
83 public:
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85   static GType get_type()      G_GNUC_CONST;
86   static GType get_base_type() G_GNUC_CONST;
87 #endif
88
89   ///Provides access to the underlying C GtkObject.
90   GtkHandleBox*       gobj()       { return reinterpret_cast<GtkHandleBox*>(gobject_); }
91
92   ///Provides access to the underlying C GtkObject.
93   const GtkHandleBox* gobj() const { return reinterpret_cast<GtkHandleBox*>(gobject_); }
94
95
96 public:
97   //C++ methods used to invoke GTK+ virtual functions:
98
99 protected:
100   //GTK+ Virtual Functions (override these to change behaviour):
101
102   //Default Signal Handlers::
103   virtual void on_child_attached(Widget* child);
104   virtual void on_child_detached(Widget* child);
105
106
107 private:
108
109 public:
110   HandleBox();
111   
112
113   void set_shadow_type(ShadowType type);
114   
115   /** Gets the type of shadow drawn around the handle box. See
116    * set_shadow_type().
117    * @return The type of shadow currently drawn around the handle box.
118    */
119   ShadowType get_shadow_type() const;
120   
121   void set_handle_position(PositionType position);
122   
123   /** Gets the handle position of the handle box. See
124    * set_handle_position().
125    * @return The current handle position.
126    */
127   PositionType get_handle_position() const;
128   
129   void set_snap_edge(PositionType edge);
130   
131   /** Gets the edge used for determining reattachment of the handle box. See
132    * set_snap_edge().
133    * @return The edge used for determining reattachment, or (GtkPositionType)-1 if this
134    * is determined (as per default) from the handle position.
135    */
136   PositionType get_snap_edge() const;
137
138   
139   Glib::SignalProxy1< void,Widget* > signal_child_attached();
140
141   
142   Glib::SignalProxy1< void,Widget* > signal_child_detached();
143
144
145   Glib::RefPtr<Gdk::Window> get_bin_window();
146   Glib::RefPtr<const Gdk::Window> get_bin_window() const;
147   Glib::RefPtr<Gdk::Window> get_float_window();
148   Glib::RefPtr<const Gdk::Window> get_float_window() const;
149
150   bool is_child_detached() const;
151   bool is_float_window_mapped() const;
152   bool is_in_drag() const;
153   bool shrinks_on_detach() const;
154
155   //_WRAP_PROPERTY("shadow", ShadowType); //deprecated.
156   /** Appearance of the shadow that surrounds the container.
157    *
158    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
159    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
160    * the value of the property changes.
161    */
162   Glib::PropertyProxy<ShadowType> property_shadow_type() ;
163
164 /** Appearance of the shadow that surrounds the container.
165    *
166    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
167    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
168    * the value of the property changes.
169    */
170   Glib::PropertyProxy_ReadOnly<ShadowType> property_shadow_type() const;
171
172   /** Position of the handle relative to the child widget.
173    *
174    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
175    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
176    * the value of the property changes.
177    */
178   Glib::PropertyProxy<PositionType> property_handle_position() ;
179
180 /** Position of the handle relative to the child widget.
181    *
182    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
183    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
184    * the value of the property changes.
185    */
186   Glib::PropertyProxy_ReadOnly<PositionType> property_handle_position() const;
187
188   /** Side of the handlebox that's lined up with the docking point to dock the handlebox.
189    *
190    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
191    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
192    * the value of the property changes.
193    */
194   Glib::PropertyProxy<PositionType> property_snap_edge() ;
195
196 /** Side of the handlebox that's lined up with the docking point to dock the handlebox.
197    *
198    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
199    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
200    * the value of the property changes.
201    */
202   Glib::PropertyProxy_ReadOnly<PositionType> property_snap_edge() const;
203
204
205 };
206
207 } /* namespace Gtk */
208
209
210 namespace Glib
211 {
212   /** @relates Gtk::HandleBox
213    * @param object The C instance
214    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
215    * @result A C++ instance that wraps this C instance.
216    */
217   Gtk::HandleBox* wrap(GtkHandleBox* object, bool take_copy = false);
218 }
219 #endif /* _GTKMM_HANDLEBOX_H */
220