gtk/auto/places_sidebar.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{
6 Adjustment, Align, Bin, Buildable, Container, CornerType, PlacesOpenFlags, PolicyType,
7 ResizeMode, ScrolledWindow, ShadowType, Widget, ffi,
8};
9use glib::{
10 object::ObjectType as _,
11 prelude::*,
12 signal::{SignalHandlerId, connect_raw},
13 translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18 /// [`PlacesSidebar`][crate::PlacesSidebar] is a widget that displays a list of frequently-used places in the
19 /// file system: the user’s home directory, the user’s bookmarks, and volumes and drives.
20 /// This widget is used as a sidebar in [`FileChooser`][crate::FileChooser] and may be used by file managers
21 /// and similar programs.
22 ///
23 /// The places sidebar displays drives and volumes, and will automatically mount
24 /// or unmount them when the user selects them.
25 ///
26 /// Applications can hook to various signals in the places sidebar to customize
27 /// its behavior. For example, they can add extra commands to the context menu
28 /// of the sidebar.
29 ///
30 /// While bookmarks are completely in control of the user, the places sidebar also
31 /// allows individual applications to provide extra shortcut folders that are unique
32 /// to each application. For example, a Paint program may want to add a shortcut
33 /// for a Clipart folder. You can do this with [`add_shortcut()`][Self::add_shortcut()].
34 ///
35 /// To make use of the places sidebar, an application at least needs to connect
36 /// to the [`open-location`][struct@crate::PlacesSidebar#open-location] signal. This is emitted when the
37 /// user selects in the sidebar a location to open. The application should also
38 /// call [`set_location()`][Self::set_location()] when it changes the currently-viewed
39 /// location.
40 ///
41 /// # CSS nodes
42 ///
43 /// GtkPlacesSidebar uses a single CSS node with name placessidebar and style
44 /// class .sidebar.
45 ///
46 /// Among the children of the places sidebar, the following style classes can
47 /// be used:
48 /// - .sidebar-new-bookmark-row for the 'Add new bookmark' row
49 /// - .sidebar-placeholder-row for a row that is a placeholder
50 /// - .has-open-popup when a popup is open for a row
51 ///
52 /// ## Properties
53 ///
54 ///
55 /// #### `local-only`
56 /// Readable | Writable
57 ///
58 ///
59 /// #### `location`
60 /// Readable | Writable
61 ///
62 ///
63 /// #### `open-flags`
64 /// Readable | Writable
65 ///
66 ///
67 /// #### `populate-all`
68 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::PlacesSidebar#populate-popup] signal
69 /// is also emitted for popovers.
70 ///
71 /// Readable | Writable
72 ///
73 ///
74 /// #### `show-connect-to-server`
75 /// Readable | Writable
76 ///
77 ///
78 /// #### `show-desktop`
79 /// Readable | Writable
80 ///
81 ///
82 /// #### `show-enter-location`
83 /// Readable | Writable
84 ///
85 ///
86 /// #### `show-other-locations`
87 /// Readable | Writable
88 ///
89 ///
90 /// #### `show-recent`
91 /// Readable | Writable
92 ///
93 ///
94 /// #### `show-starred-location`
95 /// Readable | Writable
96 ///
97 ///
98 /// #### `show-trash`
99 /// Readable | Writable
100 /// <details><summary><h4>ScrolledWindow</h4></summary>
101 ///
102 ///
103 /// #### `hadjustment`
104 /// Readable | Writable | Construct
105 ///
106 ///
107 /// #### `hscrollbar-policy`
108 /// Readable | Writable
109 ///
110 ///
111 /// #### `kinetic-scrolling`
112 /// Whether kinetic scrolling is enabled or not. Kinetic scrolling
113 /// only applies to devices with source `GDK_SOURCE_TOUCHSCREEN`.
114 ///
115 /// Readable | Writable
116 ///
117 ///
118 /// #### `max-content-height`
119 /// The maximum content height of `scrolled_window`, or -1 if not set.
120 ///
121 /// Readable | Writable
122 ///
123 ///
124 /// #### `max-content-width`
125 /// The maximum content width of `scrolled_window`, or -1 if not set.
126 ///
127 /// Readable | Writable
128 ///
129 ///
130 /// #### `min-content-height`
131 /// The minimum content height of `scrolled_window`, or -1 if not set.
132 ///
133 /// Readable | Writable
134 ///
135 ///
136 /// #### `min-content-width`
137 /// The minimum content width of `scrolled_window`, or -1 if not set.
138 ///
139 /// Readable | Writable
140 ///
141 ///
142 /// #### `overlay-scrolling`
143 /// Whether overlay scrolling is enabled or not. If it is, the
144 /// scrollbars are only added as traditional widgets when a mouse
145 /// is present. Otherwise, they are overlayed on top of the content,
146 /// as narrow indicators.
147 ///
148 /// Note that overlay scrolling can also be globally disabled, with
149 /// the [`gtk-overlay-scrolling`][struct@crate::Settings#gtk-overlay-scrolling] setting.
150 ///
151 /// Readable | Writable
152 ///
153 ///
154 /// #### `propagate-natural-height`
155 /// Whether the natural height of the child should be calculated and propagated
156 /// through the scrolled window’s requested natural height.
157 ///
158 /// This is useful in cases where an attempt should be made to allocate exactly
159 /// enough space for the natural size of the child.
160 ///
161 /// Readable | Writable
162 ///
163 ///
164 /// #### `propagate-natural-width`
165 /// Whether the natural width of the child should be calculated and propagated
166 /// through the scrolled window’s requested natural width.
167 ///
168 /// This is useful in cases where an attempt should be made to allocate exactly
169 /// enough space for the natural size of the child.
170 ///
171 /// Readable | Writable
172 ///
173 ///
174 /// #### `shadow-type`
175 /// Readable | Writable
176 ///
177 ///
178 /// #### `vadjustment`
179 /// Readable | Writable | Construct
180 ///
181 ///
182 /// #### `vscrollbar-policy`
183 /// Readable | Writable
184 ///
185 ///
186 /// #### `window-placement`
187 /// Readable | Writable
188 ///
189 ///
190 /// #### `window-placement-set`
191 /// Whether "window-placement" should be used to determine the location
192 /// of the contents with respect to the scrollbars.
193 ///
194 /// Readable | Writable
195 /// </details>
196 /// <details><summary><h4>Container</h4></summary>
197 ///
198 ///
199 /// #### `border-width`
200 /// Readable | Writable
201 ///
202 ///
203 /// #### `child`
204 /// Writable
205 ///
206 ///
207 /// #### `resize-mode`
208 /// Readable | Writable
209 /// </details>
210 /// <details><summary><h4>Widget</h4></summary>
211 ///
212 ///
213 /// #### `app-paintable`
214 /// Readable | Writable
215 ///
216 ///
217 /// #### `can-default`
218 /// Readable | Writable
219 ///
220 ///
221 /// #### `can-focus`
222 /// Readable | Writable
223 ///
224 ///
225 /// #### `composite-child`
226 /// Readable
227 ///
228 ///
229 /// #### `double-buffered`
230 /// Whether the widget is double buffered.
231 ///
232 /// Readable | Writable
233 ///
234 ///
235 /// #### `events`
236 /// Readable | Writable
237 ///
238 ///
239 /// #### `expand`
240 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
241 ///
242 /// Readable | Writable
243 ///
244 ///
245 /// #### `focus-on-click`
246 /// Whether the widget should grab focus when it is clicked with the mouse.
247 ///
248 /// This property is only relevant for widgets that can take focus.
249 ///
250 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
251 /// GtkComboBox) implemented this property individually.
252 ///
253 /// Readable | Writable
254 ///
255 ///
256 /// #### `halign`
257 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
258 ///
259 /// Readable | Writable
260 ///
261 ///
262 /// #### `has-default`
263 /// Readable | Writable
264 ///
265 ///
266 /// #### `has-focus`
267 /// Readable | Writable
268 ///
269 ///
270 /// #### `has-tooltip`
271 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
272 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
273 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
274 /// whether it will provide a tooltip or not.
275 ///
276 /// Note that setting this property to [`true`] for the first time will change
277 /// the event masks of the GdkWindows of this widget to include leave-notify
278 /// and motion-notify events. This cannot and will not be undone when the
279 /// property is set to [`false`] again.
280 ///
281 /// Readable | Writable
282 ///
283 ///
284 /// #### `height-request`
285 /// Readable | Writable
286 ///
287 ///
288 /// #### `hexpand`
289 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
290 ///
291 /// Readable | Writable
292 ///
293 ///
294 /// #### `hexpand-set`
295 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
296 ///
297 /// Readable | Writable
298 ///
299 ///
300 /// #### `is-focus`
301 /// Readable | Writable
302 ///
303 ///
304 /// #### `margin`
305 /// Sets all four sides' margin at once. If read, returns max
306 /// margin on any side.
307 ///
308 /// Readable | Writable
309 ///
310 ///
311 /// #### `margin-bottom`
312 /// Margin on bottom side of widget.
313 ///
314 /// This property adds margin outside of the widget's normal size
315 /// request, the margin will be added in addition to the size from
316 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
317 ///
318 /// Readable | Writable
319 ///
320 ///
321 /// #### `margin-end`
322 /// Margin on end of widget, horizontally. This property supports
323 /// left-to-right and right-to-left text directions.
324 ///
325 /// This property adds margin outside of the widget's normal size
326 /// request, the margin will be added in addition to the size from
327 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
328 ///
329 /// Readable | Writable
330 ///
331 ///
332 /// #### `margin-left`
333 /// Margin on left side of widget.
334 ///
335 /// This property adds margin outside of the widget's normal size
336 /// request, the margin will be added in addition to the size from
337 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
338 ///
339 /// Readable | Writable
340 ///
341 ///
342 /// #### `margin-right`
343 /// Margin on right side of widget.
344 ///
345 /// This property adds margin outside of the widget's normal size
346 /// request, the margin will be added in addition to the size from
347 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
348 ///
349 /// Readable | Writable
350 ///
351 ///
352 /// #### `margin-start`
353 /// Margin on start of widget, horizontally. This property supports
354 /// left-to-right and right-to-left text directions.
355 ///
356 /// This property adds margin outside of the widget's normal size
357 /// request, the margin will be added in addition to the size from
358 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
359 ///
360 /// Readable | Writable
361 ///
362 ///
363 /// #### `margin-top`
364 /// Margin on top side of widget.
365 ///
366 /// This property adds margin outside of the widget's normal size
367 /// request, the margin will be added in addition to the size from
368 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
369 ///
370 /// Readable | Writable
371 ///
372 ///
373 /// #### `name`
374 /// Readable | Writable
375 ///
376 ///
377 /// #### `no-show-all`
378 /// Readable | Writable
379 ///
380 ///
381 /// #### `opacity`
382 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
383 /// more details about window opacity.
384 ///
385 /// Before 3.8 this was only available in GtkWindow
386 ///
387 /// Readable | Writable
388 ///
389 ///
390 /// #### `parent`
391 /// Readable | Writable
392 ///
393 ///
394 /// #### `receives-default`
395 /// Readable | Writable
396 ///
397 ///
398 /// #### `scale-factor`
399 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
400 /// more details about widget scaling.
401 ///
402 /// Readable
403 ///
404 ///
405 /// #### `sensitive`
406 /// Readable | Writable
407 ///
408 ///
409 /// #### `style`
410 /// The style of the widget, which contains information about how it will look (colors, etc).
411 ///
412 /// Readable | Writable
413 ///
414 ///
415 /// #### `tooltip-markup`
416 /// Sets the text of tooltip to be the given string, which is marked up
417 /// with the [Pango text markup language][PangoMarkupFormat].
418 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
419 ///
420 /// This is a convenience property which will take care of getting the
421 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
422 /// will automatically be set to [`true`] and there will be taken care of
423 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
424 ///
425 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
426 /// are set, the last one wins.
427 ///
428 /// Readable | Writable
429 ///
430 ///
431 /// #### `tooltip-text`
432 /// Sets the text of tooltip to be the given string.
433 ///
434 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
435 ///
436 /// This is a convenience property which will take care of getting the
437 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
438 /// will automatically be set to [`true`] and there will be taken care of
439 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
440 ///
441 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
442 /// are set, the last one wins.
443 ///
444 /// Readable | Writable
445 ///
446 ///
447 /// #### `valign`
448 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
449 ///
450 /// Readable | Writable
451 ///
452 ///
453 /// #### `vexpand`
454 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
455 ///
456 /// Readable | Writable
457 ///
458 ///
459 /// #### `vexpand-set`
460 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
461 ///
462 /// Readable | Writable
463 ///
464 ///
465 /// #### `visible`
466 /// Readable | Writable
467 ///
468 ///
469 /// #### `width-request`
470 /// Readable | Writable
471 ///
472 ///
473 /// #### `window`
474 /// The widget's window if it is realized, [`None`] otherwise.
475 ///
476 /// Readable
477 /// </details>
478 ///
479 /// ## Signals
480 ///
481 ///
482 /// #### `drag-action-ask`
483 /// The places sidebar emits this signal when it needs to ask the application
484 /// to pop up a menu to ask the user for which drag action to perform.
485 ///
486 ///
487 ///
488 ///
489 /// #### `drag-action-requested`
490 /// When the user starts a drag-and-drop operation and the sidebar needs
491 /// to ask the application for which drag action to perform, then the
492 /// sidebar will emit this signal.
493 ///
494 /// The application can evaluate the `context` for customary actions, or
495 /// it can check the type of the files indicated by `source_file_list` against the
496 /// possible actions for the destination `dest_file`.
497 ///
498 /// The drag action to use must be the return value of the signal handler.
499 ///
500 ///
501 ///
502 ///
503 /// #### `drag-perform-drop`
504 /// The places sidebar emits this signal when the user completes a
505 /// drag-and-drop operation and one of the sidebar's items is the
506 /// destination. This item is in the `dest_file`, and the
507 /// `source_file_list` has the list of files that are dropped into it and
508 /// which should be copied/moved/etc. based on the specified `action`.
509 ///
510 ///
511 ///
512 ///
513 /// #### `mount`
514 /// The places sidebar emits this signal when it starts a new operation
515 /// because the user clicked on some location that needs mounting.
516 /// In this way the application using the [`PlacesSidebar`][crate::PlacesSidebar] can track the
517 /// progress of the operation and, for example, show a notification.
518 ///
519 ///
520 ///
521 ///
522 /// #### `open-location`
523 /// The places sidebar emits this signal when the user selects a location
524 /// in it. The calling application should display the contents of that
525 /// location; for example, a file manager should show a list of files in
526 /// the specified location.
527 ///
528 ///
529 ///
530 ///
531 /// #### `populate-popup`
532 /// The places sidebar emits this signal when the user invokes a contextual
533 /// popup on one of its items. In the signal handler, the application may
534 /// add extra items to the menu as appropriate. For example, a file manager
535 /// may want to add a "Properties" command to the menu.
536 ///
537 /// It is not necessary to store the `selected_item` for each menu item;
538 /// during their callbacks, the application can use [`PlacesSidebar::location()`][crate::PlacesSidebar::location()]
539 /// to get the file to which the item refers.
540 ///
541 /// The `selected_item` argument may be [`None`] in case the selection refers to
542 /// a volume. In this case, `selected_volume` will be non-[`None`]. In this case,
543 /// the calling application will have to `g_object_ref()` the `selected_volume` and
544 /// keep it around to use it in the callback.
545 ///
546 /// The `container` and all its contents are destroyed after the user
547 /// dismisses the popup. The popup is re-created (and thus, this signal is
548 /// emitted) every time the user activates the contextual menu.
549 ///
550 /// Before 3.18, the `container` always was a [`Menu`][crate::Menu], and you were expected
551 /// to add your items as `GtkMenuItems`. Since 3.18, the popup may be implemented
552 /// as a [`Popover`][crate::Popover], in which case `container` will be something else, e.g. a
553 /// [`Box`][crate::Box], to which you may add `GtkModelButtons` or other widgets, such as
554 /// `GtkEntries`, `GtkSpinButtons`, etc. If your application can deal with this
555 /// situation, you can set [`populate-all`][struct@crate::PlacesSidebar#populate-all] to [`true`] to request
556 /// that this signal is emitted for populating popovers as well.
557 ///
558 ///
559 ///
560 ///
561 /// #### `show-connect-to-server`
562 /// The places sidebar emits this signal when it needs the calling
563 /// application to present an way to connect directly to a network server.
564 /// For example, the application may bring up a dialog box asking for
565 /// a URL like "sftp://ftp.example.com". It is up to the application to create
566 /// the corresponding mount by using, for example, [`FileExtManual::mount_enclosing_volume()`][crate::gio::prelude::FileExtManual::mount_enclosing_volume()].
567 ///
568 ///
569 ///
570 ///
571 /// #### `show-enter-location`
572 /// The places sidebar emits this signal when it needs the calling
573 /// application to present an way to directly enter a location.
574 /// For example, the application may bring up a dialog box asking for
575 /// a URL like "http://http.example.com".
576 ///
577 ///
578 ///
579 ///
580 /// #### `show-error-message`
581 /// The places sidebar emits this signal when it needs the calling
582 /// application to present an error message. Most of these messages
583 /// refer to mounting or unmounting media, for example, when a drive
584 /// cannot be started for some reason.
585 ///
586 ///
587 ///
588 ///
589 /// #### `show-other-locations`
590 /// The places sidebar emits this signal when it needs the calling
591 /// application to present a way to show other locations e.g. drives
592 /// and network access points.
593 /// For example, the application may bring up a page showing persistent
594 /// volumes and discovered network addresses.
595 ///
596 ///
597 ///
598 ///
599 /// #### `show-other-locations-with-flags`
600 /// The places sidebar emits this signal when it needs the calling
601 /// application to present a way to show other locations e.g. drives
602 /// and network access points.
603 /// For example, the application may bring up a page showing persistent
604 /// volumes and discovered network addresses.
605 ///
606 ///
607 ///
608 ///
609 /// #### `show-starred-location`
610 /// The places sidebar emits this signal when it needs the calling
611 /// application to present a way to show the starred files. In GNOME,
612 /// starred files are implemented by setting the nao:predefined-tag-favorite
613 /// tag in the tracker database.
614 ///
615 ///
616 ///
617 ///
618 /// #### `unmount`
619 /// The places sidebar emits this signal when it starts a new operation
620 /// because the user for example ejected some drive or unmounted a mount.
621 /// In this way the application using the [`PlacesSidebar`][crate::PlacesSidebar] can track the
622 /// progress of the operation and, for example, show a notification.
623 ///
624 ///
625 /// <details><summary><h4>ScrolledWindow</h4></summary>
626 ///
627 ///
628 /// #### `edge-overshot`
629 /// The ::edge-overshot signal is emitted whenever user initiated scrolling
630 /// makes the scrolled window firmly surpass (i.e. with some edge resistance)
631 /// the lower or upper limits defined by the adjustment in that orientation.
632 ///
633 /// A similar behavior without edge resistance is provided by the
634 /// [`edge-reached`][struct@crate::ScrolledWindow#edge-reached] signal.
635 ///
636 /// Note: The `pos` argument is LTR/RTL aware, so callers should be aware too
637 /// if intending to provide behavior on horizontal edges.
638 ///
639 ///
640 ///
641 ///
642 /// #### `edge-reached`
643 /// The ::edge-reached signal is emitted whenever user-initiated scrolling
644 /// makes the scrolled window exactly reach the lower or upper limits
645 /// defined by the adjustment in that orientation.
646 ///
647 /// A similar behavior with edge resistance is provided by the
648 /// [`edge-overshot`][struct@crate::ScrolledWindow#edge-overshot] signal.
649 ///
650 /// Note: The `pos` argument is LTR/RTL aware, so callers should be aware too
651 /// if intending to provide behavior on horizontal edges.
652 ///
653 ///
654 ///
655 ///
656 /// #### `move-focus-out`
657 /// The ::move-focus-out signal is a
658 /// [keybinding signal][GtkBindingSignal] which gets
659 /// emitted when focus is moved away from the scrolled window by a
660 /// keybinding. The [`move-focus`][struct@crate::Widget#move-focus] signal is emitted with
661 /// `direction_type` on this scrolled window’s toplevel parent in the
662 /// container hierarchy. The default bindings for this signal are
663 /// `Ctrl + Tab` to move forward and `Ctrl + Shift + Tab` to move backward.
664 ///
665 /// Action
666 ///
667 ///
668 /// #### `scroll-child`
669 /// The ::scroll-child signal is a
670 /// [keybinding signal][GtkBindingSignal]
671 /// which gets emitted when a keybinding that scrolls is pressed.
672 /// The horizontal or vertical adjustment is updated which triggers a
673 /// signal that the scrolled window’s child may listen to and scroll itself.
674 ///
675 /// Action
676 /// </details>
677 /// <details><summary><h4>Container</h4></summary>
678 ///
679 ///
680 /// #### `add`
681 ///
682 ///
683 ///
684 /// #### `check-resize`
685 ///
686 ///
687 ///
688 /// #### `remove`
689 ///
690 ///
691 ///
692 /// #### `set-focus-child`
693 ///
694 /// </details>
695 /// <details><summary><h4>Widget</h4></summary>
696 ///
697 ///
698 /// #### `accel-closures-changed`
699 ///
700 ///
701 ///
702 /// #### `button-press-event`
703 /// The ::button-press-event signal will be emitted when a button
704 /// (typically from a mouse) is pressed.
705 ///
706 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
707 /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
708 ///
709 /// This signal will be sent to the grab widget if there is one.
710 ///
711 ///
712 ///
713 ///
714 /// #### `button-release-event`
715 /// The ::button-release-event signal will be emitted when a button
716 /// (typically from a mouse) is released.
717 ///
718 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
719 /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
720 ///
721 /// This signal will be sent to the grab widget if there is one.
722 ///
723 ///
724 ///
725 ///
726 /// #### `can-activate-accel`
727 /// Determines whether an accelerator that activates the signal
728 /// identified by `signal_id` can currently be activated.
729 /// This signal is present to allow applications and derived
730 /// widgets to override the default [`Widget`][crate::Widget] handling
731 /// for determining whether an accelerator can be activated.
732 ///
733 ///
734 ///
735 ///
736 /// #### `child-notify`
737 /// The ::child-notify signal is emitted for each
738 /// [child property][child-properties] that has
739 /// changed on an object. The signal's detail holds the property name.
740 ///
741 /// Detailed
742 ///
743 ///
744 /// #### `composited-changed`
745 /// The ::composited-changed signal is emitted when the composited
746 /// status of `widgets` screen changes.
747 /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
748 ///
749 /// Action
750 ///
751 ///
752 /// #### `configure-event`
753 /// The ::configure-event signal will be emitted when the size, position or
754 /// stacking of the `widget`'s window has changed.
755 ///
756 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
757 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
758 /// automatically for all new windows.
759 ///
760 ///
761 ///
762 ///
763 /// #### `damage-event`
764 /// Emitted when a redirected window belonging to `widget` gets drawn into.
765 /// The region/area members of the event shows what area of the redirected
766 /// drawable was drawn into.
767 ///
768 ///
769 ///
770 ///
771 /// #### `delete-event`
772 /// The ::delete-event signal is emitted if a user requests that
773 /// a toplevel window is closed. The default handler for this signal
774 /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
775 /// this signal will cause the window to be hidden instead, so that
776 /// it can later be shown again without reconstructing it.
777 ///
778 ///
779 ///
780 ///
781 /// #### `destroy`
782 /// Signals that all holders of a reference to the widget should release
783 /// the reference that they hold. May result in finalization of the widget
784 /// if all references are released.
785 ///
786 /// This signal is not suitable for saving widget state.
787 ///
788 ///
789 ///
790 ///
791 /// #### `destroy-event`
792 /// The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
793 /// You rarely get this signal, because most widgets disconnect themselves
794 /// from their window before they destroy it, so no widget owns the
795 /// window at destroy time.
796 ///
797 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
798 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
799 /// automatically for all new windows.
800 ///
801 ///
802 ///
803 ///
804 /// #### `direction-changed`
805 /// The ::direction-changed signal is emitted when the text direction
806 /// of a widget changes.
807 ///
808 ///
809 ///
810 ///
811 /// #### `drag-begin`
812 /// The ::drag-begin signal is emitted on the drag source when a drag is
813 /// started. A typical reason to connect to this signal is to set up a
814 /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
815 ///
816 /// Note that some widgets set up a drag icon in the default handler of
817 /// this signal, so you may have to use `g_signal_connect_after()` to
818 /// override what the default handler did.
819 ///
820 ///
821 ///
822 ///
823 /// #### `drag-data-delete`
824 /// The ::drag-data-delete signal is emitted on the drag source when a drag
825 /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
826 /// handler is responsible for deleting the data that has been dropped. What
827 /// "delete" means depends on the context of the drag operation.
828 ///
829 ///
830 ///
831 ///
832 /// #### `drag-data-get`
833 /// The ::drag-data-get signal is emitted on the drag source when the drop
834 /// site requests the data which is dragged. It is the responsibility of
835 /// the signal handler to fill `data` with the data in the format which
836 /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
837 /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
838 ///
839 ///
840 ///
841 ///
842 /// #### `drag-data-received`
843 /// format == 8))
844 /// {
845 /// GdkDragAction action;
846 ///
847 /// // handle data here
848 ///
849 /// action = gdk_drag_context_get_selected_action (context);
850 /// if (action == GDK_ACTION_ASK)
851 /// {
852 /// GtkWidget *dialog;
853 /// gint response;
854 ///
855 /// dialog = gtk_message_dialog_new (NULL,
856 /// GTK_DIALOG_MODAL |
857 /// GTK_DIALOG_DESTROY_WITH_PARENT,
858 /// GTK_MESSAGE_INFO,
859 /// GTK_BUTTONS_YES_NO,
860 /// "Move the data ?\n");
861 /// response = gtk_dialog_run (GTK_DIALOG (dialog));
862 /// gtk_widget_destroy (dialog);
863 ///
864 /// if (response == GTK_RESPONSE_YES)
865 /// action = GDK_ACTION_MOVE;
866 /// else
867 /// action = GDK_ACTION_COPY;
868 /// }
869 ///
870 /// gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
871 /// }
872 /// else
873 /// gtk_drag_finish (context, FALSE, FALSE, time);
874 /// }
875 /// ]|
876 ///
877 ///
878 ///
879 ///
880 /// #### `drag-drop`
881 /// The ::drag-drop signal is emitted on the drop site when the user drops
882 /// the data onto the widget. The signal handler must determine whether
883 /// the cursor position is in a drop zone or not. If it is not in a drop
884 /// zone, it returns [`false`] and no further processing is necessary.
885 /// Otherwise, the handler returns [`true`]. In this case, the handler must
886 /// ensure that `gtk_drag_finish()` is called to let the source know that
887 /// the drop is done. The call to `gtk_drag_finish()` can be done either
888 /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
889 /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
890 /// or more of the supported targets.
891 ///
892 ///
893 ///
894 ///
895 /// #### `drag-end`
896 /// The ::drag-end signal is emitted on the drag source when a drag is
897 /// finished. A typical reason to connect to this signal is to undo
898 /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
899 ///
900 ///
901 ///
902 ///
903 /// #### `drag-failed`
904 /// The ::drag-failed signal is emitted on the drag source when a drag has
905 /// failed. The signal handler may hook custom code to handle a failed DnD
906 /// operation based on the type of error, it returns [`true`] is the failure has
907 /// been already handled (not showing the default "drag operation failed"
908 /// animation), otherwise it returns [`false`].
909 ///
910 ///
911 ///
912 ///
913 /// #### `drag-leave`
914 /// The ::drag-leave signal is emitted on the drop site when the cursor
915 /// leaves the widget. A typical reason to connect to this signal is to
916 /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
917 /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
918 ///
919 ///
920 /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
921 /// ::drag-drop signal, for instance to allow cleaning up of a preview item
922 /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
923 ///
924 ///
925 ///
926 ///
927 /// #### `drag-motion`
928 /// suggested_action,
929 /// time);
930 /// }
931 /// else
932 /// {
933 /// // accept the drop
934 /// }
935 /// }
936 /// ]|
937 ///
938 ///
939 ///
940 ///
941 /// #### `draw`
942 /// This signal is emitted when a widget is supposed to render itself.
943 /// The `widget`'s top left corner must be painted at the origin of
944 /// the passed in context and be sized to the values returned by
945 /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
946 /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
947 ///
948 /// Signal handlers connected to this signal can modify the cairo
949 /// context passed as `cr` in any way they like and don't need to
950 /// restore it. The signal emission takes care of calling `cairo_save()`
951 /// before and `cairo_restore()` after invoking the handler.
952 ///
953 /// The signal handler will get a `cr` with a clip region already set to the
954 /// widget's dirty region, i.e. to the area that needs repainting. Complicated
955 /// widgets that want to avoid redrawing themselves completely can get the full
956 /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
957 /// get a finer-grained representation of the dirty region with
958 /// `cairo_copy_clip_rectangle_list()`.
959 ///
960 ///
961 ///
962 ///
963 /// #### `enter-notify-event`
964 /// The ::enter-notify-event will be emitted when the pointer enters
965 /// the `widget`'s window.
966 ///
967 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
968 /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
969 ///
970 /// This signal will be sent to the grab widget if there is one.
971 ///
972 ///
973 ///
974 ///
975 /// #### `event`
976 /// The GTK+ main loop will emit three signals for each GDK event delivered
977 /// to a widget: one generic ::event signal, another, more specific,
978 /// signal that matches the type of event delivered (e.g.
979 /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
980 /// [`event-after`][struct@crate::Widget#event-after] signal.
981 ///
982 ///
983 ///
984 ///
985 /// #### `event-after`
986 /// After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
987 /// the second more specific signal, ::event-after will be emitted
988 /// regardless of the previous two signals handlers return values.
989 ///
990 ///
991 ///
992 ///
993 /// #### `focus`
994 ///
995 ///
996 ///
997 /// #### `focus-in-event`
998 /// The ::focus-in-event signal will be emitted when the keyboard focus
999 /// enters the `widget`'s window.
1000 ///
1001 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1002 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
1003 ///
1004 ///
1005 ///
1006 ///
1007 /// #### `focus-out-event`
1008 /// The ::focus-out-event signal will be emitted when the keyboard focus
1009 /// leaves the `widget`'s window.
1010 ///
1011 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1012 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
1013 ///
1014 ///
1015 ///
1016 ///
1017 /// #### `grab-broken-event`
1018 /// Emitted when a pointer or keyboard grab on a window belonging
1019 /// to `widget` gets broken.
1020 ///
1021 /// On X11, this happens when the grab window becomes unviewable
1022 /// (i.e. it or one of its ancestors is unmapped), or if the same
1023 /// application grabs the pointer or keyboard again.
1024 ///
1025 ///
1026 ///
1027 ///
1028 /// #### `grab-focus`
1029 /// Action
1030 ///
1031 ///
1032 /// #### `grab-notify`
1033 /// The ::grab-notify signal is emitted when a widget becomes
1034 /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
1035 /// another widget, or when it becomes unshadowed due to a grab
1036 /// being removed.
1037 ///
1038 /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
1039 /// grab widget in the grab stack of its window group is not
1040 /// its ancestor.
1041 ///
1042 ///
1043 ///
1044 ///
1045 /// #### `hide`
1046 /// The ::hide signal is emitted when `widget` is hidden, for example with
1047 /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
1048 ///
1049 ///
1050 ///
1051 ///
1052 /// #### `hierarchy-changed`
1053 /// The ::hierarchy-changed signal is emitted when the
1054 /// anchored state of a widget changes. A widget is
1055 /// “anchored” when its toplevel
1056 /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
1057 /// a widget changes from un-anchored to anchored or vice-versa.
1058 ///
1059 ///
1060 ///
1061 ///
1062 /// #### `key-press-event`
1063 /// The ::key-press-event signal is emitted when a key is pressed. The signal
1064 /// emission will reoccur at the key-repeat rate when the key is kept pressed.
1065 ///
1066 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1067 /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
1068 ///
1069 /// This signal will be sent to the grab widget if there is one.
1070 ///
1071 ///
1072 ///
1073 ///
1074 /// #### `key-release-event`
1075 /// The ::key-release-event signal is emitted when a key is released.
1076 ///
1077 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1078 /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
1079 ///
1080 /// This signal will be sent to the grab widget if there is one.
1081 ///
1082 ///
1083 ///
1084 ///
1085 /// #### `keynav-failed`
1086 /// Gets emitted if keyboard navigation fails.
1087 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
1088 ///
1089 ///
1090 ///
1091 ///
1092 /// #### `leave-notify-event`
1093 /// The ::leave-notify-event will be emitted when the pointer leaves
1094 /// the `widget`'s window.
1095 ///
1096 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1097 /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
1098 ///
1099 /// This signal will be sent to the grab widget if there is one.
1100 ///
1101 ///
1102 ///
1103 ///
1104 /// #### `map`
1105 /// The ::map signal is emitted when `widget` is going to be mapped, that is
1106 /// when the widget is visible (which is controlled with
1107 /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
1108 /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
1109 /// be emitted.
1110 ///
1111 /// The ::map signal can be used to determine whether a widget will be drawn,
1112 /// for instance it can resume an animation that was stopped during the
1113 /// emission of [`unmap`][struct@crate::Widget#unmap].
1114 ///
1115 ///
1116 ///
1117 ///
1118 /// #### `map-event`
1119 /// The ::map-event signal will be emitted when the `widget`'s window is
1120 /// mapped. A window is mapped when it becomes visible on the screen.
1121 ///
1122 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1123 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1124 /// automatically for all new windows.
1125 ///
1126 ///
1127 ///
1128 ///
1129 /// #### `mnemonic-activate`
1130 /// The default handler for this signal activates `widget` if `group_cycling`
1131 /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
1132 ///
1133 ///
1134 ///
1135 ///
1136 /// #### `motion-notify-event`
1137 /// The ::motion-notify-event signal is emitted when the pointer moves
1138 /// over the widget's [`gdk::Window`][crate::gdk::Window].
1139 ///
1140 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
1141 /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
1142 ///
1143 /// This signal will be sent to the grab widget if there is one.
1144 ///
1145 ///
1146 ///
1147 ///
1148 /// #### `move-focus`
1149 /// Action
1150 ///
1151 ///
1152 /// #### `parent-set`
1153 /// The ::parent-set signal is emitted when a new parent
1154 /// has been set on a widget.
1155 ///
1156 ///
1157 ///
1158 ///
1159 /// #### `popup-menu`
1160 /// This signal gets emitted whenever a widget should pop up a context
1161 /// menu. This usually happens through the standard key binding mechanism;
1162 /// by pressing a certain key while a widget is focused, the user can cause
1163 /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
1164 /// a menu with clipboard commands. See the
1165 /// [Popup Menu Migration Checklist][checklist-popup-menu]
1166 /// for an example of how to use this signal.
1167 ///
1168 /// Action
1169 ///
1170 ///
1171 /// #### `property-notify-event`
1172 /// The ::property-notify-event signal will be emitted when a property on
1173 /// the `widget`'s window has been changed or deleted.
1174 ///
1175 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1176 /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
1177 ///
1178 ///
1179 ///
1180 ///
1181 /// #### `proximity-in-event`
1182 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1183 /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
1184 ///
1185 /// This signal will be sent to the grab widget if there is one.
1186 ///
1187 ///
1188 ///
1189 ///
1190 /// #### `proximity-out-event`
1191 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1192 /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
1193 ///
1194 /// This signal will be sent to the grab widget if there is one.
1195 ///
1196 ///
1197 ///
1198 ///
1199 /// #### `query-tooltip`
1200 /// Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
1201 /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
1202 /// focus in keyboard mode.
1203 ///
1204 /// Using the given coordinates, the signal handler should determine
1205 /// whether a tooltip should be shown for `widget`. If this is the case
1206 /// [`true`] should be returned, [`false`] otherwise. Note that if
1207 /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
1208 /// should not be used.
1209 ///
1210 /// The signal handler is free to manipulate `tooltip` with the therefore
1211 /// destined function calls.
1212 ///
1213 ///
1214 ///
1215 ///
1216 /// #### `realize`
1217 /// The ::realize signal is emitted when `widget` is associated with a
1218 /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
1219 /// widget has been mapped (that is, it is going to be drawn).
1220 ///
1221 ///
1222 ///
1223 ///
1224 /// #### `screen-changed`
1225 /// The ::screen-changed signal gets emitted when the
1226 /// screen of a widget has changed.
1227 ///
1228 ///
1229 ///
1230 ///
1231 /// #### `scroll-event`
1232 /// The ::scroll-event signal is emitted when a button in the 4 to 7
1233 /// range is pressed. Wheel mice are usually configured to generate
1234 /// button press events for buttons 4 and 5 when the wheel is turned.
1235 ///
1236 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1237 /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
1238 ///
1239 /// This signal will be sent to the grab widget if there is one.
1240 ///
1241 ///
1242 ///
1243 ///
1244 /// #### `selection-clear-event`
1245 /// The ::selection-clear-event signal will be emitted when the
1246 /// the `widget`'s window has lost ownership of a selection.
1247 ///
1248 ///
1249 ///
1250 ///
1251 /// #### `selection-get`
1252 ///
1253 ///
1254 ///
1255 /// #### `selection-notify-event`
1256 ///
1257 ///
1258 ///
1259 /// #### `selection-received`
1260 ///
1261 ///
1262 ///
1263 /// #### `selection-request-event`
1264 /// The ::selection-request-event signal will be emitted when
1265 /// another client requests ownership of the selection owned by
1266 /// the `widget`'s window.
1267 ///
1268 ///
1269 ///
1270 ///
1271 /// #### `show`
1272 /// The ::show signal is emitted when `widget` is shown, for example with
1273 /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
1274 ///
1275 ///
1276 ///
1277 ///
1278 /// #### `show-help`
1279 /// Action
1280 ///
1281 ///
1282 /// #### `size-allocate`
1283 ///
1284 ///
1285 ///
1286 /// #### `state-changed`
1287 /// The ::state-changed signal is emitted when the widget state changes.
1288 /// See `gtk_widget_get_state()`.
1289 ///
1290 ///
1291 ///
1292 ///
1293 /// #### `state-flags-changed`
1294 /// The ::state-flags-changed signal is emitted when the widget state
1295 /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
1296 ///
1297 ///
1298 ///
1299 ///
1300 /// #### `style-set`
1301 /// The ::style-set signal is emitted when a new style has been set
1302 /// on a widget. Note that style-modifying functions like
1303 /// `gtk_widget_modify_base()` also cause this signal to be emitted.
1304 ///
1305 /// Note that this signal is emitted for changes to the deprecated
1306 /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
1307 /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
1308 ///
1309 ///
1310 ///
1311 ///
1312 /// #### `style-updated`
1313 /// The ::style-updated signal is a convenience signal that is emitted when the
1314 /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
1315 /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
1316 ///
1317 /// Note that style-modifying functions like `gtk_widget_override_color()` also
1318 /// cause this signal to be emitted.
1319 ///
1320 ///
1321 ///
1322 ///
1323 /// #### `touch-event`
1324 ///
1325 ///
1326 ///
1327 /// #### `unmap`
1328 /// The ::unmap signal is emitted when `widget` is going to be unmapped, which
1329 /// means that either it or any of its parents up to the toplevel widget have
1330 /// been set as hidden.
1331 ///
1332 /// As ::unmap indicates that a widget will not be shown any longer, it can be
1333 /// used to, for example, stop an animation on the widget.
1334 ///
1335 ///
1336 ///
1337 ///
1338 /// #### `unmap-event`
1339 /// The ::unmap-event signal will be emitted when the `widget`'s window is
1340 /// unmapped. A window is unmapped when it becomes invisible on the screen.
1341 ///
1342 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1343 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1344 /// automatically for all new windows.
1345 ///
1346 ///
1347 ///
1348 ///
1349 /// #### `unrealize`
1350 /// The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
1351 /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
1352 /// called or the widget has been unmapped (that is, it is going to be
1353 /// hidden).
1354 ///
1355 ///
1356 ///
1357 ///
1358 /// #### `visibility-notify-event`
1359 /// The ::visibility-notify-event will be emitted when the `widget`'s
1360 /// window is obscured or unobscured.
1361 ///
1362 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1363 /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
1364 ///
1365 ///
1366 ///
1367 ///
1368 /// #### `window-state-event`
1369 /// The ::window-state-event will be emitted when the state of the
1370 /// toplevel window associated to the `widget` changes.
1371 ///
1372 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
1373 /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
1374 /// this mask automatically for all new windows.
1375 ///
1376 ///
1377 /// </details>
1378 ///
1379 /// # Implements
1380 ///
1381 /// [`ScrolledWindowExt`][trait@crate::prelude::ScrolledWindowExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
1382 #[doc(alias = "GtkPlacesSidebar")]
1383 pub struct PlacesSidebar(Object<ffi::GtkPlacesSidebar, ffi::GtkPlacesSidebarClass>) @extends ScrolledWindow, Bin, Container, Widget, @implements Buildable;
1384
1385 match fn {
1386 type_ => || ffi::gtk_places_sidebar_get_type(),
1387 }
1388}
1389
1390impl PlacesSidebar {
1391 /// Creates a new [`PlacesSidebar`][crate::PlacesSidebar] widget.
1392 ///
1393 /// The application should connect to at least the
1394 /// [`open-location`][struct@crate::PlacesSidebar#open-location] signal to be notified
1395 /// when the user makes a selection in the sidebar.
1396 ///
1397 /// # Returns
1398 ///
1399 /// a newly created [`PlacesSidebar`][crate::PlacesSidebar]
1400 #[doc(alias = "gtk_places_sidebar_new")]
1401 pub fn new() -> PlacesSidebar {
1402 assert_initialized_main_thread!();
1403 unsafe { Widget::from_glib_none(ffi::gtk_places_sidebar_new()).unsafe_cast() }
1404 }
1405
1406 // rustdoc-stripper-ignore-next
1407 /// Creates a new builder-pattern struct instance to construct [`PlacesSidebar`] objects.
1408 ///
1409 /// This method returns an instance of [`PlacesSidebarBuilder`](crate::builders::PlacesSidebarBuilder) which can be used to create [`PlacesSidebar`] objects.
1410 pub fn builder() -> PlacesSidebarBuilder {
1411 PlacesSidebarBuilder::new()
1412 }
1413
1414 /// Applications may want to present some folders in the places sidebar if
1415 /// they could be immediately useful to users. For example, a drawing
1416 /// program could add a “/usr/share/clipart” location when the sidebar is
1417 /// being used in an “Insert Clipart” dialog box.
1418 ///
1419 /// This function adds the specified `location` to a special place for immutable
1420 /// shortcuts. The shortcuts are application-specific; they are not shared
1421 /// across applications, and they are not persistent. If this function
1422 /// is called multiple times with different locations, then they are added
1423 /// to the sidebar’s list in the same order as the function is called.
1424 /// ## `location`
1425 /// location to add as an application-specific shortcut
1426 #[doc(alias = "gtk_places_sidebar_add_shortcut")]
1427 pub fn add_shortcut(&self, location: &impl IsA<gio::File>) {
1428 unsafe {
1429 ffi::gtk_places_sidebar_add_shortcut(
1430 self.to_glib_none().0,
1431 location.as_ref().to_glib_none().0,
1432 );
1433 }
1434 }
1435
1436 /// Returns the value previously set with [`set_local_only()`][Self::set_local_only()].
1437 ///
1438 /// # Returns
1439 ///
1440 /// [`true`] if the sidebar will only show local files.
1441 #[doc(alias = "gtk_places_sidebar_get_local_only")]
1442 #[doc(alias = "get_local_only")]
1443 #[doc(alias = "local-only")]
1444 pub fn is_local_only(&self) -> bool {
1445 unsafe {
1446 from_glib(ffi::gtk_places_sidebar_get_local_only(
1447 self.to_glib_none().0,
1448 ))
1449 }
1450 }
1451
1452 /// Gets the currently selected location in the `self`. This can be [`None`] when
1453 /// nothing is selected, for example, when [`set_location()`][Self::set_location()] has
1454 /// been called with a location that is not among the sidebar’s list of places to
1455 /// show.
1456 ///
1457 /// You can use this function to get the selection in the `self`. Also, if you
1458 /// connect to the [`populate-popup`][struct@crate::PlacesSidebar#populate-popup] signal, you can use this
1459 /// function to get the location that is being referred to during the callbacks
1460 /// for your menu items.
1461 ///
1462 /// # Returns
1463 ///
1464 /// a [`gio::File`][crate::gio::File] with the selected location, or
1465 /// [`None`] if nothing is visually selected.
1466 #[doc(alias = "gtk_places_sidebar_get_location")]
1467 #[doc(alias = "get_location")]
1468 pub fn location(&self) -> Option<gio::File> {
1469 unsafe { from_glib_full(ffi::gtk_places_sidebar_get_location(self.to_glib_none().0)) }
1470 }
1471
1472 /// This function queries the bookmarks added by the user to the places sidebar,
1473 /// and returns one of them. This function is used by [`FileChooser`][crate::FileChooser] to implement
1474 /// the “Alt-1”, “Alt-2”, etc. shortcuts, which activate the cooresponding bookmark.
1475 /// ## `n`
1476 /// index of the bookmark to query
1477 ///
1478 /// # Returns
1479 ///
1480 /// The bookmark specified by the index `n`, or
1481 /// [`None`] if no such index exist. Note that the indices start at 0, even though
1482 /// the file chooser starts them with the keyboard shortcut "Alt-1".
1483 #[doc(alias = "gtk_places_sidebar_get_nth_bookmark")]
1484 #[doc(alias = "get_nth_bookmark")]
1485 pub fn nth_bookmark(&self, n: i32) -> Option<gio::File> {
1486 unsafe {
1487 from_glib_full(ffi::gtk_places_sidebar_get_nth_bookmark(
1488 self.to_glib_none().0,
1489 n,
1490 ))
1491 }
1492 }
1493
1494 /// Gets the open flags.
1495 ///
1496 /// # Returns
1497 ///
1498 /// the [`PlacesOpenFlags`][crate::PlacesOpenFlags] of `self`
1499 #[doc(alias = "gtk_places_sidebar_get_open_flags")]
1500 #[doc(alias = "get_open_flags")]
1501 #[doc(alias = "open-flags")]
1502 pub fn open_flags(&self) -> PlacesOpenFlags {
1503 unsafe {
1504 from_glib(ffi::gtk_places_sidebar_get_open_flags(
1505 self.to_glib_none().0,
1506 ))
1507 }
1508 }
1509
1510 /// Returns the value previously set with [`set_show_desktop()`][Self::set_show_desktop()]
1511 ///
1512 /// # Returns
1513 ///
1514 /// [`true`] if the sidebar will display a builtin shortcut to the desktop folder.
1515 #[doc(alias = "gtk_places_sidebar_get_show_desktop")]
1516 #[doc(alias = "get_show_desktop")]
1517 #[doc(alias = "show-desktop")]
1518 pub fn shows_desktop(&self) -> bool {
1519 unsafe {
1520 from_glib(ffi::gtk_places_sidebar_get_show_desktop(
1521 self.to_glib_none().0,
1522 ))
1523 }
1524 }
1525
1526 /// Returns the value previously set with [`set_show_enter_location()`][Self::set_show_enter_location()]
1527 ///
1528 /// # Returns
1529 ///
1530 /// [`true`] if the sidebar will display an “Enter Location” item.
1531 #[doc(alias = "gtk_places_sidebar_get_show_enter_location")]
1532 #[doc(alias = "get_show_enter_location")]
1533 #[doc(alias = "show-enter-location")]
1534 pub fn shows_enter_location(&self) -> bool {
1535 unsafe {
1536 from_glib(ffi::gtk_places_sidebar_get_show_enter_location(
1537 self.to_glib_none().0,
1538 ))
1539 }
1540 }
1541
1542 /// Returns the value previously set with [`set_show_other_locations()`][Self::set_show_other_locations()]
1543 ///
1544 /// # Returns
1545 ///
1546 /// [`true`] if the sidebar will display an “Other Locations” item.
1547 #[doc(alias = "gtk_places_sidebar_get_show_other_locations")]
1548 #[doc(alias = "get_show_other_locations")]
1549 #[doc(alias = "show-other-locations")]
1550 pub fn shows_other_locations(&self) -> bool {
1551 unsafe {
1552 from_glib(ffi::gtk_places_sidebar_get_show_other_locations(
1553 self.to_glib_none().0,
1554 ))
1555 }
1556 }
1557
1558 /// Returns the value previously set with [`set_show_recent()`][Self::set_show_recent()]
1559 ///
1560 /// # Returns
1561 ///
1562 /// [`true`] if the sidebar will display a builtin shortcut for recent files
1563 #[doc(alias = "gtk_places_sidebar_get_show_recent")]
1564 #[doc(alias = "get_show_recent")]
1565 #[doc(alias = "show-recent")]
1566 pub fn shows_recent(&self) -> bool {
1567 unsafe {
1568 from_glib(ffi::gtk_places_sidebar_get_show_recent(
1569 self.to_glib_none().0,
1570 ))
1571 }
1572 }
1573
1574 /// Returns the value previously set with [`set_show_starred_location()`][Self::set_show_starred_location()]
1575 ///
1576 /// # Returns
1577 ///
1578 /// [`true`] if the sidebar will display a Starred item.
1579 #[doc(alias = "gtk_places_sidebar_get_show_starred_location")]
1580 #[doc(alias = "get_show_starred_location")]
1581 #[doc(alias = "show-starred-location")]
1582 pub fn shows_starred_location(&self) -> bool {
1583 unsafe {
1584 from_glib(ffi::gtk_places_sidebar_get_show_starred_location(
1585 self.to_glib_none().0,
1586 ))
1587 }
1588 }
1589
1590 /// Returns the value previously set with [`set_show_trash()`][Self::set_show_trash()]
1591 ///
1592 /// # Returns
1593 ///
1594 /// [`true`] if the sidebar will display a “Trash” item.
1595 #[doc(alias = "gtk_places_sidebar_get_show_trash")]
1596 #[doc(alias = "get_show_trash")]
1597 #[doc(alias = "show-trash")]
1598 pub fn shows_trash(&self) -> bool {
1599 unsafe {
1600 from_glib(ffi::gtk_places_sidebar_get_show_trash(
1601 self.to_glib_none().0,
1602 ))
1603 }
1604 }
1605
1606 /// Gets the list of shortcuts.
1607 ///
1608 /// # Returns
1609 ///
1610 ///
1611 /// g_slist_free_full (list, (GDestroyNotify) g_object_unref);
1612 /// ]|
1613 #[doc(alias = "gtk_places_sidebar_list_shortcuts")]
1614 pub fn list_shortcuts(&self) -> Vec<gio::File> {
1615 unsafe {
1616 FromGlibPtrContainer::from_glib_full(ffi::gtk_places_sidebar_list_shortcuts(
1617 self.to_glib_none().0,
1618 ))
1619 }
1620 }
1621
1622 /// Removes an application-specific shortcut that has been previously been
1623 /// inserted with [`add_shortcut()`][Self::add_shortcut()]. If the `location` is not a
1624 /// shortcut in the sidebar, then nothing is done.
1625 /// ## `location`
1626 /// location to remove
1627 #[doc(alias = "gtk_places_sidebar_remove_shortcut")]
1628 pub fn remove_shortcut(&self, location: &impl IsA<gio::File>) {
1629 unsafe {
1630 ffi::gtk_places_sidebar_remove_shortcut(
1631 self.to_glib_none().0,
1632 location.as_ref().to_glib_none().0,
1633 );
1634 }
1635 }
1636
1637 /// Make the GtkPlacesSidebar show drop targets, so it can show the available
1638 /// drop targets and a "new bookmark" row. This improves the Drag-and-Drop
1639 /// experience of the user and allows applications to show all available
1640 /// drop targets at once.
1641 ///
1642 /// This needs to be called when the application is aware of an ongoing drag
1643 /// that might target the sidebar. The drop-targets-visible state will be unset
1644 /// automatically if the drag finishes in the GtkPlacesSidebar. You only need
1645 /// to unset the state when the drag ends on some other widget on your application.
1646 /// ## `visible`
1647 /// whether to show the valid targets or not.
1648 /// ## `context`
1649 /// drag context used to ask the source about the action that wants to
1650 /// perform, so hints are more accurate.
1651 #[doc(alias = "gtk_places_sidebar_set_drop_targets_visible")]
1652 pub fn set_drop_targets_visible(&self, visible: bool, context: &gdk::DragContext) {
1653 unsafe {
1654 ffi::gtk_places_sidebar_set_drop_targets_visible(
1655 self.to_glib_none().0,
1656 visible.into_glib(),
1657 context.to_glib_none().0,
1658 );
1659 }
1660 }
1661
1662 /// Sets whether the `self` should only show local files.
1663 /// ## `local_only`
1664 /// whether to show only local files
1665 #[doc(alias = "gtk_places_sidebar_set_local_only")]
1666 #[doc(alias = "local-only")]
1667 pub fn set_local_only(&self, local_only: bool) {
1668 unsafe {
1669 ffi::gtk_places_sidebar_set_local_only(self.to_glib_none().0, local_only.into_glib());
1670 }
1671 }
1672
1673 /// Sets the location that is being shown in the widgets surrounding the
1674 /// `self`, for example, in a folder view in a file manager. In turn, the
1675 /// `self` will highlight that location if it is being shown in the list of
1676 /// places, or it will unhighlight everything if the `location` is not among the
1677 /// places in the list.
1678 /// ## `location`
1679 /// location to select, or [`None`] for no current path
1680 #[doc(alias = "gtk_places_sidebar_set_location")]
1681 #[doc(alias = "location")]
1682 pub fn set_location(&self, location: Option<&impl IsA<gio::File>>) {
1683 unsafe {
1684 ffi::gtk_places_sidebar_set_location(
1685 self.to_glib_none().0,
1686 location.map(|p| p.as_ref()).to_glib_none().0,
1687 );
1688 }
1689 }
1690
1691 /// Sets the way in which the calling application can open new locations from
1692 /// the places sidebar. For example, some applications only open locations
1693 /// “directly” into their main view, while others may support opening locations
1694 /// in a new notebook tab or a new window.
1695 ///
1696 /// This function is used to tell the places `self` about the ways in which the
1697 /// application can open new locations, so that the sidebar can display (or not)
1698 /// the “Open in new tab” and “Open in new window” menu items as appropriate.
1699 ///
1700 /// When the [`open-location`][struct@crate::PlacesSidebar#open-location] signal is emitted, its flags
1701 /// argument will be set to one of the `flags` that was passed in
1702 /// [`set_open_flags()`][Self::set_open_flags()].
1703 ///
1704 /// Passing 0 for `flags` will cause [`PlacesOpenFlags::NORMAL`][crate::PlacesOpenFlags::NORMAL] to always be sent
1705 /// to callbacks for the “open-location” signal.
1706 /// ## `flags`
1707 /// Bitmask of modes in which the calling application can open locations
1708 #[doc(alias = "gtk_places_sidebar_set_open_flags")]
1709 #[doc(alias = "open-flags")]
1710 pub fn set_open_flags(&self, flags: PlacesOpenFlags) {
1711 unsafe {
1712 ffi::gtk_places_sidebar_set_open_flags(self.to_glib_none().0, flags.into_glib());
1713 }
1714 }
1715
1716 /// Sets whether the `self` should show an item for the Desktop folder.
1717 /// The default value for this option is determined by the desktop
1718 /// environment and the user’s configuration, but this function can be
1719 /// used to override it on a per-application basis.
1720 /// ## `show_desktop`
1721 /// whether to show an item for the Desktop folder
1722 #[doc(alias = "gtk_places_sidebar_set_show_desktop")]
1723 #[doc(alias = "show-desktop")]
1724 pub fn set_show_desktop(&self, show_desktop: bool) {
1725 unsafe {
1726 ffi::gtk_places_sidebar_set_show_desktop(
1727 self.to_glib_none().0,
1728 show_desktop.into_glib(),
1729 );
1730 }
1731 }
1732
1733 /// Sets whether the `self` should show an item for entering a location;
1734 /// this is off by default. An application may want to turn this on if manually
1735 /// entering URLs is an expected user action.
1736 ///
1737 /// If you enable this, you should connect to the
1738 /// [`show-enter-location`][struct@crate::PlacesSidebar#show-enter-location] signal.
1739 /// ## `show_enter_location`
1740 /// whether to show an item to enter a location
1741 #[doc(alias = "gtk_places_sidebar_set_show_enter_location")]
1742 #[doc(alias = "show-enter-location")]
1743 pub fn set_show_enter_location(&self, show_enter_location: bool) {
1744 unsafe {
1745 ffi::gtk_places_sidebar_set_show_enter_location(
1746 self.to_glib_none().0,
1747 show_enter_location.into_glib(),
1748 );
1749 }
1750 }
1751
1752 /// Sets whether the `self` should show an item for the application to show
1753 /// an Other Locations view; this is off by default. When set to [`true`], persistent
1754 /// devices such as hard drives are hidden, otherwise they are shown in the sidebar.
1755 /// An application may want to turn this on if it implements a way for the user to
1756 /// see and interact with drives and network servers directly.
1757 ///
1758 /// If you enable this, you should connect to the
1759 /// [`show-other-locations`][struct@crate::PlacesSidebar#show-other-locations] signal.
1760 /// ## `show_other_locations`
1761 /// whether to show an item for the Other Locations view
1762 #[doc(alias = "gtk_places_sidebar_set_show_other_locations")]
1763 #[doc(alias = "show-other-locations")]
1764 pub fn set_show_other_locations(&self, show_other_locations: bool) {
1765 unsafe {
1766 ffi::gtk_places_sidebar_set_show_other_locations(
1767 self.to_glib_none().0,
1768 show_other_locations.into_glib(),
1769 );
1770 }
1771 }
1772
1773 /// Sets whether the `self` should show an item for recent files.
1774 /// The default value for this option is determined by the desktop
1775 /// environment, but this function can be used to override it on a
1776 /// per-application basis.
1777 /// ## `show_recent`
1778 /// whether to show an item for recent files
1779 #[doc(alias = "gtk_places_sidebar_set_show_recent")]
1780 #[doc(alias = "show-recent")]
1781 pub fn set_show_recent(&self, show_recent: bool) {
1782 unsafe {
1783 ffi::gtk_places_sidebar_set_show_recent(self.to_glib_none().0, show_recent.into_glib());
1784 }
1785 }
1786
1787 /// If you enable this, you should connect to the
1788 /// [`show-starred-location`][struct@crate::PlacesSidebar#show-starred-location] signal.
1789 /// ## `show_starred_location`
1790 /// whether to show an item for Starred files
1791 #[doc(alias = "gtk_places_sidebar_set_show_starred_location")]
1792 #[doc(alias = "show-starred-location")]
1793 pub fn set_show_starred_location(&self, show_starred_location: bool) {
1794 unsafe {
1795 ffi::gtk_places_sidebar_set_show_starred_location(
1796 self.to_glib_none().0,
1797 show_starred_location.into_glib(),
1798 );
1799 }
1800 }
1801
1802 /// Sets whether the `self` should show an item for the Trash location.
1803 /// ## `show_trash`
1804 /// whether to show an item for the Trash location
1805 #[doc(alias = "gtk_places_sidebar_set_show_trash")]
1806 #[doc(alias = "show-trash")]
1807 pub fn set_show_trash(&self, show_trash: bool) {
1808 unsafe {
1809 ffi::gtk_places_sidebar_set_show_trash(self.to_glib_none().0, show_trash.into_glib());
1810 }
1811 }
1812
1813 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::PlacesSidebar#populate-popup] signal
1814 /// is also emitted for popovers.
1815 #[doc(alias = "populate-all")]
1816 pub fn populates_all(&self) -> bool {
1817 ObjectExt::property(self, "populate-all")
1818 }
1819
1820 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::PlacesSidebar#populate-popup] signal
1821 /// is also emitted for popovers.
1822 #[doc(alias = "populate-all")]
1823 pub fn set_populate_all(&self, populate_all: bool) {
1824 ObjectExt::set_property(self, "populate-all", populate_all)
1825 }
1826
1827 #[doc(alias = "show-connect-to-server")]
1828 pub fn shows_connect_to_server(&self) -> bool {
1829 ObjectExt::property(self, "show-connect-to-server")
1830 }
1831
1832 #[doc(alias = "show-connect-to-server")]
1833 pub fn set_show_connect_to_server(&self, show_connect_to_server: bool) {
1834 ObjectExt::set_property(self, "show-connect-to-server", show_connect_to_server)
1835 }
1836
1837 /// The places sidebar emits this signal when it needs to ask the application
1838 /// to pop up a menu to ask the user for which drag action to perform.
1839 /// ## `actions`
1840 /// Possible drag actions that need to be asked for.
1841 ///
1842 /// # Returns
1843 ///
1844 /// the final drag action that the sidebar should pass to the drag side
1845 /// of the drag-and-drop operation.
1846 #[doc(alias = "drag-action-ask")]
1847 pub fn connect_drag_action_ask<F: Fn(&Self, i32) -> i32 + 'static>(
1848 &self,
1849 f: F,
1850 ) -> SignalHandlerId {
1851 unsafe extern "C" fn drag_action_ask_trampoline<
1852 F: Fn(&PlacesSidebar, i32) -> i32 + 'static,
1853 >(
1854 this: *mut ffi::GtkPlacesSidebar,
1855 actions: std::ffi::c_int,
1856 f: glib::ffi::gpointer,
1857 ) -> std::ffi::c_int {
1858 unsafe {
1859 let f: &F = &*(f as *const F);
1860 f(&from_glib_borrow(this), actions)
1861 }
1862 }
1863 unsafe {
1864 let f: Box_<F> = Box_::new(f);
1865 connect_raw(
1866 self.as_ptr() as *mut _,
1867 c"drag-action-ask".as_ptr(),
1868 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1869 drag_action_ask_trampoline::<F> as *const (),
1870 )),
1871 Box_::into_raw(f),
1872 )
1873 }
1874 }
1875
1876 /// The places sidebar emits this signal when it starts a new operation
1877 /// because the user clicked on some location that needs mounting.
1878 /// In this way the application using the [`PlacesSidebar`][crate::PlacesSidebar] can track the
1879 /// progress of the operation and, for example, show a notification.
1880 /// ## `mount_operation`
1881 /// the [`gio::MountOperation`][crate::gio::MountOperation] that is going to start.
1882 #[doc(alias = "mount")]
1883 pub fn connect_mount<F: Fn(&Self, &gio::MountOperation) + 'static>(
1884 &self,
1885 f: F,
1886 ) -> SignalHandlerId {
1887 unsafe extern "C" fn mount_trampoline<
1888 F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static,
1889 >(
1890 this: *mut ffi::GtkPlacesSidebar,
1891 mount_operation: *mut gio::ffi::GMountOperation,
1892 f: glib::ffi::gpointer,
1893 ) {
1894 unsafe {
1895 let f: &F = &*(f as *const F);
1896 f(&from_glib_borrow(this), &from_glib_borrow(mount_operation))
1897 }
1898 }
1899 unsafe {
1900 let f: Box_<F> = Box_::new(f);
1901 connect_raw(
1902 self.as_ptr() as *mut _,
1903 c"mount".as_ptr(),
1904 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1905 mount_trampoline::<F> as *const (),
1906 )),
1907 Box_::into_raw(f),
1908 )
1909 }
1910 }
1911
1912 /// The places sidebar emits this signal when the user selects a location
1913 /// in it. The calling application should display the contents of that
1914 /// location; for example, a file manager should show a list of files in
1915 /// the specified location.
1916 /// ## `location`
1917 /// [`gio::File`][crate::gio::File] to which the caller should switch.
1918 /// ## `open_flags`
1919 /// a single value from [`PlacesOpenFlags`][crate::PlacesOpenFlags] specifying how the `location` should be opened.
1920 #[doc(alias = "open-location")]
1921 pub fn connect_open_location<F: Fn(&Self, &gio::File, PlacesOpenFlags) + 'static>(
1922 &self,
1923 f: F,
1924 ) -> SignalHandlerId {
1925 unsafe extern "C" fn open_location_trampoline<
1926 F: Fn(&PlacesSidebar, &gio::File, PlacesOpenFlags) + 'static,
1927 >(
1928 this: *mut ffi::GtkPlacesSidebar,
1929 location: *mut gio::ffi::GFile,
1930 open_flags: ffi::GtkPlacesOpenFlags,
1931 f: glib::ffi::gpointer,
1932 ) {
1933 unsafe {
1934 let f: &F = &*(f as *const F);
1935 f(
1936 &from_glib_borrow(this),
1937 &from_glib_borrow(location),
1938 from_glib(open_flags),
1939 )
1940 }
1941 }
1942 unsafe {
1943 let f: Box_<F> = Box_::new(f);
1944 connect_raw(
1945 self.as_ptr() as *mut _,
1946 c"open-location".as_ptr(),
1947 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1948 open_location_trampoline::<F> as *const (),
1949 )),
1950 Box_::into_raw(f),
1951 )
1952 }
1953 }
1954
1955 //#[doc(alias = "populate-popup")]
1956 //pub fn connect_populate_popup<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
1957 // Ignored selected_volume: Gio.Volume
1958 //}
1959
1960 /// The places sidebar emits this signal when it needs the calling
1961 /// application to present an way to directly enter a location.
1962 /// For example, the application may bring up a dialog box asking for
1963 /// a URL like "http://http.example.com".
1964 #[doc(alias = "show-enter-location")]
1965 pub fn connect_show_enter_location<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1966 unsafe extern "C" fn show_enter_location_trampoline<F: Fn(&PlacesSidebar) + 'static>(
1967 this: *mut ffi::GtkPlacesSidebar,
1968 f: glib::ffi::gpointer,
1969 ) {
1970 unsafe {
1971 let f: &F = &*(f as *const F);
1972 f(&from_glib_borrow(this))
1973 }
1974 }
1975 unsafe {
1976 let f: Box_<F> = Box_::new(f);
1977 connect_raw(
1978 self.as_ptr() as *mut _,
1979 c"show-enter-location".as_ptr(),
1980 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1981 show_enter_location_trampoline::<F> as *const (),
1982 )),
1983 Box_::into_raw(f),
1984 )
1985 }
1986 }
1987
1988 /// The places sidebar emits this signal when it needs the calling
1989 /// application to present an error message. Most of these messages
1990 /// refer to mounting or unmounting media, for example, when a drive
1991 /// cannot be started for some reason.
1992 /// ## `primary`
1993 /// primary message with a summary of the error to show.
1994 /// ## `secondary`
1995 /// secondary message with details of the error to show.
1996 #[doc(alias = "show-error-message")]
1997 pub fn connect_show_error_message<F: Fn(&Self, &str, &str) + 'static>(
1998 &self,
1999 f: F,
2000 ) -> SignalHandlerId {
2001 unsafe extern "C" fn show_error_message_trampoline<
2002 F: Fn(&PlacesSidebar, &str, &str) + 'static,
2003 >(
2004 this: *mut ffi::GtkPlacesSidebar,
2005 primary: *mut std::ffi::c_char,
2006 secondary: *mut std::ffi::c_char,
2007 f: glib::ffi::gpointer,
2008 ) {
2009 unsafe {
2010 let f: &F = &*(f as *const F);
2011 f(
2012 &from_glib_borrow(this),
2013 &glib::GString::from_glib_borrow(primary),
2014 &glib::GString::from_glib_borrow(secondary),
2015 )
2016 }
2017 }
2018 unsafe {
2019 let f: Box_<F> = Box_::new(f);
2020 connect_raw(
2021 self.as_ptr() as *mut _,
2022 c"show-error-message".as_ptr(),
2023 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2024 show_error_message_trampoline::<F> as *const (),
2025 )),
2026 Box_::into_raw(f),
2027 )
2028 }
2029 }
2030
2031 /// The places sidebar emits this signal when it needs the calling
2032 /// application to present a way to show other locations e.g. drives
2033 /// and network access points.
2034 /// For example, the application may bring up a page showing persistent
2035 /// volumes and discovered network addresses.
2036 /// ## `open_flags`
2037 /// a single value from [`PlacesOpenFlags`][crate::PlacesOpenFlags] specifying how it should be opened.
2038 #[doc(alias = "show-other-locations-with-flags")]
2039 pub fn connect_show_other_locations_with_flags<F: Fn(&Self, PlacesOpenFlags) + 'static>(
2040 &self,
2041 f: F,
2042 ) -> SignalHandlerId {
2043 unsafe extern "C" fn show_other_locations_with_flags_trampoline<
2044 F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
2045 >(
2046 this: *mut ffi::GtkPlacesSidebar,
2047 open_flags: ffi::GtkPlacesOpenFlags,
2048 f: glib::ffi::gpointer,
2049 ) {
2050 unsafe {
2051 let f: &F = &*(f as *const F);
2052 f(&from_glib_borrow(this), from_glib(open_flags))
2053 }
2054 }
2055 unsafe {
2056 let f: Box_<F> = Box_::new(f);
2057 connect_raw(
2058 self.as_ptr() as *mut _,
2059 c"show-other-locations-with-flags".as_ptr(),
2060 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2061 show_other_locations_with_flags_trampoline::<F> as *const (),
2062 )),
2063 Box_::into_raw(f),
2064 )
2065 }
2066 }
2067
2068 /// The places sidebar emits this signal when it needs the calling
2069 /// application to present a way to show the starred files. In GNOME,
2070 /// starred files are implemented by setting the nao:predefined-tag-favorite
2071 /// tag in the tracker database.
2072 /// ## `open_flags`
2073 /// a single value from [`PlacesOpenFlags`][crate::PlacesOpenFlags] specifying how the
2074 /// starred file should be opened.
2075 #[doc(alias = "show-starred-location")]
2076 pub fn connect_show_starred_location<F: Fn(&Self, PlacesOpenFlags) + 'static>(
2077 &self,
2078 f: F,
2079 ) -> SignalHandlerId {
2080 unsafe extern "C" fn show_starred_location_trampoline<
2081 F: Fn(&PlacesSidebar, PlacesOpenFlags) + 'static,
2082 >(
2083 this: *mut ffi::GtkPlacesSidebar,
2084 open_flags: ffi::GtkPlacesOpenFlags,
2085 f: glib::ffi::gpointer,
2086 ) {
2087 unsafe {
2088 let f: &F = &*(f as *const F);
2089 f(&from_glib_borrow(this), from_glib(open_flags))
2090 }
2091 }
2092 unsafe {
2093 let f: Box_<F> = Box_::new(f);
2094 connect_raw(
2095 self.as_ptr() as *mut _,
2096 c"show-starred-location".as_ptr(),
2097 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2098 show_starred_location_trampoline::<F> as *const (),
2099 )),
2100 Box_::into_raw(f),
2101 )
2102 }
2103 }
2104
2105 /// The places sidebar emits this signal when it starts a new operation
2106 /// because the user for example ejected some drive or unmounted a mount.
2107 /// In this way the application using the [`PlacesSidebar`][crate::PlacesSidebar] can track the
2108 /// progress of the operation and, for example, show a notification.
2109 /// ## `mount_operation`
2110 /// the [`gio::MountOperation`][crate::gio::MountOperation] that is going to start.
2111 #[doc(alias = "unmount")]
2112 pub fn connect_unmount<F: Fn(&Self, &gio::MountOperation) + 'static>(
2113 &self,
2114 f: F,
2115 ) -> SignalHandlerId {
2116 unsafe extern "C" fn unmount_trampoline<
2117 F: Fn(&PlacesSidebar, &gio::MountOperation) + 'static,
2118 >(
2119 this: *mut ffi::GtkPlacesSidebar,
2120 mount_operation: *mut gio::ffi::GMountOperation,
2121 f: glib::ffi::gpointer,
2122 ) {
2123 unsafe {
2124 let f: &F = &*(f as *const F);
2125 f(&from_glib_borrow(this), &from_glib_borrow(mount_operation))
2126 }
2127 }
2128 unsafe {
2129 let f: Box_<F> = Box_::new(f);
2130 connect_raw(
2131 self.as_ptr() as *mut _,
2132 c"unmount".as_ptr(),
2133 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2134 unmount_trampoline::<F> as *const (),
2135 )),
2136 Box_::into_raw(f),
2137 )
2138 }
2139 }
2140
2141 #[doc(alias = "local-only")]
2142 pub fn connect_local_only_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2143 unsafe extern "C" fn notify_local_only_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2144 this: *mut ffi::GtkPlacesSidebar,
2145 _param_spec: glib::ffi::gpointer,
2146 f: glib::ffi::gpointer,
2147 ) {
2148 unsafe {
2149 let f: &F = &*(f as *const F);
2150 f(&from_glib_borrow(this))
2151 }
2152 }
2153 unsafe {
2154 let f: Box_<F> = Box_::new(f);
2155 connect_raw(
2156 self.as_ptr() as *mut _,
2157 c"notify::local-only".as_ptr(),
2158 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2159 notify_local_only_trampoline::<F> as *const (),
2160 )),
2161 Box_::into_raw(f),
2162 )
2163 }
2164 }
2165
2166 #[doc(alias = "location")]
2167 pub fn connect_location_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2168 unsafe extern "C" fn notify_location_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2169 this: *mut ffi::GtkPlacesSidebar,
2170 _param_spec: glib::ffi::gpointer,
2171 f: glib::ffi::gpointer,
2172 ) {
2173 unsafe {
2174 let f: &F = &*(f as *const F);
2175 f(&from_glib_borrow(this))
2176 }
2177 }
2178 unsafe {
2179 let f: Box_<F> = Box_::new(f);
2180 connect_raw(
2181 self.as_ptr() as *mut _,
2182 c"notify::location".as_ptr(),
2183 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2184 notify_location_trampoline::<F> as *const (),
2185 )),
2186 Box_::into_raw(f),
2187 )
2188 }
2189 }
2190
2191 #[doc(alias = "open-flags")]
2192 pub fn connect_open_flags_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2193 unsafe extern "C" fn notify_open_flags_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2194 this: *mut ffi::GtkPlacesSidebar,
2195 _param_spec: glib::ffi::gpointer,
2196 f: glib::ffi::gpointer,
2197 ) {
2198 unsafe {
2199 let f: &F = &*(f as *const F);
2200 f(&from_glib_borrow(this))
2201 }
2202 }
2203 unsafe {
2204 let f: Box_<F> = Box_::new(f);
2205 connect_raw(
2206 self.as_ptr() as *mut _,
2207 c"notify::open-flags".as_ptr(),
2208 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2209 notify_open_flags_trampoline::<F> as *const (),
2210 )),
2211 Box_::into_raw(f),
2212 )
2213 }
2214 }
2215
2216 #[doc(alias = "populate-all")]
2217 pub fn connect_populate_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2218 unsafe extern "C" fn notify_populate_all_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2219 this: *mut ffi::GtkPlacesSidebar,
2220 _param_spec: glib::ffi::gpointer,
2221 f: glib::ffi::gpointer,
2222 ) {
2223 unsafe {
2224 let f: &F = &*(f as *const F);
2225 f(&from_glib_borrow(this))
2226 }
2227 }
2228 unsafe {
2229 let f: Box_<F> = Box_::new(f);
2230 connect_raw(
2231 self.as_ptr() as *mut _,
2232 c"notify::populate-all".as_ptr(),
2233 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2234 notify_populate_all_trampoline::<F> as *const (),
2235 )),
2236 Box_::into_raw(f),
2237 )
2238 }
2239 }
2240
2241 #[doc(alias = "show-connect-to-server")]
2242 pub fn connect_show_connect_to_server_notify<F: Fn(&Self) + 'static>(
2243 &self,
2244 f: F,
2245 ) -> SignalHandlerId {
2246 unsafe extern "C" fn notify_show_connect_to_server_trampoline<
2247 F: Fn(&PlacesSidebar) + 'static,
2248 >(
2249 this: *mut ffi::GtkPlacesSidebar,
2250 _param_spec: glib::ffi::gpointer,
2251 f: glib::ffi::gpointer,
2252 ) {
2253 unsafe {
2254 let f: &F = &*(f as *const F);
2255 f(&from_glib_borrow(this))
2256 }
2257 }
2258 unsafe {
2259 let f: Box_<F> = Box_::new(f);
2260 connect_raw(
2261 self.as_ptr() as *mut _,
2262 c"notify::show-connect-to-server".as_ptr(),
2263 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2264 notify_show_connect_to_server_trampoline::<F> as *const (),
2265 )),
2266 Box_::into_raw(f),
2267 )
2268 }
2269 }
2270
2271 #[doc(alias = "show-desktop")]
2272 pub fn connect_show_desktop_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2273 unsafe extern "C" fn notify_show_desktop_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2274 this: *mut ffi::GtkPlacesSidebar,
2275 _param_spec: glib::ffi::gpointer,
2276 f: glib::ffi::gpointer,
2277 ) {
2278 unsafe {
2279 let f: &F = &*(f as *const F);
2280 f(&from_glib_borrow(this))
2281 }
2282 }
2283 unsafe {
2284 let f: Box_<F> = Box_::new(f);
2285 connect_raw(
2286 self.as_ptr() as *mut _,
2287 c"notify::show-desktop".as_ptr(),
2288 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2289 notify_show_desktop_trampoline::<F> as *const (),
2290 )),
2291 Box_::into_raw(f),
2292 )
2293 }
2294 }
2295
2296 #[doc(alias = "show-enter-location")]
2297 pub fn connect_show_enter_location_notify<F: Fn(&Self) + 'static>(
2298 &self,
2299 f: F,
2300 ) -> SignalHandlerId {
2301 unsafe extern "C" fn notify_show_enter_location_trampoline<
2302 F: Fn(&PlacesSidebar) + 'static,
2303 >(
2304 this: *mut ffi::GtkPlacesSidebar,
2305 _param_spec: glib::ffi::gpointer,
2306 f: glib::ffi::gpointer,
2307 ) {
2308 unsafe {
2309 let f: &F = &*(f as *const F);
2310 f(&from_glib_borrow(this))
2311 }
2312 }
2313 unsafe {
2314 let f: Box_<F> = Box_::new(f);
2315 connect_raw(
2316 self.as_ptr() as *mut _,
2317 c"notify::show-enter-location".as_ptr(),
2318 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2319 notify_show_enter_location_trampoline::<F> as *const (),
2320 )),
2321 Box_::into_raw(f),
2322 )
2323 }
2324 }
2325
2326 #[doc(alias = "show-other-locations")]
2327 pub fn connect_show_other_locations_notify<F: Fn(&Self) + 'static>(
2328 &self,
2329 f: F,
2330 ) -> SignalHandlerId {
2331 unsafe extern "C" fn notify_show_other_locations_trampoline<
2332 F: Fn(&PlacesSidebar) + 'static,
2333 >(
2334 this: *mut ffi::GtkPlacesSidebar,
2335 _param_spec: glib::ffi::gpointer,
2336 f: glib::ffi::gpointer,
2337 ) {
2338 unsafe {
2339 let f: &F = &*(f as *const F);
2340 f(&from_glib_borrow(this))
2341 }
2342 }
2343 unsafe {
2344 let f: Box_<F> = Box_::new(f);
2345 connect_raw(
2346 self.as_ptr() as *mut _,
2347 c"notify::show-other-locations".as_ptr(),
2348 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2349 notify_show_other_locations_trampoline::<F> as *const (),
2350 )),
2351 Box_::into_raw(f),
2352 )
2353 }
2354 }
2355
2356 #[doc(alias = "show-recent")]
2357 pub fn connect_show_recent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2358 unsafe extern "C" fn notify_show_recent_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2359 this: *mut ffi::GtkPlacesSidebar,
2360 _param_spec: glib::ffi::gpointer,
2361 f: glib::ffi::gpointer,
2362 ) {
2363 unsafe {
2364 let f: &F = &*(f as *const F);
2365 f(&from_glib_borrow(this))
2366 }
2367 }
2368 unsafe {
2369 let f: Box_<F> = Box_::new(f);
2370 connect_raw(
2371 self.as_ptr() as *mut _,
2372 c"notify::show-recent".as_ptr(),
2373 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2374 notify_show_recent_trampoline::<F> as *const (),
2375 )),
2376 Box_::into_raw(f),
2377 )
2378 }
2379 }
2380
2381 #[doc(alias = "show-starred-location")]
2382 pub fn connect_show_starred_location_notify<F: Fn(&Self) + 'static>(
2383 &self,
2384 f: F,
2385 ) -> SignalHandlerId {
2386 unsafe extern "C" fn notify_show_starred_location_trampoline<
2387 F: Fn(&PlacesSidebar) + 'static,
2388 >(
2389 this: *mut ffi::GtkPlacesSidebar,
2390 _param_spec: glib::ffi::gpointer,
2391 f: glib::ffi::gpointer,
2392 ) {
2393 unsafe {
2394 let f: &F = &*(f as *const F);
2395 f(&from_glib_borrow(this))
2396 }
2397 }
2398 unsafe {
2399 let f: Box_<F> = Box_::new(f);
2400 connect_raw(
2401 self.as_ptr() as *mut _,
2402 c"notify::show-starred-location".as_ptr(),
2403 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2404 notify_show_starred_location_trampoline::<F> as *const (),
2405 )),
2406 Box_::into_raw(f),
2407 )
2408 }
2409 }
2410
2411 #[doc(alias = "show-trash")]
2412 pub fn connect_show_trash_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2413 unsafe extern "C" fn notify_show_trash_trampoline<F: Fn(&PlacesSidebar) + 'static>(
2414 this: *mut ffi::GtkPlacesSidebar,
2415 _param_spec: glib::ffi::gpointer,
2416 f: glib::ffi::gpointer,
2417 ) {
2418 unsafe {
2419 let f: &F = &*(f as *const F);
2420 f(&from_glib_borrow(this))
2421 }
2422 }
2423 unsafe {
2424 let f: Box_<F> = Box_::new(f);
2425 connect_raw(
2426 self.as_ptr() as *mut _,
2427 c"notify::show-trash".as_ptr(),
2428 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2429 notify_show_trash_trampoline::<F> as *const (),
2430 )),
2431 Box_::into_raw(f),
2432 )
2433 }
2434 }
2435}
2436
2437impl Default for PlacesSidebar {
2438 fn default() -> Self {
2439 Self::new()
2440 }
2441}
2442
2443// rustdoc-stripper-ignore-next
2444/// A [builder-pattern] type to construct [`PlacesSidebar`] objects.
2445///
2446/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
2447#[must_use = "The builder must be built to be used"]
2448pub struct PlacesSidebarBuilder {
2449 builder: glib::object::ObjectBuilder<'static, PlacesSidebar>,
2450}
2451
2452impl PlacesSidebarBuilder {
2453 fn new() -> Self {
2454 Self {
2455 builder: glib::object::Object::builder(),
2456 }
2457 }
2458
2459 pub fn local_only(self, local_only: bool) -> Self {
2460 Self {
2461 builder: self.builder.property("local-only", local_only),
2462 }
2463 }
2464
2465 pub fn location(self, location: &impl IsA<gio::File>) -> Self {
2466 Self {
2467 builder: self.builder.property("location", location.clone().upcast()),
2468 }
2469 }
2470
2471 pub fn open_flags(self, open_flags: PlacesOpenFlags) -> Self {
2472 Self {
2473 builder: self.builder.property("open-flags", open_flags),
2474 }
2475 }
2476
2477 /// If :populate-all is [`true`], the [`populate-popup`][struct@crate::PlacesSidebar#populate-popup] signal
2478 /// is also emitted for popovers.
2479 pub fn populate_all(self, populate_all: bool) -> Self {
2480 Self {
2481 builder: self.builder.property("populate-all", populate_all),
2482 }
2483 }
2484
2485 pub fn show_connect_to_server(self, show_connect_to_server: bool) -> Self {
2486 Self {
2487 builder: self
2488 .builder
2489 .property("show-connect-to-server", show_connect_to_server),
2490 }
2491 }
2492
2493 pub fn show_desktop(self, show_desktop: bool) -> Self {
2494 Self {
2495 builder: self.builder.property("show-desktop", show_desktop),
2496 }
2497 }
2498
2499 pub fn show_enter_location(self, show_enter_location: bool) -> Self {
2500 Self {
2501 builder: self
2502 .builder
2503 .property("show-enter-location", show_enter_location),
2504 }
2505 }
2506
2507 pub fn show_other_locations(self, show_other_locations: bool) -> Self {
2508 Self {
2509 builder: self
2510 .builder
2511 .property("show-other-locations", show_other_locations),
2512 }
2513 }
2514
2515 pub fn show_recent(self, show_recent: bool) -> Self {
2516 Self {
2517 builder: self.builder.property("show-recent", show_recent),
2518 }
2519 }
2520
2521 pub fn show_starred_location(self, show_starred_location: bool) -> Self {
2522 Self {
2523 builder: self
2524 .builder
2525 .property("show-starred-location", show_starred_location),
2526 }
2527 }
2528
2529 pub fn show_trash(self, show_trash: bool) -> Self {
2530 Self {
2531 builder: self.builder.property("show-trash", show_trash),
2532 }
2533 }
2534
2535 pub fn hadjustment(self, hadjustment: &impl IsA<Adjustment>) -> Self {
2536 Self {
2537 builder: self
2538 .builder
2539 .property("hadjustment", hadjustment.clone().upcast()),
2540 }
2541 }
2542
2543 pub fn hscrollbar_policy(self, hscrollbar_policy: PolicyType) -> Self {
2544 Self {
2545 builder: self
2546 .builder
2547 .property("hscrollbar-policy", hscrollbar_policy),
2548 }
2549 }
2550
2551 /// Whether kinetic scrolling is enabled or not. Kinetic scrolling
2552 /// only applies to devices with source `GDK_SOURCE_TOUCHSCREEN`.
2553 pub fn kinetic_scrolling(self, kinetic_scrolling: bool) -> Self {
2554 Self {
2555 builder: self
2556 .builder
2557 .property("kinetic-scrolling", kinetic_scrolling),
2558 }
2559 }
2560
2561 /// The maximum content height of `scrolled_window`, or -1 if not set.
2562 pub fn max_content_height(self, max_content_height: i32) -> Self {
2563 Self {
2564 builder: self
2565 .builder
2566 .property("max-content-height", max_content_height),
2567 }
2568 }
2569
2570 /// The maximum content width of `scrolled_window`, or -1 if not set.
2571 pub fn max_content_width(self, max_content_width: i32) -> Self {
2572 Self {
2573 builder: self
2574 .builder
2575 .property("max-content-width", max_content_width),
2576 }
2577 }
2578
2579 /// The minimum content height of `scrolled_window`, or -1 if not set.
2580 pub fn min_content_height(self, min_content_height: i32) -> Self {
2581 Self {
2582 builder: self
2583 .builder
2584 .property("min-content-height", min_content_height),
2585 }
2586 }
2587
2588 /// The minimum content width of `scrolled_window`, or -1 if not set.
2589 pub fn min_content_width(self, min_content_width: i32) -> Self {
2590 Self {
2591 builder: self
2592 .builder
2593 .property("min-content-width", min_content_width),
2594 }
2595 }
2596
2597 /// Whether overlay scrolling is enabled or not. If it is, the
2598 /// scrollbars are only added as traditional widgets when a mouse
2599 /// is present. Otherwise, they are overlayed on top of the content,
2600 /// as narrow indicators.
2601 ///
2602 /// Note that overlay scrolling can also be globally disabled, with
2603 /// the [`gtk-overlay-scrolling`][struct@crate::Settings#gtk-overlay-scrolling] setting.
2604 pub fn overlay_scrolling(self, overlay_scrolling: bool) -> Self {
2605 Self {
2606 builder: self
2607 .builder
2608 .property("overlay-scrolling", overlay_scrolling),
2609 }
2610 }
2611
2612 /// Whether the natural height of the child should be calculated and propagated
2613 /// through the scrolled window’s requested natural height.
2614 ///
2615 /// This is useful in cases where an attempt should be made to allocate exactly
2616 /// enough space for the natural size of the child.
2617 pub fn propagate_natural_height(self, propagate_natural_height: bool) -> Self {
2618 Self {
2619 builder: self
2620 .builder
2621 .property("propagate-natural-height", propagate_natural_height),
2622 }
2623 }
2624
2625 /// Whether the natural width of the child should be calculated and propagated
2626 /// through the scrolled window’s requested natural width.
2627 ///
2628 /// This is useful in cases where an attempt should be made to allocate exactly
2629 /// enough space for the natural size of the child.
2630 pub fn propagate_natural_width(self, propagate_natural_width: bool) -> Self {
2631 Self {
2632 builder: self
2633 .builder
2634 .property("propagate-natural-width", propagate_natural_width),
2635 }
2636 }
2637
2638 pub fn shadow_type(self, shadow_type: ShadowType) -> Self {
2639 Self {
2640 builder: self.builder.property("shadow-type", shadow_type),
2641 }
2642 }
2643
2644 pub fn vadjustment(self, vadjustment: &impl IsA<Adjustment>) -> Self {
2645 Self {
2646 builder: self
2647 .builder
2648 .property("vadjustment", vadjustment.clone().upcast()),
2649 }
2650 }
2651
2652 pub fn vscrollbar_policy(self, vscrollbar_policy: PolicyType) -> Self {
2653 Self {
2654 builder: self
2655 .builder
2656 .property("vscrollbar-policy", vscrollbar_policy),
2657 }
2658 }
2659
2660 pub fn window_placement(self, window_placement: CornerType) -> Self {
2661 Self {
2662 builder: self.builder.property("window-placement", window_placement),
2663 }
2664 }
2665
2666 pub fn border_width(self, border_width: u32) -> Self {
2667 Self {
2668 builder: self.builder.property("border-width", border_width),
2669 }
2670 }
2671
2672 pub fn child(self, child: &impl IsA<Widget>) -> Self {
2673 Self {
2674 builder: self.builder.property("child", child.clone().upcast()),
2675 }
2676 }
2677
2678 pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
2679 Self {
2680 builder: self.builder.property("resize-mode", resize_mode),
2681 }
2682 }
2683
2684 pub fn app_paintable(self, app_paintable: bool) -> Self {
2685 Self {
2686 builder: self.builder.property("app-paintable", app_paintable),
2687 }
2688 }
2689
2690 pub fn can_default(self, can_default: bool) -> Self {
2691 Self {
2692 builder: self.builder.property("can-default", can_default),
2693 }
2694 }
2695
2696 pub fn can_focus(self, can_focus: bool) -> Self {
2697 Self {
2698 builder: self.builder.property("can-focus", can_focus),
2699 }
2700 }
2701
2702 pub fn events(self, events: gdk::EventMask) -> Self {
2703 Self {
2704 builder: self.builder.property("events", events),
2705 }
2706 }
2707
2708 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
2709 pub fn expand(self, expand: bool) -> Self {
2710 Self {
2711 builder: self.builder.property("expand", expand),
2712 }
2713 }
2714
2715 /// Whether the widget should grab focus when it is clicked with the mouse.
2716 ///
2717 /// This property is only relevant for widgets that can take focus.
2718 ///
2719 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
2720 /// GtkComboBox) implemented this property individually.
2721 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
2722 Self {
2723 builder: self.builder.property("focus-on-click", focus_on_click),
2724 }
2725 }
2726
2727 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
2728 pub fn halign(self, halign: Align) -> Self {
2729 Self {
2730 builder: self.builder.property("halign", halign),
2731 }
2732 }
2733
2734 pub fn has_default(self, has_default: bool) -> Self {
2735 Self {
2736 builder: self.builder.property("has-default", has_default),
2737 }
2738 }
2739
2740 pub fn has_focus(self, has_focus: bool) -> Self {
2741 Self {
2742 builder: self.builder.property("has-focus", has_focus),
2743 }
2744 }
2745
2746 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
2747 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
2748 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
2749 /// whether it will provide a tooltip or not.
2750 ///
2751 /// Note that setting this property to [`true`] for the first time will change
2752 /// the event masks of the GdkWindows of this widget to include leave-notify
2753 /// and motion-notify events. This cannot and will not be undone when the
2754 /// property is set to [`false`] again.
2755 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
2756 Self {
2757 builder: self.builder.property("has-tooltip", has_tooltip),
2758 }
2759 }
2760
2761 pub fn height_request(self, height_request: i32) -> Self {
2762 Self {
2763 builder: self.builder.property("height-request", height_request),
2764 }
2765 }
2766
2767 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
2768 pub fn hexpand(self, hexpand: bool) -> Self {
2769 Self {
2770 builder: self.builder.property("hexpand", hexpand),
2771 }
2772 }
2773
2774 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
2775 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
2776 Self {
2777 builder: self.builder.property("hexpand-set", hexpand_set),
2778 }
2779 }
2780
2781 pub fn is_focus(self, is_focus: bool) -> Self {
2782 Self {
2783 builder: self.builder.property("is-focus", is_focus),
2784 }
2785 }
2786
2787 /// Sets all four sides' margin at once. If read, returns max
2788 /// margin on any side.
2789 pub fn margin(self, margin: i32) -> Self {
2790 Self {
2791 builder: self.builder.property("margin", margin),
2792 }
2793 }
2794
2795 /// Margin on bottom side of widget.
2796 ///
2797 /// This property adds margin outside of the widget's normal size
2798 /// request, the margin will be added in addition to the size from
2799 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2800 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
2801 Self {
2802 builder: self.builder.property("margin-bottom", margin_bottom),
2803 }
2804 }
2805
2806 /// Margin on end of widget, horizontally. This property supports
2807 /// left-to-right and right-to-left text directions.
2808 ///
2809 /// This property adds margin outside of the widget's normal size
2810 /// request, the margin will be added in addition to the size from
2811 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2812 pub fn margin_end(self, margin_end: i32) -> Self {
2813 Self {
2814 builder: self.builder.property("margin-end", margin_end),
2815 }
2816 }
2817
2818 /// Margin on start of widget, horizontally. This property supports
2819 /// left-to-right and right-to-left text directions.
2820 ///
2821 /// This property adds margin outside of the widget's normal size
2822 /// request, the margin will be added in addition to the size from
2823 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2824 pub fn margin_start(self, margin_start: i32) -> Self {
2825 Self {
2826 builder: self.builder.property("margin-start", margin_start),
2827 }
2828 }
2829
2830 /// Margin on top side of widget.
2831 ///
2832 /// This property adds margin outside of the widget's normal size
2833 /// request, the margin will be added in addition to the size from
2834 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2835 pub fn margin_top(self, margin_top: i32) -> Self {
2836 Self {
2837 builder: self.builder.property("margin-top", margin_top),
2838 }
2839 }
2840
2841 pub fn name(self, name: impl Into<glib::GString>) -> Self {
2842 Self {
2843 builder: self.builder.property("name", name.into()),
2844 }
2845 }
2846
2847 pub fn no_show_all(self, no_show_all: bool) -> Self {
2848 Self {
2849 builder: self.builder.property("no-show-all", no_show_all),
2850 }
2851 }
2852
2853 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
2854 /// more details about window opacity.
2855 ///
2856 /// Before 3.8 this was only available in GtkWindow
2857 pub fn opacity(self, opacity: f64) -> Self {
2858 Self {
2859 builder: self.builder.property("opacity", opacity),
2860 }
2861 }
2862
2863 pub fn parent(self, parent: &impl IsA<Container>) -> Self {
2864 Self {
2865 builder: self.builder.property("parent", parent.clone().upcast()),
2866 }
2867 }
2868
2869 pub fn receives_default(self, receives_default: bool) -> Self {
2870 Self {
2871 builder: self.builder.property("receives-default", receives_default),
2872 }
2873 }
2874
2875 pub fn sensitive(self, sensitive: bool) -> Self {
2876 Self {
2877 builder: self.builder.property("sensitive", sensitive),
2878 }
2879 }
2880
2881 /// Sets the text of tooltip to be the given string, which is marked up
2882 /// with the [Pango text markup language][PangoMarkupFormat].
2883 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
2884 ///
2885 /// This is a convenience property which will take care of getting the
2886 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
2887 /// will automatically be set to [`true`] and there will be taken care of
2888 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
2889 ///
2890 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
2891 /// are set, the last one wins.
2892 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
2893 Self {
2894 builder: self
2895 .builder
2896 .property("tooltip-markup", tooltip_markup.into()),
2897 }
2898 }
2899
2900 /// Sets the text of tooltip to be the given string.
2901 ///
2902 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
2903 ///
2904 /// This is a convenience property which will take care of getting the
2905 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
2906 /// will automatically be set to [`true`] and there will be taken care of
2907 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
2908 ///
2909 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
2910 /// are set, the last one wins.
2911 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
2912 Self {
2913 builder: self.builder.property("tooltip-text", tooltip_text.into()),
2914 }
2915 }
2916
2917 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
2918 pub fn valign(self, valign: Align) -> Self {
2919 Self {
2920 builder: self.builder.property("valign", valign),
2921 }
2922 }
2923
2924 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
2925 pub fn vexpand(self, vexpand: bool) -> Self {
2926 Self {
2927 builder: self.builder.property("vexpand", vexpand),
2928 }
2929 }
2930
2931 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
2932 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
2933 Self {
2934 builder: self.builder.property("vexpand-set", vexpand_set),
2935 }
2936 }
2937
2938 pub fn visible(self, visible: bool) -> Self {
2939 Self {
2940 builder: self.builder.property("visible", visible),
2941 }
2942 }
2943
2944 pub fn width_request(self, width_request: i32) -> Self {
2945 Self {
2946 builder: self.builder.property("width-request", width_request),
2947 }
2948 }
2949
2950 // rustdoc-stripper-ignore-next
2951 /// Build the [`PlacesSidebar`].
2952 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2953 pub fn build(self) -> PlacesSidebar {
2954 assert_initialized_main_thread!();
2955 self.builder.build()
2956 }
2957}