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