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