glibmm 2.66.5
|
Monitors a file or directory for changes. More...
#include <giomm/volumemonitor.h>
Public Member Functions | |
VolumeMonitor (VolumeMonitor && src) noexcept | |
VolumeMonitor & | operator= (VolumeMonitor && src) noexcept |
~VolumeMonitor () noexcept override | |
GVolumeMonitor * | gobj () |
Provides access to the underlying C GObject. More... | |
const GVolumeMonitor * | gobj () const |
Provides access to the underlying C GObject. More... | |
GVolumeMonitor * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
Glib::ListHandle< Glib::RefPtr< Drive > > | get_connected_drives () |
Gets a list of drives connected to the system. More... | |
Glib::ListHandle< Glib::RefPtr< Volume > > | get_volumes () |
Gets a list of the volumes on the system. More... | |
Glib::ListHandle< Glib::RefPtr< Mount > > | get_mounts () |
Gets a list of the mounts on the system. More... | |
Glib::RefPtr< Volume > | get_volume_for_uuid (const std::string & uuid) |
Finds a Volume object by its UUID (see g_volume_get_uuid()) More... | |
Glib::RefPtr< Mount > | get_mount_for_uuid (const std::string & uuid) |
Finds a Mount object by its UUID (see g_mount_get_uuid()) More... | |
Glib::SignalProxy< void, const Glib::RefPtr< Volume > & > | signal_volume_added () |
Glib::SignalProxy< void, const Glib::RefPtr< Volume > & > | signal_volume_removed () |
Glib::SignalProxy< void, const Glib::RefPtr< Volume > & > | signal_volume_changed () |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > | signal_mount_added () |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > | signal_mount_removed () |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > | signal_mount_pre_unmount () |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > | signal_mount_changed () |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > | signal_drive_connected () |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > | signal_drive_disconnected () |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > | signal_drive_changed () |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > | signal_drive_eject_button () |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > | signal_drive_stop_button () |
Public Member Functions inherited from Glib::Object | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object && src) noexcept | |
Object & | operator= (Object && src) noexcept |
void * | get_data (const QueryQuark & key) |
void | set_data (const Quark & key, void *data) |
void | set_data (const Quark & key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark & quark) |
void * | steal_data (const QueryQuark & quark) |
Public Member Functions inherited from Glib::ObjectBase | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value) |
You probably want to use a specific property_*() accessor method instead. More... | |
void | get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
void | set_property (const Glib::ustring & property_name, const PropertyType & value) |
You probably want to use a specific property_*() accessor method instead. More... | |
template<class PropertyType > | |
void | get_property (const Glib::ustring & property_name, PropertyType & value) const |
You probably want to use a specific property_*() accessor method instead. More... | |
void | connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void > & slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
void | connect_property_changed (const Glib::ustring & property_name, sigc::slot< void > && slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
sigc::connection | connect_property_changed_with_return (const Glib::ustring & property_name, const sigc::slot< void > & slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
sigc::connection | connect_property_changed_with_return (const Glib::ustring & property_name, sigc::slot< void > && slot) |
You can use the signal_changed() signal of the property proxy instead. More... | |
void | freeze_notify () |
Increases the freeze count on object. More... | |
void | thaw_notify () |
Reverts the effect of a previous call to freeze_notify(). More... | |
virtual void | reference () const |
Increment the reference count for this object. More... | |
virtual void | unreference () const |
Decrement the reference count for this object. More... | |
GObject * | gobj () |
Provides access to the underlying C GObject. More... | |
const GObject * | gobj () const |
Provides access to the underlying C GObject. More... | |
GObject * | gobj_copy () const |
Give a ref-ed copy to someone. Use for direct struct access. More... | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< VolumeMonitor > | get () |
Gets the volume monitor used by gio. More... | |
static Glib::RefPtr< Volume > | adopt_orphan_mount (const Glib::RefPtr< Mount > & mount) |
This function should be called by any VolumeMonitor implementation when a new Mount object is created that is not associated with a Volume object. More... | |
Protected Member Functions | |
virtual void | on_volume_added (const Glib::RefPtr< Volume > & volume) |
This is a default handler for the signal signal_volume_added(). More... | |
virtual void | on_volume_removed (const Glib::RefPtr< Volume > & volume) |
This is a default handler for the signal signal_volume_removed(). More... | |
virtual void | on_volume_changed (const Glib::RefPtr< Volume > & volume) |
This is a default handler for the signal signal_volume_changed(). More... | |
virtual void | on_mount_added (const Glib::RefPtr< Mount > & mount) |
This is a default handler for the signal signal_mount_added(). More... | |
virtual void | on_mount_removed (const Glib::RefPtr< Mount > & mount) |
This is a default handler for the signal signal_mount_removed(). More... | |
virtual void | on_mount_pre_unmount (const Glib::RefPtr< Mount > & mount) |
This is a default handler for the signal signal_mount_pre_unmount(). More... | |
virtual void | on_mount_changed (const Glib::RefPtr< Mount > & mount) |
This is a default handler for the signal signal_mount_changed(). More... | |
virtual void | on_drive_connected (const Glib::RefPtr< Drive > & drive) |
This is a default handler for the signal signal_drive_connected(). More... | |
virtual void | on_drive_disconnected (const Glib::RefPtr< Drive > & drive) |
This is a default handler for the signal signal_drive_disconnected(). More... | |
virtual void | on_drive_changed (const Glib::RefPtr< Drive > & drive) |
This is a default handler for the signal signal_drive_changed(). More... | |
Protected Member Functions inherited from Glib::Object | |
Object () | |
Object (const Glib::ConstructParams & construct_params) | |
Object (GObject * castitem) | |
~Object () noexcept override | |
Protected Member Functions inherited from Glib::ObjectBase | |
ObjectBase () | |
This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More... | |
ObjectBase (const char * custom_type_name) | |
A derived constructor always overrides this choice. More... | |
ObjectBase (const std::type_info & custom_type_info) | |
This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More... | |
ObjectBase (ObjectBase && src) noexcept | |
ObjectBase & | operator= (ObjectBase && src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject * castitem) |
void | initialize_move (GObject * castitem, Glib::ObjectBase * previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gio::VolumeMonitor > | wrap (GVolumeMonitor * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Related Functions inherited from Glib::Object | |
Glib::RefPtr< Glib::Object > | wrap (GObject * object, bool take_copy=false) |
Additional Inherited Members | |
Public Types inherited from Glib::Object | |
using | DestroyNotify = void(*)(gpointer data) |
Monitors a file or directory for changes.
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.
|
noexcept |
|
overridenoexcept |
|
static |
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 mount_added signal.
If the return value is not nullptr
, the caller must associate the returned Volume object with the Mount. This involves returning it in its g_mount_get_volume() 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 g_volume_monitor_adopt_orphan_mount(), the implementor must take a reference to mount and return it in its g_volume_get_mount() 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.
Deprecated: 2.20: Instead of using this function, VolumeMonitor implementations should instead create shadow mounts with the URI of the mount they intend to adopt. See the proxy volume monitor in gvfs for an example of this. Also see g_mount_is_shadowed(), g_mount_shadow() and g_mount_unshadow() functions.
mount | A Mount object to find a parent for. |
|
static |
Gets the volume monitor used by gio.
Glib::ListHandle< Glib::RefPtr< Drive > > Gio::VolumeMonitor::get_connected_drives | ( | ) |
Gets a list of drives connected to the system.
Glib::RefPtr< Mount > Gio::VolumeMonitor::get_mount_for_uuid | ( | const std::string & | uuid | ) |
Glib::ListHandle< Glib::RefPtr< Mount > > Gio::VolumeMonitor::get_mounts | ( | ) |
Gets a list of the mounts on the system.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Glib::RefPtr< Volume > Gio::VolumeMonitor::get_volume_for_uuid | ( | const std::string & | uuid | ) |
Glib::ListHandle< Glib::RefPtr< Volume > > Gio::VolumeMonitor::get_volumes | ( | ) |
Gets a list of the volumes on the system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GVolumeMonitor * Gio::VolumeMonitor::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
protectedvirtual |
This is a default handler for the signal signal_drive_changed().
|
protectedvirtual |
This is a default handler for the signal signal_drive_connected().
|
protectedvirtual |
This is a default handler for the signal signal_drive_disconnected().
|
protectedvirtual |
This is a default handler for the signal signal_mount_added().
|
protectedvirtual |
This is a default handler for the signal signal_mount_changed().
|
protectedvirtual |
This is a default handler for the signal signal_mount_pre_unmount().
|
protectedvirtual |
This is a default handler for the signal signal_mount_removed().
|
protectedvirtual |
This is a default handler for the signal signal_volume_added().
|
protectedvirtual |
This is a default handler for the signal signal_volume_changed().
|
protectedvirtual |
This is a default handler for the signal signal_volume_removed().
|
noexcept |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > Gio::VolumeMonitor::signal_drive_changed | ( | ) |
void on_my_drive_changed(const Glib::RefPtr<Drive>& drive)
Flags: Run Last
Emitted when a drive changes.
drive | The drive that changed. |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > Gio::VolumeMonitor::signal_drive_connected | ( | ) |
void on_my_drive_connected(const Glib::RefPtr<Drive>& drive)
Flags: Run Last
Emitted when a drive is connected to the system.
drive | A Drive that was connected. |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > Gio::VolumeMonitor::signal_drive_disconnected | ( | ) |
void on_my_drive_disconnected(const Glib::RefPtr<Drive>& drive)
Flags: Run Last
Emitted when a drive is disconnected from the system.
drive | A Drive that was disconnected. |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > Gio::VolumeMonitor::signal_drive_eject_button | ( | ) |
void on_my_drive_eject_button(const Glib::RefPtr<Drive>& drive)
Flags: Run Last
Emitted when the eject button is pressed on drive.
drive | The drive where the eject button was pressed. |
Glib::SignalProxy< void, const Glib::RefPtr< Drive > & > Gio::VolumeMonitor::signal_drive_stop_button | ( | ) |
void on_my_drive_stop_button(const Glib::RefPtr<Drive>& drive)
Flags: Run Last
Emitted when the stop button is pressed on drive.
drive | The drive where the stop button was pressed. |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > Gio::VolumeMonitor::signal_mount_added | ( | ) |
void on_my_mount_added(const Glib::RefPtr<Mount>& mount)
Flags: Run Last
Emitted when a mount is added.
mount | A Mount that was added. |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > Gio::VolumeMonitor::signal_mount_changed | ( | ) |
void on_my_mount_changed(const Glib::RefPtr<Mount>& mount)
Flags: Run Last
Emitted when a mount changes.
mount | A Mount that changed. |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > Gio::VolumeMonitor::signal_mount_pre_unmount | ( | ) |
void on_my_mount_pre_unmount(const Glib::RefPtr<Mount>& mount)
Flags: Run Last
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.
mount | A Mount that is being unmounted. |
Glib::SignalProxy< void, const Glib::RefPtr< Mount > & > Gio::VolumeMonitor::signal_mount_removed | ( | ) |
void on_my_mount_removed(const Glib::RefPtr<Mount>& mount)
Flags: Run Last
Emitted when a mount is removed.
mount | A Mount that was removed. |
Glib::SignalProxy< void, const Glib::RefPtr< Volume > & > Gio::VolumeMonitor::signal_volume_added | ( | ) |
void on_my_volume_added(const Glib::RefPtr<Volume>& volume)
Flags: Run Last
Emitted when a mountable volume is added to the system.
volume | A Volume that was added. |
Glib::SignalProxy< void, const Glib::RefPtr< Volume > & > Gio::VolumeMonitor::signal_volume_changed | ( | ) |
void on_my_volume_changed(const Glib::RefPtr<Volume>& volume)
Flags: Run Last
Emitted when mountable volume is changed.
volume | A Volume that changed. |
Glib::SignalProxy< void, const Glib::RefPtr< Volume > & > Gio::VolumeMonitor::signal_volume_removed | ( | ) |
void on_my_volume_removed(const Glib::RefPtr<Volume>& volume)
Flags: Run Last
Emitted when a mountable volume is removed from the system.
volume | A Volume that was removed. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |