| Gtk2Hs | Contents | Index

System.Gnome.VFS.Drive

Maintainer | gtk2hs-devel@lists.sourceforge.net Stability : alpha Portability : portable (depends on GHC)

Contents

Types
Type Conversion
Drive Comparison
Drive Properties
Drive State
Drive Operations
Drive Signals

Description
Synopsis

data Drive
class GObjectClass o => DriveClass o
type DriveID = CULong
data DeviceType
castToDrive :: GObjectClass obj => obj -> Drive
driveCompare :: DriveClass drive => drive -> drive -> IO Ordering
driveGetActivationURI :: DriveClass drive => drive -> IO String
driveGetDevicePath :: DriveClass drive => drive -> IO (Maybe String)
driveGetDeviceType :: DriveClass drive => drive -> IO DeviceType
driveGetDisplayName :: DriveClass drive => drive -> IO String
driveGetHalUDI :: DriveClass drive => drive -> IO (Maybe String)
driveGetIcon :: DriveClass drive => drive -> IO FilePath
driveGetID :: DriveClass drive => drive -> IO DriveID
driveIsConnected :: DriveClass drive => drive -> IO Bool
driveIsMounted :: DriveClass drive => drive -> IO Bool
driveIsUserVisible :: DriveClass drive => drive -> IO Bool
driveGetMountedVolumes :: DriveClass drive => drive -> IO [Volume]
driveEject :: DriveClass drive => drive -> VolumeOpSuccessCallback -> VolumeOpFailureCallback -> IO ()
driveMount :: DriveClass drive => drive -> VolumeOpSuccessCallback -> VolumeOpFailureCallback -> IO ()
onDriveVolumeMounted :: DriveClass drive => drive -> (Volume -> IO ()) -> IO (ConnectId drive)
afterDriveVolumeMounted :: DriveClass drive => drive -> (Volume -> IO ()) -> IO (ConnectId drive)
onDriveVolumePreUnmount :: DriveClass drive => drive -> (Volume -> IO ()) -> IO (ConnectId drive)
afterDriveVolumePreUnmount :: DriveClass drive => drive -> (Volume -> IO ()) -> IO (ConnectId drive)
onDriveVolumeUnmounted :: DriveClass drive => drive -> (Volume -> IO ()) -> IO (ConnectId drive)
afterDriveVolumeUnmounted :: DriveClass drive => drive -> (Volume -> IO ()) -> IO (ConnectId drive)

Types
A container for `Volume`s.
data Drive

Instances

GObjectClass Drive
DriveClass Drive

class GObjectClass o => DriveClass o

Instances

DriveClass Drive

type DriveID = CULong
Identifies a `Drive`
data DeviceType

Identifies the device type of a `Volume` or `Drive`.
Instances

Enum DeviceType
Eq DeviceType
Show DeviceType

Type Conversion
castToDrive :: GObjectClass obj => obj -> Drive
Drive Comparison
driveCompare

:: DriveClass drive |
=> drive | `a` - the first drive
-> drive | `b` - the second drive
-> IO Ordering | the ordering relationship between the drives

Compares two `DriveClass` objects `a` and `b`. Two `DriveClass` objects referring to different drives are guaranteed to not return `EQ` when comparing them. If they refer to the same drive `EQ` is returned.

The resulting gint should be used to determine the order in which `a` and `b` are displayed in graphical user interfaces.

The comparison algorithm first of all peeks the device type of `a` and `b`, they will be sorted in the following order:

- Magnetic and opto-magnetic drives (ZIP, floppy)
- Optical drives (CD, DVD)
- External drives (USB sticks, music players)
- Mounted hard disks
- Other drives

Afterwards, the display name of `a` and `b` is compared using a locale-sensitive sorting algorithm.

If two drives have the same display name, their unique ID is compared which can be queried using `driveGetID`.

Drive Properties
driveGetActivationURI

:: DriveClass drive |
=> drive | `drive` - the drive object to query
-> IO String | the drive's activation URI
Returns the activation URI of `drive`. The returned URI usually refers to a valid location. You can check the validity of the location by calling System.Gnome.VFS.URI.uriFromString with the URI, and checking whether the return value is not `Nothing`.

driveGetDevicePath

:: DriveClass drive |
=> drive | `drive` - the drive object to query
-> IO (Maybe String) | the drive's device path
Returns the device path of a `Drive` object. For HAL drives, this returns the value of the drive's `block.device` key. For UNIX mounts, it returns the `mntent`'s `mnt_fsname` entry. Otherwise, it returns `Nothing`.

