gio.mount_operation

Module for [MountOperation] class

Types 3

gio.mount_operation.MountOperation 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 gio.mount_operation.MountOperation is used for more than just gio.mount.Mount objects – for example it is also used in gio.drive.Drive.start and gio.drive.Drive.stop.

Users should instantiate a subclass of this that implements all the various callbacks to show the required dialogs, such as [[gtk.mount_operation.MountOperation]](https://docs.gtk.org/gtk4/class.MountOperation.html). If no user interaction is desired (for example when automounting filesystems at login time), usually NULL can be passed, see each method taking a gio.mount_operation.MountOperation 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.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
MountOperation self() nothrowReturns `this`, for use in `with` statements.
MountOperationGidBuilder builder() static nothrowGet builder for [gio.mount_operation.MountOperation] Returns: New builder object
bool anonymous() @property nothrowGet `anonymous` property. Returns: Whether to use an anonymous user when authenticating.
void anonymous(bool propval) @property nothrowSet `anonymous` property. Params: propval = Whether to use an anonymous user when authenticating.
int choice() @property nothrowGet `choice` property. Returns: The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal.
void choice(int propval) @property nothrowSet `choice` property. Params: propval = The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal.
string domain() @property nothrowGet `domain` property. Returns: The domain to use for the mount operation.
void domain(string propval) @property nothrowSet `domain` property. Params: propval = The domain to use for the mount operation.
bool isTcryptHiddenVolume() @property nothrowGet `isTcryptHiddenVolume` property. Returns: Whether the device to be unlocked is a TCRYPT hidden volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`.html).
void isTcryptHiddenVolume(bool propval) @property nothrowSet `isTcryptHiddenVolume` property. Params: propval = Whether the device to be unlocked is a TCRYPT hidden volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`.ht...
bool isTcryptSystemVolume() @property nothrowGet `isTcryptSystemVolume` property. Returns: 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 instal...
void isTcryptSystemVolume(bool propval) @property nothrowSet `isTcryptSystemVolume` property. Params: propval = 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 syst...
string password() @property nothrowGet `password` property. Returns: The password that is used for authentication when carrying out the mount operation.
void password(string propval) @property nothrowSet `password` property. Params: propval = The password that is used for authentication when carrying out the mount operation.
gio.types.PasswordSave passwordSave() @property nothrowGet `passwordSave` property. Returns: Determines if and how the password information should be saved.
void passwordSave(gio.types.PasswordSave propval) @property nothrowSet `passwordSave` property. Params: propval = Determines if and how the password information should be saved.
uint pim() @property nothrowGet `pim` property. Returns: The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``20`(PIM)....
void pim(uint propval) @property nothrowSet `pim` property. Params: propval = The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``...
string username() @property nothrowGet `username` property. Returns: The user name that is used for authentication when carrying out the mount operation.
void username(string propval) @property nothrowSet `username` property. Params: propval = The user name that is used for authentication when carrying out the mount operation.
bool getAnonymous() nothrowCheck to see whether the mount operation is being used for an anonymous user. Returns: true if mount operation is anonymous.
int getChoice() nothrowGets a choice from the mount operation. Returns: an integer containing an index of the user's choice from the choice's list, or `0`.
string getDomain() nothrowGets the domain of the mount operation. Returns: a string set to the domain.
bool getIsTcryptHiddenVolume() nothrowCheck to see whether the mount operation is being used for a TCRYPT hidden volume. Returns: true if mount operation is for hidden volume.
bool getIsTcryptSystemVolume() nothrowCheck to see whether the mount operation is being used for a TCRYPT system volume. Returns: true if mount operation is for system volume.
string getPassword() nothrowGets a password from the mount operation. Returns: a string containing the password within op.
gio.types.PasswordSave getPasswordSave() nothrowGets the state of saving passwords for the mount operation. Returns: a #GPasswordSave flag.
uint getPim() nothrowGets a PIM from the mount operation. Returns: The VeraCrypt PIM within op.
string getUsername() nothrowGet the user name from the mount operation. Returns: a string containing the user name.
void reply(gio.types.MountOperationResult result) nothrowEmits the #GMountOperation::reply signal.
void setAnonymous(bool anonymous) nothrowSets the mount operation to use an anonymous user if anonymous is true.
void setChoice(int choice) nothrowSets a default choice for the mount operation.
void setDomain(string domain = null) nothrowSets the mount operation's domain.
void setIsTcryptHiddenVolume(bool hiddenVolume) nothrowSets the mount operation to use a hidden volume if hidden_volume is true.
void setIsTcryptSystemVolume(bool systemVolume) nothrowSets the mount operation to use a system volume if system_volume is true.
void setPassword(string password = null) nothrowSets the mount operation's password to password.
void setPasswordSave(gio.types.PasswordSave save) nothrowSets the state of saving passwords for the mount operation.
void setPim(uint pim) nothrowSets the mount operation's PIM to pim.
void setUsername(string username = null) nothrowSets the user name within op to username.
gulong connectAborted(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gio.mount_operation.MountOperation))) && Parameters!T.length < 2) nothrowConnect to `Aborted` signal.
gulong connectAskPassword(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == string))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == string))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] == gio.types.AskPasswordFlags))) && (Parameters!T.length < 5 || (ParameterStorageClassTuple!T[4] == ParameterStorageClass.none && is(Parameters!T[4] : gio.mount_operation.MountOperation))) && Parameters!T.length < 6) nothrowConnect to `AskPassword` signal.
gulong connectAskQuestion(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == string[]))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gio.mount_operation.MountOperation))) && Parameters!T.length < 4) nothrowConnect to `AskQuestion` signal.
gulong connectReply(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gio.types.MountOperationResult))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.mount_operation.MountOperation))) && Parameters!T.length < 3) nothrowConnect to `Reply` signal.
gulong connectShowProcesses(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == glib.types.Pid[]))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == string[]))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gio.mount_operation.MountOperation))) && Parameters!T.length < 5) nothrowConnect to `ShowProcesses` signal.
gulong connectShowUnmountProgress(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == long))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == long))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gio.mount_operation.MountOperation))) && Parameters!T.length < 5) nothrowConnect to `ShowUnmountProgress` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new mount operation. Returns: a #GMountOperation.

Fluent builder implementation template for gio.mount_operation.MountOperation

Methods
T anonymous(bool propval) nothrowSet `anonymous` property. Params: propval = Whether to use an anonymous user when authenticating. Returns: Builder instance for fluent chaining
T choice(int propval) nothrowSet `choice` property. Params: propval = The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal. Returns: Builder instance...
T domain(string propval) nothrowSet `domain` property. Params: propval = The domain to use for the mount operation. Returns: Builder instance for fluent chaining
T isTcryptHiddenVolume(bool propval) nothrowSet `isTcryptHiddenVolume` property. Params: propval = Whether the device to be unlocked is a TCRYPT hidden volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Hidden`20Volume`.ht...
T isTcryptSystemVolume(bool propval) nothrowSet `isTcryptSystemVolume` property. Params: propval = 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 syst...
T password(string propval) nothrowSet `password` property. Params: propval = The password that is used for authentication when carrying out the mount operation. Returns: Builder instance for fluent chaining
T passwordSave(gio.types.PasswordSave propval) nothrowSet `passwordSave` property. Params: propval = Determines if and how the password information should be saved. Returns: Builder instance for fluent chaining
T pim(uint propval) nothrowSet `pim` property. Params: propval = The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See [the VeraCrypt documentation](https://www.veracrypt.fr/en/Personal`20Iterations``20Multiplier``...
T username(string propval) nothrowSet `username` property. Params: propval = The user name that is used for authentication when carrying out the mount operation. Returns: Builder instance for fluent chaining
Methods
MountOperation build() nothrowCreate object from builder. Returns: New object