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 gtk.PlacesSidebar;
26 
27 private import gdk.DragContext;
28 private import gio.File;
29 private import gio.FileIF;
30 private import gio.MountOperation;
31 private import gio.Volume;
32 private import gio.VolumeIF;
33 private import glib.ConstructionException;
34 private import glib.ListG;
35 private import glib.ListSG;
36 private import glib.Str;
37 private import gobject.ObjectG;
38 private import gobject.Signals;
39 private import gtk.ScrolledWindow;
40 private import gtk.Widget;
41 private import gtkc.gtk;
42 public  import gtkc.gtktypes;
43 private import std.algorithm;
44 
45 
46 /**
47  * #GtkPlacesSidebar is a widget that displays a list of frequently-used places in the
48  * file system:  the user’s home directory, the user’s bookmarks, and volumes and drives.
49  * This widget is used as a sidebar in #GtkFileChooser and may be used by file managers
50  * and similar programs.
51  * 
52  * The places sidebar displays drives and volumes, and will automatically mount
53  * or unmount them when the user selects them.
54  * 
55  * Applications can hook to various signals in the places sidebar to customize
56  * its behavior.  For example, they can add extra commands to the context menu
57  * of the sidebar.
58  * 
59  * While bookmarks are completely in control of the user, the places sidebar also
60  * allows individual applications to provide extra shortcut folders that are unique
61  * to each application.  For example, a Paint program may want to add a shortcut
62  * for a Clipart folder.  You can do this with gtk_places_sidebar_add_shortcut().
63  * 
64  * To make use of the places sidebar, an application at least needs to connect
65  * to the #GtkPlacesSidebar::open-location signal.  This is emitted when the
66  * user selects in the sidebar a location to open.  The application should also
67  * call gtk_places_sidebar_set_location() when it changes the currently-viewed
68  * location.
69  * 
70  * # CSS nodes
71  * 
72  * GtkPlacesSidebar uses a single CSS node with name placessidebar and style
73  * class .sidebar.
74  * 
75  * Among the children of the places sidebar, the following style classes can
76  * be used:
77  * - .sidebar-new-bookmark-row for the 'Add new bookmark' row
78  * - .sidebar-placeholder-row for a row that is a placeholder
79  * - .has-open-popup when a popup is open for a row
80  */
81 public class PlacesSidebar : ScrolledWindow
82 {
83 	/** the main Gtk struct */
84 	protected GtkPlacesSidebar* gtkPlacesSidebar;
85 
86 	/** Get the main Gtk struct */
87 	public GtkPlacesSidebar* getPlacesSidebarStruct(bool transferOwnership = false)
88 	{
89 		if (transferOwnership)
90 			ownedRef = false;
91 		return gtkPlacesSidebar;
92 	}
93 
94 	/** the main Gtk struct as a void* */
95 	protected override void* getStruct()
96 	{
97 		return cast(void*)gtkPlacesSidebar;
98 	}
99 
100 	protected override void setStruct(GObject* obj)
101 	{
102 		gtkPlacesSidebar = cast(GtkPlacesSidebar*)obj;
103 		super.setStruct(obj);
104 	}
105 
106 	/**
107 	 * Sets our main struct and passes it to the parent class.
108 	 */
109 	public this (GtkPlacesSidebar* gtkPlacesSidebar, bool ownedRef = false)
110 	{
111 		this.gtkPlacesSidebar = gtkPlacesSidebar;
112 		super(cast(GtkScrolledWindow*)gtkPlacesSidebar, ownedRef);
113 	}
114 
115 
116 	/** */
117 	public static GType getType()
118 	{
119 		return gtk_places_sidebar_get_type();
120 	}
121 
122 	/**
123 	 * Creates a new #GtkPlacesSidebar widget.
124 	 *
125 	 * The application should connect to at least the
126 	 * #GtkPlacesSidebar::open-location signal to be notified
127 	 * when the user makes a selection in the sidebar.
128 	 *
129 	 * Returns: a newly created #GtkPlacesSidebar
130 	 *
131 	 * Since: 3.10
132 	 *
133 	 * Throws: ConstructionException GTK+ fails to create the object.
134 	 */
135 	public this()
136 	{
137 		auto p = gtk_places_sidebar_new();
138 		
139 		if(p is null)
140 		{
141 			throw new ConstructionException("null returned by new");
142 		}
143 		
144 		this(cast(GtkPlacesSidebar*) p);
145 	}
146 
147 	/**
148 	 * Applications may want to present some folders in the places sidebar if
149 	 * they could be immediately useful to users.  For example, a drawing
150 	 * program could add a “/usr/share/clipart” location when the sidebar is
151 	 * being used in an “Insert Clipart” dialog box.
152 	 *
153 	 * This function adds the specified @location to a special place for immutable
154 	 * shortcuts.  The shortcuts are application-specific; they are not shared
155 	 * across applications, and they are not persistent.  If this function
156 	 * is called multiple times with different locations, then they are added
157 	 * to the sidebar’s list in the same order as the function is called.
158 	 *
159 	 * Params:
160 	 *     location = location to add as an application-specific shortcut
161 	 *
162 	 * Since: 3.10
163 	 */
164 	public void addShortcut(FileIF location)
165 	{
166 		gtk_places_sidebar_add_shortcut(gtkPlacesSidebar, (location is null) ? null : location.getFileStruct());
167 	}
168 
169 	/**
170 	 * Returns the value previously set with gtk_places_sidebar_set_local_only().
171 	 *
172 	 * Returns: %TRUE if the sidebar will only show local files.
173 	 *
174 	 * Since: 3.12
175 	 */
176 	public bool getLocalOnly()
177 	{
178 		return gtk_places_sidebar_get_local_only(gtkPlacesSidebar) != 0;
179 	}
180 
181 	/**
182 	 * Gets the currently-selected location in the @sidebar.  This can be #NULL when
183 	 * nothing is selected, for example, when gtk_places_sidebar_set_location() has
184 	 * been called with a location that is not among the sidebar’s list of places to
185 	 * show.
186 	 *
187 	 * You can use this function to get the selection in the @sidebar.  Also, if you
188 	 * connect to the #GtkPlacesSidebar::populate-popup signal, you can use this
189 	 * function to get the location that is being referred to during the callbacks
190 	 * for your menu items.
191 	 *
192 	 * Returns: a GFile with the selected location, or
193 	 *     %NULL if nothing is visually selected.
194 	 *
195 	 * Since: 3.10
196 	 */
197 	public FileIF getLocation()
198 	{
199 		auto p = gtk_places_sidebar_get_location(gtkPlacesSidebar);
200 		
201 		if(p is null)
202 		{
203 			return null;
204 		}
205 		
206 		return ObjectG.getDObject!(File, FileIF)(cast(GFile*) p, true);
207 	}
208 
209 	/**
210 	 * This function queries the bookmarks added by the user to the places sidebar,
211 	 * and returns one of them.  This function is used by #GtkFileChooser to implement
212 	 * the “Alt-1”, “Alt-2”, etc. shortcuts, which activate the cooresponding bookmark.
213 	 *
214 	 * Params:
215 	 *     n = index of the bookmark to query
216 	 *
217 	 * Returns: The bookmark specified by the index @n, or
218 	 *     %NULL if no such index exist.  Note that the indices start at 0, even though
219 	 *     the file chooser starts them with the keyboard shortcut "Alt-1".
220 	 *
221 	 * Since: 3.10
222 	 */
223 	public FileIF getNthBookmark(int n)
224 	{
225 		auto p = gtk_places_sidebar_get_nth_bookmark(gtkPlacesSidebar, n);
226 		
227 		if(p is null)
228 		{
229 			return null;
230 		}
231 		
232 		return ObjectG.getDObject!(File, FileIF)(cast(GFile*) p, true);
233 	}
234 
235 	/**
236 	 * Gets the open flags.
237 	 *
238 	 * Returns: the #GtkPlacesOpenFlags of @sidebar
239 	 *
240 	 * Since: 3.10
241 	 */
242 	public GtkPlacesOpenFlags getOpenFlags()
243 	{
244 		return gtk_places_sidebar_get_open_flags(gtkPlacesSidebar);
245 	}
246 
247 	/**
248 	 * Returns the value previously set with gtk_places_sidebar_set_show_connect_to_server()
249 	 *
250 	 * Deprecated: It is recommended to group this functionality with the drives
251 	 * and network location under the new 'Other Location' item
252 	 *
253 	 * Returns: %TRUE if the sidebar will display a “Connect to Server” item.
254 	 */
255 	public bool getShowConnectToServer()
256 	{
257 		return gtk_places_sidebar_get_show_connect_to_server(gtkPlacesSidebar) != 0;
258 	}
259 
260 	/**
261 	 * Returns the value previously set with gtk_places_sidebar_set_show_desktop()
262 	 *
263 	 * Returns: %TRUE if the sidebar will display a builtin shortcut to the desktop folder.
264 	 *
265 	 * Since: 3.10
266 	 */
267 	public bool getShowDesktop()
268 	{
269 		return gtk_places_sidebar_get_show_desktop(gtkPlacesSidebar) != 0;
270 	}
271 
272 	/**
273 	 * Returns the value previously set with gtk_places_sidebar_set_show_enter_location()
274 	 *
275 	 * Returns: %TRUE if the sidebar will display an “Enter Location” item.
276 	 *
277 	 * Since: 3.14
278 	 */
279 	public bool getShowEnterLocation()
280 	{
281 		return gtk_places_sidebar_get_show_enter_location(gtkPlacesSidebar) != 0;
282 	}
283 
284 	/**
285 	 * Returns the value previously set with gtk_places_sidebar_set_show_other_locations()
286 	 *
287 	 * Returns: %TRUE if the sidebar will display an “Other Locations” item.
288 	 *
289 	 * Since: 3.18
290 	 */
291 	public bool getShowOtherLocations()
292 	{
293 		return gtk_places_sidebar_get_show_other_locations(gtkPlacesSidebar) != 0;
294 	}
295 
296 	/**
297 	 * Returns the value previously set with gtk_places_sidebar_set_show_recent()
298 	 *
299 	 * Returns: %TRUE if the sidebar will display a builtin shortcut for recent files
300 	 *
301 	 * Since: 3.18
302 	 */
303 	public bool getShowRecent()
304 	{
305 		return gtk_places_sidebar_get_show_recent(gtkPlacesSidebar) != 0;
306 	}
307 
308 	/**
309 	 * Returns the value previously set with gtk_places_sidebar_set_show_trash()
310 	 *
311 	 * Returns: %TRUE if the sidebar will display a “Trash” item.
312 	 *
313 	 * Since: 3.18
314 	 */
315 	public bool getShowTrash()
316 	{
317 		return gtk_places_sidebar_get_show_trash(gtkPlacesSidebar) != 0;
318 	}
319 
320 	/**
321 	 * Gets the list of shortcuts.
322 	 *
323 	 * Returns: A #GSList of #GFile of the locations that have been added as
324 	 *     application-specific shortcuts with gtk_places_sidebar_add_shortcut().
325 	 *     To free this list, you can use
326 	 *     |[<!-- language="C" -->
327 	 *     g_slist_free_full (list, (GDestroyNotify) g_object_unref);
328 	 *     ]|
329 	 *
330 	 * Since: 3.10
331 	 */
332 	public ListSG listShortcuts()
333 	{
334 		auto p = gtk_places_sidebar_list_shortcuts(gtkPlacesSidebar);
335 		
336 		if(p is null)
337 		{
338 			return null;
339 		}
340 		
341 		return new ListSG(cast(GSList*) p, true);
342 	}
343 
344 	/**
345 	 * Removes an application-specific shortcut that has been previously been
346 	 * inserted with gtk_places_sidebar_add_shortcut().  If the @location is not a
347 	 * shortcut in the sidebar, then nothing is done.
348 	 *
349 	 * Params:
350 	 *     location = location to remove
351 	 *
352 	 * Since: 3.10
353 	 */
354 	public void removeShortcut(FileIF location)
355 	{
356 		gtk_places_sidebar_remove_shortcut(gtkPlacesSidebar, (location is null) ? null : location.getFileStruct());
357 	}
358 
359 	/**
360 	 * Make the GtkPlacesSidebar show drop targets, so it can show the available
361 	 * drop targets and a "new bookmark" row. This improves the Drag-and-Drop
362 	 * experience of the user and allows applications to show all available
363 	 * drop targets at once.
364 	 *
365 	 * This needs to be called when the application is aware of an ongoing drag
366 	 * that might target the sidebar. The drop-targets-visible state will be unset
367 	 * automatically if the drag finishes in the GtkPlacesSidebar. You only need
368 	 * to unset the state when the drag ends on some other widget on your application.
369 	 *
370 	 * Params:
371 	 *     visible = whether to show the valid targets or not.
372 	 *     context = drag context used to ask the source about the action that wants to
373 	 *         perform, so hints are more accurate.
374 	 *
375 	 * Since: 3.18
376 	 */
377 	public void setDropTargetsVisible(bool visible, DragContext context)
378 	{
379 		gtk_places_sidebar_set_drop_targets_visible(gtkPlacesSidebar, visible, (context is null) ? null : context.getDragContextStruct());
380 	}
381 
382 	/**
383 	 * Sets whether the @sidebar should only show local files.
384 	 *
385 	 * Params:
386 	 *     localOnly = whether to show only local files
387 	 *
388 	 * Since: 3.12
389 	 */
390 	public void setLocalOnly(bool localOnly)
391 	{
392 		gtk_places_sidebar_set_local_only(gtkPlacesSidebar, localOnly);
393 	}
394 
395 	/**
396 	 * Sets the location that is being shown in the widgets surrounding the
397 	 * @sidebar, for example, in a folder view in a file manager.  In turn, the
398 	 * @sidebar will highlight that location if it is being shown in the list of
399 	 * places, or it will unhighlight everything if the @location is not among the
400 	 * places in the list.
401 	 *
402 	 * Params:
403 	 *     location = location to select, or #NULL for no current path
404 	 *
405 	 * Since: 3.10
406 	 */
407 	public void setLocation(FileIF location)
408 	{
409 		gtk_places_sidebar_set_location(gtkPlacesSidebar, (location is null) ? null : location.getFileStruct());
410 	}
411 
412 	/**
413 	 * Sets the way in which the calling application can open new locations from
414 	 * the places sidebar.  For example, some applications only open locations
415 	 * “directly” into their main view, while others may support opening locations
416 	 * in a new notebook tab or a new window.
417 	 *
418 	 * This function is used to tell the places @sidebar about the ways in which the
419 	 * application can open new locations, so that the sidebar can display (or not)
420 	 * the “Open in new tab” and “Open in new window” menu items as appropriate.
421 	 *
422 	 * When the #GtkPlacesSidebar::open-location signal is emitted, its flags
423 	 * argument will be set to one of the @flags that was passed in
424 	 * gtk_places_sidebar_set_open_flags().
425 	 *
426 	 * Passing 0 for @flags will cause #GTK_PLACES_OPEN_NORMAL to always be sent
427 	 * to callbacks for the “open-location” signal.
428 	 *
429 	 * Params:
430 	 *     flags = Bitmask of modes in which the calling application can open locations
431 	 *
432 	 * Since: 3.10
433 	 */
434 	public void setOpenFlags(GtkPlacesOpenFlags flags)
435 	{
436 		gtk_places_sidebar_set_open_flags(gtkPlacesSidebar, flags);
437 	}
438 
439 	/**
440 	 * Sets whether the @sidebar should show an item for connecting to a network server;
441 	 * this is off by default. An application may want to turn this on if it implements
442 	 * a way for the user to connect to network servers directly.
443 	 *
444 	 * If you enable this, you should connect to the
445 	 * #GtkPlacesSidebar::show-connect-to-server signal.
446 	 *
447 	 * Deprecated: It is recommended to group this functionality with the drives
448 	 * and network location under the new 'Other Location' item
449 	 *
450 	 * Params:
451 	 *     showConnectToServer = whether to show an item for the Connect to Server command
452 	 *
453 	 * Since: 3.10
454 	 */
455 	public void setShowConnectToServer(bool showConnectToServer)
456 	{
457 		gtk_places_sidebar_set_show_connect_to_server(gtkPlacesSidebar, showConnectToServer);
458 	}
459 
460 	/**
461 	 * Sets whether the @sidebar should show an item for the Desktop folder.
462 	 * The default value for this option is determined by the desktop
463 	 * environment and the user’s configuration, but this function can be
464 	 * used to override it on a per-application basis.
465 	 *
466 	 * Params:
467 	 *     showDesktop = whether to show an item for the Desktop folder
468 	 *
469 	 * Since: 3.10
470 	 */
471 	public void setShowDesktop(bool showDesktop)
472 	{
473 		gtk_places_sidebar_set_show_desktop(gtkPlacesSidebar, showDesktop);
474 	}
475 
476 	/**
477 	 * Sets whether the @sidebar should show an item for entering a location;
478 	 * this is off by default. An application may want to turn this on if manually
479 	 * entering URLs is an expected user action.
480 	 *
481 	 * If you enable this, you should connect to the
482 	 * #GtkPlacesSidebar::show-enter-location signal.
483 	 *
484 	 * Params:
485 	 *     showEnterLocation = whether to show an item to enter a location
486 	 *
487 	 * Since: 3.14
488 	 */
489 	public void setShowEnterLocation(bool showEnterLocation)
490 	{
491 		gtk_places_sidebar_set_show_enter_location(gtkPlacesSidebar, showEnterLocation);
492 	}
493 
494 	/**
495 	 * Sets whether the @sidebar should show an item for the application to show
496 	 * an Other Locations view; this is off by default. When set to %TRUE, persistent
497 	 * devices such as hard drives are hidden, otherwise they are shown in the sidebar.
498 	 * An application may want to turn this on if it implements a way for the user to
499 	 * see and interact with drives and network servers directly.
500 	 *
501 	 * If you enable this, you should connect to the
502 	 * #GtkPlacesSidebar::show-other-locations signal.
503 	 *
504 	 * Params:
505 	 *     showOtherLocations = whether to show an item for the Other Locations view
506 	 *
507 	 * Since: 3.18
508 	 */
509 	public void setShowOtherLocations(bool showOtherLocations)
510 	{
511 		gtk_places_sidebar_set_show_other_locations(gtkPlacesSidebar, showOtherLocations);
512 	}
513 
514 	/**
515 	 * Sets whether the @sidebar should show an item for recent files.
516 	 * The default value for this option is determined by the desktop
517 	 * environment, but this function can be used to override it on a
518 	 * per-application basis.
519 	 *
520 	 * Params:
521 	 *     showRecent = whether to show an item for recent files
522 	 *
523 	 * Since: 3.18
524 	 */
525 	public void setShowRecent(bool showRecent)
526 	{
527 		gtk_places_sidebar_set_show_recent(gtkPlacesSidebar, showRecent);
528 	}
529 
530 	/**
531 	 * Sets whether the @sidebar should show an item for the Trash location.
532 	 *
533 	 * Params:
534 	 *     showTrash = whether to show an item for the Trash location
535 	 *
536 	 * Since: 3.18
537 	 */
538 	public void setShowTrash(bool showTrash)
539 	{
540 		gtk_places_sidebar_set_show_trash(gtkPlacesSidebar, showTrash);
541 	}
542 
543 	protected class OnDragActionAskDelegateWrapper
544 	{
545 		static OnDragActionAskDelegateWrapper[] listeners;
546 		int delegate(int, PlacesSidebar) dlg;
547 		gulong handlerId;
548 		
549 		this(int delegate(int, PlacesSidebar) dlg)
550 		{
551 			this.dlg = dlg;
552 			this.listeners ~= this;
553 		}
554 		
555 		void remove(OnDragActionAskDelegateWrapper source)
556 		{
557 			foreach(index, wrapper; listeners)
558 			{
559 				if (wrapper.handlerId == source.handlerId)
560 				{
561 					listeners[index] = null;
562 					listeners = std.algorithm.remove(listeners, index);
563 					break;
564 				}
565 			}
566 		}
567 	}
568 
569 	/**
570 	 * The places sidebar emits this signal when it needs to ask the application
571 	 * to pop up a menu to ask the user for which drag action to perform.
572 	 *
573 	 * Params:
574 	 *     actions = Possible drag actions that need to be asked for.
575 	 *
576 	 * Returns: the final drag action that the sidebar should pass to the drag side
577 	 *     of the drag-and-drop operation.
578 	 *
579 	 * Since: 3.10
580 	 */
581 	gulong addOnDragActionAsk(int delegate(int, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
582 	{
583 		auto wrapper = new OnDragActionAskDelegateWrapper(dlg);
584 		wrapper.handlerId = Signals.connectData(
585 			this,
586 			"drag-action-ask",
587 			cast(GCallback)&callBackDragActionAsk,
588 			cast(void*)wrapper,
589 			cast(GClosureNotify)&callBackDragActionAskDestroy,
590 			connectFlags);
591 		return wrapper.handlerId;
592 	}
593 	
594 	extern(C) static int callBackDragActionAsk(GtkPlacesSidebar* placessidebarStruct, int actions, OnDragActionAskDelegateWrapper wrapper)
595 	{
596 		return wrapper.dlg(actions, wrapper.outer);
597 	}
598 	
599 	extern(C) static void callBackDragActionAskDestroy(OnDragActionAskDelegateWrapper wrapper, GClosure* closure)
600 	{
601 		wrapper.remove(wrapper);
602 	}
603 
604 	protected class OnDragActionRequestedDelegateWrapper
605 	{
606 		static OnDragActionRequestedDelegateWrapper[] listeners;
607 		int delegate(DragContext, FileIF, ListG, PlacesSidebar) dlg;
608 		gulong handlerId;
609 		
610 		this(int delegate(DragContext, FileIF, ListG, PlacesSidebar) dlg)
611 		{
612 			this.dlg = dlg;
613 			this.listeners ~= this;
614 		}
615 		
616 		void remove(OnDragActionRequestedDelegateWrapper source)
617 		{
618 			foreach(index, wrapper; listeners)
619 			{
620 				if (wrapper.handlerId == source.handlerId)
621 				{
622 					listeners[index] = null;
623 					listeners = std.algorithm.remove(listeners, index);
624 					break;
625 				}
626 			}
627 		}
628 	}
629 
630 	/**
631 	 * When the user starts a drag-and-drop operation and the sidebar needs
632 	 * to ask the application for which drag action to perform, then the
633 	 * sidebar will emit this signal.
634 	 *
635 	 * The application can evaluate the @context for customary actions, or
636 	 * it can check the type of the files indicated by @source_file_list against the
637 	 * possible actions for the destination @dest_file.
638 	 *
639 	 * The drag action to use must be the return value of the signal handler.
640 	 *
641 	 * Params:
642 	 *     context = #GdkDragContext with information about the drag operation
643 	 *     destFile = #GFile with the tentative location that is being hovered for a drop
644 	 *     sourceFileList = List of #GFile that are being dragged
645 	 *
646 	 * Returns: The drag action to use, for example, #GDK_ACTION_COPY
647 	 *     or #GDK_ACTION_MOVE, or 0 if no action is allowed here (i.e. drops
648 	 *     are not allowed in the specified @dest_file).
649 	 *
650 	 * Since: 3.10
651 	 */
652 	gulong addOnDragActionRequested(int delegate(DragContext, FileIF, ListG, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
653 	{
654 		auto wrapper = new OnDragActionRequestedDelegateWrapper(dlg);
655 		wrapper.handlerId = Signals.connectData(
656 			this,
657 			"drag-action-requested",
658 			cast(GCallback)&callBackDragActionRequested,
659 			cast(void*)wrapper,
660 			cast(GClosureNotify)&callBackDragActionRequestedDestroy,
661 			connectFlags);
662 		return wrapper.handlerId;
663 	}
664 	
665 	extern(C) static int callBackDragActionRequested(GtkPlacesSidebar* placessidebarStruct, GdkDragContext* context, GFile* destFile, GList* sourceFileList, OnDragActionRequestedDelegateWrapper wrapper)
666 	{
667 		return wrapper.dlg(ObjectG.getDObject!(DragContext)(context), ObjectG.getDObject!(File, FileIF)(destFile), new ListG(sourceFileList), wrapper.outer);
668 	}
669 	
670 	extern(C) static void callBackDragActionRequestedDestroy(OnDragActionRequestedDelegateWrapper wrapper, GClosure* closure)
671 	{
672 		wrapper.remove(wrapper);
673 	}
674 
675 	protected class OnDragPerformDropDelegateWrapper
676 	{
677 		static OnDragPerformDropDelegateWrapper[] listeners;
678 		void delegate(FileIF, ListG, int, PlacesSidebar) dlg;
679 		gulong handlerId;
680 		
681 		this(void delegate(FileIF, ListG, int, PlacesSidebar) dlg)
682 		{
683 			this.dlg = dlg;
684 			this.listeners ~= this;
685 		}
686 		
687 		void remove(OnDragPerformDropDelegateWrapper source)
688 		{
689 			foreach(index, wrapper; listeners)
690 			{
691 				if (wrapper.handlerId == source.handlerId)
692 				{
693 					listeners[index] = null;
694 					listeners = std.algorithm.remove(listeners, index);
695 					break;
696 				}
697 			}
698 		}
699 	}
700 
701 	/**
702 	 * The places sidebar emits this signal when the user completes a
703 	 * drag-and-drop operation and one of the sidebar's items is the
704 	 * destination.  This item is in the @dest_file, and the
705 	 * @source_file_list has the list of files that are dropped into it and
706 	 * which should be copied/moved/etc. based on the specified @action.
707 	 *
708 	 * Params:
709 	 *     destFile = Destination #GFile.
710 	 *     sourceFileList = #GList of #GFile that got dropped.
711 	 *     action = Drop action to perform.
712 	 *
713 	 * Since: 3.10
714 	 */
715 	gulong addOnDragPerformDrop(void delegate(FileIF, ListG, int, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
716 	{
717 		auto wrapper = new OnDragPerformDropDelegateWrapper(dlg);
718 		wrapper.handlerId = Signals.connectData(
719 			this,
720 			"drag-perform-drop",
721 			cast(GCallback)&callBackDragPerformDrop,
722 			cast(void*)wrapper,
723 			cast(GClosureNotify)&callBackDragPerformDropDestroy,
724 			connectFlags);
725 		return wrapper.handlerId;
726 	}
727 	
728 	extern(C) static void callBackDragPerformDrop(GtkPlacesSidebar* placessidebarStruct, GFile* destFile, GList* sourceFileList, int action, OnDragPerformDropDelegateWrapper wrapper)
729 	{
730 		wrapper.dlg(ObjectG.getDObject!(File, FileIF)(destFile), new ListG(sourceFileList), action, wrapper.outer);
731 	}
732 	
733 	extern(C) static void callBackDragPerformDropDestroy(OnDragPerformDropDelegateWrapper wrapper, GClosure* closure)
734 	{
735 		wrapper.remove(wrapper);
736 	}
737 
738 	protected class OnMountDelegateWrapper
739 	{
740 		static OnMountDelegateWrapper[] listeners;
741 		void delegate(MountOperation, PlacesSidebar) dlg;
742 		gulong handlerId;
743 		
744 		this(void delegate(MountOperation, PlacesSidebar) dlg)
745 		{
746 			this.dlg = dlg;
747 			this.listeners ~= this;
748 		}
749 		
750 		void remove(OnMountDelegateWrapper source)
751 		{
752 			foreach(index, wrapper; listeners)
753 			{
754 				if (wrapper.handlerId == source.handlerId)
755 				{
756 					listeners[index] = null;
757 					listeners = std.algorithm.remove(listeners, index);
758 					break;
759 				}
760 			}
761 		}
762 	}
763 
764 	/**
765 	 * The places sidebar emits this signal when it starts a new operation
766 	 * because the user clicked on some location that needs mounting.
767 	 * In this way the application using the #GtkPlacesSidebar can track the
768 	 * progress of the operation and, for example, show a notification.
769 	 *
770 	 * Params:
771 	 *     mountOperation = the #GMountOperation that is going to start.
772 	 *
773 	 * Since: 3.20
774 	 */
775 	gulong addOnMount(void delegate(MountOperation, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
776 	{
777 		auto wrapper = new OnMountDelegateWrapper(dlg);
778 		wrapper.handlerId = Signals.connectData(
779 			this,
780 			"mount",
781 			cast(GCallback)&callBackMount,
782 			cast(void*)wrapper,
783 			cast(GClosureNotify)&callBackMountDestroy,
784 			connectFlags);
785 		return wrapper.handlerId;
786 	}
787 	
788 	extern(C) static void callBackMount(GtkPlacesSidebar* placessidebarStruct, GMountOperation* mountOperation, OnMountDelegateWrapper wrapper)
789 	{
790 		wrapper.dlg(ObjectG.getDObject!(MountOperation)(mountOperation), wrapper.outer);
791 	}
792 	
793 	extern(C) static void callBackMountDestroy(OnMountDelegateWrapper wrapper, GClosure* closure)
794 	{
795 		wrapper.remove(wrapper);
796 	}
797 
798 	protected class OnOpenLocationDelegateWrapper
799 	{
800 		static OnOpenLocationDelegateWrapper[] listeners;
801 		void delegate(FileIF, GtkPlacesOpenFlags, PlacesSidebar) dlg;
802 		gulong handlerId;
803 		
804 		this(void delegate(FileIF, GtkPlacesOpenFlags, PlacesSidebar) dlg)
805 		{
806 			this.dlg = dlg;
807 			this.listeners ~= this;
808 		}
809 		
810 		void remove(OnOpenLocationDelegateWrapper source)
811 		{
812 			foreach(index, wrapper; listeners)
813 			{
814 				if (wrapper.handlerId == source.handlerId)
815 				{
816 					listeners[index] = null;
817 					listeners = std.algorithm.remove(listeners, index);
818 					break;
819 				}
820 			}
821 		}
822 	}
823 
824 	/**
825 	 * The places sidebar emits this signal when the user selects a location
826 	 * in it.  The calling application should display the contents of that
827 	 * location; for example, a file manager should show a list of files in
828 	 * the specified location.
829 	 *
830 	 * Params:
831 	 *     location = #GFile to which the caller should switch.
832 	 *     openFlags = a single value from #GtkPlacesOpenFlags specifying how the @location should be opened.
833 	 *
834 	 * Since: 3.10
835 	 */
836 	gulong addOnOpenLocation(void delegate(FileIF, GtkPlacesOpenFlags, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
837 	{
838 		auto wrapper = new OnOpenLocationDelegateWrapper(dlg);
839 		wrapper.handlerId = Signals.connectData(
840 			this,
841 			"open-location",
842 			cast(GCallback)&callBackOpenLocation,
843 			cast(void*)wrapper,
844 			cast(GClosureNotify)&callBackOpenLocationDestroy,
845 			connectFlags);
846 		return wrapper.handlerId;
847 	}
848 	
849 	extern(C) static void callBackOpenLocation(GtkPlacesSidebar* placessidebarStruct, GFile* location, GtkPlacesOpenFlags openFlags, OnOpenLocationDelegateWrapper wrapper)
850 	{
851 		wrapper.dlg(ObjectG.getDObject!(File, FileIF)(location), openFlags, wrapper.outer);
852 	}
853 	
854 	extern(C) static void callBackOpenLocationDestroy(OnOpenLocationDelegateWrapper wrapper, GClosure* closure)
855 	{
856 		wrapper.remove(wrapper);
857 	}
858 
859 	protected class OnPopulatePopupDelegateWrapper
860 	{
861 		static OnPopulatePopupDelegateWrapper[] listeners;
862 		void delegate(Widget, FileIF, VolumeIF, PlacesSidebar) dlg;
863 		gulong handlerId;
864 		
865 		this(void delegate(Widget, FileIF, VolumeIF, PlacesSidebar) dlg)
866 		{
867 			this.dlg = dlg;
868 			this.listeners ~= this;
869 		}
870 		
871 		void remove(OnPopulatePopupDelegateWrapper source)
872 		{
873 			foreach(index, wrapper; listeners)
874 			{
875 				if (wrapper.handlerId == source.handlerId)
876 				{
877 					listeners[index] = null;
878 					listeners = std.algorithm.remove(listeners, index);
879 					break;
880 				}
881 			}
882 		}
883 	}
884 
885 	/**
886 	 * The places sidebar emits this signal when the user invokes a contextual
887 	 * popup on one of its items. In the signal handler, the application may
888 	 * add extra items to the menu as appropriate. For example, a file manager
889 	 * may want to add a "Properties" command to the menu.
890 	 *
891 	 * It is not necessary to store the @selected_item for each menu item;
892 	 * during their callbacks, the application can use gtk_places_sidebar_get_location()
893 	 * to get the file to which the item refers.
894 	 *
895 	 * The @selected_item argument may be %NULL in case the selection refers to
896 	 * a volume. In this case, @selected_volume will be non-%NULL. In this case,
897 	 * the calling application will have to g_object_ref() the @selected_volume and
898 	 * keep it around to use it in the callback.
899 	 *
900 	 * The @container and all its contents are destroyed after the user
901 	 * dismisses the popup. The popup is re-created (and thus, this signal is
902 	 * emitted) every time the user activates the contextual menu.
903 	 *
904 	 * Before 3.18, the @container always was a #GtkMenu, and you were expected
905 	 * to add your items as #GtkMenuItems. Since 3.18, the popup may be implemented
906 	 * as a #GtkPopover, in which case @container will be something else, e.g. a
907 	 * #GtkBox, to which you may add #GtkModelButtons or other widgets, such as
908 	 * #GtkEntries, #GtkSpinButtons, etc. If your application can deal with this
909 	 * situation, you can set #GtkPlacesSidebar::populate-all to %TRUE to request
910 	 * that this signal is emitted for populating popovers as well.
911 	 *
912 	 * Params:
913 	 *     container = a #GtkMenu or another #GtkContainer
914 	 *     selectedItem = #GFile with the item to which the popup should refer, or #NULL in the case of a @selected_volume.
915 	 *     selectedVolume = #GVolume if the selected item is a volume, or #NULL if it is a file.
916 	 *
917 	 * Since: 3.10
918 	 */
919 	gulong addOnPopulatePopup(void delegate(Widget, FileIF, VolumeIF, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
920 	{
921 		auto wrapper = new OnPopulatePopupDelegateWrapper(dlg);
922 		wrapper.handlerId = Signals.connectData(
923 			this,
924 			"populate-popup",
925 			cast(GCallback)&callBackPopulatePopup,
926 			cast(void*)wrapper,
927 			cast(GClosureNotify)&callBackPopulatePopupDestroy,
928 			connectFlags);
929 		return wrapper.handlerId;
930 	}
931 	
932 	extern(C) static void callBackPopulatePopup(GtkPlacesSidebar* placessidebarStruct, GtkWidget* container, GFile* selectedItem, GVolume* selectedVolume, OnPopulatePopupDelegateWrapper wrapper)
933 	{
934 		wrapper.dlg(ObjectG.getDObject!(Widget)(container), ObjectG.getDObject!(File, FileIF)(selectedItem), ObjectG.getDObject!(Volume, VolumeIF)(selectedVolume), wrapper.outer);
935 	}
936 	
937 	extern(C) static void callBackPopulatePopupDestroy(OnPopulatePopupDelegateWrapper wrapper, GClosure* closure)
938 	{
939 		wrapper.remove(wrapper);
940 	}
941 
942 	protected class OnShowConnectToServerDelegateWrapper
943 	{
944 		static OnShowConnectToServerDelegateWrapper[] listeners;
945 		void delegate(PlacesSidebar) dlg;
946 		gulong handlerId;
947 		
948 		this(void delegate(PlacesSidebar) dlg)
949 		{
950 			this.dlg = dlg;
951 			this.listeners ~= this;
952 		}
953 		
954 		void remove(OnShowConnectToServerDelegateWrapper source)
955 		{
956 			foreach(index, wrapper; listeners)
957 			{
958 				if (wrapper.handlerId == source.handlerId)
959 				{
960 					listeners[index] = null;
961 					listeners = std.algorithm.remove(listeners, index);
962 					break;
963 				}
964 			}
965 		}
966 	}
967 
968 	/**
969 	 * The places sidebar emits this signal when it needs the calling
970 	 * application to present an way to connect directly to a network server.
971 	 * For example, the application may bring up a dialog box asking for
972 	 * a URL like "sftp://ftp.example.com".  It is up to the application to create
973 	 * the corresponding mount by using, for example, g_file_mount_enclosing_volume().
974 	 *
975 	 * Deprecated: use the #GtkPlacesSidebar::show-other-locations signal
976 	 * to connect to network servers.
977 	 */
978 	gulong addOnShowConnectToServer(void delegate(PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
979 	{
980 		auto wrapper = new OnShowConnectToServerDelegateWrapper(dlg);
981 		wrapper.handlerId = Signals.connectData(
982 			this,
983 			"show-connect-to-server",
984 			cast(GCallback)&callBackShowConnectToServer,
985 			cast(void*)wrapper,
986 			cast(GClosureNotify)&callBackShowConnectToServerDestroy,
987 			connectFlags);
988 		return wrapper.handlerId;
989 	}
990 	
991 	extern(C) static void callBackShowConnectToServer(GtkPlacesSidebar* placessidebarStruct, OnShowConnectToServerDelegateWrapper wrapper)
992 	{
993 		wrapper.dlg(wrapper.outer);
994 	}
995 	
996 	extern(C) static void callBackShowConnectToServerDestroy(OnShowConnectToServerDelegateWrapper wrapper, GClosure* closure)
997 	{
998 		wrapper.remove(wrapper);
999 	}
1000 
1001 	protected class OnShowEnterLocationDelegateWrapper
1002 	{
1003 		static OnShowEnterLocationDelegateWrapper[] listeners;
1004 		void delegate(PlacesSidebar) dlg;
1005 		gulong handlerId;
1006 		
1007 		this(void delegate(PlacesSidebar) dlg)
1008 		{
1009 			this.dlg = dlg;
1010 			this.listeners ~= this;
1011 		}
1012 		
1013 		void remove(OnShowEnterLocationDelegateWrapper source)
1014 		{
1015 			foreach(index, wrapper; listeners)
1016 			{
1017 				if (wrapper.handlerId == source.handlerId)
1018 				{
1019 					listeners[index] = null;
1020 					listeners = std.algorithm.remove(listeners, index);
1021 					break;
1022 				}
1023 			}
1024 		}
1025 	}
1026 
1027 	/**
1028 	 * The places sidebar emits this signal when it needs the calling
1029 	 * application to present an way to directly enter a location.
1030 	 * For example, the application may bring up a dialog box asking for
1031 	 * a URL like "http://http.example.com".
1032 	 *
1033 	 * Since: 3.14
1034 	 */
1035 	gulong addOnShowEnterLocation(void delegate(PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1036 	{
1037 		auto wrapper = new OnShowEnterLocationDelegateWrapper(dlg);
1038 		wrapper.handlerId = Signals.connectData(
1039 			this,
1040 			"show-enter-location",
1041 			cast(GCallback)&callBackShowEnterLocation,
1042 			cast(void*)wrapper,
1043 			cast(GClosureNotify)&callBackShowEnterLocationDestroy,
1044 			connectFlags);
1045 		return wrapper.handlerId;
1046 	}
1047 	
1048 	extern(C) static void callBackShowEnterLocation(GtkPlacesSidebar* placessidebarStruct, OnShowEnterLocationDelegateWrapper wrapper)
1049 	{
1050 		wrapper.dlg(wrapper.outer);
1051 	}
1052 	
1053 	extern(C) static void callBackShowEnterLocationDestroy(OnShowEnterLocationDelegateWrapper wrapper, GClosure* closure)
1054 	{
1055 		wrapper.remove(wrapper);
1056 	}
1057 
1058 	protected class OnShowErrorMessageDelegateWrapper
1059 	{
1060 		static OnShowErrorMessageDelegateWrapper[] listeners;
1061 		void delegate(string, string, PlacesSidebar) dlg;
1062 		gulong handlerId;
1063 		
1064 		this(void delegate(string, string, PlacesSidebar) dlg)
1065 		{
1066 			this.dlg = dlg;
1067 			this.listeners ~= this;
1068 		}
1069 		
1070 		void remove(OnShowErrorMessageDelegateWrapper source)
1071 		{
1072 			foreach(index, wrapper; listeners)
1073 			{
1074 				if (wrapper.handlerId == source.handlerId)
1075 				{
1076 					listeners[index] = null;
1077 					listeners = std.algorithm.remove(listeners, index);
1078 					break;
1079 				}
1080 			}
1081 		}
1082 	}
1083 
1084 	/**
1085 	 * The places sidebar emits this signal when it needs the calling
1086 	 * application to present an error message.  Most of these messages
1087 	 * refer to mounting or unmounting media, for example, when a drive
1088 	 * cannot be started for some reason.
1089 	 *
1090 	 * Params:
1091 	 *     primary = primary message with a summary of the error to show.
1092 	 *     secondary = secondary message with details of the error to show.
1093 	 *
1094 	 * Since: 3.10
1095 	 */
1096 	gulong addOnShowErrorMessage(void delegate(string, string, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1097 	{
1098 		auto wrapper = new OnShowErrorMessageDelegateWrapper(dlg);
1099 		wrapper.handlerId = Signals.connectData(
1100 			this,
1101 			"show-error-message",
1102 			cast(GCallback)&callBackShowErrorMessage,
1103 			cast(void*)wrapper,
1104 			cast(GClosureNotify)&callBackShowErrorMessageDestroy,
1105 			connectFlags);
1106 		return wrapper.handlerId;
1107 	}
1108 	
1109 	extern(C) static void callBackShowErrorMessage(GtkPlacesSidebar* placessidebarStruct, char* primary, char* secondary, OnShowErrorMessageDelegateWrapper wrapper)
1110 	{
1111 		wrapper.dlg(Str.toString(primary), Str.toString(secondary), wrapper.outer);
1112 	}
1113 	
1114 	extern(C) static void callBackShowErrorMessageDestroy(OnShowErrorMessageDelegateWrapper wrapper, GClosure* closure)
1115 	{
1116 		wrapper.remove(wrapper);
1117 	}
1118 
1119 	protected class OnShowOtherLocationsDelegateWrapper
1120 	{
1121 		static OnShowOtherLocationsDelegateWrapper[] listeners;
1122 		void delegate(PlacesSidebar) dlg;
1123 		gulong handlerId;
1124 		
1125 		this(void delegate(PlacesSidebar) dlg)
1126 		{
1127 			this.dlg = dlg;
1128 			this.listeners ~= this;
1129 		}
1130 		
1131 		void remove(OnShowOtherLocationsDelegateWrapper source)
1132 		{
1133 			foreach(index, wrapper; listeners)
1134 			{
1135 				if (wrapper.handlerId == source.handlerId)
1136 				{
1137 					listeners[index] = null;
1138 					listeners = std.algorithm.remove(listeners, index);
1139 					break;
1140 				}
1141 			}
1142 		}
1143 	}
1144 
1145 	/**
1146 	 * The places sidebar emits this signal when it needs the calling
1147 	 * application to present a way to show other locations e.g. drives
1148 	 * and network access points.
1149 	 * For example, the application may bring up a page showing persistent
1150 	 * volumes and discovered network addresses.
1151 	 *
1152 	 * Deprecated: use the #GtkPlacesSidebar::show-other-locations-with-flags
1153 	 * which includes the open flags in order to allow the user to specify to open
1154 	 * in a new tab or window, in a similar way than #GtkPlacesSidebar::open-location
1155 	 *
1156 	 * Since: 3.18
1157 	 */
1158 	gulong addOnShowOtherLocations(void delegate(PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1159 	{
1160 		auto wrapper = new OnShowOtherLocationsDelegateWrapper(dlg);
1161 		wrapper.handlerId = Signals.connectData(
1162 			this,
1163 			"show-other-locations",
1164 			cast(GCallback)&callBackShowOtherLocations,
1165 			cast(void*)wrapper,
1166 			cast(GClosureNotify)&callBackShowOtherLocationsDestroy,
1167 			connectFlags);
1168 		return wrapper.handlerId;
1169 	}
1170 	
1171 	extern(C) static void callBackShowOtherLocations(GtkPlacesSidebar* placessidebarStruct, OnShowOtherLocationsDelegateWrapper wrapper)
1172 	{
1173 		wrapper.dlg(wrapper.outer);
1174 	}
1175 	
1176 	extern(C) static void callBackShowOtherLocationsDestroy(OnShowOtherLocationsDelegateWrapper wrapper, GClosure* closure)
1177 	{
1178 		wrapper.remove(wrapper);
1179 	}
1180 
1181 	protected class OnShowOtherLocationsWithFlagsDelegateWrapper
1182 	{
1183 		static OnShowOtherLocationsWithFlagsDelegateWrapper[] listeners;
1184 		void delegate(GtkPlacesOpenFlags, PlacesSidebar) dlg;
1185 		gulong handlerId;
1186 		
1187 		this(void delegate(GtkPlacesOpenFlags, PlacesSidebar) dlg)
1188 		{
1189 			this.dlg = dlg;
1190 			this.listeners ~= this;
1191 		}
1192 		
1193 		void remove(OnShowOtherLocationsWithFlagsDelegateWrapper source)
1194 		{
1195 			foreach(index, wrapper; listeners)
1196 			{
1197 				if (wrapper.handlerId == source.handlerId)
1198 				{
1199 					listeners[index] = null;
1200 					listeners = std.algorithm.remove(listeners, index);
1201 					break;
1202 				}
1203 			}
1204 		}
1205 	}
1206 
1207 	/**
1208 	 * The places sidebar emits this signal when it needs the calling
1209 	 * application to present a way to show other locations e.g. drives
1210 	 * and network access points.
1211 	 * For example, the application may bring up a page showing persistent
1212 	 * volumes and discovered network addresses.
1213 	 *
1214 	 * Params:
1215 	 *     openFlags = a single value from #GtkPlacesOpenFlags specifying how it should be opened.
1216 	 *
1217 	 * Since: 3.20
1218 	 */
1219 	gulong addOnShowOtherLocationsWithFlags(void delegate(GtkPlacesOpenFlags, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1220 	{
1221 		auto wrapper = new OnShowOtherLocationsWithFlagsDelegateWrapper(dlg);
1222 		wrapper.handlerId = Signals.connectData(
1223 			this,
1224 			"show-other-locations-with-flags",
1225 			cast(GCallback)&callBackShowOtherLocationsWithFlags,
1226 			cast(void*)wrapper,
1227 			cast(GClosureNotify)&callBackShowOtherLocationsWithFlagsDestroy,
1228 			connectFlags);
1229 		return wrapper.handlerId;
1230 	}
1231 	
1232 	extern(C) static void callBackShowOtherLocationsWithFlags(GtkPlacesSidebar* placessidebarStruct, GtkPlacesOpenFlags openFlags, OnShowOtherLocationsWithFlagsDelegateWrapper wrapper)
1233 	{
1234 		wrapper.dlg(openFlags, wrapper.outer);
1235 	}
1236 	
1237 	extern(C) static void callBackShowOtherLocationsWithFlagsDestroy(OnShowOtherLocationsWithFlagsDelegateWrapper wrapper, GClosure* closure)
1238 	{
1239 		wrapper.remove(wrapper);
1240 	}
1241 
1242 	protected class OnUnmountDelegateWrapper
1243 	{
1244 		static OnUnmountDelegateWrapper[] listeners;
1245 		void delegate(MountOperation, PlacesSidebar) dlg;
1246 		gulong handlerId;
1247 		
1248 		this(void delegate(MountOperation, PlacesSidebar) dlg)
1249 		{
1250 			this.dlg = dlg;
1251 			this.listeners ~= this;
1252 		}
1253 		
1254 		void remove(OnUnmountDelegateWrapper source)
1255 		{
1256 			foreach(index, wrapper; listeners)
1257 			{
1258 				if (wrapper.handlerId == source.handlerId)
1259 				{
1260 					listeners[index] = null;
1261 					listeners = std.algorithm.remove(listeners, index);
1262 					break;
1263 				}
1264 			}
1265 		}
1266 	}
1267 
1268 	/**
1269 	 * The places sidebar emits this signal when it starts a new operation
1270 	 * because the user for example ejected some drive or unmounted a mount.
1271 	 * In this way the application using the #GtkPlacesSidebar can track the
1272 	 * progress of the operation and, for example, show a notification.
1273 	 *
1274 	 * Params:
1275 	 *     mountOperation = the #GMountOperation that is going to start.
1276 	 *
1277 	 * Since: 3.20
1278 	 */
1279 	gulong addOnUnmount(void delegate(MountOperation, PlacesSidebar) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1280 	{
1281 		auto wrapper = new OnUnmountDelegateWrapper(dlg);
1282 		wrapper.handlerId = Signals.connectData(
1283 			this,
1284 			"unmount",
1285 			cast(GCallback)&callBackUnmount,
1286 			cast(void*)wrapper,
1287 			cast(GClosureNotify)&callBackUnmountDestroy,
1288 			connectFlags);
1289 		return wrapper.handlerId;
1290 	}
1291 	
1292 	extern(C) static void callBackUnmount(GtkPlacesSidebar* placessidebarStruct, GMountOperation* mountOperation, OnUnmountDelegateWrapper wrapper)
1293 	{
1294 		wrapper.dlg(ObjectG.getDObject!(MountOperation)(mountOperation), wrapper.outer);
1295 	}
1296 	
1297 	extern(C) static void callBackUnmountDestroy(OnUnmountDelegateWrapper wrapper, GClosure* closure)
1298 	{
1299 		wrapper.remove(wrapper);
1300 	}
1301 }