Gio.MountOperation
Description: Reference for Gio.MountOperation

### Class

# GioMountOperation

#### Description [src]

    class Gio.MountOperation : GObject.Object
    {
      GMountOperationPrivate* priv
    }

`GMountOperation` provides a mechanism for interacting with the user. It can be used for authenticating mountable operations, such as loop mounting files, hard drive partitions or server locations. It can also be used to ask the user questions or show a list of applications preventing unmount or eject operations from completing.

Note that `GMountOperation` is used for more than just `GMount` objects – for example it is also used in `g_drive_start()` and `g_drive_stop()`.

Users should instantiate a subclass of this that implements all the various callbacks to show the required dialogs, such as `GtkMountOperation`. If no user interaction is desired (for example when automounting filesystems at login time), usually `NULL` can be passed, see each method taking a `GMountOperation` for details.

Throughout the API, the term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’. TrueCrypt is a discontinued system for encrypting file containers, partitions or whole disks, typically used with Windows. VeraCrypt is a maintained fork of TrueCrypt with various improvements and auditing fixes.

#### Ancestors

- GObject

#### Constructors

###### g_mount_operation_new

Creates a new mount operation.

#### Instance methods

###### g_mount_operation_get_anonymous

Check to see whether the mount operation is being used for an anonymous user.

###### g_mount_operation_get_choice

Gets a choice from the mount operation.

###### g_mount_operation_get_domain

Gets the domain of the mount operation.

###### g_mount_operation_get_is_tcrypt_hidden_volume

Check to see whether the mount operation is being used for a TCRYPT hidden volume.

since: 2.58

###### g_mount_operation_get_is_tcrypt_system_volume

Check to see whether the mount operation is being used for a TCRYPT system volume.

since: 2.58

###### g_mount_operation_get_password

Gets a password from the mount operation.

###### g_mount_operation_get_password_save

Gets the state of saving passwords for the mount operation.

###### g_mount_operation_get_pim

Gets a PIM from the mount operation.

since: 2.58

###### g_mount_operation_get_username

Get the user name from the mount operation.

###### g_mount_operation_reply

Emits the `GMountOperation::reply` signal.

###### g_mount_operation_set_anonymous

Sets the mount operation to use an anonymous user if `anonymous` is `TRUE`.

###### g_mount_operation_set_choice

Sets a default choice for the mount operation.

###### g_mount_operation_set_domain

Sets the mount operation’s domain.

###### g_mount_operation_set_is_tcrypt_hidden_volume

Sets the mount operation to use a hidden volume if `hidden_volume` is `TRUE`.

since: 2.58

###### g_mount_operation_set_is_tcrypt_system_volume

Sets the mount operation to use a system volume if `system_volume` is `TRUE`.

since: 2.58

###### g_mount_operation_set_password

Sets the mount operation’s password to `password`.

###### g_mount_operation_set_password_save

Sets the state of saving passwords for the mount operation.

###### g_mount_operation_set_pim

Sets the mount operation’s PIM to `pim`.

since: 2.58

###### g_mount_operation_set_username

Sets the user name within `op` to `username`.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gio.MountOperation:anonymous

Whether to use an anonymous user when authenticating.

###### Gio.MountOperation:choice

The index of the user’s choice when a question is asked during the mount operation. See the `GMountOperation::ask-question` signal.

###### Gio.MountOperation:domain

The domain to use for the mount operation.

###### Gio.MountOperation:is-tcrypt-hidden-volume

Whether the device to be unlocked is a TCRYPT hidden volume. See the VeraCrypt documentation.

since: 2.58

###### Gio.MountOperation:is-tcrypt-system-volume

Whether the device to be unlocked is a TCRYPT system volume. In this context, a system volume is a volume with a bootloader and operating system installed. This is only supported for Windows operating systems. For further documentation, see the VeraCrypt documentation.

since: 2.58

###### Gio.MountOperation:password

The password that is used for authentication when carrying out the mount operation.

###### Gio.MountOperation:password-save

Determines if and how the password information should be saved.

###### Gio.MountOperation:pim

