gio-0.13.6.0: Binding to GIO

Maintainer | gtk2hs-devel@lists.sourceforge.net
Stability | alpha
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

System.GIO.File.MountOperation

Contents

- Details
- Types
- Enums
- Methods
- Attributes
- Signals

Description

Synopsis

- newtype MountOperation = MountOperation (ForeignPtr MountOperation)
- class GObjectClass o => MountOperationClass o
- data MountOperationResult
  - = MountOperationHandled
  - | MountOperationAborted
  - | MountOperationUnhandled
- data AskPasswordFlags
  - = AskPasswordNeedPassword
  - | AskPasswordNeedUsername
  - | AskPasswordNeedDomain
  - | AskPasswordSavingSupported
  - | AskPasswordAnonymousSupported
  - | AskPasswordTcrypt
- data PasswordSave
  - = PasswordSaveNever
  - | PasswordSaveForSession
  - | PasswordSavePermanently
- mountOperationNew :: IO MountOperation
- mountOperationReply :: MountOperationClass op => op -> MountOperationResult -> IO ()
- mountOperationAnonymous :: MountOperationClass op => Attr op Bool
- mountOperationChoice :: MountOperationClass op => Attr op Int
- mountOperationDomain :: (MountOperationClass op, GlibString string) => Attr op string
- mountOperationPassword :: (MountOperationClass op, GlibString string) => Attr op string
- mountOperationPasswordSave :: MountOperationClass op => Attr op PasswordSave
- mountOperationUsername :: (MountOperationClass op, GlibString string) => Attr op string
- mountOperationAborted :: MountOperationClass op => Signal op (IO ())
- mountOperationAskPassword :: (MountOperationClass op, GlibString string) => Signal op (string -> string -> string -> AskPasswordFlags -> IO ())
- mountOperationReplySignal :: MountOperationClass op => Signal op (MountOperationResult -> IO ())

# Details

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

Users should instantiate a subclass of this that implements all the various callbacks to show the required dialogs, such as `MountOperation`. 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.

# Types

newtype MountOperation Source #

Constructors

MountOperation (ForeignPtr MountOperation) |

Instances

Eq MountOperation Source # |
Instance details Defined in System.GIO.Types Methods (==) :: MountOperation -> MountOperation -> Bool Source # (/=) :: MountOperation -> MountOperation -> Bool Source #
Ord MountOperation Source # |

Instance details

Defined in System.GIO.Types

Methods

compare :: MountOperation -> MountOperation -> Ordering Source #

(<) :: MountOperation -> MountOperation -> Bool Source #

(<=) :: MountOperation -> MountOperation -> Bool Source #

(>) :: MountOperation -> MountOperation -> Bool Source #

(>=) :: MountOperation -> MountOperation -> Bool Source #

max :: MountOperation -> MountOperation -> MountOperation Source #

min :: MountOperation -> MountOperation -> MountOperation Source #

GObjectClass MountOperation Source # |
Instance details Defined in System.GIO.Types Methods toGObject :: MountOperation -> GObject Source # unsafeCastGObject :: GObject -> MountOperation Source #
MountOperationClass MountOperation Source # |
Instance details Defined in System.GIO.Types

class GObjectClass o => MountOperationClass o Source #

Instances

MountOperationClass MountOperation Source # |
Instance details Defined in System.GIO.Types

# Enums

data MountOperationResult Source #

Constructors

MountOperationHandled |
MountOperationAborted |
MountOperationUnhandled |

Instances

Bounded MountOperationResult Source # |
Instance details Defined in System.GIO.Enums Methods minBound :: MountOperationResult Source # maxBound :: MountOperationResult Source #
Enum MountOperationResult Source # |

Instance details

Defined in System.GIO.Enums

Methods

succ :: MountOperationResult -> MountOperationResult Source #

pred :: MountOperationResult -> MountOperationResult Source #

toEnum :: Int -> MountOperationResult Source #

fromEnum :: MountOperationResult -> Int Source #

enumFrom :: MountOperationResult -> [MountOperationResult] Source #

