Maintainer | gtk2hs-devel@lists.sourceforge.net |
---|---|
Stability | alpha |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
- newtype Mount = Mount (ForeignPtr Mount)
- class GObjectClass o => MountClass o
- mountGetName :: (MountClass mount, GlibString string) => mount -> IO string
- mountGetUUID :: (MountClass mount, GlibString string) => mount -> IO (Maybe string)
- mountGetIcon :: MountClass mount => mount -> IO Icon
- mountGetDrive :: MountClass mount => mount -> IO (Maybe Drive)
- mountGetRoot :: MountClass mount => mount -> IO File
- mountGetVolume :: MountClass mount => mount -> IO (Maybe Volume)
- mountGetDefaultLocation :: MountClass mount => mount -> IO File
- mountCanUnmount :: MountClass mount => mount -> IO Bool
- mountUnmountWithOperation :: MountClass mount => mount -> [MountUnmountFlags] -> Maybe MountOperation -> Maybe Cancellable -> AsyncReadyCallback -> IO ()
- mountUnmountWithOperationFinish :: MountClass mount => mount -> AsyncResult -> IO ()
- mountRemount :: MountClass mount => mount -> [MountMountFlags] -> Maybe MountOperation -> Maybe Cancellable -> AsyncReadyCallback -> IO ()
- mountRemountFinish :: MountClass mount => mount -> AsyncResult -> IO ()
- mountCanEject :: MountClass mount => mount -> IO Bool
- mountEjectWithOperation :: MountClass mount => mount -> [MountUnmountFlags] -> Maybe MountOperation -> Maybe Cancellable -> AsyncReadyCallback -> IO ()
- mountEjectWithOperationFinish :: MountClass mount => mount -> AsyncResult -> IO ()
- mountGuessContentType :: MountClass mount => mount -> Bool -> Maybe Cancellable -> AsyncReadyCallback -> IO ()
- mountGuessContentTypeFinish :: (MountClass mount, GlibString string) => mount -> AsyncResult -> IO [string]
- mountGuessContentTypeSync :: (MountClass mount, GlibString string) => mount -> Bool -> Maybe Cancellable -> IO [string]
- mountIsShadowed :: MountClass mount => mount -> IO Bool
- mountShadow :: MountClass mount => mount -> IO ()
- mountUnshadow :: MountClass mount => mount -> IO ()
- mountChanged :: MountClass mount => Signal mount (IO ())
- mountPreUnmount :: MountClass mount => Signal mount (IO ())
- mountUnmounted :: MountClass mount => Signal mount (IO ())
Details
The Mount
interface represents user-visible mounts. Note, when porting from GnomeVFS, Mount
is the
moral equivalent of GnomeVFSVolume.
Mount
is a "mounted" filesystem that you can access. Mounted is in quotes because it's not the same
as a 1 mount, it might be a gvfs mount, but you can still access the files on it if you use
GIO. Might or might not be related to a volume object.
Unmounting a Mount
instance is an asynchronous operation. For more information about asynchronous
operations, see AsyncReady
and GSimpleAsyncReady. To unmount a Mount
instance, first call
mountUnmountWithOperation
the Mount
instance and a AsyncReadyCallback
. The
callback will be fired when the operation has resolved (either with success or failure), and a
AsyncReady
structure will be passed to the callback. That callback should then call
mountUnmountWithOperationFinish
with the Mount
and the AsyncReady
data to see if the
operation was completed successfully. If an error is present when
mountUnmountWithOperationFinish
is called, then it will be filled with any error
information.
Types
class GObjectClass o => MountClass o Source #
Methods
:: (MountClass mount, GlibString string) | |
=> mount | |
-> IO string | returns the name for the given mount. |
Gets the name of mount.
:: (MountClass mount, GlibString string) | |
=> mount | |
-> IO (Maybe string) | returns the UUID for mount or |
Gets the UUID for the mount. The reference is typically based on the file system UUID for the mount
in question and should be considered an opaque string. Returns Nothing
if there is no UUID available.
mountGetRoot :: MountClass mount => mount -> IO File Source #
Gets the root directory on mount.
:: MountClass mount | |
=> mount | |
-> IO (Maybe Volume) | returns a |
Gets the volume directory on mount.
mountGetDefaultLocation :: MountClass mount => mount -> IO File Source #
Gets the default location of mount. The default location of the given mount is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume). | Gets the root directory on mount.
:: MountClass mount | |
=> mount | |
-> IO Bool | returns |
Checks if mount can be mounted.
mountUnmountWithOperation Source #
:: MountClass mount | |
=> mount | |
-> [MountUnmountFlags] |
|
-> Maybe MountOperation |
|
-> Maybe Cancellable |
|
-> AsyncReadyCallback |
|
-> IO () |
Unmounts a mount. This is an asynchronous operation, and is finished by calling
mountUnmountWithOperationFinish
with the mount and AsyncResult
data returned in the
callback.
mountUnmountWithOperationFinish Source #
:: MountClass mount | |
=> mount | |
-> AsyncResult |
|
-> IO () |
:: MountClass mount | |
=> mount | |
-> [MountMountFlags] |
|
-> Maybe MountOperation |
|
-> Maybe Cancellable |
|
-> AsyncReadyCallback |
|
-> IO () |
Remounts a mount. This is an asynchronous operation, and is finished by calling
mountRemountFinish
with the mount and AsyncResult
s data returned in the callback.
Remounting is useful when some setting affecting the operation of the volume has been changed, as these may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting not all backends might need to actually be unmounted.
:: MountClass mount | |
=> mount | |
-> AsyncResult |
|
-> IO () |
:: MountClass mount | |
=> mount | |
-> IO Bool | returns |
Checks if mount can be eject.
mountEjectWithOperation Source #
:: MountClass mount | |
=> mount | |
-> [MountUnmountFlags] |
|
-> Maybe MountOperation |
|
-> Maybe Cancellable |
|
-> AsyncReadyCallback |
|
-> IO () |
Ejects a mount. This is an asynchronous operation, and is finished by calling
mountEjectWithOperationFinish
with the mount and AsyncResult
data returned in the callback.
mountEjectWithOperationFinish Source #
:: MountClass mount | |
=> mount | |
-> AsyncResult |
|
-> IO () |
Finishes ejecting a mount. If any errors occurred during the operation.
Throws a GError
if an error occurs.
mountGuessContentType Source #
:: MountClass mount | |
=> mount | |
-> Bool |
|
-> Maybe Cancellable |
|
-> AsyncReadyCallback |
|
-> IO () |
Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content"), e.g. x-contentimage-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an asynchronous operation (see mountGuessContentTypeSync
for the synchronous
version), and is finished by calling mountGuessContentTypeFinish
with the mount and
AsyncResult
data returned in the callback.
mountGuessContentTypeFinish Source #
:: (MountClass mount, GlibString string) | |
=> mount | |
-> AsyncResult |
|
-> IO [string] | returns |
Finishes guessing content types of mount. If any errors occured during the operation, error will be
set to contain the errors and False
will be returned. In particular, you may get an
IoErrorNotSupported
if the mount does not support content guessing.
mountGuessContentTypeSync Source #
:: (MountClass mount, GlibString string) | |
=> mount | |
-> Bool |
|
-> Maybe Cancellable |
|
-> IO [string] |
Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content"), e.g. x-contentimage-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an synchronous operation and as such may block doing IO; see mountGuessContentType
for the asynchronous version.
:: MountClass mount | |
=> mount | |
-> IO Bool | returns |
Determines if mount is shadowed. Applications or libraries should avoid displaying mount in the user interface if it is shadowed.
A mount is said to be shadowed if there exists one or more user visible objects (currently Mount
objects) with a root that is inside the root of mount.
One application of shadow mounts is when exposing a single file system that is used to address
several logical volumes. In this situation, a VolumeMonitor
implementation would create two Volume
objects (for example, one for the camera functionality of the device and one for a SD card reader on
the device) with activation URIs gphoto2:
gphoto2:
mounted, said VolumeMonitor
implementation would create two Mount
objects (each with their root
matching the corresponding volume activation root) that would shadow the original mount.
The proxy monitor in GVfs 2.26 and later, automatically creates and manage shadow mounts (and
shadows the underlying mount) if the activation root on a Volume
is set.
mountShadow :: MountClass mount => mount -> IO () Source #
Increments the shadow count on mount. Usually used by VolumeMonitor
implementations when creating a
shadow mount for mount, see mountIsShadowed
for more information. The caller will need to emit
the "changed" signal on mount manually.
mountUnshadow :: MountClass mount => mount -> IO () Source #
Decrements the shadow count on mount. Usually used by VolumeMonitor
implementations when destroying
a shadow mount for mount, see mountIsShadowed
for more information. The caller will need to
emit the "changed" signal on mount manually.
Signals
mountChanged :: MountClass mount => Signal mount (IO ()) Source #
Emitted when the mount has been changed.
mountPreUnmount :: MountClass mount => Signal mount (IO ()) Source #
This signal is emitted when the Mount
is about to be unmounted.
mountUnmounted :: MountClass mount => Signal mount (IO ()) Source #
This signal is emitted when the Mount
have been unmounted. If the recipient is holding references
to the object they should release them so the object can be finalized.