1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
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.1 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 * Lesser General Public License for more details.
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/>.
18 * Author: Alexander Larsson <alexl@redhat.com>
21 #ifndef __G_LOCAL_FILE_MONITOR_H__
22 #define __G_LOCAL_FILE_MONITOR_H__
24 #include <gio/gfilemonitor.h>
25 #include "gunixmounts.h"
29 #define G_TYPE_LOCAL_FILE_MONITOR (g_local_file_monitor_get_type ())
30 #define G_LOCAL_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_LOCAL_FILE_MONITOR, GLocalFileMonitor))
31 #define G_LOCAL_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), G_TYPE_LOCAL_FILE_MONITOR, GLocalFileMonitorClass))
32 #define G_IS_LOCAL_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_LOCAL_FILE_MONITOR))
33 #define G_IS_LOCAL_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_LOCAL_FILE_MONITOR))
34 #define G_LOCAL_FILE_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_LOCAL_FILE_MONITOR, GLocalFileMonitorClass))
36 #define G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME "gio-local-file-monitor"
37 #define G_NFS_FILE_MONITOR_EXTENSION_POINT_NAME "gio-nfs-file-monitor"
39 typedef struct _GLocalFileMonitor GLocalFileMonitor;
40 typedef struct _GLocalFileMonitorClass GLocalFileMonitorClass;
41 typedef struct _GFileMonitorSource GFileMonitorSource;
43 struct _GLocalFileMonitor
45 GFileMonitor parent_instance;
47 GFileMonitorSource *source;
48 GUnixMountMonitor *mount_monitor;
52 struct _GLocalFileMonitorClass
54 GFileMonitorClass parent_class;
56 gboolean (* is_supported) (void);
57 void (* start) (GLocalFileMonitor *local_monitor,
59 const gchar *basename,
60 const gchar *filename,
61 GFileMonitorSource *source);
63 gboolean mount_notify;
69 GType g_local_file_monitor_get_type (void) G_GNUC_CONST;
71 /* for glocalfile.c */
73 g_local_file_monitor_new_for_path (const gchar *pathname,
74 gboolean is_directory,
75 GFileMonitorFlags flags,
78 /* for various users in glib */
79 typedef void (* GFileMonitorCallback) (GFileMonitor *monitor,
82 GFileMonitorEvent event,
85 g_local_file_monitor_new_in_worker (const gchar *pathname,
86 gboolean is_directory,
87 GFileMonitorFlags flags,
88 GFileMonitorCallback callback,
90 GClosureNotify destroy_user_data,
93 /* for implementations of GLocalFileMonitor */
94 GLIB_AVAILABLE_IN_2_44
96 g_file_monitor_source_handle_event (GFileMonitorSource *fms,
97 GFileMonitorEvent event_type,
99 const gchar *rename_to,
106 #endif /* __G_LOCAL_FILE_MONITOR_H__ */