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