driveGetDeviceType

:: DriveClass drive |
=> drive | `drive` - the drive object to query
-> IO DeviceType | the drive's device type
Returns the `DeviceType` of a `Drive` object.

driveGetDisplayName

:: DriveClass drive |
=> drive | `drive` - the drive object to query
-> IO String | the drive's display name
Returns the display name of a `Drive` object.

driveGetHalUDI

:: DriveClass drive |
=> drive | `drive` - the drive object to query
-> IO (Maybe String) | the drive's HAL UDI
Returns the HAL UDI of a `Drive` object. For HAL drives, this matches the value of the `info.udi` key, for other drives it is `Nothing`.

driveGetIcon

:: DriveClass drive |
=> drive | `drive` - a drive object
-> IO FilePath | the icon that should be used for this drive
Returns the icon filename for a `Drive` object.

driveGetID

:: DriveClass drive |
=> drive | `drive` - a drive object
-> IO DriveID | a unique identifier for the drive
Returns a unique identifier for a `Drive` object.

Drive State
driveIsConnected

:: DriveClass drive |
=> drive | `drive` - a drive object
-> IO Bool | `True` if the drive is connected, `False` otherwise
Returns a `Bool` for whether a drive is connected.

driveIsMounted

:: DriveClass drive |
=> drive | `drive` - a drive object
-> IO Bool | `True` if the drive is mounted, `False` otherwise
Returns a `Bool` for whether a drive is mounted.

driveIsUserVisible

:: DriveClass drive |
=> drive | `drive` - a drive object
-> IO Bool | `True` if the drive is user-visible, `False` otherwise
Returns a `Bool` for whether a drive is user-visible. This should be used by applications to determine whether the drive should be listed in user interfaces listing available drives.

driveGetMountedVolumes

:: DriveClass drive |
=> drive | `drive` - a drive object
-> IO [Volume] | the `Volume`s currently mounted on the drive
Returns a list of mounted volumes for a `Drive` object.

Drive Operations
driveEject

:: DriveClass drive |
=> drive | `drive` - the drive to be ejected
-> VolumeOpSuccessCallback | `successCallback` - the action to be performed on successful ejection
-> VolumeOpFailureCallback | `failureCallback` - the action to be performed on failure
-> IO () |
If drive has associated `Volume` objects, all of them will be unmounted by calling System.Gnome.VFS.Volume.volumeUnmount for each volume in `driveGetMountedVolumes`, except for the last one, for which System.Gnome.VFS.Volume.volumeEject is called to ensure that the drive's media is ejected.

driveMount

:: DriveClass drive |
=> drive | `drive` - a drive object
-> VolumeOpSuccessCallback | `successCallback` - the action to be performed on successful mount
-> VolumeOpFailureCallback | `failureCallback` - the action to be performed on failure
-> IO () |
Mounts a `Drive` object.

Drive Signals
onDriveVolumeMounted

:: DriveClass drive |
=> drive | `drive` - the drive to connect the signal handler to
-> Volume -> IO () | `handler` - the signal handling function
-> IO (ConnectId drive) | the identifier for the connection

afterDriveVolumeMounted

:: DriveClass drive |
=> drive | `drive` - the drive to connect the signal handler to
-> Volume -> IO () | `handler` - the signal handling function
-> IO (ConnectId drive) | the identifier for the connection

onDriveVolumePreUnmount

:: DriveClass drive |
=> drive | `drive` - the drive to connect the signal handler to
-> Volume -> IO () | `handler` - the signal handling function
-> IO (ConnectId drive) | the identifier for the connection

afterDriveVolumePreUnmount

:: DriveClass drive |
=> drive | `drive` - the drive to connect the signal handler to
-> Volume -> IO () | `handler` - the signal handling function
-> IO (ConnectId drive) | the identifier for the connection

onDriveVolumeUnmounted

:: DriveClass drive |
=> drive | `drive` - the drive to connect the signal handler to
-> Volume -> IO () | `handler` - the signal handling function
-> IO (ConnectId drive) | the identifier for the connection

afterDriveVolumeUnmounted

:: DriveClass drive |
=> drive | `drive` - the drive to connect the signal handler to
-> Volume -> IO () | `handler` - the signal handling function
-> IO (ConnectId drive) | the identifier for the connection

Produced by Haddock version 2.4.2