gi-gio-2.0.27: Gio bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.MountOperation

Description

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 MountOperation is used for more than just Mount objects – for example it is also used in driveStart and driveStop.

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 Nothing can be passed, see each method taking a MountOperation for details.

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.

Synopsis

Exported types

class (GObject o, IsDescendantOf MountOperation o) => IsMountOperation o Source #

Type class for types which can be safely cast to MountOperation, for instance with toMountOperation.

Instances

Instances details
(GObject o, IsDescendantOf MountOperation o) => IsMountOperation o Source # 
Instance details

Defined in GI.Gio.Objects.MountOperation

toMountOperation :: (MonadIO m, IsMountOperation o) => o -> m MountOperation Source #

Cast to MountOperation, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getAnonymous

mountOperationGetAnonymous Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Bool

Returns: True if mount operation is anonymous.

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

getChoice

mountOperationGetChoice Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Int32

Returns: an integer containing an index of the user's choice from the choice's list, or 0.

Gets a choice from the mount operation.

getDomain

mountOperationGetDomain Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Text

Returns: a string set to the domain.

Gets the domain of the mount operation.

getIsTcryptHiddenVolume

mountOperationGetIsTcryptHiddenVolume Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Bool

Returns: True if mount operation is for hidden volume.

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

Since: 2.58

getIsTcryptSystemVolume

mountOperationGetIsTcryptSystemVolume Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Bool

Returns: True if mount operation is for system volume.

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

Since: 2.58

getPassword

mountOperationGetPassword Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Text

Returns: a string containing the password within op.

Gets a password from the mount operation.

getPasswordSave

mountOperationGetPasswordSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m PasswordSave

Returns: a PasswordSave flag.

Gets the state of saving passwords for the mount operation.

getPim

mountOperationGetPim Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Word32

Returns: The VeraCrypt PIM within op.

Gets a PIM from the mount operation.

Since: 2.58

getUsername

mountOperationGetUsername Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> m Text

Returns: a string containing the user name.

Get the user name from the mount operation.

new

mountOperationNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m MountOperation

Returns: a MountOperation.

Creates a new mount operation.

reply

setAnonymous

mountOperationSetAnonymous Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Bool

anonymous: boolean value.

-> m () 

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

setChoice

mountOperationSetChoice Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Int32

choice: an integer.

-> m () 

Sets a default choice for the mount operation.

setDomain

mountOperationSetDomain Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Text

domain: the domain to set.

-> m () 

Sets the mount operation's domain.

setIsTcryptHiddenVolume

mountOperationSetIsTcryptHiddenVolume Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Bool

hiddenVolume: boolean value.

-> m () 

Sets the mount operation to use a hidden volume if hiddenVolume is True.

Since: 2.58

setIsTcryptSystemVolume

mountOperationSetIsTcryptSystemVolume Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Bool

systemVolume: boolean value.

-> m () 

Sets the mount operation to use a system volume if systemVolume is True.

Since: 2.58

setPassword

mountOperationSetPassword Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Text

password: password to set.

-> m () 

Sets the mount operation's password to password.

setPasswordSave

mountOperationSetPasswordSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> PasswordSave

save: a set of PasswordSave flags.

-> m () 

Sets the state of saving passwords for the mount operation.

setPim

mountOperationSetPim Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Word32

pim: an unsigned integer.

-> m () 

Sets the mount operation's PIM to pim.

Since: 2.58

setUsername

mountOperationSetUsername Source #

Arguments

:: (HasCallStack, MonadIO m, IsMountOperation a) 
=> a

op: a MountOperation.

-> Text

username: input username.

-> m () 

Sets the user name within op to username.

Properties

anonymous

Whether to use an anonymous user when authenticating.

