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