gi-gio-2.0.25: Gio bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.VolumeMonitor

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.

In order to receive updates about volumes and mounts monitored through GVFS, a main loop must be running.

Synopsis

Exported types

newtype VolumeMonitor Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf VolumeMonitor o) => IsVolumeMonitor o Source #

Type class for types which can be safely cast to VolumeMonitor, for instance with toVolumeMonitor.

Instances

Instances details
(GObject o, IsDescendantOf VolumeMonitor o) => IsVolumeMonitor o Source # 
Instance details

Defined in GI.Gio.Objects.VolumeMonitor

toVolumeMonitor :: (MonadIO m, IsVolumeMonitor o) => o -> m VolumeMonitor Source #

Cast to VolumeMonitor, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded 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

Similarly, 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

type C_VolumeMonitorDriveChangedCallback = Ptr () -> Ptr Drive -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorDriveChangedCallback Source #

Arguments

 = Drive

drive: the drive that changed

-> IO () 

Emitted when a drive changes.

afterVolumeMonitorDriveChanged :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #driveChanged callback

onVolumeMonitorDriveChanged :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #driveChanged callback

driveConnected

type C_VolumeMonitorDriveConnectedCallback = Ptr () -> Ptr Drive -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorDriveConnectedCallback Source #

Arguments

 = Drive

drive: a Drive that was connected.

-> IO () 

Emitted when a drive is connected to the system.

afterVolumeMonitorDriveConnected :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveConnectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveConnected signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #driveConnected callback

onVolumeMonitorDriveConnected :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveConnectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveConnected signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #driveConnected callback

driveDisconnected

type C_VolumeMonitorDriveDisconnectedCallback = Ptr () -> Ptr Drive -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorDriveDisconnectedCallback Source #

Arguments

 = Drive

drive: a Drive that was disconnected.

-> IO () 

Emitted when a drive is disconnected from the system.

afterVolumeMonitorDriveDisconnected :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveDisconnectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveDisconnected signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #driveDisconnected callback

onVolumeMonitorDriveDisconnected :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveDisconnectedCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveDisconnected signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #driveDisconnected callback

driveEjectButton

type C_VolumeMonitorDriveEjectButtonCallback = Ptr () -> Ptr Drive -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorDriveEjectButtonCallback Source #

Arguments

 = Drive

drive: the drive where the eject button was pressed

-> IO () 

Emitted when the eject button is pressed on drive.

Since: 2.18

afterVolumeMonitorDriveEjectButton :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveEjectButtonCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveEjectButton signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #driveEjectButton callback

onVolumeMonitorDriveEjectButton :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveEjectButtonCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveEjectButton signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #driveEjectButton callback

driveStopButton

type C_VolumeMonitorDriveStopButtonCallback = Ptr () -> Ptr Drive -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorDriveStopButtonCallback Source #

Arguments

 = Drive

drive: the drive where the stop button was pressed

-> IO () 

Emitted when the stop button is pressed on drive.

Since: 2.22

afterVolumeMonitorDriveStopButton :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveStopButtonCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveStopButton signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #driveStopButton callback

onVolumeMonitorDriveStopButton :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorDriveStopButtonCallback -> m SignalHandlerId Source #

Connect a signal handler for the driveStopButton signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #driveStopButton callback

mountAdded

type C_VolumeMonitorMountAddedCallback = Ptr () -> Ptr Mount -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorMountAddedCallback Source #

Arguments

 = Mount

mount: a Mount that was added.

-> IO () 

Emitted when a mount is added.

afterVolumeMonitorMountAdded :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #mountAdded callback

onVolumeMonitorMountAdded :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #mountAdded callback

mountChanged

type C_VolumeMonitorMountChangedCallback = Ptr () -> Ptr Mount -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorMountChangedCallback Source #

Arguments

 = Mount

mount: a Mount that changed.

-> IO () 

Emitted when a mount changes.

afterVolumeMonitorMountChanged :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #mountChanged callback

onVolumeMonitorMountChanged :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #mountChanged callback

mountPreUnmount

type C_VolumeMonitorMountPreUnmountCallback = Ptr () -> Ptr Mount -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorMountPreUnmountCallback Source #

Arguments

 = Mount

mount: a Mount that is being unmounted.

-> IO () 

May be emitted when a mount is about to be removed.

This signal depends on the backend and is only emitted if GIO was used to unmount.

afterVolumeMonitorMountPreUnmount :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountPreUnmountCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountPreUnmount signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #mountPreUnmount callback

onVolumeMonitorMountPreUnmount :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountPreUnmountCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountPreUnmount signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #mountPreUnmount callback

mountRemoved

type C_VolumeMonitorMountRemovedCallback = Ptr () -> Ptr Mount -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorMountRemovedCallback Source #

Arguments

 = Mount

mount: a Mount that was removed.

-> IO () 

Emitted when a mount is removed.

afterVolumeMonitorMountRemoved :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #mountRemoved callback

onVolumeMonitorMountRemoved :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorMountRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the mountRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #mountRemoved callback

volumeAdded

type C_VolumeMonitorVolumeAddedCallback = Ptr () -> Ptr Volume -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorVolumeAddedCallback Source #

Arguments

 = Volume

volume: a Volume that was added.

-> IO () 

Emitted when a mountable volume is added to the system.

afterVolumeMonitorVolumeAdded :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorVolumeAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the volumeAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #volumeAdded callback

onVolumeMonitorVolumeAdded :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorVolumeAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the volumeAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #volumeAdded callback

volumeChanged

type C_VolumeMonitorVolumeChangedCallback = Ptr () -> Ptr Volume -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorVolumeChangedCallback Source #

Arguments

 = Volume

volume: a Volume that changed.

-> IO () 

Emitted when mountable volume is changed.

afterVolumeMonitorVolumeChanged :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorVolumeChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the volumeChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #volumeChanged callback

onVolumeMonitorVolumeChanged :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorVolumeChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the volumeChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #volumeChanged callback

volumeRemoved

type C_VolumeMonitorVolumeRemovedCallback = Ptr () -> Ptr Volume -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VolumeMonitorVolumeRemovedCallback Source #

Arguments

 = Volume

volume: a Volume that was removed.

-> IO () 

Emitted when a mountable volume is removed from the system.

afterVolumeMonitorVolumeRemoved :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorVolumeRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the volumeRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after volumeMonitor #volumeRemoved callback

onVolumeMonitorVolumeRemoved :: (IsVolumeMonitor a, MonadIO m) => a -> VolumeMonitorVolumeRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the volumeRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on volumeMonitor #volumeRemoved callback