logo top
Main Page   Widgets   glibmm Namespaces   Book  

Gio::VolumeMonitor Class Reference

Monitors a file or directory for changes. More...

Inheritance diagram for Gio::VolumeMonitor:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~VolumeMonitor ()
GVolumeMonitor* gobj ()
 Provides access to the underlying C GObject.
const GVolumeMonitor* gobj () const
 Provides access to the underlying C GObject.
GVolumeMonitor* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::ListHandle< Glib::RefPtr<
Drive > > 
get_connected_drives ()
 Gets a list of drives connected to the system.
Glib::ListHandle< Glib::RefPtr<
Volume > > 
get_volumes ()
 Gets a list of the volumes on the system.
Glib::ListHandle< Glib::RefPtr<
Mount > > 
get_mounts ()
 Gets a list of the mounts on the system.
Glib::RefPtr<Volumeget_volume_for_uuid (const std::string& uuid)
 Finds a G::Volume object by it's UUID (see g_volume_get_uuid()).
Glib::RefPtr<Mountget_mount_for_uuid (const std::string& uuid)
 Finds a G::Mount object by it's UUID (see g_mount_get_uuid()).

Static Public Member Functions

static Glib::RefPtr<VolumeMonitorget ()
 Gets the volume monitor used by gio.
static Glib::RefPtr<Volumeadopt_orphan_mount (const Glib::RefPtr<Mount>& mount)
 This function should be called by any G::VolumeMonitor implementation when a new G::Mount object is created that is not associated with a G::Volume object.

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gio::VolumeMonitorwrap (GVolumeMonitor* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Monitors a file or directory for changes.

TODO: Documentation: See http://bugzilla.gnome.org/show_bug.cgi?id=509994.

Since glibmm 2.16:


Constructor & Destructor Documentation

virtual Gio::VolumeMonitor::~VolumeMonitor (  )  [virtual]


Member Function Documentation

GVolumeMonitor* Gio::VolumeMonitor::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

const GVolumeMonitor* Gio::VolumeMonitor::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

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.

static Glib::RefPtr<VolumeMonitor> Gio::VolumeMonitor::get (  )  [static]

Gets the volume monitor used by gio.

Returns:
A reference to the G::VolumeMonitor used by gio. Call Glib::object_unref() when done with it.

Glib::ListHandle<Glib::RefPtr<Drive>> Gio::VolumeMonitor::get_connected_drives (  ) 

Gets a list of drives connected to the system.

Returns:
A G::List of connected G::Drives.

Glib::ListHandle<Glib::RefPtr<Volume>> Gio::VolumeMonitor::get_volumes (  ) 

Gets a list of the volumes on the system.

Returns:
A G::List of G::Volume.

Glib::ListHandle<Glib::RefPtr<Mount>> Gio::VolumeMonitor::get_mounts (  ) 

Gets a list of the mounts on the system.

Returns:
A G::List of G::Mount.

Glib::RefPtr<Volume> Gio::VolumeMonitor::get_volume_for_uuid ( const std::string uuid  ) 

Finds a G::Volume object by it's UUID (see g_volume_get_uuid()).

Parameters:
uuid The UUID to look for.
Returns:
A G::Volume or 0 if no such volume is available.

Glib::RefPtr<Mount> Gio::VolumeMonitor::get_mount_for_uuid ( const std::string uuid  ) 

Finds a G::Mount object by it's UUID (see g_mount_get_uuid()).

Parameters:
uuid The UUID to look for.
Returns:
A G::Mount or 0 if no such mount is available.

static Glib::RefPtr<Volume> Gio::VolumeMonitor::adopt_orphan_mount ( const Glib::RefPtr<Mount>&  mount  )  [static]

This function should be called by any G::VolumeMonitor implementation when a new G::Mount object is created that is not associated with a G::Volume object.

It must be called just before emitting the mount_added signal.

If the return value is not 0, the caller must associate the returned G::Volume object with the G::Mount. This involves returning it in it's g_mount_get_volume() implementation. The caller must also listen for the "removed" signal on the returned object and give up it's reference when handling that signal

Similary, if implementing g_volume_monitor_adopt_orphan_mount(), the implementor must take a reference to mount and return it in it's g_volume_get_mount() implemented. Also, the implementor must listen for the "unmounted" signal on mount and give up it's 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 it's own G::Mount object that needs to be assoicated with the G::Volume object that represents the volume.

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

Parameters:
mount A G::Mount object to find a parent for.
Returns:
The G::Volume object that is the parent for mount or 0 if no wants to adopt the G::Mount.


Friends And Related Function Documentation

Glib::RefPtr<Gio::VolumeMonitor> wrap ( GVolumeMonitor *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
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.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:

Generated for glibmm 2.4 by Doxygen 1.5.1 © 1997-2001