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 gdk.ToplevelIF;
26 
27 private import gdk.Device;
28 private import gdk.Event;
29 private import gdk.Surface;
30 private import gdk.Texture;
31 private import gdk.ToplevelLayout;
32 private import gdk.ToplevelSize;
33 private import gdk.c.functions;
34 public  import gdk.c.types;
35 private import glib.ListG;
36 private import glib.Str;
37 private import gobject.Signals;
38 private import std.algorithm;
39 
40 
41 /**
42  * A `GdkToplevel` is a freestanding toplevel surface.
43  * 
44  * The `GdkToplevel` interface provides useful APIs for interacting with
45  * the windowing system, such as controlling maximization and size of the
46  * surface, setting icons and transient parents for dialogs.
47  */
48 public interface ToplevelIF{
49 	/** Get the main Gtk struct */
50 	public GdkToplevel* getToplevelStruct(bool transferOwnership = false);
51 
52 	/** the main Gtk struct as a void* */
53 	protected void* getStruct();
54 
55 
56 	/** */
57 	public static GType getType()
58 	{
59 		return gdk_toplevel_get_type();
60 	}
61 
62 	/**
63 	 * Begins an interactive move operation.
64 	 *
65 	 * You might use this function to implement draggable titlebars.
66 	 *
67 	 * Params:
68 	 *     device = the device used for the operation
69 	 *     button = the button being used to drag, or 0 for a keyboard-initiated drag
70 	 *     x = surface X coordinate of mouse click that began the drag
71 	 *     y = surface Y coordinate of mouse click that began the drag
72 	 *     timestamp = timestamp of mouse click that began the drag (use
73 	 *         [method@Gdk.Event.get_time])
74 	 */
75 	public void beginMove(Device device, int button, double x, double y, uint timestamp);
76 
77 	/**
78 	 * Begins an interactive resize operation.
79 	 *
80 	 * You might use this function to implement a “window resize grip.”
81 	 *
82 	 * Params:
83 	 *     edge = the edge or corner from which the drag is started
84 	 *     device = the device used for the operation
85 	 *     button = the button being used to drag, or 0 for a keyboard-initiated drag
86 	 *     x = surface X coordinate of mouse click that began the drag
87 	 *     y = surface Y coordinate of mouse click that began the drag
88 	 *     timestamp = timestamp of mouse click that began the drag (use
89 	 *         [method@Gdk.Event.get_time])
90 	 */
91 	public void beginResize(GdkSurfaceEdge edge, Device device, int button, double x, double y, uint timestamp);
92 
93 	/**
94 	 * Sets keyboard focus to @surface.
95 	 *
96 	 * In most cases, [method@Gtk.Window.present_with_time] should be
97 	 * used on a [class@Gtk.Window], rather than calling this function.
98 	 *
99 	 * Params:
100 	 *     timestamp = timestamp of the event triggering the surface focus
101 	 */
102 	public void focus(uint timestamp);
103 
104 	/**
105 	 * Gets the bitwise or of the currently active surface state flags,
106 	 * from the `GdkToplevelState` enumeration.
107 	 *
108 	 * Returns: surface state bitfield
109 	 */
110 	public GdkToplevelState getState();
111 
112 	/**
113 	 * Requests that the @toplevel inhibit the system shortcuts.
114 	 *
115 	 * This is asking the desktop environment/windowing system to let all
116 	 * keyboard events reach the surface, as long as it is focused, instead
117 	 * of triggering system actions.
118 	 *
119 	 * If granted, the rerouting remains active until the default shortcuts
120 	 * processing is restored with [method@Gdk.Toplevel.restore_system_shortcuts],
121 	 * or the request is revoked by the desktop environment, windowing system
122 	 * or the user.
123 	 *
124 	 * A typical use case for this API is remote desktop or virtual machine
125 	 * viewers which need to inhibit the default system keyboard shortcuts
126 	 * so that the remote session or virtual host gets those instead of the
127 	 * local environment.
128 	 *
129 	 * The windowing system or desktop environment may ask the user to grant
130 	 * or deny the request or even choose to ignore the request entirely.
131 	 *
132 	 * The caller can be notified whenever the request is granted or revoked
133 	 * by listening to the [property@Gdk.Toplevel:shortcuts-inhibited] property.
134 	 *
135 	 * Params:
136 	 *     event = the `GdkEvent` that is triggering the inhibit
137 	 *         request, or %NULL if none is available
138 	 */
139 	public void inhibitSystemShortcuts(Event event);
140 
141 	/**
142 	 * Asks to lower the @toplevel below other windows.
143 	 *
144 	 * The windowing system may choose to ignore the request.
145 	 *
146 	 * Returns: %TRUE if the surface was lowered
147 	 */
148 	public bool lower();
149 
150 	/**
151 	 * Asks to minimize the @toplevel.
152 	 *
153 	 * The windowing system may choose to ignore the request.
154 	 *
155 	 * Returns: %TRUE if the surface was minimized
156 	 */
157 	public bool minimize();
158 
159 	/**
160 	 * Present @toplevel after having processed the `GdkToplevelLayout` rules.
161 	 *
162 	 * If the toplevel was previously not showing, it will be showed,
163 	 * otherwise it will change layout according to @layout.
164 	 *
165 	 * GDK may emit the [signal@Gdk.Toplevel::compute-size] signal to let
166 	 * the user of this toplevel compute the preferred size of the toplevel
167 	 * surface.
168 	 *
169 	 * Presenting is asynchronous and the specified layout parameters are not
170 	 * guaranteed to be respected.
171 	 *
172 	 * Params:
173 	 *     layout = the `GdkToplevelLayout` object used to layout
174 	 */
175 	public void present(ToplevelLayout layout);
176 
177 	/**
178 	 * Restore default system keyboard shortcuts which were previously
179 	 * inhibited.
180 	 *
181 	 * This undoes the effect of [method@Gdk.Toplevel.inhibit_system_shortcuts].
182 	 */
183 	public void restoreSystemShortcuts();
184 
185 	/**
186 	 * Sets the toplevel to be decorated.
187 	 *
188 	 * Setting @decorated to %FALSE hints the desktop environment
189 	 * that the surface has its own, client-side decorations and
190 	 * does not need to have window decorations added.
191 	 *
192 	 * Params:
193 	 *     decorated = %TRUE to request decorations
194 	 */
195 	public void setDecorated(bool decorated);
196 
197 	/**
198 	 * Sets the toplevel to be deletable.
199 	 *
200 	 * Setting @deletable to %TRUE hints the desktop environment
201 	 * that it should offer the user a way to close the surface.
202 	 *
203 	 * Params:
204 	 *     deletable = %TRUE to request a delete button
205 	 */
206 	public void setDeletable(bool deletable);
207 
208 	/**
209 	 * Sets a list of icons for the surface.
210 	 *
211 	 * One of these will be used to represent the surface in iconic form.
212 	 * The icon may be shown in window lists or task bars. Which icon
213 	 * size is shown depends on the window manager. The window manager
214 	 * can scale the icon but setting several size icons can give better
215 	 * image quality.
216 	 *
217 	 * Note that some platforms don't support surface icons.
218 	 *
219 	 * Params:
220 	 *     surfaces = A list of textures to use as icon, of different sizes
221 	 */
222 	public void setIconList(ListG surfaces);
223 
224 	/**
225 	 * Sets the toplevel to be modal.
226 	 *
227 	 * The application can use this hint to tell the
228 	 * window manager that a certain surface has modal
229 	 * behaviour. The window manager can use this information
230 	 * to handle modal surfaces in a special way.
231 	 *
232 	 * You should only use this on surfaces for which you have
233 	 * previously called [method@Gdk.Toplevel.set_transient_for].
234 	 *
235 	 * Params:
236 	 *     modal = %TRUE if the surface is modal, %FALSE otherwise.
237 	 */
238 	public void setModal(bool modal);
239 
240 	/**
241 	 * Sets the startup notification ID.
242 	 *
243 	 * When using GTK, typically you should use
244 	 * [method@Gtk.Window.set_startup_id] instead of this
245 	 * low-level function.
246 	 *
247 	 * Params:
248 	 *     startupId = a string with startup-notification identifier
249 	 */
250 	public void setStartupId(string startupId);
251 
252 	/**
253 	 * Sets the title of a toplevel surface.
254 	 *
255 	 * The title maybe be displayed in the titlebar,
256 	 * in lists of windows, etc.
257 	 *
258 	 * Params:
259 	 *     title = title of @surface
260 	 */
261 	public void setTitle(string title);
262 
263 	/**
264 	 * Sets a transient-for parent.
265 	 *
266 	 * Indicates to the window manager that @surface is a transient
267 	 * dialog associated with the application surface @parent. This
268 	 * allows the window manager to do things like center @surface
269 	 * on @parent and keep @surface above @parent.
270 	 *
271 	 * See [method@Gtk.Window.set_transient_for] if you’re using
272 	 * [class@Gtk.Window] or [class@Gtk.Dialog].
273 	 *
274 	 * Params:
275 	 *     parent = another toplevel `GdkSurface`
276 	 */
277 	public void setTransientFor(Surface parent);
278 
279 	/**
280 	 * Asks the windowing system to show the window menu.
281 	 *
282 	 * The window menu is the menu shown when right-clicking the titlebar
283 	 * on traditional windows managed by the window manager. This is useful
284 	 * for windows using client-side decorations, activating it with a
285 	 * right-click on the window decorations.
286 	 *
287 	 * Params:
288 	 *     event = a `GdkEvent` to show the menu for
289 	 *
290 	 * Returns: %TRUE if the window menu was shown and %FALSE otherwise.
291 	 */
292 	public bool showWindowMenu(Event event);
293 
294 	/**
295 	 * Returns whether the desktop environment supports
296 	 * tiled window states.
297 	 *
298 	 * Returns: %TRUE if the desktop environment supports
299 	 *     tiled window states
300 	 */
301 	public bool supportsEdgeConstraints();
302 
303 	/**
304 	 * Emitted when the size for the surface needs to be computed, when
305 	 * it is present.
306 	 *
307 	 * It will normally be emitted during or after [method@Gdk.Toplevel.present],
308 	 * depending on the configuration received by the windowing system.
309 	 * It may also be emitted at any other point in time, in response
310 	 * to the windowing system spontaneously changing the configuration.
311 	 *
312 	 * It is the responsibility of the toplevel user to handle this signal
313 	 * and compute the desired size of the toplevel, given the information
314 	 * passed via the [struct@Gdk.ToplevelSize] object. Failing to do so
315 	 * will result in an arbitrary size being used as a result.
316 	 *
317 	 * Params:
318 	 *     size = a `GdkToplevelSize`
319 	 */
320 	gulong addOnComputeSize(void delegate(ToplevelSize, ToplevelIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
321 }