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