Gtk2HsContentsIndex
System.Gnome.VFS.Drive
Maintainergtk2hs-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 Volumes.
data Drive
class GObjectClass o => DriveClass o
type DriveID = CULong
Identifies a Drive
data DeviceType
Identifies the device type of a Volume or Drive.
Type Conversion
castToDrive :: GObjectClass obj => obj -> Drive
Drive Comparison
driveCompare
:: DriveClass drive
=> driveb - the second drive
-> drivethe ordering relationship between the drives
-> IO Ordering

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
=> drivethe drive's activation URI
-> IO String

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
=> drivethe drive's device path
-> IO (Maybe String)

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
=> drivethe drive's device type
-> IO DeviceType
Returns the DeviceType of a Drive object.
driveGetDisplayName
:: DriveClass drive
=> drivethe drive's display name
-> IO String
Returns the display name of a Drive object.
driveGetHalUDI
:: DriveClass drive
=> drivethe drive's HAL UDI
-> IO (Maybe String)

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
=> drivethe icon that should be used for this drive
-> IO FilePath
Returns the icon filename for a Drive object.
driveGetID
:: DriveClass drive
=> drivea unique identifier for the drive
-> IO DriveID
Returns a unique identifier for a Drive object.
Drive State
driveIsConnected
:: DriveClass drive
=> driveTrue if the drive is connected, False otherwise
-> IO Bool
Returns a Bool for whether a drive is connected.
driveIsMounted
:: DriveClass drive
=> driveTrue if the drive is mounted, False otherwise
-> IO Bool
Returns a Bool for whether a drive is mounted.
driveIsUserVisible
:: DriveClass drive
=> driveTrue if the drive is user-visible, False otherwise
-> IO Bool
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
=> drivethe Volumes currently mounted on the drive
-> IO [Volume]
Returns a list of mounted volumes for a Drive object.
Drive Operations
driveEject
:: DriveClass drive
=> drivesuccessCallback - the action to be performed on successful ejection
-> VolumeOpSuccessCallbackfailureCallback - the action to be performed on failure
-> VolumeOpFailureCallback
-> 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
=> drivesuccessCallback - the action to be performed on successful mount
-> VolumeOpSuccessCallbackfailureCallback - the action to be performed on failure
-> VolumeOpFailureCallback
-> IO ()
Mounts a Drive object.
Drive Signals
onDriveVolumeMounted
:: DriveClass drive
=> drivehandler - the signal handling function
-> Volume -> IO ()the identifier for the connection
-> IO (ConnectId drive)
afterDriveVolumeMounted
:: DriveClass drive
=> drivehandler - the signal handling function
-> Volume -> IO ()the identifier for the connection
-> IO (ConnectId drive)
onDriveVolumePreUnmount
:: DriveClass drive
=> drivehandler - the signal handling function
-> Volume -> IO ()the identifier for the connection
-> IO (ConnectId drive)
afterDriveVolumePreUnmount
:: DriveClass drive
=> drivehandler - the signal handling function
-> Volume -> IO ()the identifier for the connection
-> IO (ConnectId drive)
onDriveVolumeUnmounted
:: DriveClass drive
=> drivehandler - the signal handling function
-> Volume -> IO ()the identifier for the connection
-> IO (ConnectId drive)
afterDriveVolumeUnmounted
:: DriveClass drive
=> drivehandler - the signal handling function
-> Volume -> IO ()the identifier for the connection
-> IO (ConnectId drive)
Produced by Haddock version 2.6.0