enumFromThen :: MountOperationResult -> MountOperationResult -> [MountOperationResult] Source #

enumFromTo :: MountOperationResult -> MountOperationResult -> [MountOperationResult] Source #

enumFromThenTo :: MountOperationResult -> MountOperationResult -> MountOperationResult -> [MountOperationResult] Source #

Eq MountOperationResult Source # |
Instance details Defined in System.GIO.Enums Methods (==) :: MountOperationResult -> MountOperationResult -> Bool Source # (/=) :: MountOperationResult -> MountOperationResult -> Bool Source #
Ord MountOperationResult Source # |

Instance details

Defined in System.GIO.Enums

Methods

compare :: MountOperationResult -> MountOperationResult -> Ordering Source #

(<) :: MountOperationResult -> MountOperationResult -> Bool Source #

(<=) :: MountOperationResult -> MountOperationResult -> Bool Source #

(>) :: MountOperationResult -> MountOperationResult -> Bool Source #

(>=) :: MountOperationResult -> MountOperationResult -> Bool Source #

max :: MountOperationResult -> MountOperationResult -> MountOperationResult Source #

min :: MountOperationResult -> MountOperationResult -> MountOperationResult Source #

Show MountOperationResult Source # |
Instance details Defined in System.GIO.Enums Methods showsPrec :: Int -> MountOperationResult -> ShowS Source # show :: MountOperationResult -> String Source # showList :: [MountOperationResult] -> ShowS Source #

data AskPasswordFlags Source #

Constructors

AskPasswordNeedPassword |
AskPasswordNeedUsername |
AskPasswordNeedDomain |
AskPasswordSavingSupported |
AskPasswordAnonymousSupported |
AskPasswordTcrypt |

Instances

Bounded AskPasswordFlags Source # |
Instance details Defined in System.GIO.Enums Methods minBound :: AskPasswordFlags Source # maxBound :: AskPasswordFlags Source #
Enum AskPasswordFlags Source # | `MountOperationResult` is returned as a result when a request for information is send by the mounting operation.

Instance details

Defined in System.GIO.Enums

Methods

succ :: AskPasswordFlags -> AskPasswordFlags Source #

pred :: AskPasswordFlags -> AskPasswordFlags Source #

toEnum :: Int -> AskPasswordFlags Source #

fromEnum :: AskPasswordFlags -> Int Source #

enumFrom :: AskPasswordFlags -> [AskPasswordFlags] Source #

enumFromThen :: AskPasswordFlags -> AskPasswordFlags -> [AskPasswordFlags] Source #

enumFromTo :: AskPasswordFlags -> AskPasswordFlags -> [AskPasswordFlags] Source #

enumFromThenTo :: AskPasswordFlags -> AskPasswordFlags -> AskPasswordFlags -> [AskPasswordFlags] Source #

Eq AskPasswordFlags Source # |
Instance details Defined in System.GIO.Enums Methods (==) :: AskPasswordFlags -> AskPasswordFlags -> Bool Source # (/=) :: AskPasswordFlags -> AskPasswordFlags -> Bool Source #
Ord AskPasswordFlags Source # |

Instance details

Defined in System.GIO.Enums

Methods

compare :: AskPasswordFlags -> AskPasswordFlags -> Ordering Source #

(<) :: AskPasswordFlags -> AskPasswordFlags -> Bool Source #

(<=) :: AskPasswordFlags -> AskPasswordFlags -> Bool Source #

(>) :: AskPasswordFlags -> AskPasswordFlags -> Bool Source #

(>=) :: AskPasswordFlags -> AskPasswordFlags -> Bool Source #

max :: AskPasswordFlags -> AskPasswordFlags -> AskPasswordFlags Source #

min :: AskPasswordFlags -> AskPasswordFlags -> AskPasswordFlags Source #

Show AskPasswordFlags Source # |
Instance details Defined in System.GIO.Enums Methods showsPrec :: Int -> AskPasswordFlags -> ShowS Source # show :: AskPasswordFlags -> String Source # showList :: [AskPasswordFlags] -> ShowS Source #
Flags AskPasswordFlags Source # |
Instance details Defined in System.GIO.Enums

