Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / fontbutton.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_FONTBUTTON_H
4 #define _GTKMM_FONTBUTTON_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* fontbutton.h
12  * 
13  * Copyright (C) 2003 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/button.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkFontButton GtkFontButton;
35 typedef struct _GtkFontButtonClass GtkFontButtonClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class FontButton_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** A button to launch a font selection dialog.
45  * 
46  * The Gtk::FontButton is a button which displays the currently selected font and
47  * allows to open a font selection dialog to change the font. It is suitable widget
48  * for selecting a font in a preference dialog.
49  * @ingroup Widgets
50  */
51
52 class FontButton : public Button
53 {
54   public:
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56   typedef FontButton CppObjectType;
57   typedef FontButton_Class CppClassType;
58   typedef GtkFontButton BaseObjectType;
59   typedef GtkFontButtonClass BaseClassType;
60 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
61
62   virtual ~FontButton();
63
64 #ifndef DOXYGEN_SHOULD_SKIP_THIS
65
66 private:
67   friend class FontButton_Class;
68   static CppClassType fontbutton_class_;
69
70   // noncopyable
71   FontButton(const FontButton&);
72   FontButton& operator=(const FontButton&);
73
74 protected:
75   explicit FontButton(const Glib::ConstructParams& construct_params);
76   explicit FontButton(GtkFontButton* 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   GtkFontButton*       gobj()       { return reinterpret_cast<GtkFontButton*>(gobject_); }
88
89   ///Provides access to the underlying C GtkObject.
90   const GtkFontButton* gobj() const { return reinterpret_cast<GtkFontButton*>(gobject_); }
91
92
93 public:
94   //C++ methods used to invoke GTK+ virtual functions:
95 #ifdef GLIBMM_VFUNCS_ENABLED
96 #endif //GLIBMM_VFUNCS_ENABLED
97
98 protected:
99   //GTK+ Virtual Functions (override these to change behaviour):
100 #ifdef GLIBMM_VFUNCS_ENABLED
101 #endif //GLIBMM_VFUNCS_ENABLED
102
103   //Default Signal Handlers::
104 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
105   virtual void on_font_set();
106 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
107
108
109 private:
110
111 public:
112   FontButton();
113   explicit FontButton(const Glib::ustring& font_name);
114   
115   
116   /** Retrieves the title of the font selection dialog.
117    * @return An internal copy of the title string which must not be freed.
118    * 
119    * @newin2p4.
120    */
121   Glib::ustring get_title() const;
122   
123   /** Sets the title for the font selection dialog.  
124    * 
125    * @newin2p4
126    * @param title A string containing the font selection dialog title.
127    */
128   void set_title(const Glib::ustring& title);
129   
130   /** Returns: whether the selected font is used in the label.
131    * @return Whether the selected font is used in the label.
132    * 
133    * @newin2p4.
134    */
135   bool get_use_font() const;
136   
137   /** If @a use_font  is <tt>true</tt>, the font name will be written using the selected font.  
138    * 
139    * @newin2p4
140    * @param use_font If <tt>true</tt>, font name will be written using font chosen.
141    */
142   void set_use_font(bool use_font = true);
143   
144   /** Returns: whether the selected size is used in the label.
145    * @return Whether the selected size is used in the label.
146    * 
147    * @newin2p4.
148    */
149   bool get_use_size() const;
150   
151   /** If @a use_size  is <tt>true</tt>, the font name will be written using the selected size.
152    * 
153    * @newin2p4
154    * @param use_size If <tt>true</tt>, font name will be written using the selected size.
155    */
156   void set_use_size(bool use_size = true);
157   
158   /** Retrieves the name of the currently selected font.
159    * @return An internal copy of the font name which must not be freed.
160    * 
161    * @newin2p4.
162    */
163   Glib::ustring get_font_name() const;
164   
165   /** Sets or updates the currently-displayed font in font picker dialog.
166    * @param fontname Name of font to display in font selection dialog.
167    * @return Return value of Gtk::FontSelectionDialog::set_font_name() if the
168    * font selection dialog exists, otherwise <tt>false</tt>.
169    * 
170    * @newin2p4.
171    */
172   bool set_font_name(const Glib::ustring& fontname);
173   
174   /** Return value: whether the font style will be shown in the label.
175    * @return Whether the font style will be shown in the label.
176    * 
177    * @newin2p4.
178    */
179   bool get_show_style() const;
180   
181   /** If @a show_style  is <tt>true</tt>, the font style will be displayed along with name of the selected font.
182    * 
183    * @newin2p4
184    * @param show_style <tt>true</tt> if font style should be displayed in label.
185    */
186   void set_show_style(bool show_style = true);
187   
188   /** Return value: whether the font size will be shown in the label.
189    * @return Whether the font size will be shown in the label.
190    * 
191    * @newin2p4.
192    */
193   bool get_show_size() const;
194   
195   /** If @a show_size  is <tt>true</tt>, the font size will be displayed along with the name of the selected font.
196    * 
197    * @newin2p4
198    * @param show_size <tt>true</tt> if font size should be displayed in dialog.
199    */
200   void set_show_size(bool show_size = true);
201
202   #ifdef GLIBMM_PROPERTIES_ENABLED
203 /** The title of the font selection dialog.
204    *
205    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
206    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
207    * the value of the property changes.
208    */
209   Glib::PropertyProxy<Glib::ustring> property_title() ;
210 #endif //#GLIBMM_PROPERTIES_ENABLED
211
212 #ifdef GLIBMM_PROPERTIES_ENABLED
213 /** The title of the font selection dialog.
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_title() const;
220 #endif //#GLIBMM_PROPERTIES_ENABLED
221
222   #ifdef GLIBMM_PROPERTIES_ENABLED
223 /** The name of the selected font.
224    *
225    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
226    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
227    * the value of the property changes.
228    */
229   Glib::PropertyProxy<Glib::ustring> property_font_name() ;
230 #endif //#GLIBMM_PROPERTIES_ENABLED
231
232 #ifdef GLIBMM_PROPERTIES_ENABLED
233 /** The name of the selected font.
234    *
235    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
236    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
237    * the value of the property changes.
238    */
239   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_font_name() const;
240 #endif //#GLIBMM_PROPERTIES_ENABLED
241
242   #ifdef GLIBMM_PROPERTIES_ENABLED
243 /** Whether the label is drawn in the selected font.
244    *
245    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
246    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
247    * the value of the property changes.
248    */
249   Glib::PropertyProxy<bool> property_use_font() ;
250 #endif //#GLIBMM_PROPERTIES_ENABLED
251
252 #ifdef GLIBMM_PROPERTIES_ENABLED
253 /** Whether the label is drawn in the selected font.
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_ReadOnly<bool> property_use_font() const;
260 #endif //#GLIBMM_PROPERTIES_ENABLED
261
262   #ifdef GLIBMM_PROPERTIES_ENABLED
263 /** Whether the label is drawn with the selected font size.
264    *
265    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
266    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
267    * the value of the property changes.
268    */
269   Glib::PropertyProxy<bool> property_use_size() ;
270 #endif //#GLIBMM_PROPERTIES_ENABLED
271
272 #ifdef GLIBMM_PROPERTIES_ENABLED
273 /** Whether the label is drawn with the selected font size.
274    *
275    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
276    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
277    * the value of the property changes.
278    */
279   Glib::PropertyProxy_ReadOnly<bool> property_use_size() const;
280 #endif //#GLIBMM_PROPERTIES_ENABLED
281
282   #ifdef GLIBMM_PROPERTIES_ENABLED
283 /** Whether the selected font style is shown in the label.
284    *
285    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
286    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
287    * the value of the property changes.
288    */
289   Glib::PropertyProxy<bool> property_show_style() ;
290 #endif //#GLIBMM_PROPERTIES_ENABLED
291
292 #ifdef GLIBMM_PROPERTIES_ENABLED
293 /** Whether the selected font style is shown in the label.
294    *
295    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
296    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
297    * the value of the property changes.
298    */
299   Glib::PropertyProxy_ReadOnly<bool> property_show_style() const;
300 #endif //#GLIBMM_PROPERTIES_ENABLED
301
302   #ifdef GLIBMM_PROPERTIES_ENABLED
303 /** Whether selected font size is shown in the label.
304    *
305    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
306    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
307    * the value of the property changes.
308    */
309   Glib::PropertyProxy<bool> property_show_size() ;
310 #endif //#GLIBMM_PROPERTIES_ENABLED
311
312 #ifdef GLIBMM_PROPERTIES_ENABLED
313 /** Whether selected font size is shown in the label.
314    *
315    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
316    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
317    * the value of the property changes.
318    */
319   Glib::PropertyProxy_ReadOnly<bool> property_show_size() const;
320 #endif //#GLIBMM_PROPERTIES_ENABLED
321
322
323   /** The font_set signal is emitted when the user selects a font. When handling this signal,
324    * use get_font_name() to find out which font was just selected.
325    *
326    * @par Prototype:
327    * <tt>void on_my_%font_set()</tt>
328    */
329
330   Glib::SignalProxy0< void > signal_font_set();
331                                              
332
333 };
334
335
336 } // namespace Gtk
337
338
339 namespace Glib
340 {
341   /** A Glib::wrap() method for this object.
342    * 
343    * @param object The C instance.
344    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
345    * @result A C++ instance that wraps this C instance.
346    *
347    * @relates Gtk::FontButton
348    */
349   Gtk::FontButton* wrap(GtkFontButton* object, bool take_copy = false);
350 } //namespace Glib
351
352
353 #endif /* _GTKMM_FONTBUTTON_H */
354