constructMountOperationAnonymous :: (IsMountOperation o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “anonymous” property. This is rarely needed directly, but it is used by new.

getMountOperationAnonymous :: (MonadIO m, IsMountOperation o) => o -> m Bool Source #

Get the value of the “anonymous” property. When overloading is enabled, this is equivalent to

get mountOperation #anonymous

setMountOperationAnonymous :: (MonadIO m, IsMountOperation o) => o -> Bool -> m () Source #

Set the value of the “anonymous” property. When overloading is enabled, this is equivalent to

set mountOperation [ #anonymous := value ]

choice

The index of the user's choice when a question is asked during the mount operation. See the askQuestion signal.

constructMountOperationChoice :: (IsMountOperation o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “choice” property. This is rarely needed directly, but it is used by new.

getMountOperationChoice :: (MonadIO m, IsMountOperation o) => o -> m Int32 Source #

Get the value of the “choice” property. When overloading is enabled, this is equivalent to

get mountOperation #choice

setMountOperationChoice :: (MonadIO m, IsMountOperation o) => o -> Int32 -> m () Source #

Set the value of the “choice” property. When overloading is enabled, this is equivalent to

set mountOperation [ #choice := value ]

domain

The domain to use for the mount operation.

constructMountOperationDomain :: (IsMountOperation o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “domain” property. This is rarely needed directly, but it is used by new.

getMountOperationDomain :: (MonadIO m, IsMountOperation o) => o -> m Text Source #

Get the value of the “domain” property. When overloading is enabled, this is equivalent to

get mountOperation #domain

setMountOperationDomain :: (MonadIO m, IsMountOperation o) => o -> Text -> m () Source #

Set the value of the “domain” property. When overloading is enabled, this is equivalent to

set mountOperation [ #domain := value ]

isTcryptHiddenVolume

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

Since: 2.58

constructMountOperationIsTcryptHiddenVolume :: (IsMountOperation o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-tcrypt-hidden-volume” property. This is rarely needed directly, but it is used by new.

getMountOperationIsTcryptHiddenVolume :: (MonadIO m, IsMountOperation o) => o -> m Bool Source #

Get the value of the “is-tcrypt-hidden-volume” property. When overloading is enabled, this is equivalent to

get mountOperation #isTcryptHiddenVolume

setMountOperationIsTcryptHiddenVolume :: (MonadIO m, IsMountOperation o) => o -> Bool -> m () Source #

Set the value of the “is-tcrypt-hidden-volume” property. When overloading is enabled, this is equivalent to

set mountOperation [ #isTcryptHiddenVolume := value ]

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.

Since: 2.58

constructMountOperationIsTcryptSystemVolume :: (IsMountOperation o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “is-tcrypt-system-volume” property. This is rarely needed directly, but it is used by new.

getMountOperationIsTcryptSystemVolume :: (MonadIO m, IsMountOperation o) => o -> m Bool Source #

Get the value of the “is-tcrypt-system-volume” property. When overloading is enabled, this is equivalent to

get mountOperation #isTcryptSystemVolume

setMountOperationIsTcryptSystemVolume :: (MonadIO m, IsMountOperation o) => o -> Bool -> m () Source #

Set the value of the “is-tcrypt-system-volume” property. When overloading is enabled, this is equivalent to

set mountOperation [ #isTcryptSystemVolume := value ]

password

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

constructMountOperationPassword :: (IsMountOperation o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “password” property. This is rarely needed directly, but it is used by new.

getMountOperationPassword :: (MonadIO m, IsMountOperation o) => o -> m Text Source #

Get the value of the “password” property. When overloading is enabled, this is equivalent to

get mountOperation #password

setMountOperationPassword :: (MonadIO m, IsMountOperation o) => o -> Text -> m () Source #

Set the value of the “password” property. When overloading is enabled, this is equivalent to

set mountOperation [ #password := value ]

passwordSave

Determines if and how the password information should be saved.

constructMountOperationPasswordSave :: (IsMountOperation o, MonadIO m) => PasswordSave -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “password-save” property. This is rarely needed directly, but it is used by new.

getMountOperationPasswordSave :: (MonadIO m, IsMountOperation o) => o -> m PasswordSave Source #

Get the value of the “password-save” property. When overloading is enabled, this is equivalent to

get mountOperation #passwordSave

setMountOperationPasswordSave :: (MonadIO m, IsMountOperation o) => o -> PasswordSave -> m () Source #

Set the value of the “password-save” property. When overloading is enabled, this is equivalent to

set mountOperation [ #passwordSave := value ]

pim

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

Since: 2.58

constructMountOperationPim :: (IsMountOperation o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “pim” property. This is rarely needed directly, but it is used by new.

getMountOperationPim :: (MonadIO m, IsMountOperation o) => o -> m Word32 Source #

Get the value of the “pim” property. When overloading is enabled, this is equivalent to

get mountOperation #pim

setMountOperationPim :: (MonadIO m, IsMountOperation o) => o -> Word32 -> m () Source #

Set the value of the “pim” property. When overloading is enabled, this is equivalent to

set mountOperation [ #pim := value ]

username

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

constructMountOperationUsername :: (IsMountOperation o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “username” property. This is rarely needed directly, but it is used by new.

getMountOperationUsername :: (MonadIO m, IsMountOperation o) => o -> m Text Source #

Get the value of the “username” property. When overloading is enabled, this is equivalent to

get mountOperation #username

setMountOperationUsername :: (MonadIO m, IsMountOperation o) => o -> Text -> m () Source #

Set the value of the “username” property. When overloading is enabled, this is equivalent to

set mountOperation [ #username := value ]

Signals

aborted

type C_MountOperationAbortedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MountOperationAbortedCallback = IO () Source #

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.

Since: 2.20

afterMountOperationAborted :: (IsMountOperation a, MonadIO m) => a -> MountOperationAbortedCallback -> m SignalHandlerId Source #

Connect a signal handler for the aborted signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after mountOperation #aborted callback

onMountOperationAborted :: (IsMountOperation a, MonadIO m) => a -> MountOperationAbortedCallback -> m SignalHandlerId Source #

Connect a signal handler for the aborted signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on mountOperation #aborted callback

askPassword

type C_MountOperationAskPasswordCallback = Ptr () -> CString -> CString -> CString -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MountOperationAskPasswordCallback Source #

Arguments

 = Text

message: string containing a message to display to the user.

-> Text

defaultUser: string containing the default user name.

-> Text

defaultDomain: string containing the default domain.

-> [AskPasswordFlags]

flags: a set of AskPasswordFlags.

-> IO () 

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.

afterMountOperationAskPassword :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskPasswordCallback -> m SignalHandlerId Source #

Connect a signal handler for the askPassword signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after mountOperation #askPassword callback

onMountOperationAskPassword :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskPasswordCallback -> m SignalHandlerId Source #

Connect a signal handler for the askPassword signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on mountOperation #askPassword callback

askQuestion

type C_MountOperationAskQuestionCallback = Ptr () -> CString -> Ptr CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MountOperationAskQuestionCallback Source #

Arguments

 = Text

message: string containing a message to display to the user.

-> [Text]

choices: an array of strings for each possible choice.

-> IO () 

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.

afterMountOperationAskQuestion :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskQuestionCallback -> m SignalHandlerId Source #

Connect a signal handler for the askQuestion signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after mountOperation #askQuestion callback

onMountOperationAskQuestion :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskQuestionCallback -> m SignalHandlerId Source #

Connect a signal handler for the askQuestion signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on mountOperation #askQuestion callback

reply

type C_MountOperationReplyCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MountOperationReplyCallback Source #

Arguments

 = MountOperationResult

result: a MountOperationResult indicating how the request was handled

-> IO () 

Emitted when the user has replied to the mount operation.

afterMountOperationReply :: (IsMountOperation a, MonadIO m) => a -> MountOperationReplyCallback -> m SignalHandlerId Source #

Connect a signal handler for the reply signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after mountOperation #reply callback

onMountOperationReply :: (IsMountOperation a, MonadIO m) => a -> MountOperationReplyCallback -> m SignalHandlerId Source #

Connect a signal handler for the reply signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on mountOperation #reply callback

showProcesses

type C_MountOperationShowProcessesCallback = Ptr () -> CString -> Ptr (GArray Int32) -> Ptr CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MountOperationShowProcessesCallback Source #

Arguments

 = Text

message: string containing a message to display to the user.

-> [Int32]

processes: an array of GPid for processes blocking the operation.

-> [Text]

choices: an array of strings for each possible choice.

-> IO () 

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

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 mountOperationReply to the latest signal (setting MountOperation: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.

Since: 2.22

afterMountOperationShowProcesses :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowProcessesCallback -> m SignalHandlerId Source #

Connect a signal handler for the showProcesses signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after mountOperation #showProcesses callback

onMountOperationShowProcesses :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowProcessesCallback -> m SignalHandlerId Source #

Connect a signal handler for the showProcesses signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on mountOperation #showProcesses callback

showUnmountProgress

type C_MountOperationShowUnmountProgressCallback = Ptr () -> CString -> Int64 -> Int64 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MountOperationShowUnmountProgressCallback Source #

Arguments

 = Text

message: string containing a mesage to display to the user

-> Int64

timeLeft: the estimated time left before the operation completes, in microseconds, or -1

-> Int64

bytesLeft: the amount of bytes to be written before the operation completes (or -1 if such amount is not known), or zero if the operation is completed

-> IO () 

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.

Since: 2.34

afterMountOperationShowUnmountProgress :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowUnmountProgressCallback -> m SignalHandlerId Source #

Connect a signal handler for the showUnmountProgress signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after mountOperation #showUnmountProgress callback

onMountOperationShowUnmountProgress :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowUnmountProgressCallback -> m SignalHandlerId Source #

Connect a signal handler for the showUnmountProgress signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on mountOperation #showUnmountProgress callback