gio/auto/
mount_operation.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::{AskPasswordFlags, MountOperationResult, PasswordSave, ffi};
6use glib::{
7    object::ObjectType as _,
8    prelude::*,
9    signal::{SignalHandlerId, connect_raw},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    /// `GMountOperation` provides a mechanism for interacting with the user.
16    /// It can be used for authenticating mountable operations, such as loop
17    /// mounting files, hard drive partitions or server locations. It can
18    /// also be used to ask the user questions or show a list of applications
19    /// preventing unmount or eject operations from completing.
20    ///
21    /// Note that `GMountOperation` is used for more than just [`Mount`][crate::Mount]
22    /// objects – for example it is also used in [`DriveExt::start()`][crate::prelude::DriveExt::start()] and
23    /// [`DriveExt::stop()`][crate::prelude::DriveExt::stop()].
24    ///
25    /// Users should instantiate a subclass of this that implements all the
26    /// various callbacks to show the required dialogs, such as
27    /// [`GtkMountOperation`](https://docs.gtk.org/gtk4/class.MountOperation.html).
28    /// If no user interaction is desired (for example when automounting
29    /// filesystems at login time), usually `NULL` can be passed, see each method
30    /// taking a `GMountOperation` for details.
31    ///
32    /// Throughout the API, the term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’.
33    /// [TrueCrypt](https://en.wikipedia.org/wiki/TrueCrypt) is a discontinued system for
34    /// encrypting file containers, partitions or whole disks, typically used with Windows.
35    /// [VeraCrypt](https://www.veracrypt.fr/) is a maintained fork of TrueCrypt with various
36    /// improvements and auditing fixes.
37    ///
38    /// ## Properties
39    ///
40    ///
41    /// #### `anonymous`
42    ///  Whether to use an anonymous user when authenticating.
43    ///
44    /// Readable | Writeable
45    ///
46    ///
47    /// #### `choice`
48    ///  The index of the user's choice when a question is asked during the
49    /// mount operation. See the #GMountOperation::ask-question signal.
50    ///
51    /// Readable | Writeable
52    ///
53    ///
54    /// #### `domain`
55    ///  The domain to use for the mount operation.
56    ///
57    /// Readable | Writeable
58    ///
59    ///
60    /// #### `is-tcrypt-hidden-volume`
61    ///  Whether the device to be unlocked is a TCRYPT hidden volume.
62    /// See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`).
63    ///
64    /// Readable | Writeable
65    ///
66    ///
67    /// #### `is-tcrypt-system-volume`
68    ///  Whether the device to be unlocked is a TCRYPT system volume.
69    /// In this context, a system volume is a volume with a bootloader
70    /// and operating system installed. This is only supported for Windows
71    /// operating systems. For further documentation, see
72    /// [the VeraCrypt documentation](https://www.veracrypt.fr/en/System`20Encryption`).
73    ///
74    /// Readable | Writeable
75    ///
76    ///
77    /// #### `password`
78    ///  The password that is used for authentication when carrying out
79    /// the mount operation.
80    ///
81    /// Readable | Writeable
82    ///
83    ///
84    /// #### `password-save`
85    ///  Determines if and how the password information should be saved.
86    ///
87    /// Readable | Writeable
88    ///
89    ///
90    /// #### `pim`
91    ///  The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See
92    /// [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``20`(PIM).html).
93    ///
94    /// Readable | Writeable
95    ///
96    ///
97    /// #### `username`
98    ///  The user name that is used for authentication when carrying out
99    /// the mount operation.
100    ///
101    /// Readable | Writeable
102    ///
103    /// ## Signals
104    ///
105    ///
106    /// #### `aborted`
107    ///  Emitted by the backend when e.g. a device becomes unavailable
108    /// while a mount operation is in progress.
109    ///
110    /// Implementations of GMountOperation should handle this signal
111    /// by dismissing open password dialogs.
112    ///
113    ///
114    ///
115    ///
116    /// #### `ask-password`
117    ///  Emitted when a mount operation asks the user for a password.
118    ///
119    /// If the message contains a line break, the first line should be
120    /// presented as a heading. For example, it may be used as the
121    /// primary text in a #GtkMessageDialog.
122    ///
123    ///
124    ///
125    ///
126    /// #### `ask-question`
127    ///  Emitted when asking the user a question and gives a list of
128    /// choices for the user to choose from.
129    ///
130    /// If the message contains a line break, the first line should be
131    /// presented as a heading. For example, it may be used as the
132    /// primary text in a #GtkMessageDialog.
133    ///
134    ///
135    ///
136    ///
137    /// #### `reply`
138    ///  Emitted when the user has replied to the mount operation.
139    ///
140    ///
141    ///
142    ///
143    /// #### `show-processes`
144    ///  Emitted when one or more processes are blocking an operation
145    /// e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
146    ///
147    /// Note that this signal may be emitted several times to update the
148    /// list of blocking processes as processes close files. The
149    /// application should only respond with g_mount_operation_reply() to
150    /// the latest signal (setting #GMountOperation:choice to the choice
151    /// the user made).
152    ///
153    /// If the message contains a line break, the first line should be
154    /// presented as a heading. For example, it may be used as the
155    /// primary text in a #GtkMessageDialog.
156    ///
157    ///
158    ///
159    ///
160    /// #### `show-unmount-progress`
161    ///  Emitted when an unmount operation has been busy for more than some time
162    /// (typically 1.5 seconds).
163    ///
164    /// When unmounting or ejecting a volume, the kernel might need to flush
165    /// pending data in its buffers to the volume stable storage, and this operation
166    /// can take a considerable amount of time. This signal may be emitted several
167    /// times as long as the unmount operation is outstanding, and then one
168    /// last time when the operation is completed, with @bytes_left set to zero.
169    ///
170    /// Implementations of GMountOperation should handle this signal by
171    /// showing an UI notification, and then dismiss it, or show another notification
172    /// of completion, when @bytes_left reaches zero.
173    ///
174    /// If the message contains a line break, the first line should be
175    /// presented as a heading. For example, it may be used as the
176    /// primary text in a #GtkMessageDialog.
177    ///
178    ///
179    ///
180    /// # Implements
181    ///
182    /// [`MountOperationExt`][trait@crate::prelude::MountOperationExt], [`trait@glib::ObjectExt`]
183    #[doc(alias = "GMountOperation")]
184    pub struct MountOperation(Object<ffi::GMountOperation, ffi::GMountOperationClass>);
185
186    match fn {
187        type_ => || ffi::g_mount_operation_get_type(),
188    }
189}
190
191impl MountOperation {
192    pub const NONE: Option<&'static MountOperation> = None;
193
194    /// Creates a new mount operation.
195    ///
196    /// # Returns
197    ///
198    /// a #GMountOperation.
199    #[doc(alias = "g_mount_operation_new")]
200    pub fn new() -> MountOperation {
201        unsafe { from_glib_full(ffi::g_mount_operation_new()) }
202    }
203}
204
205impl Default for MountOperation {
206    fn default() -> Self {
207        Self::new()
208    }
209}
210
211/// Trait containing all [`struct@MountOperation`] methods.
212///
213/// # Implementors
214///
215/// [`MountOperation`][struct@crate::MountOperation]
216pub trait MountOperationExt: IsA<MountOperation> + 'static {
217    /// Check to see whether the mount operation is being used
218    /// for an anonymous user.
219    ///
220    /// # Returns
221    ///
222    /// [`true`] if mount operation is anonymous.
223    #[doc(alias = "g_mount_operation_get_anonymous")]
224    #[doc(alias = "get_anonymous")]
225    #[doc(alias = "anonymous")]
226    fn is_anonymous(&self) -> bool {
227        unsafe {
228            from_glib(ffi::g_mount_operation_get_anonymous(
229                self.as_ref().to_glib_none().0,
230            ))
231        }
232    }
233
234    /// Gets a choice from the mount operation.
235    ///
236    /// # Returns
237    ///
238    /// an integer containing an index of the user's choice from
239    /// the choice's list, or `0`.
240    #[doc(alias = "g_mount_operation_get_choice")]
241    #[doc(alias = "get_choice")]
242    fn choice(&self) -> i32 {
243        unsafe { ffi::g_mount_operation_get_choice(self.as_ref().to_glib_none().0) }
244    }
245
246    /// Gets the domain of the mount operation.
247    ///
248    /// # Returns
249    ///
250    /// a string set to the domain.
251    #[doc(alias = "g_mount_operation_get_domain")]
252    #[doc(alias = "get_domain")]
253    fn domain(&self) -> Option<glib::GString> {
254        unsafe {
255            from_glib_none(ffi::g_mount_operation_get_domain(
256                self.as_ref().to_glib_none().0,
257            ))
258        }
259    }
260
261    /// Check to see whether the mount operation is being used
262    /// for a TCRYPT hidden volume.
263    ///
264    /// # Returns
265    ///
266    /// [`true`] if mount operation is for hidden volume.
267    #[cfg(feature = "v2_58")]
268    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
269    #[doc(alias = "g_mount_operation_get_is_tcrypt_hidden_volume")]
270    #[doc(alias = "get_is_tcrypt_hidden_volume")]
271    #[doc(alias = "is-tcrypt-hidden-volume")]
272    fn is_tcrypt_hidden_volume(&self) -> bool {
273        unsafe {
274            from_glib(ffi::g_mount_operation_get_is_tcrypt_hidden_volume(
275                self.as_ref().to_glib_none().0,
276            ))
277        }
278    }
279
280    /// Check to see whether the mount operation is being used
281    /// for a TCRYPT system volume.
282    ///
283    /// # Returns
284    ///
285    /// [`true`] if mount operation is for system volume.
286    #[cfg(feature = "v2_58")]
287    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
288    #[doc(alias = "g_mount_operation_get_is_tcrypt_system_volume")]
289    #[doc(alias = "get_is_tcrypt_system_volume")]
290    #[doc(alias = "is-tcrypt-system-volume")]
291    fn is_tcrypt_system_volume(&self) -> bool {
292        unsafe {
293            from_glib(ffi::g_mount_operation_get_is_tcrypt_system_volume(
294                self.as_ref().to_glib_none().0,
295            ))
296        }
297    }
298
299    /// Gets a password from the mount operation.
300    ///
301    /// # Returns
302    ///
303    /// a string containing the password within @self.
304    #[doc(alias = "g_mount_operation_get_password")]
305    #[doc(alias = "get_password")]
306    fn password(&self) -> Option<glib::GString> {
307        unsafe {
308            from_glib_none(ffi::g_mount_operation_get_password(
309                self.as_ref().to_glib_none().0,
310            ))
311        }
312    }
313
314    /// Gets the state of saving passwords for the mount operation.
315    ///
316    /// # Returns
317    ///
318    /// a #GPasswordSave flag.
319    #[doc(alias = "g_mount_operation_get_password_save")]
320    #[doc(alias = "get_password_save")]
321    #[doc(alias = "password-save")]
322    fn password_save(&self) -> PasswordSave {
323        unsafe {
324            from_glib(ffi::g_mount_operation_get_password_save(
325                self.as_ref().to_glib_none().0,
326            ))
327        }
328    }
329
330    /// Gets a PIM from the mount operation.
331    ///
332    /// # Returns
333    ///
334    /// The VeraCrypt PIM within @self.
335    #[cfg(feature = "v2_58")]
336    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
337    #[doc(alias = "g_mount_operation_get_pim")]
338    #[doc(alias = "get_pim")]
339    fn pim(&self) -> u32 {
340        unsafe { ffi::g_mount_operation_get_pim(self.as_ref().to_glib_none().0) }
341    }
342
343    /// Get the user name from the mount operation.
344    ///
345    /// # Returns
346    ///
347    /// a string containing the user name.
348    #[doc(alias = "g_mount_operation_get_username")]
349    #[doc(alias = "get_username")]
350    fn username(&self) -> Option<glib::GString> {
351        unsafe {
352            from_glib_none(ffi::g_mount_operation_get_username(
353                self.as_ref().to_glib_none().0,
354            ))
355        }
356    }
357
358    /// Emits the #GMountOperation::reply signal.
359    /// ## `result`
360    /// a #GMountOperationResult
361    #[doc(alias = "g_mount_operation_reply")]
362    fn reply(&self, result: MountOperationResult) {
363        unsafe {
364            ffi::g_mount_operation_reply(self.as_ref().to_glib_none().0, result.into_glib());
365        }
366    }
367
368    /// Sets the mount operation to use an anonymous user if @anonymous is [`true`].
369    /// ## `anonymous`
370    /// boolean value.
371    #[doc(alias = "g_mount_operation_set_anonymous")]
372    #[doc(alias = "anonymous")]
373    fn set_anonymous(&self, anonymous: bool) {
374        unsafe {
375            ffi::g_mount_operation_set_anonymous(
376                self.as_ref().to_glib_none().0,
377                anonymous.into_glib(),
378            );
379        }
380    }
381
382    /// Sets a default choice for the mount operation.
383    /// ## `choice`
384    /// an integer.
385    #[doc(alias = "g_mount_operation_set_choice")]
386    #[doc(alias = "choice")]
387    fn set_choice(&self, choice: i32) {
388        unsafe {
389            ffi::g_mount_operation_set_choice(self.as_ref().to_glib_none().0, choice);
390        }
391    }
392
393    /// Sets the mount operation's domain.
394    /// ## `domain`
395    /// the domain to set.
396    #[doc(alias = "g_mount_operation_set_domain")]
397    #[doc(alias = "domain")]
398    fn set_domain(&self, domain: Option<&str>) {
399        unsafe {
400            ffi::g_mount_operation_set_domain(
401                self.as_ref().to_glib_none().0,
402                domain.to_glib_none().0,
403            );
404        }
405    }
406
407    /// Sets the mount operation to use a hidden volume if @hidden_volume is [`true`].
408    /// ## `hidden_volume`
409    /// boolean value.
410    #[cfg(feature = "v2_58")]
411    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
412    #[doc(alias = "g_mount_operation_set_is_tcrypt_hidden_volume")]
413    #[doc(alias = "is-tcrypt-hidden-volume")]
414    fn set_is_tcrypt_hidden_volume(&self, hidden_volume: bool) {
415        unsafe {
416            ffi::g_mount_operation_set_is_tcrypt_hidden_volume(
417                self.as_ref().to_glib_none().0,
418                hidden_volume.into_glib(),
419            );
420        }
421    }
422
423    /// Sets the mount operation to use a system volume if @system_volume is [`true`].
424    /// ## `system_volume`
425    /// boolean value.
426    #[cfg(feature = "v2_58")]
427    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
428    #[doc(alias = "g_mount_operation_set_is_tcrypt_system_volume")]
429    #[doc(alias = "is-tcrypt-system-volume")]
430    fn set_is_tcrypt_system_volume(&self, system_volume: bool) {
431        unsafe {
432            ffi::g_mount_operation_set_is_tcrypt_system_volume(
433                self.as_ref().to_glib_none().0,
434                system_volume.into_glib(),
435            );
436        }
437    }
438
439    /// Sets the mount operation's password to @password.
440    /// ## `password`
441    /// password to set.
442    #[doc(alias = "g_mount_operation_set_password")]
443    #[doc(alias = "password")]
444    fn set_password(&self, password: Option<&str>) {
445        unsafe {
446            ffi::g_mount_operation_set_password(
447                self.as_ref().to_glib_none().0,
448                password.to_glib_none().0,
449            );
450        }
451    }
452
453    /// Sets the state of saving passwords for the mount operation.
454    /// ## `save`
455    /// a set of #GPasswordSave flags.
456    #[doc(alias = "g_mount_operation_set_password_save")]
457    #[doc(alias = "password-save")]
458    fn set_password_save(&self, save: PasswordSave) {
459        unsafe {
460            ffi::g_mount_operation_set_password_save(
461                self.as_ref().to_glib_none().0,
462                save.into_glib(),
463            );
464        }
465    }
466
467    /// Sets the mount operation's PIM to @pim.
468    /// ## `pim`
469    /// an unsigned integer.
470    #[cfg(feature = "v2_58")]
471    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
472    #[doc(alias = "g_mount_operation_set_pim")]
473    #[doc(alias = "pim")]
474    fn set_pim(&self, pim: u32) {
475        unsafe {
476            ffi::g_mount_operation_set_pim(self.as_ref().to_glib_none().0, pim);
477        }
478    }
479
480    /// Sets the user name within @self to @username.
481    /// ## `username`
482    /// input username.
483    #[doc(alias = "g_mount_operation_set_username")]
484    #[doc(alias = "username")]
485    fn set_username(&self, username: Option<&str>) {
486        unsafe {
487            ffi::g_mount_operation_set_username(
488                self.as_ref().to_glib_none().0,
489                username.to_glib_none().0,
490            );
491        }
492    }
493
494    /// Emitted by the backend when e.g. a device becomes unavailable
495    /// while a mount operation is in progress.
496    ///
497    /// Implementations of GMountOperation should handle this signal
498    /// by dismissing open password dialogs.
499    #[doc(alias = "aborted")]
500    fn connect_aborted<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
501        unsafe extern "C" fn aborted_trampoline<P: IsA<MountOperation>, F: Fn(&P) + 'static>(
502            this: *mut ffi::GMountOperation,
503            f: glib::ffi::gpointer,
504        ) {
505            unsafe {
506                let f: &F = &*(f as *const F);
507                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
508            }
509        }
510        unsafe {
511            let f: Box_<F> = Box_::new(f);
512            connect_raw(
513                self.as_ptr() as *mut _,
514                c"aborted".as_ptr() as *const _,
515                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
516                    aborted_trampoline::<Self, F> as *const (),
517                )),
518                Box_::into_raw(f),
519            )
520        }
521    }
522
523    /// Emitted when a mount operation asks the user for a password.
524    ///
525    /// If the message contains a line break, the first line should be
526    /// presented as a heading. For example, it may be used as the
527    /// primary text in a #GtkMessageDialog.
528    /// ## `message`
529    /// string containing a message to display to the user.
530    /// ## `default_user`
531    /// string containing the default user name.
532    /// ## `default_domain`
533    /// string containing the default domain.
534    /// ## `flags`
535    /// a set of #GAskPasswordFlags.
536    #[doc(alias = "ask-password")]
537    fn connect_ask_password<F: Fn(&Self, &str, &str, &str, AskPasswordFlags) + 'static>(
538        &self,
539        f: F,
540    ) -> SignalHandlerId {
541        unsafe extern "C" fn ask_password_trampoline<
542            P: IsA<MountOperation>,
543            F: Fn(&P, &str, &str, &str, AskPasswordFlags) + 'static,
544        >(
545            this: *mut ffi::GMountOperation,
546            message: *mut std::ffi::c_char,
547            default_user: *mut std::ffi::c_char,
548            default_domain: *mut std::ffi::c_char,
549            flags: ffi::GAskPasswordFlags,
550            f: glib::ffi::gpointer,
551        ) {
552            unsafe {
553                let f: &F = &*(f as *const F);
554                f(
555                    MountOperation::from_glib_borrow(this).unsafe_cast_ref(),
556                    &glib::GString::from_glib_borrow(message),
557                    &glib::GString::from_glib_borrow(default_user),
558                    &glib::GString::from_glib_borrow(default_domain),
559                    from_glib(flags),
560                )
561            }
562        }
563        unsafe {
564            let f: Box_<F> = Box_::new(f);
565            connect_raw(
566                self.as_ptr() as *mut _,
567                c"ask-password".as_ptr() as *const _,
568                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
569                    ask_password_trampoline::<Self, F> as *const (),
570                )),
571                Box_::into_raw(f),
572            )
573        }
574    }
575
576    //#[doc(alias = "ask-question")]
577    //fn connect_ask_question<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
578    //    Empty ctype choices: *.CArray TypeId { ns_id: 0, id: 28 }
579    //}
580
581    /// Emitted when the user has replied to the mount operation.
582    /// ## `result`
583    /// a #GMountOperationResult indicating how the request was handled
584    #[doc(alias = "reply")]
585    fn connect_reply<F: Fn(&Self, MountOperationResult) + 'static>(&self, f: F) -> SignalHandlerId {
586        unsafe extern "C" fn reply_trampoline<
587            P: IsA<MountOperation>,
588            F: Fn(&P, MountOperationResult) + 'static,
589        >(
590            this: *mut ffi::GMountOperation,
591            result: ffi::GMountOperationResult,
592            f: glib::ffi::gpointer,
593        ) {
594            unsafe {
595                let f: &F = &*(f as *const F);
596                f(
597                    MountOperation::from_glib_borrow(this).unsafe_cast_ref(),
598                    from_glib(result),
599                )
600            }
601        }
602        unsafe {
603            let f: Box_<F> = Box_::new(f);
604            connect_raw(
605                self.as_ptr() as *mut _,
606                c"reply".as_ptr() as *const _,
607                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
608                    reply_trampoline::<Self, F> as *const (),
609                )),
610                Box_::into_raw(f),
611            )
612        }
613    }
614
615    //#[doc(alias = "show-processes")]
616    //fn connect_show_processes<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
617    //    Empty ctype processes: *.Array TypeId { ns_id: 2, id: 4 }
618    //    Empty ctype choices: *.CArray TypeId { ns_id: 0, id: 28 }
619    //}
620
621    /// Emitted when an unmount operation has been busy for more than some time
622    /// (typically 1.5 seconds).
623    ///
624    /// When unmounting or ejecting a volume, the kernel might need to flush
625    /// pending data in its buffers to the volume stable storage, and this operation
626    /// can take a considerable amount of time. This signal may be emitted several
627    /// times as long as the unmount operation is outstanding, and then one
628    /// last time when the operation is completed, with @bytes_left set to zero.
629    ///
630    /// Implementations of GMountOperation should handle this signal by
631    /// showing an UI notification, and then dismiss it, or show another notification
632    /// of completion, when @bytes_left reaches zero.
633    ///
634    /// If the message contains a line break, the first line should be
635    /// presented as a heading. For example, it may be used as the
636    /// primary text in a #GtkMessageDialog.
637    /// ## `message`
638    /// string containing a message to display to the user
639    /// ## `time_left`
640    /// the estimated time left before the operation completes,
641    ///     in microseconds, or -1
642    /// ## `bytes_left`
643    /// the amount of bytes to be written before the operation
644    ///     completes (or -1 if such amount is not known), or zero if the operation
645    ///     is completed
646    #[doc(alias = "show-unmount-progress")]
647    fn connect_show_unmount_progress<F: Fn(&Self, &str, i64, i64) + 'static>(
648        &self,
649        f: F,
650    ) -> SignalHandlerId {
651        unsafe extern "C" fn show_unmount_progress_trampoline<
652            P: IsA<MountOperation>,
653            F: Fn(&P, &str, i64, i64) + 'static,
654        >(
655            this: *mut ffi::GMountOperation,
656            message: *mut std::ffi::c_char,
657            time_left: i64,
658            bytes_left: i64,
659            f: glib::ffi::gpointer,
660        ) {
661            unsafe {
662                let f: &F = &*(f as *const F);
663                f(
664                    MountOperation::from_glib_borrow(this).unsafe_cast_ref(),
665                    &glib::GString::from_glib_borrow(message),
666                    time_left,
667                    bytes_left,
668                )
669            }
670        }
671        unsafe {
672            let f: Box_<F> = Box_::new(f);
673            connect_raw(
674                self.as_ptr() as *mut _,
675                c"show-unmount-progress".as_ptr() as *const _,
676                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
677                    show_unmount_progress_trampoline::<Self, F> as *const (),
678                )),
679                Box_::into_raw(f),
680            )
681        }
682    }
683
684    #[doc(alias = "anonymous")]
685    fn connect_anonymous_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
686        unsafe extern "C" fn notify_anonymous_trampoline<
687            P: IsA<MountOperation>,
688            F: Fn(&P) + 'static,
689        >(
690            this: *mut ffi::GMountOperation,
691            _param_spec: glib::ffi::gpointer,
692            f: glib::ffi::gpointer,
693        ) {
694            unsafe {
695                let f: &F = &*(f as *const F);
696                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
697            }
698        }
699        unsafe {
700            let f: Box_<F> = Box_::new(f);
701            connect_raw(
702                self.as_ptr() as *mut _,
703                c"notify::anonymous".as_ptr() as *const _,
704                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
705                    notify_anonymous_trampoline::<Self, F> as *const (),
706                )),
707                Box_::into_raw(f),
708            )
709        }
710    }
711
712    #[doc(alias = "choice")]
713    fn connect_choice_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
714        unsafe extern "C" fn notify_choice_trampoline<
715            P: IsA<MountOperation>,
716            F: Fn(&P) + 'static,
717        >(
718            this: *mut ffi::GMountOperation,
719            _param_spec: glib::ffi::gpointer,
720            f: glib::ffi::gpointer,
721        ) {
722            unsafe {
723                let f: &F = &*(f as *const F);
724                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
725            }
726        }
727        unsafe {
728            let f: Box_<F> = Box_::new(f);
729            connect_raw(
730                self.as_ptr() as *mut _,
731                c"notify::choice".as_ptr() as *const _,
732                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
733                    notify_choice_trampoline::<Self, F> as *const (),
734                )),
735                Box_::into_raw(f),
736            )
737        }
738    }
739
740    #[doc(alias = "domain")]
741    fn connect_domain_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
742        unsafe extern "C" fn notify_domain_trampoline<
743            P: IsA<MountOperation>,
744            F: Fn(&P) + 'static,
745        >(
746            this: *mut ffi::GMountOperation,
747            _param_spec: glib::ffi::gpointer,
748            f: glib::ffi::gpointer,
749        ) {
750            unsafe {
751                let f: &F = &*(f as *const F);
752                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
753            }
754        }
755        unsafe {
756            let f: Box_<F> = Box_::new(f);
757            connect_raw(
758                self.as_ptr() as *mut _,
759                c"notify::domain".as_ptr() as *const _,
760                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
761                    notify_domain_trampoline::<Self, F> as *const (),
762                )),
763                Box_::into_raw(f),
764            )
765        }
766    }
767
768    #[cfg(feature = "v2_58")]
769    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
770    #[doc(alias = "is-tcrypt-hidden-volume")]
771    fn connect_is_tcrypt_hidden_volume_notify<F: Fn(&Self) + 'static>(
772        &self,
773        f: F,
774    ) -> SignalHandlerId {
775        unsafe extern "C" fn notify_is_tcrypt_hidden_volume_trampoline<
776            P: IsA<MountOperation>,
777            F: Fn(&P) + 'static,
778        >(
779            this: *mut ffi::GMountOperation,
780            _param_spec: glib::ffi::gpointer,
781            f: glib::ffi::gpointer,
782        ) {
783            unsafe {
784                let f: &F = &*(f as *const F);
785                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
786            }
787        }
788        unsafe {
789            let f: Box_<F> = Box_::new(f);
790            connect_raw(
791                self.as_ptr() as *mut _,
792                c"notify::is-tcrypt-hidden-volume".as_ptr() as *const _,
793                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
794                    notify_is_tcrypt_hidden_volume_trampoline::<Self, F> as *const (),
795                )),
796                Box_::into_raw(f),
797            )
798        }
799    }
800
801    #[cfg(feature = "v2_58")]
802    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
803    #[doc(alias = "is-tcrypt-system-volume")]
804    fn connect_is_tcrypt_system_volume_notify<F: Fn(&Self) + 'static>(
805        &self,
806        f: F,
807    ) -> SignalHandlerId {
808        unsafe extern "C" fn notify_is_tcrypt_system_volume_trampoline<
809            P: IsA<MountOperation>,
810            F: Fn(&P) + 'static,
811        >(
812            this: *mut ffi::GMountOperation,
813            _param_spec: glib::ffi::gpointer,
814            f: glib::ffi::gpointer,
815        ) {
816            unsafe {
817                let f: &F = &*(f as *const F);
818                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
819            }
820        }
821        unsafe {
822            let f: Box_<F> = Box_::new(f);
823            connect_raw(
824                self.as_ptr() as *mut _,
825                c"notify::is-tcrypt-system-volume".as_ptr() as *const _,
826                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
827                    notify_is_tcrypt_system_volume_trampoline::<Self, F> as *const (),
828                )),
829                Box_::into_raw(f),
830            )
831        }
832    }
833
834    #[doc(alias = "password")]
835    fn connect_password_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
836        unsafe extern "C" fn notify_password_trampoline<
837            P: IsA<MountOperation>,
838            F: Fn(&P) + 'static,
839        >(
840            this: *mut ffi::GMountOperation,
841            _param_spec: glib::ffi::gpointer,
842            f: glib::ffi::gpointer,
843        ) {
844            unsafe {
845                let f: &F = &*(f as *const F);
846                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
847            }
848        }
849        unsafe {
850            let f: Box_<F> = Box_::new(f);
851            connect_raw(
852                self.as_ptr() as *mut _,
853                c"notify::password".as_ptr() as *const _,
854                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
855                    notify_password_trampoline::<Self, F> as *const (),
856                )),
857                Box_::into_raw(f),
858            )
859        }
860    }
861
862    #[doc(alias = "password-save")]
863    fn connect_password_save_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
864        unsafe extern "C" fn notify_password_save_trampoline<
865            P: IsA<MountOperation>,
866            F: Fn(&P) + 'static,
867        >(
868            this: *mut ffi::GMountOperation,
869            _param_spec: glib::ffi::gpointer,
870            f: glib::ffi::gpointer,
871        ) {
872            unsafe {
873                let f: &F = &*(f as *const F);
874                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
875            }
876        }
877        unsafe {
878            let f: Box_<F> = Box_::new(f);
879            connect_raw(
880                self.as_ptr() as *mut _,
881                c"notify::password-save".as_ptr() as *const _,
882                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
883                    notify_password_save_trampoline::<Self, F> as *const (),
884                )),
885                Box_::into_raw(f),
886            )
887        }
888    }
889
890    #[cfg(feature = "v2_58")]
891    #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))]
892    #[doc(alias = "pim")]
893    fn connect_pim_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
894        unsafe extern "C" fn notify_pim_trampoline<P: IsA<MountOperation>, F: Fn(&P) + 'static>(
895            this: *mut ffi::GMountOperation,
896            _param_spec: glib::ffi::gpointer,
897            f: glib::ffi::gpointer,
898        ) {
899            unsafe {
900                let f: &F = &*(f as *const F);
901                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
902            }
903        }
904        unsafe {
905            let f: Box_<F> = Box_::new(f);
906            connect_raw(
907                self.as_ptr() as *mut _,
908                c"notify::pim".as_ptr() as *const _,
909                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
910                    notify_pim_trampoline::<Self, F> as *const (),
911                )),
912                Box_::into_raw(f),
913            )
914        }
915    }
916
917    #[doc(alias = "username")]
918    fn connect_username_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
919        unsafe extern "C" fn notify_username_trampoline<
920            P: IsA<MountOperation>,
921            F: Fn(&P) + 'static,
922        >(
923            this: *mut ffi::GMountOperation,
924            _param_spec: glib::ffi::gpointer,
925            f: glib::ffi::gpointer,
926        ) {
927            unsafe {
928                let f: &F = &*(f as *const F);
929                f(MountOperation::from_glib_borrow(this).unsafe_cast_ref())
930            }
931        }
932        unsafe {
933            let f: Box_<F> = Box_::new(f);
934            connect_raw(
935                self.as_ptr() as *mut _,
936                c"notify::username".as_ptr() as *const _,
937                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
938                    notify_username_trampoline::<Self, F> as *const (),
939                )),
940                Box_::into_raw(f),
941            )
942        }
943    }
944}
945
946impl<O: IsA<MountOperation>> MountOperationExt for O {}