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 atk.ComponentIF;
26 
27 private import atk.ObjectAtk;
28 private import gobject.ObjectG;
29 private import gobject.Signals;
30 private import gtkc.atk;
31 public  import gtkc.atktypes;
32 public  import gtkc.gdktypes;
33 private import std.algorithm;
34 
35 
36 /**
37  * #AtkComponent should be implemented by most if not all UI elements
38  * with an actual on-screen presence, i.e. components which can be
39  * said to have a screen-coordinate bounding box.  Virtually all
40  * widgets will need to have #AtkComponent implementations provided
41  * for their corresponding #AtkObject class.  In short, only UI
42  * elements which are *not* GUI elements will omit this ATK interface.
43  * 
44  * A possible exception might be textual information with a
45  * transparent background, in which case text glyph bounding box
46  * information is provided by #AtkText.
47  */
48 public interface ComponentIF{
49 	/** Get the main Gtk struct */
50 	public AtkComponent* getComponentStruct();
51 
52 	/** the main Gtk struct as a void* */
53 	protected void* getStruct();
54 
55 
56 	/**
57 	 * Add the specified handler to the set of functions to be called
58 	 * when this object receives focus events (in or out). If the handler is
59 	 * already added it is not added again
60 	 *
61 	 * Deprecated: If you need to track when an object gains or
62 	 * lose the focus, use the #AtkObject::state-change "focused" notification instead.
63 	 *
64 	 * Params:
65 	 *     handler = The #AtkFocusHandler to be attached to @component
66 	 *
67 	 * Return: a handler id which can be used in atk_component_remove_focus_handler()
68 	 *     or zero if the handler was already added.
69 	 */
70 	public uint addFocusHandler(AtkFocusHandler handler);
71 
72 	/**
73 	 * Checks whether the specified point is within the extent of the @component.
74 	 *
75 	 * Toolkit implementor note: ATK provides a default implementation for
76 	 * this virtual method. In general there are little reason to
77 	 * re-implement it.
78 	 *
79 	 * Params:
80 	 *     x = x coordinate
81 	 *     y = y coordinate
82 	 *     coordType = specifies whether the coordinates are relative to the screen
83 	 *         or to the components top level window
84 	 *
85 	 * Return: %TRUE or %FALSE indicating whether the specified point is within
86 	 *     the extent of the @component or not
87 	 */
88 	public bool contains(int x, int y, AtkCoordType coordType);
89 
90 	/**
91 	 * Returns the alpha value (i.e. the opacity) for this
92 	 * @component, on a scale from 0 (fully transparent) to 1.0
93 	 * (fully opaque).
94 	 *
95 	 * Return: An alpha value from 0 to 1.0, inclusive.
96 	 *
97 	 * Since: 1.12
98 	 */
99 	public double getAlpha();
100 
101 	/**
102 	 * Gets the rectangle which gives the extent of the @component.
103 	 *
104 	 * Params:
105 	 *     x = address of #gint to put x coordinate
106 	 *     y = address of #gint to put y coordinate
107 	 *     width = address of #gint to put width
108 	 *     height = address of #gint to put height
109 	 *     coordType = specifies whether the coordinates are relative to the screen
110 	 *         or to the components top level window
111 	 */
112 	public void getExtents(out int x, out int y, out int width, out int height, AtkCoordType coordType);
113 
114 	/**
115 	 * Gets the layer of the component.
116 	 *
117 	 * Return: an #AtkLayer which is the layer of the component
118 	 */
119 	public AtkLayer getLayer();
120 
121 	/**
122 	 * Gets the zorder of the component. The value G_MININT will be returned
123 	 * if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW.
124 	 *
125 	 * Return: a gint which is the zorder of the component, i.e. the depth at
126 	 *     which the component is shown in relation to other components in the same
127 	 *     container.
128 	 */
129 	public int getMdiZorder();
130 
131 	/**
132 	 * Gets the position of @component in the form of
133 	 * a point specifying @component's top-left corner.
134 	 *
135 	 * Deprecated: Since 2.12. Use atk_component_get_extents() instead.
136 	 *
137 	 * Params:
138 	 *     x = address of #gint to put x coordinate position
139 	 *     y = address of #gint to put y coordinate position
140 	 *     coordType = specifies whether the coordinates are relative to the screen
141 	 *         or to the components top level window
142 	 */
143 	public void getPosition(out int x, out int y, AtkCoordType coordType);
144 
145 	/**
146 	 * Gets the size of the @component in terms of width and height.
147 	 *
148 	 * Deprecated: Since 2.12. Use atk_component_get_extents() instead.
149 	 *
150 	 * Params:
151 	 *     width = address of #gint to put width of @component
152 	 *     height = address of #gint to put height of @component
153 	 */
154 	public void getSize(out int width, out int height);
155 
156 	/**
157 	 * Grabs focus for this @component.
158 	 *
159 	 * Return: %TRUE if successful, %FALSE otherwise.
160 	 */
161 	public bool grabFocus();
162 
163 	/**
164 	 * Gets a reference to the accessible child, if one exists, at the
165 	 * coordinate point specified by @x and @y.
166 	 *
167 	 * Params:
168 	 *     x = x coordinate
169 	 *     y = y coordinate
170 	 *     coordType = specifies whether the coordinates are relative to the screen
171 	 *         or to the components top level window
172 	 *
173 	 * Return: a reference to the accessible
174 	 *     child, if one exists
175 	 */
176 	public ObjectAtk refAccessibleAtPoint(int x, int y, AtkCoordType coordType);
177 
178 	/**
179 	 * Remove the handler specified by @handler_id from the list of
180 	 * functions to be executed when this object receives focus events
181 	 * (in or out).
182 	 *
183 	 * Deprecated: If you need to track when an object gains or
184 	 * lose the focus, use the #AtkObject::state-change "focused" notification instead.
185 	 *
186 	 * Params:
187 	 *     handlerId = the handler id of the focus handler to be removed
188 	 *         from @component
189 	 */
190 	public void removeFocusHandler(uint handlerId);
191 
192 	/**
193 	 * Sets the extents of @component.
194 	 *
195 	 * Params:
196 	 *     x = x coordinate
197 	 *     y = y coordinate
198 	 *     width = width to set for @component
199 	 *     height = height to set for @component
200 	 *     coordType = specifies whether the coordinates are relative to the screen
201 	 *         or to the components top level window
202 	 *
203 	 * Return: %TRUE or %FALSE whether the extents were set or not
204 	 */
205 	public bool setExtents(int x, int y, int width, int height, AtkCoordType coordType);
206 
207 	/**
208 	 * Sets the postition of @component.
209 	 *
210 	 * Params:
211 	 *     x = x coordinate
212 	 *     y = y coordinate
213 	 *     coordType = specifies whether the coordinates are relative to the screen
214 	 *         or to the components top level window
215 	 *
216 	 * Return: %TRUE or %FALSE whether or not the position was set or not
217 	 */
218 	public bool setPosition(int x, int y, AtkCoordType coordType);
219 
220 	/**
221 	 * Set the size of the @component in terms of width and height.
222 	 *
223 	 * Params:
224 	 *     width = width to set for @component
225 	 *     height = height to set for @component
226 	 *
227 	 * Return: %TRUE or %FALSE whether the size was set or not
228 	 */
229 	public bool setSize(int width, int height);
230 	/**
231 	 * The 'bounds-changed" signal is emitted when the bposition or
232 	 * size of the component changes.
233 	 *
234 	 * Params:
235 	 *     arg1 = The AtkRectangle giving the new position and size.
236 	 */
237 	gulong addOnBoundsChanged(void delegate(AtkRectangle*, ComponentIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
238 	;
239 
240 }