1 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 /* Copyright (C) 2007 The gtkmm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <giomm/drive.h>
21 #include <giomm/volume.h>
22 #include <giomm/mount.h>
25 _PINCLUDE(glibmm/private/object_p.h)
30 /** Monitors a file or directory for changes.
31 * VolumeMonitor is for listing the user-interesting devices and volumes on the
32 * computer. In other words, what a file selector or file manager would show in
37 class VolumeMonitor : public Glib::Object
39 _CLASS_GOBJECT(VolumeMonitor, GVolumeMonitor, G_VOLUME_MONITOR, Glib::Object, GObject)
44 _WRAP_METHOD(static Glib::RefPtr<VolumeMonitor> get(), g_volume_monitor_get)
46 #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Drive> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
47 _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Drive> > get_connected_drives(), g_volume_monitor_get_connected_drives)
49 #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Volume> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
50 _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Volume> > get_volumes(), g_volume_monitor_get_volumes)
52 #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Mount> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
53 _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Mount> > get_mounts(), g_volume_monitor_get_mounts)
55 _WRAP_METHOD(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), g_volume_monitor_get_volume_for_uuid, refreturn)
56 _WRAP_METHOD(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), g_volume_monitor_get_mount_for_uuid, refreturn)
58 _WRAP_METHOD(static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount), g_volume_monitor_adopt_orphan_mount)
60 #m4 _CONVERSION(`GVolume*',`const Glib::RefPtr<Volume>&',`Glib::wrap($3, true)')
61 _WRAP_SIGNAL(void volume_added(const Glib::RefPtr<Volume>& volume), volume_added)
62 _WRAP_SIGNAL(void volume_removed(const Glib::RefPtr<Volume>& volume), volume_removed)
63 _WRAP_SIGNAL(void volume_changed(const Glib::RefPtr<Volume>& volume), volume_changed)
65 #m4 _CONVERSION(`GMount*',`const Glib::RefPtr<Mount>&',`Glib::wrap($3, true)')
66 _WRAP_SIGNAL(void mount_added(const Glib::RefPtr<Mount>& mount), mount_added)
67 _WRAP_SIGNAL(void mount_removed(const Glib::RefPtr<Mount>& mount), mount_removed)
68 _WRAP_SIGNAL(void mount_pre_unmount(const Glib::RefPtr<Mount>& mount), mount_pre_unmount)
69 _WRAP_SIGNAL(void mount_changed(const Glib::RefPtr<Mount>& mount), mount_changed)
71 #m4 _CONVERSION(`GDrive*',`const Glib::RefPtr<Drive>&',`Glib::wrap($3, true)')
72 _WRAP_SIGNAL(void drive_connected(const Glib::RefPtr<Drive>& drive), drive_connected)
73 _WRAP_SIGNAL(void drive_disconnected(const Glib::RefPtr<Drive>& drive), drive_disconnected)
74 _WRAP_SIGNAL(void drive_changed(const Glib::RefPtr<Drive>& drive), drive_changed)
76 //TODO: Remove no_default_handler when we can break ABI:
77 _WRAP_SIGNAL(void drive_eject_button(const Glib::RefPtr<Drive>& drive), drive_eject_button, no_default_handler)
79 gboolean (*is_supported) (void);
81 //TODO: Use ListHandle?
82 //_WRAP_VFUNC(GList* get_volumes(), get_volumes)
83 //_WRAP_VFUNC(GList* get_mounts(), get_mounts)
85 #m4 _CONVERSION(`Glib::RefPtr<Volume>',`GVolume*',__CONVERT_CONST_REFPTR_TO_P)
86 //_WRAP_VFUNC(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), get_volume_for_uuid)
88 #m4 _CONVERSION(`Glib::RefPtr<Mount>',`GMount*',__CONVERT_CONST_REFPTR_TO_P)
89 //_WRAP_VFUNC(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), get_mount_for_uuid)
92 //There are no properties.