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.ColorChooserDialog;
26 
27 private import glib.ConstructionException;
28 private import glib.Str;
29 private import gobject.ObjectG;
30 private import gtk.ColorChooserIF;
31 private import gtk.ColorChooserT;
32 private import gtk.Dialog;
33 private import gtk.Widget;
34 private import gtk.Window;
35 private import gtk.c.functions;
36 public  import gtk.c.types;
37 
38 
39 /**
40  * A dialog for choosing a color.
41  * 
42  * ![An example GtkColorChooserDialog](colorchooser.png)
43  * 
44  * `GtkColorChooserDialog` implements the [iface@Gtk.ColorChooser] interface
45  * and does not provide much API of its own.
46  * 
47  * To create a `GtkColorChooserDialog`, use [ctor@Gtk.ColorChooserDialog.new].
48  * 
49  * To change the initially selected color, use
50  * [method@Gtk.ColorChooser.set_rgba]. To get the selected color use
51  * [method@Gtk.ColorChooser.get_rgba].
52  */
53 public class ColorChooserDialog : Dialog, ColorChooserIF
54 {
55 	/** the main Gtk struct */
56 	protected GtkColorChooserDialog* gtkColorChooserDialog;
57 
58 	/** Get the main Gtk struct */
59 	public GtkColorChooserDialog* getColorChooserDialogStruct(bool transferOwnership = false)
60 	{
61 		if (transferOwnership)
62 			ownedRef = false;
63 		return gtkColorChooserDialog;
64 	}
65 
66 	/** the main Gtk struct as a void* */
67 	protected override void* getStruct()
68 	{
69 		return cast(void*)gtkColorChooserDialog;
70 	}
71 
72 	/**
73 	 * Sets our main struct and passes it to the parent class.
74 	 */
75 	public this (GtkColorChooserDialog* gtkColorChooserDialog, bool ownedRef = false)
76 	{
77 		this.gtkColorChooserDialog = gtkColorChooserDialog;
78 		super(cast(GtkDialog*)gtkColorChooserDialog, ownedRef);
79 	}
80 
81 	// add the ColorChooser capabilities
82 	mixin ColorChooserT!(GtkColorChooserDialog);
83 
84 
85 	/** */
86 	public static GType getType()
87 	{
88 		return gtk_color_chooser_dialog_get_type();
89 	}
90 
91 	/**
92 	 * Creates a new `GtkColorChooserDialog`.
93 	 *
94 	 * Params:
95 	 *     title = Title of the dialog, or %NULL
96 	 *     parent = Transient parent of the dialog, or %NULL
97 	 *
98 	 * Returns: a new `GtkColorChooserDialog`
99 	 *
100 	 * Throws: ConstructionException GTK+ fails to create the object.
101 	 */
102 	public this(string title, Window parent)
103 	{
104 		auto __p = gtk_color_chooser_dialog_new(Str.toStringz(title), (parent is null) ? null : parent.getWindowStruct());
105 
106 		if(__p is null)
107 		{
108 			throw new ConstructionException("null returned by new");
109 		}
110 
111 		this(cast(GtkColorChooserDialog*) __p);
112 	}
113 }