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.ColorChooserIF;
26 
27 private import gdk.RGBA;
28 private import gobject.ObjectG;
29 private import gobject.Signals;
30 private import gtk.c.functions;
31 public  import gtk.c.types;
32 public  import gtkc.gtktypes;
33 private import std.algorithm;
34 
35 
36 /**
37  * #GtkColorChooser is an interface that is implemented by widgets
38  * for choosing colors. Depending on the situation, colors may be
39  * allowed to have alpha (translucency).
40  * 
41  * In GTK+, the main widgets that implement this interface are
42  * #GtkColorChooserWidget, #GtkColorChooserDialog and #GtkColorButton.
43  */
44 public interface ColorChooserIF{
45 	/** Get the main Gtk struct */
46 	public GtkColorChooser* getColorChooserStruct(bool transferOwnership = false);
47 
48 	/** the main Gtk struct as a void* */
49 	protected void* getStruct();
50 
51 
52 	/** */
53 	public static GType getType()
54 	{
55 		return gtk_color_chooser_get_type();
56 	}
57 
58 	/**
59 	 * Adds a palette to the color chooser. If @orientation is horizontal,
60 	 * the colors are grouped in rows, with @colors_per_line colors
61 	 * in each row. If @horizontal is %FALSE, the colors are grouped
62 	 * in columns instead.
63 	 *
64 	 * The default color palette of #GtkColorChooserWidget has
65 	 * 27 colors, organized in columns of 3 colors. The default gray
66 	 * palette has 9 grays in a single row.
67 	 *
68 	 * The layout of the color chooser widget works best when the
69 	 * palettes have 9-10 columns.
70 	 *
71 	 * Calling this function for the first time has the
72 	 * side effect of removing the default color and gray palettes
73 	 * from the color chooser.
74 	 *
75 	 * If @colors is %NULL, removes all previously added palettes.
76 	 *
77 	 * Params:
78 	 *     orientation = %GTK_ORIENTATION_HORIZONTAL if the palette should
79 	 *         be displayed in rows, %GTK_ORIENTATION_VERTICAL for columns
80 	 *     colorsPerLine = the number of colors to show in each row/column
81 	 *     colors = the colors of the palette, or %NULL
82 	 *
83 	 * Since: 3.4
84 	 */
85 	public void addPalette(GtkOrientation orientation, int colorsPerLine, RGBA[] colors);
86 
87 	/**
88 	 * Gets the currently-selected color.
89 	 *
90 	 * Params:
91 	 *     color = a #GdkRGBA to fill in with the current color
92 	 *
93 	 * Since: 3.4
94 	 */
95 	public void getRgba(out RGBA color);
96 
97 	/**
98 	 * Returns whether the color chooser shows the alpha channel.
99 	 *
100 	 * Returns: %TRUE if the color chooser uses the alpha channel,
101 	 *     %FALSE if not
102 	 *
103 	 * Since: 3.4
104 	 */
105 	public bool getUseAlpha();
106 
107 	/**
108 	 * Sets the color.
109 	 *
110 	 * Params:
111 	 *     color = the new color
112 	 *
113 	 * Since: 3.4
114 	 */
115 	public void setRgba(RGBA color);
116 
117 	/**
118 	 * Sets whether or not the color chooser should use the alpha channel.
119 	 *
120 	 * Params:
121 	 *     useAlpha = %TRUE if color chooser should use alpha channel, %FALSE if not
122 	 *
123 	 * Since: 3.4
124 	 */
125 	public void setUseAlpha(bool useAlpha);
126 
127 	/**
128 	 * Emitted when a color is activated from the color chooser.
129 	 * This usually happens when the user clicks a color swatch,
130 	 * or a color is selected and the user presses one of the keys
131 	 * Space, Shift+Space, Return or Enter.
132 	 *
133 	 * Params:
134 	 *     color = the color
135 	 *
136 	 * Since: 3.4
137 	 */
138 	gulong addOnColorActivated(void delegate(RGBA, ColorChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
139 }