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
show/hide Instances
class GObjectClass o => DriveClass o
show/hide Instances
type DriveID = CULong
Identifies a Drive
data DeviceType
Identifies the device type of a Volume or Drive.
show/hide Instances
Type Conversion
castToDrive :: GObjectClass obj => obj -> Drive
Drive Comparison
driveCompare
:: DriveClass drive
=> drivea - the first drive
-> driveb - the second drive
-> IO Orderingthe 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
=> drivedrive - the drive object to query
-> IO Stringthe 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 uriFromString with the URI, and checking whether the return value is not Nothing.

driveGetDevicePath
:: DriveClass drive
=> drivedrive - 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
=> drivedrive - the drive object to query
-> IO DeviceTypethe drive's device type
Returns the DeviceType of a Drive object.
driveGetDisplayName
:: DriveClass drive
=> drivedrive - the drive object to query
-> IO Stringthe drive's display name
Returns the display name of a Drive object.
driveGetHalUDI
:: DriveClass drive
=> drivedrive - 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
=> drivedrive - a drive object
-> IO FilePaththe icon that should be used for this drive
Returns the icon filename for a Drive object.
driveGetID
:: DriveClass drive
=> drivedrive - a drive object
-> IO DriveIDa unique identifier for the drive
Returns a unique identifier for a Drive object.
Drive State
driveIsConnected
:: DriveClass drive
=> drivedrive - a drive object
-> IO BoolTrue if the drive is connected, False otherwise
Returns a Bool for whether a drive is connected.
driveIsMounted
:: DriveClass drive
=> drivedrive - a drive object
-> IO BoolTrue if the drive is mounted, False otherwise
Returns a Bool for whether a drive is mounted.
driveIsUserVisible
:: DriveClass drive
=> drivedrive - a drive object
-> IO BoolTrue 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
=> drivedrive - a drive object
-> IO [Volume]the Volumes currently mounted on the drive
Returns a list of mounted volumes for a Drive object.
Drive Operations
driveEject
:: DriveClass drive
=> drivedrive - the drive to be ejected
-> VolumeOpSuccessCallbacksuccessCallback - the action to be performed on successful ejection
-> VolumeOpFailureCallbackfailureCallback - the action to be performed on failure
-> IO ()
If drive has associated Volume objects, all of them will be unmounted by calling volumeUnmount for each volume in driveGetMountedVolumes, except for the last one, for which volumeEject is called to ensure that the drive's media is ejected.
driveMount
:: DriveClass drive
=> drivedrive - a drive object
-> VolumeOpSuccessCallbacksuccessCallback - the action to be performed on successful mount
-> VolumeOpFailureCallbackfailureCallback - the action to be performed on failure
-> IO ()
Mounts a Drive object.
Drive Signals
onDriveVolumeMounted
:: DriveClass drive
=> drivedrive - 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
=> drivedrive - 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
=> drivedrive - 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
=> drivedrive - 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
=> drivedrive - 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
=> drivedrive - 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 0.8