gfilemonitor.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2006-2007 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser 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.
  9. *
  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. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General
  16. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Alexander Larsson <[email protected]>
  19. */
  20. #ifndef __G_FILE_MONITOR_H__
  21. #define __G_FILE_MONITOR_H__
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #include <gio/giotypes.h>
  26. G_BEGIN_DECLS
  27. #define G_TYPE_FILE_MONITOR (g_file_monitor_get_type ())
  28. #define G_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_MONITOR, GFileMonitor))
  29. #define G_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_MONITOR, GFileMonitorClass))
  30. #define G_IS_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_MONITOR))
  31. #define G_IS_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_MONITOR))
  32. #define G_FILE_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_MONITOR, GFileMonitorClass))
  33. typedef struct _GFileMonitorClass GFileMonitorClass;
  34. typedef struct _GFileMonitorPrivate GFileMonitorPrivate;
  35. /**
  36. * GFileMonitor:
  37. *
  38. * Watches for changes to a file.
  39. **/
  40. struct _GFileMonitor
  41. {
  42. GObject parent_instance;
  43. /*< private >*/
  44. GFileMonitorPrivate *priv;
  45. };
  46. struct _GFileMonitorClass
  47. {
  48. GObjectClass parent_class;
  49. /* Signals */
  50. void (* changed) (GFileMonitor *monitor,
  51. GFile *file,
  52. GFile *other_file,
  53. GFileMonitorEvent event_type);
  54. /* Virtual Table */
  55. gboolean (* cancel) (GFileMonitor *monitor);
  56. /*< private >*/
  57. /* Padding for future expansion */
  58. void (*_g_reserved1) (void);
  59. void (*_g_reserved2) (void);
  60. void (*_g_reserved3) (void);
  61. void (*_g_reserved4) (void);
  62. void (*_g_reserved5) (void);
  63. };
  64. GLIB_AVAILABLE_IN_ALL
  65. GType g_file_monitor_get_type (void) G_GNUC_CONST;
  66. GLIB_AVAILABLE_IN_ALL
  67. gboolean g_file_monitor_cancel (GFileMonitor *monitor);
  68. GLIB_AVAILABLE_IN_ALL
  69. gboolean g_file_monitor_is_cancelled (GFileMonitor *monitor);
  70. GLIB_AVAILABLE_IN_ALL
  71. void g_file_monitor_set_rate_limit (GFileMonitor *monitor,
  72. gint limit_msecs);
  73. /* For implementations */
  74. GLIB_AVAILABLE_IN_ALL
  75. void g_file_monitor_emit_event (GFileMonitor *monitor,
  76. GFile *child,
  77. GFile *other_file,
  78. GFileMonitorEvent event_type);
  79. G_END_DECLS
  80. #endif /* __G_FILE_MONITOR_H__ */