data PasswordSave Source #

`PasswordSave` is used to indicate the lifespan of a saved password.

Constructors

PasswordSaveNever |
PasswordSaveForSession |
PasswordSavePermanently |

Instances

Bounded PasswordSave Source # |
Instance details Defined in System.GIO.Enums Methods minBound :: PasswordSave Source # maxBound :: PasswordSave Source #
Enum PasswordSave Source # |

Instance details

Defined in System.GIO.Enums

Methods

succ :: PasswordSave -> PasswordSave Source #

pred :: PasswordSave -> PasswordSave Source #

toEnum :: Int -> PasswordSave Source #

fromEnum :: PasswordSave -> Int Source #

enumFrom :: PasswordSave -> [PasswordSave] Source #

enumFromThen :: PasswordSave -> PasswordSave -> [PasswordSave] Source #

enumFromTo :: PasswordSave -> PasswordSave -> [PasswordSave] Source #

enumFromThenTo :: PasswordSave -> PasswordSave -> PasswordSave -> [PasswordSave] Source #

Eq PasswordSave Source # |
Instance details Defined in System.GIO.Enums Methods (==) :: PasswordSave -> PasswordSave -> Bool Source # (/=) :: PasswordSave -> PasswordSave -> Bool Source #
Ord PasswordSave Source # |

Instance details

Defined in System.GIO.Enums

Methods

compare :: PasswordSave -> PasswordSave -> Ordering Source #

(<) :: PasswordSave -> PasswordSave -> Bool Source #

(<=) :: PasswordSave -> PasswordSave -> Bool Source #

(>) :: PasswordSave -> PasswordSave -> Bool Source #

(>=) :: PasswordSave -> PasswordSave -> Bool Source #

max :: PasswordSave -> PasswordSave -> PasswordSave Source #

min :: PasswordSave -> PasswordSave -> PasswordSave Source #

Show PasswordSave Source # |
Instance details Defined in System.GIO.Enums Methods showsPrec :: Int -> PasswordSave -> ShowS Source # show :: PasswordSave -> String Source # showList :: [PasswordSave] -> ShowS Source #

# Methods

mountOperationNew :: IO MountOperation Source #

Creates a new mount operation.

mountOperationReply :: MountOperationClass op => op -> MountOperationResult -> IO () Source #

Emits the "reply" signal.

# Attributes

mountOperationAnonymous :: MountOperationClass op => Attr op Bool Source #

Whether to use an anonymous user when authenticating.

Default value: `False`

mountOperationChoice :: MountOperationClass op => Attr op Int Source #

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

Allowed values: >= 0

Default value: 0

mountOperationDomain :: (MountOperationClass op, GlibString string) => Attr op string Source #

The domain to use for the mount operation.

Default value: ""

mountOperationPassword :: (MountOperationClass op, GlibString string) => Attr op string Source #

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

Default value: ""

mountOperationPasswordSave :: MountOperationClass op => Attr op PasswordSave Source #

Determines if and how the password information should be saved.

Default value: `PasswordSaveNever`

mountOperationUsername :: (MountOperationClass op, GlibString string) => Attr op string Source #

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

Default value: ""

# Signals

mountOperationAborted :: MountOperationClass op => Signal op (IO ()) Source #

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

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

Since 2.20

mountOperationAskPassword :: (MountOperationClass op, GlibString string) => Signal op (string -> string -> string -> AskPasswordFlags -> IO ()) Source #

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 `MessageDialog`.

mountOperationReplySignal :: MountOperationClass op => Signal op (MountOperationResult -> IO ()) Source #

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 `MessageDialog`. askQuestion :: MountOperationClass op => Signal op (String -> [String] -> IO ()) askQuestion Signal (after obj user -> connect_GLIBSTRING_BOXED__NONE "ask-question" after obj (message choicesPtr -> do choices <- peekUTFString choicesPtr user str choices))

Emitted when the user has replied to the mount operation.