Skip to main content

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