rollback to 3428, before the mysterious removal of libs/* at 3431/3432
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / frame.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FRAME_H
4 #define _GTKMM_FRAME_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* frame.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
31 #include <gtkmm/bin.h>
32
33
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkFrame GtkFrame;
36 typedef struct _GtkFrameClass GtkFrameClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38
39
40 namespace Gtk
41 { class Frame_Class; } // namespace Gtk
42 namespace Gtk
43 {
44
45 /** A Gtk::Bin with a decorative frame and optional label.
46  *
47  * The Frame widget surrounds its single child with a decorative frame and
48  * an optional label.  If present, the label is drawn in a gap in the top
49  * side of the frame. The position of the label can be controlled with
50  * set_label_align().
51  *
52  * @ingroup Widgets
53  * @ingroup Containers
54  */
55
56 class Frame : public Bin
57 {
58   public:
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60   typedef Frame CppObjectType;
61   typedef Frame_Class CppClassType;
62   typedef GtkFrame BaseObjectType;
63   typedef GtkFrameClass BaseClassType;
64 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
65
66   virtual ~Frame();
67
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69
70 private:
71   friend class Frame_Class;
72   static CppClassType frame_class_;
73
74   // noncopyable
75   Frame(const Frame&);
76   Frame& operator=(const Frame&);
77
78 protected:
79   explicit Frame(const Glib::ConstructParams& construct_params);
80   explicit Frame(GtkFrame* 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   GtkFrame*       gobj()       { return reinterpret_cast<GtkFrame*>(gobject_); }
92
93   ///Provides access to the underlying C GtkObject.
94   const GtkFrame* gobj() const { return reinterpret_cast<GtkFrame*>(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 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
110
111
112 private:
113
114 public:
115
116   Frame();
117   explicit Frame(const Glib::ustring& label);
118
119   //TODO: Add a bool use_markup arg to set_label() as a convenience - it would have to use set_label_widget().
120     
121   /** Set the label to appear in the top edge of the frame.
122    * Label alignment defaults to the upper left corner of the frame.
123    */
124   
125   /** Sets the text of the label. If @a label  is <tt>0</tt>,
126    * the current label is removed.
127    * @param label The text to use as the label of the frame.
128    */
129   void set_label(const Glib::ustring& label);
130   void unset_label();
131   
132   /** If the frame's label widget is a Gtk::Label, returns the
133    * text in the label widget. (The frame will have a Gtk::Label
134    * for the label widget if a non-<tt>0</tt> argument was passed
135    * to new().)
136    * @return The text in the label, or <tt>0</tt> if there
137    * was no label widget or the lable widget was not
138    * a Gtk::Label. This string is owned by GTK+ and
139    * must not be modified or freed.
140    */
141   Glib::ustring get_label() const;
142
143   
144   /** Sets the label widget for the frame. This is the widget that
145    * will appear embedded in the top edge of the frame as a
146    * title.
147    * @param label_widget The new label widget.
148    */
149   void set_label_widget(Widget& label_widget);
150   
151   /** Retrieves the label widget for the frame. See
152    * set_label_widget().
153    * @return The label widget, or <tt>0</tt> if there is none.
154    */
155   Widget* get_label_widget();
156   
157   /** Retrieves the label widget for the frame. See
158    * set_label_widget().
159    * @return The label widget, or <tt>0</tt> if there is none.
160    */
161   const Widget* get_label_widget() const;
162
163   /** Set the alignment of the Frame's label.
164    * @param xalign The position of the label along the top edge of the widget.
165    * A value of 0.0 represents left alignment; 1.0 represents right alignment.
166    * The default value for a newly created Frame is 0.0.
167    * @param yalign The y alignment of the label. Currently ignored.
168    */
169   
170   /** Sets the alignment of the frame widget's label. The
171    * default values for a newly created frame are 0.0 and 0.5.
172    * @param xalign The position of the label along the top edge
173    * of the widget. A value of 0.0 represents left alignment;
174    * 1.0 represents right alignment.
175    * @param yalign The y alignment of the label. A value of 0.0 aligns under 
176    * the frame; 1.0 aligns above the frame. If the values are exactly
177    * 0.0 or 1.0 the gap in the frame won't be painted because the label
178    * will be completely above or below the frame.
179    */
180   void set_label_align(float xalign = 0.0, float yalign = 0.5);
181   
182   /** Sets the alignment of the frame widget's label. The
183    * default values for a newly created frame are 0.0 and 0.5.
184    * @param xalign The position of the label along the top edge
185    * of the widget. A value of 0.0 represents left alignment;
186    * 1.0 represents right alignment.
187    * @param yalign The y alignment of the label. A value of 0.0 aligns under 
188    * the frame; 1.0 aligns above the frame. If the values are exactly
189    * 0.0 or 1.0 the gap in the frame won't be painted because the label
190    * will be completely above or below the frame.
191    */
192   void set_label_align(AlignmentEnum xalign, AlignmentEnum yalign = Gtk::ALIGN_CENTER);
193
194   
195   /** Retrieves the X and Y alignment of the frame's label. See
196    * set_label_align().
197    * @param xalign Location to store X alignment of frame's label, or <tt>0</tt>.
198    * @param yalign Location to store X alignment of frame's label, or <tt>0</tt>.
199    */
200   void get_label_align(float& xalign, float& yalign) const;
201
202   /** Sets shadow type of the frame.
203    */
204   
205   /** Sets the shadow type for @a frame .
206    * @param type The new Gtk::ShadowType.
207    */
208   void set_shadow_type(ShadowType type);
209   
210   /** Retrieves the shadow type of the frame. See
211    * set_shadow_type().
212    * @return The current shadow type of the frame.
213    */
214   ShadowType get_shadow_type() const;
215
216   #ifdef GLIBMM_PROPERTIES_ENABLED
217 /** Text of the frame's label.
218    *
219    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
220    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
221    * the value of the property changes.
222    */
223   Glib::PropertyProxy<Glib::ustring> property_label() ;
224 #endif //#GLIBMM_PROPERTIES_ENABLED
225
226 #ifdef GLIBMM_PROPERTIES_ENABLED
227 /** Text of the frame's label.
228    *
229    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
230    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
231    * the value of the property changes.
232    */
233   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_label() const;
234 #endif //#GLIBMM_PROPERTIES_ENABLED
235
236   #ifdef GLIBMM_PROPERTIES_ENABLED
237 /** The horizontal alignment of the label.
238    *
239    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
240    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
241    * the value of the property changes.
242    */
243   Glib::PropertyProxy<double> property_label_xalign() ;
244 #endif //#GLIBMM_PROPERTIES_ENABLED
245
246 #ifdef GLIBMM_PROPERTIES_ENABLED
247 /** The horizontal alignment of the label.
248    *
249    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
250    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
251    * the value of the property changes.
252    */
253   Glib::PropertyProxy_ReadOnly<double> property_label_xalign() const;
254 #endif //#GLIBMM_PROPERTIES_ENABLED
255
256   #ifdef GLIBMM_PROPERTIES_ENABLED
257 /** The vertical alignment of the label.
258    *
259    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
260    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
261    * the value of the property changes.
262    */
263   Glib::PropertyProxy<double> property_label_yalign() ;
264 #endif //#GLIBMM_PROPERTIES_ENABLED
265
266 #ifdef GLIBMM_PROPERTIES_ENABLED
267 /** The vertical alignment of the label.
268    *
269    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
270    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
271    * the value of the property changes.
272    */
273   Glib::PropertyProxy_ReadOnly<double> property_label_yalign() const;
274 #endif //#GLIBMM_PROPERTIES_ENABLED
275
276   #ifdef GLIBMM_PROPERTIES_ENABLED
277 /** Appearance of the frame border.
278    *
279    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
280    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
281    * the value of the property changes.
282    */
283   Glib::PropertyProxy<ShadowType> property_shadow_type() ;
284 #endif //#GLIBMM_PROPERTIES_ENABLED
285
286 #ifdef GLIBMM_PROPERTIES_ENABLED
287 /** Appearance of the frame border.
288    *
289    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
290    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
291    * the value of the property changes.
292    */
293   Glib::PropertyProxy_ReadOnly<ShadowType> property_shadow_type() const;
294 #endif //#GLIBMM_PROPERTIES_ENABLED
295
296   #ifdef GLIBMM_PROPERTIES_ENABLED
297 /** A widget to display in place of the usual frame label.
298    *
299    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
300    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
301    * the value of the property changes.
302    */
303   Glib::PropertyProxy<Widget*> property_label_widget() ;
304 #endif //#GLIBMM_PROPERTIES_ENABLED
305
306 #ifdef GLIBMM_PROPERTIES_ENABLED
307 /** A widget to display in place of the usual frame label.
308    *
309    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
310    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
311    * the value of the property changes.
312    */
313   Glib::PropertyProxy_ReadOnly<Widget*> property_label_widget() const;
314 #endif //#GLIBMM_PROPERTIES_ENABLED
315
316
317 protected:
318   #ifdef GLIBMM_VFUNCS_ENABLED
319   virtual void compute_child_allocation_vfunc(Allocation& allocation);
320 #endif //GLIBMM_VFUNCS_ENABLED
321
322
323 };
324
325 } // namespace Gtk
326
327
328 namespace Glib
329 {
330   /** A Glib::wrap() method for this object.
331    * 
332    * @param object The C instance.
333    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
334    * @result A C++ instance that wraps this C instance.
335    *
336    * @relates Gtk::Frame
337    */
338   Gtk::Frame* wrap(GtkFrame* object, bool take_copy = false);
339 } //namespace Glib
340
341
342 #endif /* _GTKMM_FRAME_H */
343