Portability | portable (depends on GHC) |
---|---|
Stability | alpha |
Maintainer | gtk2hs-devel@lists.sourceforge.net |
- 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.
class GObjectClass o => DriveClass o Source
data DeviceType Source
Type Conversion
castToDrive :: GObjectClass obj => obj -> DriveSource
Drive Comparison
:: DriveClass drive | |
=> drive |
|
-> 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
:: DriveClass drive | |
=> drive |
|
-> 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
.
:: DriveClass drive | |
=> drive |
|
-> IO (Maybe String) | the drive's device path |
:: DriveClass drive | |
=> drive |
|
-> IO DeviceType | the drive's device type |
Returns the DeviceType
of a Drive
object.
:: DriveClass drive | |
=> drive |
|
-> IO String | the drive's display name |
Returns the display name of a Drive
object.
:: DriveClass drive | |
=> drive |
|
-> IO (Maybe String) | the drive's HAL UDI |
:: DriveClass drive | |
=> drive |
|
-> IO FilePath | the icon that should be used for this drive |
Returns the icon filename for a Drive
object.
:: DriveClass drive | |
=> drive |
|
-> IO DriveID | a unique identifier for the drive |
Returns a unique identifier for a Drive
object.
Drive State
:: DriveClass drive | |
=> drive |
|
-> IO Bool |
Returns a Bool
for whether a drive is connected.
:: DriveClass drive | |
=> drive |
|
-> IO Bool |
Returns a Bool
for whether a drive is mounted.
:: DriveClass drive | |
=> drive |
|
-> 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.
:: DriveClass drive | |
=> drive |
|
-> IO [Volume] | the |
Returns a list of mounted volumes for a Drive
object.
Drive Operations
:: DriveClass drive | |
=> drive |
|
-> VolumeOpSuccessCallback |
|
-> 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.
:: DriveClass drive | |
=> drive |
|
-> VolumeOpSuccessCallback |
|
-> VolumeOpFailureCallback |
|
-> IO () |
Mounts a Drive
object.