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.FontChooserIF;
30 private import gtk.FontChooserT;
31 private import gtk.Widget;
32 private import gtk.c.functions;
33 public  import gtk.c.types;
34 
35 
36 /**
37  * The `GtkFontChooserWidget` widget lets the user select a font.
38  * 
39  * It is used in the `GtkFontChooserDialog` widget to provide a
40  * dialog for selecting fonts.
41  * 
42  * To set the font which is initially selected, use
43  * [method@Gtk.FontChooser.set_font] or [method@Gtk.FontChooser.set_font_desc].
44  * 
45  * To get the selected font use [method@Gtk.FontChooser.get_font] or
46  * [method@Gtk.FontChooser.get_font_desc].
47  * 
48  * To change the text which is shown in the preview area, use
49  * [method@Gtk.FontChooser.set_preview_text].
50  * 
51  * # CSS nodes
52  * 
53  * `GtkFontChooserWidget` has a single CSS node with name fontchooser.
54  */
55 public class FontChooserWidget : Widget, FontChooserIF
56 {
57 	/** the main Gtk struct */
58 	protected GtkFontChooserWidget* gtkFontChooserWidget;
59 
60 	/** Get the main Gtk struct */
61 	public GtkFontChooserWidget* getFontChooserWidgetStruct(bool transferOwnership = false)
62 	{
63 		if (transferOwnership)
64 			ownedRef = false;
65 		return gtkFontChooserWidget;
66 	}
67 
68 	/** the main Gtk struct as a void* */
69 	protected override void* getStruct()
70 	{
71 		return cast(void*)gtkFontChooserWidget;
72 	}
73 
74 	/**
75 	 * Sets our main struct and passes it to the parent class.
76 	 */
77 	public this (GtkFontChooserWidget* gtkFontChooserWidget, bool ownedRef = false)
78 	{
79 		this.gtkFontChooserWidget = gtkFontChooserWidget;
80 		super(cast(GtkWidget*)gtkFontChooserWidget, ownedRef);
81 	}
82 
83 	// add the FontChooser capabilities
84 	mixin FontChooserT!(GtkFontChooserWidget);
85 
86 
87 	/** */
88 	public static GType getType()
89 	{
90 		return gtk_font_chooser_widget_get_type();
91 	}
92 
93 	/**
94 	 * Creates a new `GtkFontChooserWidget`.
95 	 *
96 	 * Returns: a new `GtkFontChooserWidget`
97 	 *
98 	 * Throws: ConstructionException GTK+ fails to create the object.
99 	 */
100 	public this()
101 	{
102 		auto __p = gtk_font_chooser_widget_new();
103 
104 		if(__p is null)
105 		{
106 			throw new ConstructionException("null returned by new");
107 		}
108 
109 		this(cast(GtkFontChooserWidget*) __p);
110 	}
111 }