Class MountOperation

All Implemented Interfaces:
PointerInterface
Direct Known Subclasses:
MountOperation

public class MountOperation extends Object
#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.

The term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’.
[TrueCrypt](https://en.wikipedia.org/wiki/TrueCrypt) is a discontinued system for
encrypting file containers, partitions or whole disks, typically used with Windows.
[VeraCrypt](https://www.veracrypt.fr/) is a maintained fork of TrueCrypt with various
improvements and auditing fixes.

https://docs.gtk.org/gio/class.MountOperation.html

  • Field Details

  • Constructor Details

    • MountOperation

      public MountOperation(PointerContainer pointer)
    • MountOperation

      public MountOperation()
      Creates a new mount operation.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAnonymous

      public boolean getAnonymous()
      Check to see whether the mount operation is being used
      for an anonymous user.
      Returns:
      %TRUE if mount operation is anonymous.
    • getChoice

      public int getChoice()
      Gets a choice from the mount operation.
      Returns:
      an integer containing an index of the user's choice from the choice's list, or `0`.
    • getDomain

      public Str getDomain()
      Gets the domain of the mount operation.
      Returns:
      a string set to the domain.
    • getIsTcryptHiddenVolume

      public boolean getIsTcryptHiddenVolume()
      Check to see whether the mount operation is being used
      for a TCRYPT hidden volume.
      Returns:
      %TRUE if mount operation is for hidden volume.
    • getIsTcryptSystemVolume

      public boolean getIsTcryptSystemVolume()
      Check to see whether the mount operation is being used
      for a TCRYPT system volume.
      Returns:
      %TRUE if mount operation is for system volume.
    • getPassword

      public Str getPassword()
      Gets a password from the mount operation.
      Returns:
      a string containing the password within @op.
    • getPasswordSave

      public int getPasswordSave()
      Gets the state of saving passwords for the mount operation.
      Returns:
      a #GPasswordSave flag.
    • getPim

      public int getPim()
      Gets a PIM from the mount operation.
      Returns:
      The VeraCrypt PIM within @op.
    • getUsername

      public Str getUsername()
      Get the user name from the mount operation.
      Returns:
      a string containing the user name.
    • reply

      public void reply(int result)
      Emits the #GMountOperation::reply signal.
      Parameters:
      result - a #GMountOperationResult
    • setAnonymous

      public void setAnonymous(boolean anonymous)
      Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
      Parameters:
      anonymous - boolean value.
    • setChoice

      public void setChoice(int choice)
      Sets a default choice for the mount operation.
      Parameters:
      choice - an integer.
    • setDomain

      public void setDomain(@Nullable Str domain)
      Sets the mount operation's domain.
      Parameters:
      domain - the domain to set.
    • setDomain

      public void setDomain(String domain)
      Sets the mount operation's domain.
      Parameters:
      domain - the domain to set.
    • setIsTcryptHiddenVolume

      public void setIsTcryptHiddenVolume(boolean hidden_volume)
      Sets the mount operation to use a hidden volume if @hidden_volume is %TRUE.
      Parameters:
      hidden_volume - boolean value.
    • setIsTcryptSystemVolume

      public void setIsTcryptSystemVolume(boolean system_volume)
      Sets the mount operation to use a system volume if @system_volume is %TRUE.
      Parameters:
      system_volume - boolean value.
    • setPassword

      public void setPassword(@Nullable Str password)
      Sets the mount operation's password to @password.
      Parameters:
      password - password to set.
    • setPassword

      public void setPassword(String password)
      Sets the mount operation's password to @password.
      Parameters:
      password - password to set.
    • setPasswordSave

      public void setPasswordSave(int save)
      Sets the state of saving passwords for the mount operation.
      Parameters:
      save - a set of #GPasswordSave flags.
    • setPim

      public void setPim(int pim)
      Sets the mount operation's PIM to @pim.
      Parameters:
      pim - an unsigned integer.
    • setUsername

      public void setUsername(@Nullable Str username)
      Sets the user name within @op to @username.
      Parameters:
      username - input username.
    • setUsername

      public void setUsername(String username)
      Sets the user name within @op to @username.
      Parameters:
      username - input username.
    • onAborted

      public SignalHandler onAborted(MountOperation.OnAborted signal)
      Connect to signal "aborted".
      See MountOperation.OnAborted.onAborted() for signal description.
      Field SIGNAL_ON_ABORTED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onAskPassword

      public SignalHandler onAskPassword(MountOperation.OnAskPassword signal)
      Connect to signal "ask-password".
      See MountOperation.OnAskPassword.onAskPassword(ch.bailu.gtk.type.Str, ch.bailu.gtk.type.Str, ch.bailu.gtk.type.Str, int) for signal description.
      Field SIGNAL_ON_ASK_PASSWORD contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onReply

      public SignalHandler onReply(MountOperation.OnReply signal)
      Connect to signal "reply".
      See MountOperation.OnReply.onReply(int) for signal description.
      Field SIGNAL_ON_REPLY contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onShowUnmountProgress

      public SignalHandler onShowUnmountProgress(MountOperation.OnShowUnmountProgress signal)
      Connect to signal "show-unmount-progress".
      See MountOperation.OnShowUnmountProgress.onShowUnmountProgress(ch.bailu.gtk.type.Str, long, long) for signal description.
      Field SIGNAL_ON_SHOW_UNMOUNT_PROGRESS contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()