Class MountOperation.Builder<B extends MountOperation.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
MountOperation.Builder
Enclosing class:
MountOperation

public static class MountOperation.Builder<B extends MountOperation.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public MountOperation build()
      Finish building the MountOperation object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to MountOperation.
      Overrides:
      build in class GObject.Builder<B extends MountOperation.Builder<B>>
      Returns:
      a new instance of MountOperation with the properties that were set in the Builder object.
    • setAnonymous

      public B setAnonymous(boolean anonymous)
      Whether to use an anonymous user when authenticating.
      Parameters:
      anonymous - the value for the anonymous property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setChoice

      public B setChoice(int choice)
      The index of the user's choice when a question is asked during the mount operation. See the GMountOperation::ask-question signal.
      Parameters:
      choice - the value for the choice property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDomain

      public B setDomain(String domain)
      The domain to use for the mount operation.
      Parameters:
      domain - the value for the domain property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIsTcryptHiddenVolume

      public B setIsTcryptHiddenVolume(boolean isTcryptHiddenVolume)
      Whether the device to be unlocked is a TCRYPT hidden volume. See the VeraCrypt documentation.
      Parameters:
      isTcryptHiddenVolume - the value for the is-tcrypt-hidden-volume property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.58
    • setIsTcryptSystemVolume

      public B setIsTcryptSystemVolume(boolean isTcryptSystemVolume)
      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.
      Parameters:
      isTcryptSystemVolume - the value for the is-tcrypt-system-volume property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.58
    • setPassword

      public B setPassword(String password)
      The password that is used for authentication when carrying out the mount operation.
      Parameters:
      password - the value for the password property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPasswordSave

      public B setPasswordSave(PasswordSave passwordSave)
      Determines if and how the password information should be saved.
      Parameters:
      passwordSave - the value for the password-save property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPim

      public B setPim(int pim)
      The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See the VeraCrypt documentation.
      Parameters:
      pim - the value for the pim property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.58
    • setUsername

      public B setUsername(String username)
      The user name that is used for authentication when carrying out the mount operation.
      Parameters:
      username - the value for the username property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onAborted

      public B onAborted(MountOperation.AbortedCallback handler)

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

      Implementations of GMountOperation should handle this signal by dismissing open password dialogs.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.20
      See Also:
    • onAskPassword

      public B onAskPassword(MountOperation.AskPasswordCallback handler)

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

      If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onAskQuestion

      public B onAskQuestion(MountOperation.AskQuestionCallback handler)

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

      If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onReply

      public B onReply(MountOperation.ReplyCallback handler)
      Emitted when the user has replied to the mount operation.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onShowProcesses

      public B onShowProcesses(MountOperation.ShowProcessesCallback handler)

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

      Note that this signal may be emitted several times to update the list of blocking processes as processes close files. The application should only respond with g_mount_operation_reply() to the latest signal (setting GMountOperation:choice to the choice the user made).

      If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.22
      See Also:
    • onShowUnmountProgress

      public B onShowUnmountProgress(MountOperation.ShowUnmountProgressCallback handler)

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

      When unmounting or ejecting a volume, the kernel might need to flush pending data in its buffers to the volume stable storage, and this operation can take a considerable amount of time. This signal may be emitted several times as long as the unmount operation is outstanding, and then one last time when the operation is completed, with bytesLeft set to zero.

      Implementations of GMountOperation should handle this signal by showing an UI notification, and then dismiss it, or show another notification of completion, when bytesLeft reaches zero.

      If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.34
      See Also: