You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

151 lines
5.8 KiB

  1. /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
  2. /* GIO - GLib Input, Output and Streaming Library
  3. *
  4. * Copyright (C) 2006-2007 Red Hat, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General
  17. * Public License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * Author: Alexander Larsson <alexl@redhat.com>
  22. * David Zeuthen <davidz@redhat.com>
  23. */
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #ifndef __G_VOLUME_MONITOR_H__
  28. #define __G_VOLUME_MONITOR_H__
  29. #include <gio/giotypes.h>
  30. G_BEGIN_DECLS
  31. #define G_TYPE_VOLUME_MONITOR (g_volume_monitor_get_type ())
  32. #define G_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitor))
  33. #define G_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
  34. #define G_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VOLUME_MONITOR, GVolumeMonitorClass))
  35. #define G_IS_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VOLUME_MONITOR))
  36. #define G_IS_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VOLUME_MONITOR))
  37. /**
  38. * G_VOLUME_MONITOR_EXTENSION_POINT_NAME:
  39. *
  40. * Extension point for volume monitor functionality.
  41. * See <link linkend="extending-gio">Extending GIO</link>.
  42. */
  43. #define G_VOLUME_MONITOR_EXTENSION_POINT_NAME "gio-volume-monitor"
  44. /**
  45. * GVolumeMonitor:
  46. *
  47. * A Volume Monitor that watches for volume events.
  48. **/
  49. typedef struct _GVolumeMonitorClass GVolumeMonitorClass;
  50. struct _GVolumeMonitor
  51. {
  52. GObject parent_instance;
  53. /*< private >*/
  54. gpointer priv;
  55. };
  56. struct _GVolumeMonitorClass
  57. {
  58. GObjectClass parent_class;
  59. /*< public >*/
  60. /* signals */
  61. void (* volume_added) (GVolumeMonitor *volume_monitor,
  62. GVolume *volume);
  63. void (* volume_removed) (GVolumeMonitor *volume_monitor,
  64. GVolume *volume);
  65. void (* volume_changed) (GVolumeMonitor *volume_monitor,
  66. GVolume *volume);
  67. void (* mount_added) (GVolumeMonitor *volume_monitor,
  68. GMount *mount);
  69. void (* mount_removed) (GVolumeMonitor *volume_monitor,
  70. GMount *mount);
  71. void (* mount_pre_unmount) (GVolumeMonitor *volume_monitor,
  72. GMount *mount);
  73. void (* mount_changed) (GVolumeMonitor *volume_monitor,
  74. GMount *mount);
  75. void (* drive_connected) (GVolumeMonitor *volume_monitor,
  76. GDrive *drive);
  77. void (* drive_disconnected) (GVolumeMonitor *volume_monitor,
  78. GDrive *drive);
  79. void (* drive_changed) (GVolumeMonitor *volume_monitor,
  80. GDrive *drive);
  81. /* Vtable */
  82. gboolean (* is_supported) (void);
  83. GList * (* get_connected_drives) (GVolumeMonitor *volume_monitor);
  84. GList * (* get_volumes) (GVolumeMonitor *volume_monitor);
  85. GList * (* get_mounts) (GVolumeMonitor *volume_monitor);
  86. GVolume * (* get_volume_for_uuid) (GVolumeMonitor *volume_monitor,
  87. const char *uuid);
  88. GMount * (* get_mount_for_uuid) (GVolumeMonitor *volume_monitor,
  89. const char *uuid);
  90. /* These arguments are unfortunately backwards by mistake (bug #520169). Deprecated in 2.20. */
  91. GVolume * (* adopt_orphan_mount) (GMount *mount,
  92. GVolumeMonitor *volume_monitor);
  93. /* signal added in 2.17 */
  94. void (* drive_eject_button) (GVolumeMonitor *volume_monitor,
  95. GDrive *drive);
  96. /* signal added in 2.21 */
  97. void (* drive_stop_button) (GVolumeMonitor *volume_monitor,
  98. GDrive *drive);
  99. /*< private >*/
  100. /* Padding for future expansion */
  101. void (*_g_reserved1) (void);
  102. void (*_g_reserved2) (void);
  103. void (*_g_reserved3) (void);
  104. void (*_g_reserved4) (void);
  105. void (*_g_reserved5) (void);
  106. void (*_g_reserved6) (void);
  107. };
  108. GType g_volume_monitor_get_type (void) G_GNUC_CONST;
  109. GVolumeMonitor *g_volume_monitor_get (void);
  110. GList * g_volume_monitor_get_connected_drives (GVolumeMonitor *volume_monitor);
  111. GList * g_volume_monitor_get_volumes (GVolumeMonitor *volume_monitor);
  112. GList * g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor);
  113. GVolume * g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
  114. const char *uuid);
  115. GMount * g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,
  116. const char *uuid);
  117. #ifndef G_DISABLE_DEPRECATED
  118. GVolume * g_volume_monitor_adopt_orphan_mount (GMount *mount);
  119. #endif
  120. G_END_DECLS
  121. #endif /* __G_VOLUME_MONITOR_H__ */