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  = GtkColorChooser.html
27  * outPack = gtk
28  * outFile = ColorChooserIF
29  * strct   = GtkColorChooser
30  * realStrct=
31  * ctorStrct=
32  * clss    = ColorChooserT
33  * interf  = ColorChooserIF
34  * class Code: Yes
35  * interface Code: Yes
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_color_chooser_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * 	- gtk_color_chooser_add_palette
45  * omit signals:
46  * imports:
47  * 	- gdk.RGBA
48  * structWrap:
49  * 	- GdkRGBA* -> RGBA
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gtk.ColorChooserIF;
56 
57 public  import gtkc.gtktypes;
58 
59 private import gtkc.gtk;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 private import gobject.Signals;
64 public  import gtkc.gdktypes;
65 private import gdk.RGBA;
66 
67 
68 
69 /**
70  * GtkColorChooser is an interface that is implemented by widgets
71  * for choosing colors. Depending on the situation, colors may be
72  * allowed to have alpha (translucency).
73  *
74  * In GTK+, the main widgets that implement this interface are
75  * GtkColorChooserWidget, GtkColorChooserDialog and GtkColorButton.
76  */
77 public interface ColorChooserIF
78 {
79 	
80 	
81 	/** Get the main Gtk struct */
82 	public GtkColorChooser* getColorChooserTStruct();
83 	
84 	/** the main Gtk struct as a void* */
85 	protected void* getStruct();
86 	
87 	
88 	/**
89 	 * Adds a palette to the color chooser. If orientation is horizontal,
90 	 * the colors are grouped in rows, with colorsPerPine colors
91 	 * in each row. If horizontal is false, the colors are grouped
92 	 * in columns instead.
93 	 *
94 	 * The default color palette of ColorChooserWidget has
95 	 * 27 colors, organized in columns of 3 colors. The default gray
96 	 * palette has 9 grays in a single row.
97 	 *
98 	 * The layout of the color chooser widget works best when the
99 	 * palettes have 9-10 columns.
100 	 *
101 	 * Calling this function for the first time has the
102 	 * side effect of removing the default color and gray palettes
103 	 * from the color chooser.
104 	 *
105 	 * If colors is null, removes all previously added palettes.
106 	 *
107 	 * Params:
108 	 *     orientation   = Orientation.HORIZONTAL if the palette should
109 	 *                     be displayed in rows, Orientation.VERTICAL for columns
110 	 *     colorsPerLine = the number of colors to show in each row/column
111 	 *     colors        = the colors of the palette, or null.
112 	 * Since 3.4
113 	 */
114 	public void addPalette(GtkOrientation orientation, int colorsPerLine, RGBA[] colors);
115 	
116 	/**
117 	 */
118 	
119 	@property void delegate(RGBA, ColorChooserIF)[] onColorActivatedListeners();
120 	/**
121 	 * Emitted when a color is activated from the color chooser.
122 	 * This usually happens when the user clicks a color swatch,
123 	 * or a color is selected and the user presses one of the keys
124 	 * Space, Shift+Space, Return or Enter.
125 	 * Since 3.4
126 	 * See Also
127 	 * GtkColorChooserDialog, GtkColorChooserWidget, GtkColorButton
128 	 */
129 	void addOnColorActivated(void delegate(RGBA, ColorChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
130 	
131 	/**
132 	 * Gets the currently-selected color.
133 	 * Params:
134 	 * color = a GdkRGBA to fill in with the current color. [out]
135 	 * Since 3.4
136 	 */
137 	public void getRgba(RGBA color);
138 	
139 	/**
140 	 * Sets the color.
141 	 * Params:
142 	 * color = the new color
143 	 * Since 3.4
144 	 */
145 	public void setRgba(RGBA color);
146 	
147 	/**
148 	 * Returns whether the color chooser shows the alpha channel.
149 	 * Returns: TRUE if the color chooser uses the alpha channel, FALSE if not Since 3.4
150 	 */
151 	public int getUseAlpha();
152 	
153 	/**
154 	 * Sets whether or not the color chooser should use the alpha channel.
155 	 * Params:
156 	 * useAlpha = TRUE if color chooser should use alpha channel, FALSE if not
157 	 * Since 3.4
158 	 */
159 	public void setUseAlpha(int useAlpha);
160 }