add new sigc++2 directory
[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
7 #include <glibmm.h>
8
9  /* $Id$ */
10
11 /* handlebox.h
12  * 
13  * Copyright (C) 1998-2002 The gtkmm Development Team
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License as published by the Free Software Foundation; either
18  * version 2 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Library General Public License for more details.
24  *
25  * You should have received a copy of the GNU Library General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 #include <gtkmm/eventbox.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkHandleBox GtkHandleBox;
35 typedef struct _GtkHandleBoxClass GtkHandleBoxClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class HandleBox_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** A widget for detachable window portions.
45  *
46  * The Gtk::HandleBox widget allows a portion of a window to be "torn off".
47  * 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.
48  * 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.
49  * 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.
50  * 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.
51  *
52  * @ingroup Widgets
53  * @ingroup Containers
54  */
55
56 class HandleBox : public Bin
57 {
58   public:
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60   typedef HandleBox CppObjectType;
61   typedef HandleBox_Class CppClassType;
62   typedef GtkHandleBox BaseObjectType;
63   typedef GtkHandleBoxClass BaseClassType;
64 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
65
66   virtual ~HandleBox();
67
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69
70 private:
71   friend class HandleBox_Class;
72   static CppClassType handlebox_class_;
73
74   // noncopyable
75   HandleBox(const HandleBox&);
76   HandleBox& operator=(const HandleBox&);
77
78 protected:
79   explicit HandleBox(const Glib::ConstructParams& construct_params);
80   explicit HandleBox(GtkHandleBox* castitem);
81
82 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
83
84 public:
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
86   static GType get_type()      G_GNUC_CONST;
87   static GType get_base_type() G_GNUC_CONST;
88 #endif
89
90   ///Provides access to the underlying C GtkObject.
91   GtkHandleBox*       gobj()       { return reinterpret_cast<GtkHandleBox*>(gobject_); }
92
93   ///Provides access to the underlying C GtkObject.
94   const GtkHandleBox* gobj() const { return reinterpret_cast<GtkHandleBox*>(gobject_); }
95
96
97 public:
98   //C++ methods used to invoke GTK+ virtual functions:
99 #ifdef GLIBMM_VFUNCS_ENABLED
100 #endif //GLIBMM_VFUNCS_ENABLED
101
102 protected:
103   //GTK+ Virtual Functions (override these to change behaviour):
104 #ifdef GLIBMM_VFUNCS_ENABLED
105 #endif //GLIBMM_VFUNCS_ENABLED
106
107   //Default Signal Handlers::
108 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
109   virtual void on_child_attached(Widget* child);
110   virtual void on_child_detached(Widget* child);
111 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
112
113
114 private:
115
116 public:
117   HandleBox();
118   
119
120   void set_shadow_type(ShadowType type);
121   
122   /** Gets the type of shadow drawn around the handle box. See
123    * set_shadow_type().
124    * @return The type of shadow currently drawn around the handle box.
125    */
126   ShadowType get_shadow_type() const;
127   
128   void set_handle_position(PositionType position);
129   
130   /** Gets the handle position of the handle box. See
131    * set_handle_position().
132    * @return The current handle position.
133    */
134   PositionType get_handle_position() const;
135   
136   void set_snap_edge(PositionType edge);
137   
138   /** Gets the edge used for determining reattachment of the handle box. See
139    * set_snap_edge().
140    * @return The edge used for determining reattachment, or (GtkPositionType)-1 if this
141    * is determined (as per default) from the handle position.
142    */
143   PositionType get_snap_edge() const;
144
145   
146   /**
147    * @par Prototype:
148    * <tt>void on_my_%child_attached(Widget* child)</tt>
149    */
150
151   Glib::SignalProxy1< void,Widget* > signal_child_attached();
152
153   
154   /**
155    * @par Prototype:
156    * <tt>void on_my_%child_detached(Widget* child)</tt>
157    */
158
159   Glib::SignalProxy1< void,Widget* > signal_child_detached();
160
161
162    Glib::RefPtr<Gdk::Window> get_bin_window();
163   Glib::RefPtr<const Gdk::Window> get_bin_window() const;
164     Glib::RefPtr<Gdk::Window> get_float_window();
165   Glib::RefPtr<const Gdk::Window> get_float_window() const;
166  
167   bool is_child_detached() const;
168   bool is_float_window_mapped() const;
169   bool is_in_drag() const;
170   bool shrinks_on_detach() const;
171
172   //_WRAP_PROPERTY("shadow", ShadowType); //deprecated.
173   #ifdef GLIBMM_PROPERTIES_ENABLED
174 /** Appearance of the shadow that surrounds the container.
175    *
176    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
177    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
178    * the value of the property changes.
179    */
180   Glib::PropertyProxy<ShadowType> property_shadow_type() ;
181 #endif //#GLIBMM_PROPERTIES_ENABLED
182
183 #ifdef GLIBMM_PROPERTIES_ENABLED
184 /** Appearance of the shadow that surrounds the container.
185    *
186    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
187    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
188    * the value of the property changes.
189    */
190   Glib::PropertyProxy_ReadOnly<ShadowType> property_shadow_type() const;
191 #endif //#GLIBMM_PROPERTIES_ENABLED
192
193   #ifdef GLIBMM_PROPERTIES_ENABLED
194 /** Position of the handle relative to the child widget.
195    *
196    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
197    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
198    * the value of the property changes.
199    */
200   Glib::PropertyProxy<PositionType> property_handle_position() ;
201 #endif //#GLIBMM_PROPERTIES_ENABLED
202
203 #ifdef GLIBMM_PROPERTIES_ENABLED
204 /** Position of the handle relative to the child widget.
205    *
206    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
207    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
208    * the value of the property changes.
209    */
210   Glib::PropertyProxy_ReadOnly<PositionType> property_handle_position() const;
211 #endif //#GLIBMM_PROPERTIES_ENABLED
212
213   #ifdef GLIBMM_PROPERTIES_ENABLED
214 /** Side of the handlebox that's lined up with the docking point to dock the handlebox.
215    *
216    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
217    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
218    * the value of the property changes.
219    */
220   Glib::PropertyProxy<PositionType> property_snap_edge() ;
221 #endif //#GLIBMM_PROPERTIES_ENABLED
222
223 #ifdef GLIBMM_PROPERTIES_ENABLED
224 /** Side of the handlebox that's lined up with the docking point to dock the handlebox.
225    *
226    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
227    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
228    * the value of the property changes.
229    */
230   Glib::PropertyProxy_ReadOnly<PositionType> property_snap_edge() const;
231 #endif //#GLIBMM_PROPERTIES_ENABLED
232
233
234 };
235
236 } /* namespace Gtk */
237
238
239 namespace Glib
240 {
241   /** A Glib::wrap() method for this object.
242    * 
243    * @param object The C instance.
244    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
245    * @result A C++ instance that wraps this C instance.
246    *
247    * @relates Gtk::HandleBox
248    */
249   Gtk::HandleBox* wrap(GtkHandleBox* object, bool take_copy = false);
250 } //namespace Glib
251
252
253 #endif /* _GTKMM_HANDLEBOX_H */
254