1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.FontChooserWidget;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Box;
30 private import gtk.FontChooserIF;
31 private import gtk.FontChooserT;
32 private import gtk.Widget;
33 private import gtk.c.functions;
34 public  import gtk.c.types;
35 public  import gtkc.gtktypes;
36 
37 
38 /**
39  * The #GtkFontChooserWidget widget lists the available fonts,
40  * styles and sizes, allowing the user to select a font. It is
41  * used in the #GtkFontChooserDialog widget to provide a
42  * dialog box for selecting fonts.
43  * 
44  * To set the font which is initially selected, use
45  * gtk_font_chooser_set_font() or gtk_font_chooser_set_font_desc().
46  * 
47  * To get the selected font use gtk_font_chooser_get_font() or
48  * gtk_font_chooser_get_font_desc().
49  * 
50  * To change the text which is shown in the preview area, use
51  * gtk_font_chooser_set_preview_text().
52  * 
53  * # CSS nodes
54  * 
55  * GtkFontChooserWidget has a single CSS node with name fontchooser.
56  *
57  * Since: 3.2
58  */
59 public class FontChooserWidget : Box, FontChooserIF
60 {
61 	/** the main Gtk struct */
62 	protected GtkFontChooserWidget* gtkFontChooserWidget;
63 
64 	/** Get the main Gtk struct */
65 	public GtkFontChooserWidget* getFontChooserWidgetStruct(bool transferOwnership = false)
66 	{
67 		if (transferOwnership)
68 			ownedRef = false;
69 		return gtkFontChooserWidget;
70 	}
71 
72 	/** the main Gtk struct as a void* */
73 	protected override void* getStruct()
74 	{
75 		return cast(void*)gtkFontChooserWidget;
76 	}
77 
78 	/**
79 	 * Sets our main struct and passes it to the parent class.
80 	 */
81 	public this (GtkFontChooserWidget* gtkFontChooserWidget, bool ownedRef = false)
82 	{
83 		this.gtkFontChooserWidget = gtkFontChooserWidget;
84 		super(cast(GtkBox*)gtkFontChooserWidget, ownedRef);
85 	}
86 
87 	// add the FontChooser capabilities
88 	mixin FontChooserT!(GtkFontChooserWidget);
89 
90 
91 	/** */
92 	public static GType getType()
93 	{
94 		return gtk_font_chooser_widget_get_type();
95 	}
96 
97 	/**
98 	 * Creates a new #GtkFontChooserWidget.
99 	 *
100 	 * Returns: a new #GtkFontChooserWidget
101 	 *
102 	 * Since: 3.2
103 	 *
104 	 * Throws: ConstructionException GTK+ fails to create the object.
105 	 */
106 	public this()
107 	{
108 		auto p = gtk_font_chooser_widget_new();
109 
110 		if(p is null)
111 		{
112 			throw new ConstructionException("null returned by new");
113 		}
114 
115 		this(cast(GtkFontChooserWidget*) p);
116 	}
117 }