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 
66 private import gdk.RGBA;
67 
68 
69 
70 
71 /**
72  * GtkColorChooser is an interface that is implemented by widgets
73  * for choosing colors. Depending on the situation, colors may be
74  * allowed to have alpha (translucency).
75  *
76  * In GTK+, the main widgets that implement this interface are
77  * GtkColorChooserWidget, GtkColorChooserDialog and GtkColorButton.
78  */
79 public interface ColorChooserIF
80 {
81 	
82 	
83 	public GtkColorChooser* getColorChooserTStruct();
84 	
85 	/** the main Gtk struct as a void* */
86 	protected void* getStruct();
87 	
88 	
89 	/**
90 	 * Adds a palette to the color chooser. If orientation is horizontal,
91 	 * the colors are grouped in rows, with colorsPerPine colors
92 	 * in each row. If horizontal is false, the colors are grouped
93 	 * in columns instead.
94 	 *
95 	 * The default color palette of ColorChooserWidget has
96 	 * 27 colors, organized in columns of 3 colors. The default gray
97 	 * palette has 9 grays in a single row.
98 	 *
99 	 * The layout of the color chooser widget works best when the
100 	 * palettes have 9-10 columns.
101 	 *
102 	 * Calling this function for the first time has the
103 	 * side effect of removing the default color and gray palettes
104 	 * from the color chooser.
105 	 *
106 	 * If colors is null, removes all previously added palettes.
107 	 *
108 	 * Params:
109 	 *     orientation   = Orientation.HORIZONTAL if the palette should
110 	 *                     be displayed in rows, Orientation.VERTICAL for columns
111 	 *     colorsPerLine = the number of colors to show in each row/column
112 	 *     colors        = the colors of the palette, or null.
113 	 * Since 3.4
114 	 */
115 	public void addPalette(GtkOrientation orientation, int colorsPerLine, RGBA[] colors);
116 	
117 	/**
118 	 */
119 	
120 	@property void delegate(RGBA, ColorChooserIF)[] onColorActivatedListeners();
121 	/**
122 	 * Emitted when a color is activated from the color chooser.
123 	 * This usually happens when the user clicks a color swatch,
124 	 * or a color is selected and the user presses one of the keys
125 	 * Space, Shift+Space, Return or Enter.
126 	 * Since 3.4
127 	 * See Also
128 	 * GtkColorChooserDialog, GtkColorChooserWidget, GtkColorButton
129 	 */
130 	void addOnColorActivated(void delegate(RGBA, ColorChooserIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
131 	
132 	/**
133 	 * Gets the currently-selected color.
134 	 * Params:
135 	 * color = a GdkRGBA to fill in with the current color. [out]
136 	 * Since 3.4
137 	 */
138 	public void getRgba(RGBA color);
139 	
140 	/**
141 	 * Sets the color.
142 	 * Params:
143 	 * color = the new color
144 	 * Since 3.4
145 	 */
146 	public void setRgba(RGBA color);
147 	
148 	/**
149 	 * Returns whether the color chooser shows the alpha channel.
150 	 * Returns: TRUE if the color chooser uses the alpha channel, FALSE if not Since 3.4
151 	 */
152 	public int getUseAlpha();
153 	
154 	/**
155 	 * Sets whether or not the color chooser should use the alpha channel.
156 	 * Params:
157 	 * useAlpha = TRUE if color chooser should use alpha channel, FALSE if not
158 	 * Since 3.4
159 	 */
160 	public void setUseAlpha(int useAlpha);
161 }