The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See the VeraCrypt documentation.

since: 2.58

###### Gio.MountOperation:username

The user name that is used for authentication when carrying out the mount operation.

#### Signals

###### Gio.MountOperation::aborted

Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress.

since: 2.20

###### Gio.MountOperation::ask-password

Emitted when a mount operation asks the user for a password.

###### Gio.MountOperation::ask-question

Emitted when asking the user a question and gives a list of choices for the user to choose from.

###### Gio.MountOperation::reply

Emitted when the user has replied to the mount operation.

###### Gio.MountOperation::show-processes

Emitted when one or more processes are blocking an operation e.g. unmounting/ejecting a `GMount` or stopping a `GDrive`.

since: 2.22

###### Gio.MountOperation::show-unmount-progress

Emitted when an unmount operation has been busy for more than some time (typically 1.5 seconds).

since: 2.34

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GioMountOperationClass {
      GObjectClass parent_class;
      void (* ask_password) (
        GMountOperation* op,
        const char* message,
        const char* default_user,
        const char* default_domain,
        GAskPasswordFlags flags
      );
      void (* ask_question) (
        GMountOperation* op,
        const char* message,
        const char** choices
      );
      void (* reply) (
        GMountOperation* op,
        GMountOperationResult result
      );
      void (* aborted) (
        GMountOperation* op
      );
      void (* show_processes) (
        GMountOperation* op,
        const gchar* message,
        GArray* processes,
        const gchar** choices
      );
      void (* show_unmount_progress) (
        GMountOperation* op,
        const gchar* message,
        gint64 time_left,
        gint64 bytes_left
      );
      void (* _g_reserved1) (
    void
      );
      void (* _g_reserved2) (
    void
      );
      void (* _g_reserved3) (
    void
      );
      void (* _g_reserved4) (
    void
      );
      void (* _g_reserved5) (
    void
      );
      void (* _g_reserved6) (
    void
      );
      void (* _g_reserved7) (
    void
      );
      void (* _g_reserved8) (
    void
      );
      void (* _g_reserved9) (
    void
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`ask_password: void (* ask_password) ( GMountOperation* op, const char* message, const char* default_user, const char* default_domain, GAskPasswordFlags flags )`

  No description available.

`ask_question: void (* ask_question) ( GMountOperation* op, const char* message, const char** choices )`

  No description available.

`reply: void (* reply) ( GMountOperation* op, GMountOperationResult result )`

  No description available.

`aborted: void (* aborted) ( GMountOperation* op )`

  No description available.

`show_processes: void (* show_processes) ( GMountOperation* op, const gchar* message, GArray* processes, const gchar** choices )`

  No description available.

`show_unmount_progress: void (* show_unmount_progress) ( GMountOperation* op, const gchar* message, gint64 time_left, gint64 bytes_left )`

  No description available.

`_g_reserved1: void (* _g_reserved1) ( void )`

  No description available.

`_g_reserved2: void (* _g_reserved2) ( void )`

  No description available.

`_g_reserved3: void (* _g_reserved3) ( void )`

  No description available.

`_g_reserved4: void (* _g_reserved4) ( void )`

  No description available.

`_g_reserved5: void (* _g_reserved5) ( void )`

  No description available.

`_g_reserved6: void (* _g_reserved6) ( void )`

  No description available.

`_g_reserved7: void (* _g_reserved7) ( void )`

  No description available.

`_g_reserved8: void (* _g_reserved8) ( void )`

  No description available.

`_g_reserved9: void (* _g_reserved9) ( void )`

  No description available.

#### Virtual methods

###### Gio.MountOperationClass.aborted

No description available.

###### Gio.MountOperationClass.ask_password

No description available.

###### Gio.MountOperationClass.ask_question

Virtual implementation of `GMountOperation::ask-question`.

###### Gio.MountOperationClass.reply

Emits the `GMountOperation::reply` signal.

###### Gio.MountOperationClass.show_processes

Virtual implementation of `GMountOperation::show-processes`.

since: 2.22

###### Gio.MountOperationClass.show_unmount_progress

No description available.