gi-gio-2.0.14: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.VolumeMonitor

Contents

Description

VolumeMonitor is for listing the user interesting devices and volumes on the computer. In other words, what a file selector or file manager would show in a sidebar.

VolumeMonitor is not [thread-default-context aware][g-main-context-push-thread-default], and so should not be used other than from the main thread, with no thread-default-context active.

Synopsis

Exported types

Methods

adoptOrphanMount

volumeMonitorAdoptOrphanMount Source #

Arguments

:: (HasCallStack, MonadIO m, IsMount a) 
=> a

mount: a Mount object to find a parent for

-> m Volume

Returns: the Volume object that is the parent for mount or Nothing if no wants to adopt the Mount.

Deprecated: (Since version 2.20)Instead of using this function, VolumeMonitorimplementations should instead create shadow mounts with the URI ofthe mount they intend to adopt. See the proxy volume monitor ingvfs for an example of this. Also see mountIsShadowed,mountShadow and mountUnshadow functions.

This function should be called by any VolumeMonitor implementation when a new Mount object is created that is not associated with a Volume object. It must be called just before emitting the mountAdded signal.

If the return value is not Nothing, the caller must associate the returned Volume object with the Mount. This involves returning it in its mountGetVolume implementation. The caller must also listen for the "removed" signal on the returned object and give up its reference when handling that signal

Similary, if implementing volumeMonitorAdoptOrphanMount, the implementor must take a reference to mount and return it in its volumeGetMount implemented. Also, the implementor must listen for the "unmounted" signal on mount and give up its reference upon handling that signal.

There are two main use cases for this function.

One is when implementing a user space file system driver that reads blocks of a block device that is already represented by the native volume monitor (for example a CD Audio file system driver). Such a driver will generate its own Mount object that needs to be associated with the Volume object that represents the volume.

The other is for implementing a VolumeMonitor whose sole purpose is to return Volume objects representing entries in the users "favorite servers" list or similar.

get

volumeMonitorGet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m VolumeMonitor

Returns: a reference to the VolumeMonitor used by gio. Call objectUnref when done with it.

Gets the volume monitor used by gio.

getConnectedDrives

volumeMonitorGetConnectedDrives Source #

Arguments

:: (HasCallStack, MonadIO m, IsVolumeMonitor a) 
=> a

volumeMonitor: a VolumeMonitor.

-> m [Drive]

Returns: a List of connected Drive objects.

Gets a list of drives connected to the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with objectUnref.

getMountForUuid

volumeMonitorGetMountForUuid Source #

Arguments

:: (HasCallStack, MonadIO m, IsVolumeMonitor a) 
=> a

volumeMonitor: a VolumeMonitor.

-> Text

uuid: the UUID to look for

-> m Mount

Returns: a Mount or Nothing if no such mount is available. Free the returned object with objectUnref.

Finds a Mount object by its UUID (see mountGetUuid)

getMounts

volumeMonitorGetMounts Source #

Arguments

:: (HasCallStack, MonadIO m, IsVolumeMonitor a) 
=> a

volumeMonitor: a VolumeMonitor.

-> m [Mount]

Returns: a List of Mount objects.

Gets a list of the mounts on the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with objectUnref.

getVolumeForUuid

volumeMonitorGetVolumeForUuid Source #

Arguments

:: (HasCallStack, MonadIO m, IsVolumeMonitor a) 
=> a

volumeMonitor: a VolumeMonitor.

-> Text

uuid: the UUID to look for

-> m Volume

Returns: a Volume or Nothing if no such volume is available. Free the returned object with objectUnref.

Finds a Volume object by its UUID (see volumeGetUuid)

getVolumes

volumeMonitorGetVolumes Source #

Arguments

:: (HasCallStack, MonadIO m, IsVolumeMonitor a) 
=> a

volumeMonitor: a VolumeMonitor.

-> m [Volume]

Returns: a List of Volume objects.

Gets a list of the volumes on the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with objectUnref.

Signals

driveChanged

driveConnected

driveDisconnected

driveEjectButton

driveStopButton

mountAdded

mountChanged

mountPreUnmount

mountRemoved

volumeAdded

volumeChanged

volumeRemoved