## ThunarVfsVolumeManager

ThunarVfsVolumeManager

## Synopsis

    #include <thunar-vfs/thunar-vfs.h>

                        ThunarVfsVolumeManager;
    ThunarVfsVolumeManager* thunar_vfs_volume_manager_get_default
                                                            (void);
    ThunarVfsVolume*    thunar_vfs_volume_manager_get_volume_by_info
                                                            (ThunarVfsVolumeManager *manager,
                                                             const ThunarVfsInfo *info);
    GList*              thunar_vfs_volume_manager_get_volumes
                                                            (ThunarVfsVolumeManager *manager);

## Object Hierarchy

      GObject
       +----ThunarVfsVolumeManager

## Signals

      "volume-mounted"                                 : Run Last
      "volume-pre-unmount"                             : Run Last
      "volume-unmounted"                               : Run Last
      "volumes-added"                                  : Run Last
      "volumes-removed"                                : Run Last

## Description

## Details

### ThunarVfsVolumeManager

    typedef struct {
      /* the list of available volumes */
      GList  *volumes;
    } ThunarVfsVolumeManager;

### thunar_vfs_volume_manager_get_default ()

    ThunarVfsVolumeManager* thunar_vfs_volume_manager_get_default
                                                            (void);

Returns the default, shared ThunarVfsVolumeManager instance for this system. This function automatically determines, which implementation of ThunarVfsVolumeManager should be used for the target system and returns an instance of that class, which is shared among all modules using the volume manager facility.

Call `g_object_unref()` on the returned object when you are done with it.

Returns : | the shared ThunarVfsVolumeManager instance.

### thunar_vfs_volume_manager_get_volume_by_info ()

    ThunarVfsVolume*    thunar_vfs_volume_manager_get_volume_by_info
                                                            (ThunarVfsVolumeManager *manager,
                                                             const ThunarVfsInfo *info);

Tries to lookup the ThunarVfsVolume on which `info` is located. If `manager` doesn't know a ThunarVfsVolume for `info`, `NULL` will be returned.

The returned ThunarVfsVolume (if any) is owned by `manager` and must not be freed by the caller.

`manager` : | a ThunarVfsVolumeManager instance.
`info` : | a ThunarVfsInfo.
Returns : | the ThunarVfsVolume, on which `info` is located or `NULL`.

### thunar_vfs_volume_manager_get_volumes ()

    GList*              thunar_vfs_volume_manager_get_volumes
                                                            (ThunarVfsVolumeManager *manager);

Returns all ThunarVfsVolumes currently known for `manager`. The returned list is owned by `manager` and should therefore considered constant in the caller.

`manager` : | a ThunarVfsVolumeManager instance.
Returns : | the list of volumes known for `manager`.

## Signal Details

### The `"volume-mounted"` signal

    void                user_function                      (ThunarVfsVolumeManager *manager,
                                                            ThunarVfsVolume        *volume,
                                                            gpointer                user_data)      : Run Last

Emitted by `manager` right after the `volume` was successfully mounted.

`manager` : | a ThunarVfsVolumeManager instance.
`volume` : | a ThunarVfsVolume instance.
`user_data` : | user data set when the signal handler was connected.

### The `"volume-pre-unmount"` signal

    void                user_function                      (ThunarVfsVolumeManager *manager,
                                                            ThunarVfsVolume        *volume,
                                                            gpointer                user_data)      : Run Last

Emitted by `manager` right before an attempt is made to unmount `volume`. Applications can connect to this signal to perform cleanups, like changing to a different folder if a folder on the `volume` is currently displayed.

`manager` : | a ThunarVfsVolumeManager instance.
`volume` : | a ThunarVfsVolume instance.
`user_data` : | user data set when the signal handler was connected.

### The `"volume-unmounted"` signal

    void                user_function                      (ThunarVfsVolumeManager *manager,
                                                            ThunarVfsVolume        *volume,
                                                            gpointer                user_data)      : Run Last

Emitted by `manager` right after the `volume` was successfully unmounted.

`manager` : | a ThunarVfsVolumeManager instance.
`volume` : | a ThunarVfsVolume instance.
`user_data` : | user data set when the signal handler was connected.

### The `"volumes-added"` signal

    void                user_function                      (ThunarVfsVolumeManager *manager,
                                                            gpointer                volumes,
                                                            gpointer                user_data)      : Run Last

Invoked by the `manager` whenever new volumes have been attached to the system or the administrator changes the /etc/fstab file, or some other condition, depending on the manager implementation.

Note that the implementation should not invoke this method when a volume is mounted, as that's a completely different condition!

`manager` : | a ThunarVfsVolumeManager instance.
`volumes` : | a list of ThunarVfsVolumes.
`user_data` : | user data set when the signal handler was connected.

### The `"volumes-removed"` signal

    void                user_function                      (ThunarVfsVolumeManager *manager,
                                                            gpointer                volumes,
                                                            gpointer                user_data)      : Run Last

Invoked whenever the `manager` notices that `volumes` have been detached from the system.

`manager` : | a ThunarVfsVolumeManager instance.
`volumes` : | a list of ThunarVfsVolumes.
`user_data` : | user data set when the signal handler was connected.