Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / bin.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_BIN_H
4 #define _GTKMM_BIN_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* bin.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/container.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkBin GtkBin;
34 typedef struct _GtkBinClass GtkBinClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class Bin_Class; } // namespace Gtk
40 namespace Gtk
41 {
42
43 /** A container with just one child.
44  *
45  * This is an abstract base class from which all classes holding
46  * up to 1 widget inside of them derive.  It provides access to methods
47  * relevent to a single object, such as add_label, add_pixmap, etc.
48  *
49  * @ingroup Widgets
50  */
51
52 class Bin : public Container
53 {
54   public:
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56   typedef Bin CppObjectType;
57   typedef Bin_Class CppClassType;
58   typedef GtkBin BaseObjectType;
59   typedef GtkBinClass BaseClassType;
60 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
61
62   virtual ~Bin();
63
64 #ifndef DOXYGEN_SHOULD_SKIP_THIS
65
66 private:
67   friend class Bin_Class;
68   static CppClassType bin_class_;
69
70   // noncopyable
71   Bin(const Bin&);
72   Bin& operator=(const Bin&);
73
74 protected:
75   explicit Bin(const Glib::ConstructParams& construct_params);
76   explicit Bin(GtkBin* castitem);
77
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79
80 public:
81 #ifndef DOXYGEN_SHOULD_SKIP_THIS
82   static GType get_type()      G_GNUC_CONST;
83   static GType get_base_type() G_GNUC_CONST;
84 #endif
85
86   ///Provides access to the underlying C GtkObject.
87   GtkBin*       gobj()       { return reinterpret_cast<GtkBin*>(gobject_); }
88
89   ///Provides access to the underlying C GtkObject.
90   const GtkBin* gobj() const { return reinterpret_cast<GtkBin*>(gobject_); }
91
92
93 public:
94   //C++ methods used to invoke GTK+ virtual functions:
95
96 protected:
97   //GTK+ Virtual Functions (override these to change behaviour):
98
99   //Default Signal Handlers::
100
101
102 private:
103
104 protected:
105   Bin();
106 public:
107   
108
109   // get_child() is a convenience function to get a c++ wrapper of
110   // the contained widget. It may return NULL if such an item is not
111   // available.
112   Widget* get_child();
113   const Widget* get_child() const;
114
115   /** Remove the contained object
116    * Since this can only hold one object it is not necessary to
117    * specify which object to remove like other containers.
118    *
119    * When calling remove() on a Gtk::ScrolledWindow this might not remove the
120    * expected child directly, because Gtk::ScrolledWindow::add() sometimes creates a
121    * Gtk::ViewPort child and places the widget in that.
122    */
123   void remove();
124
125   //Convenience methods that don't correspond to GTK+ functions:
126
127   /** Add a Label object.
128    * This does not correspond to any GTK+ function and is provided purely for
129    * convenience.
130    * @param label The text for the label.
131    * @param mnemonic If <tt>true</tt>, characters preceded by an underscore 
132    * (_) will be underlined and used as a keyboard accelerator (shortcut).
133    * @param x_align The horizontal alignment of the text.  This ranges from 
134    * 0.0 (left aligned) to 1.0 (right aligned).
135    * @param y_align The vertical alignment of the text.  This ranges from 
136    * 0.0 (top aligned) to 1.0 (bottom aligned).
137    */
138   void add_label(const Glib::ustring& label, bool mnemonic = false,
139                  double x_align = 0.5, double y_align = 0.5);
140
141   /** Add a Label object.
142    * This does not correspond to any GTK+ function and is provided purely for
143    * convenience.
144    * @param label The label text.
145    * @param mnemonic If <tt>true</tt>, characters preceded by an underscore
146    * (_) will be underlined and used as a keyboard accelerator (shortcut).
147    * @param x_align The horizontal alignment of the text.  For possible 
148    * values, see Gtk::AlignmentEnum.
149    * @param y_align The vertical alignment of the text.  For possible 
150    * values, see Gtk::AlignmentEnum.
151    */
152   void add_label(const Glib::ustring& label, bool mnemonic,
153                  AlignmentEnum x_align, AlignmentEnum y_align = ALIGN_CENTER);
154
155   /** Add an Image object.
156    * This does not correspond to any GTK+ function and is provided purely for
157    * convenience.
158    * This will create, manage, add, and show a new Image to this Bin.
159    * @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
160    * @param mask A Glib::RefPtr to a Gdk::Bitmap.
161    */
162   void add_pixmap(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
163                   const Glib::RefPtr<Gdk::Bitmap>& mask);
164
165   /** Add Image and Label objects.
166    * This does not correspond to any GTK+ function and is provided purely for
167    * convenience.
168    * This will create, manage, add, and show a new Image and Label (within an 
169    * HBox) to this Bin.
170    * @param pixmap A Glib::RefPtr to a Gdk::Pixmap.
171    * @param mask A Glib::RefPtr to a Gdk::Bitmap.
172    * @param label The text for the label.
173    * @param x_align The horizontal alignment of the text in the label.
174    * @param y_align The vertical alignment of the text in the label.
175    */
176   void add_pixlabel(const Glib::RefPtr<Gdk::Pixmap>& pixmap,
177                     const Glib::RefPtr<Gdk::Bitmap>& mask,
178                     const Glib::ustring& label,
179                                 double x_align = 0.5, double y_align = 0.5);
180
181   /** Add Image and Label objects.
182    * This does not correspond to any GTK+ function and is provided purely for
183    * convenience.
184    * This will create, manage, add, and show a new Image and Label (within an 
185    * HBox) to this Bin.
186    * @param pixfile The path to a file to be displayed.
187    * @param label The text for the label.
188    * @param x_align The horizontal alignment of the text in the label.
189    * @param y_align The vertical alignment of the text in the label.
190    */
191   void add_pixlabel(const Glib::ustring& pixfile,
192                     const Glib::ustring& label,
193                                 double x_align = 0.5, double y_align = 0.5);
194
195
196 };
197
198 }  /* namespace Gtk */
199
200
201 namespace Glib
202 {
203   /** @relates Gtk::Bin
204    * @param object The C instance
205    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
206    * @result A C++ instance that wraps this C instance.
207    */
208   Gtk::Bin* wrap(GtkBin* object, bool take_copy = false);
209 }
210 #endif /* _GTKMM_BIN_H */
211