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  * Conversion parameters:
26  * inFile  = GtkColorSelectionDialog.html
27  * outPack = gtk
28  * outFile = ColorSelectionDialog
29  * strct   = GtkColorSelectionDialog
30  * realStrct=
31  * ctorStrct=
32  * clss    = ColorSelectionDialog
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_color_selection_dialog_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * 	- gtk_color_selection_dialog_get_color_selection
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gtk.ColorSelection
49  * structWrap:
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gtk.ColorSelectionDialog;
56 
57 public  import gtkc.gtktypes;
58 
59 private import gtkc.gtk;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 
64 private import glib.Str;
65 private import gtk.ColorSelection;
66 
67 
68 
69 private import gtk.Dialog;
70 
71 /**
72  * The GtkColorSelectionDialog provides a standard dialog which
73  * allows the user to select a color much like the GtkFileChooserDialog
74  * provides a standard dialog for file selection.
75  *
76  * Use gtk_color_selection_dialog_get_color_selection() to get the
77  * GtkColorSelection widget contained within the dialog. Use this widget
78  * and its gtk_color_selection_get_current_color()
79  * function to gain access to the selected color. Connect a handler
80  * for this widget's "color-changed" signal to be notified
81  * when the color changes.
82  *
83  * GtkColorSelectionDialog as GtkBuildable
84  *
85  * The GtkColorSelectionDialog implementation of the GtkBuildable interface
86  * exposes the embedded GtkColorSelection as internal child with the
87  * name "color_selection". It also exposes the buttons with the names
88  * "ok_button", "cancel_button" and "help_button".
89  */
90 public class ColorSelectionDialog : Dialog
91 {
92 	
93 	/** the main Gtk struct */
94 	protected GtkColorSelectionDialog* gtkColorSelectionDialog;
95 	
96 	
97 	public GtkColorSelectionDialog* getColorSelectionDialogStruct()
98 	{
99 		return gtkColorSelectionDialog;
100 	}
101 	
102 	
103 	/** the main Gtk struct as a void* */
104 	protected override void* getStruct()
105 	{
106 		return cast(void*)gtkColorSelectionDialog;
107 	}
108 	
109 	/**
110 	 * Sets our main struct and passes it to the parent class
111 	 */
112 	public this (GtkColorSelectionDialog* gtkColorSelectionDialog)
113 	{
114 		super(cast(GtkDialog*)gtkColorSelectionDialog);
115 		this.gtkColorSelectionDialog = gtkColorSelectionDialog;
116 	}
117 	
118 	protected override void setStruct(GObject* obj)
119 	{
120 		super.setStruct(obj);
121 		gtkColorSelectionDialog = cast(GtkColorSelectionDialog*)obj;
122 	}
123 	
124 	/**
125 	 * Retrieves the GtkColorSelection widget embedded in the dialog.
126 	 * Since 2.14
127 	 * Returns: the embedded GtkColorSelection
128 	 */
129 	public ColorSelection getColorSelection()
130 	{
131 		// GtkWidget* gtk_color_selection_dialog_get_color_selection  (GtkColorSelectionDialog *colorsel);
132 		auto p = gtk_color_selection_dialog_get_color_selection(gtkColorSelectionDialog);
133 		if(p is null)
134 		{
135 			return null;
136 		}
137 		return new ColorSelection(cast(GtkColorSelection*) p);
138 	}
139 	
140 	/**
141 	 */
142 	
143 	/**
144 	 * Creates a new GtkColorSelectionDialog.
145 	 * Params:
146 	 * title = a string containing the title text for the dialog.
147 	 * Throws: ConstructionException GTK+ fails to create the object.
148 	 */
149 	public this (string title)
150 	{
151 		// GtkWidget * gtk_color_selection_dialog_new (const gchar *title);
152 		auto p = gtk_color_selection_dialog_new(Str.toStringz(title));
153 		if(p is null)
154 		{
155 			throw new ConstructionException("null returned by gtk_color_selection_dialog_new(Str.toStringz(title))");
156 		}
157 		this(cast(GtkColorSelectionDialog*) p);
158 	}
159 }