Blame gio/glocalfilemonitor.h

Packit ae235b
/* GIO - GLib Input, Output and Streaming Library
Packit ae235b
 *
Packit ae235b
 * Copyright (C) 2006-2007 Red Hat, Inc.
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General
Packit ae235b
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 *
Packit ae235b
 * Author: Alexander Larsson <alexl@redhat.com>
Packit ae235b
 */
Packit ae235b
Packit ae235b
#ifndef __G_LOCAL_FILE_MONITOR_H__
Packit ae235b
#define __G_LOCAL_FILE_MONITOR_H__
Packit ae235b
Packit ae235b
#include <gio/gfilemonitor.h>
Packit ae235b
#include "gunixmounts.h"
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
#define G_TYPE_LOCAL_FILE_MONITOR		(g_local_file_monitor_get_type ())
Packit ae235b
#define G_LOCAL_FILE_MONITOR(o)			(G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_LOCAL_FILE_MONITOR, GLocalFileMonitor))
Packit ae235b
#define G_LOCAL_FILE_MONITOR_CLASS(k)		(G_TYPE_CHECK_CLASS_CAST ((k), G_TYPE_LOCAL_FILE_MONITOR, GLocalFileMonitorClass))
Packit ae235b
#define G_IS_LOCAL_FILE_MONITOR(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_LOCAL_FILE_MONITOR))
Packit ae235b
#define G_IS_LOCAL_FILE_MONITOR_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_LOCAL_FILE_MONITOR))
Packit ae235b
#define G_LOCAL_FILE_MONITOR_GET_CLASS(o)       (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_LOCAL_FILE_MONITOR, GLocalFileMonitorClass))
Packit ae235b
Packit ae235b
#define G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME "gio-local-file-monitor"
Packit ae235b
#define G_NFS_FILE_MONITOR_EXTENSION_POINT_NAME   "gio-nfs-file-monitor"
Packit ae235b
Packit ae235b
typedef struct _GLocalFileMonitor      GLocalFileMonitor;
Packit ae235b
typedef struct _GLocalFileMonitorClass GLocalFileMonitorClass;
Packit ae235b
typedef struct _GFileMonitorSource     GFileMonitorSource;
Packit ae235b
Packit ae235b
struct _GLocalFileMonitor
Packit ae235b
{
Packit ae235b
  GFileMonitor parent_instance;
Packit ae235b
Packit ae235b
  GFileMonitorSource *source;
Packit ae235b
  GUnixMountMonitor  *mount_monitor;
Packit ae235b
  gboolean            was_mounted;
Packit ae235b
};
Packit ae235b
Packit ae235b
struct _GLocalFileMonitorClass
Packit ae235b
{
Packit ae235b
  GFileMonitorClass parent_class;
Packit ae235b
Packit ae235b
  gboolean (* is_supported) (void);
Packit ae235b
  void     (* start)        (GLocalFileMonitor *local_monitor,
Packit ae235b
                             const gchar *dirname,
Packit ae235b
                             const gchar *basename,
Packit ae235b
                             const gchar *filename,
Packit ae235b
                             GFileMonitorSource *source);
Packit ae235b
Packit ae235b
  gboolean mount_notify;
Packit ae235b
};
Packit ae235b
Packit ae235b
#ifdef G_OS_UNIX
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
#endif
Packit ae235b
GType           g_local_file_monitor_get_type (void) G_GNUC_CONST;
Packit ae235b
Packit ae235b
/* for glocalfile.c */
Packit ae235b
GFileMonitor *
Packit ae235b
g_local_file_monitor_new_for_path (const gchar        *pathname,
Packit ae235b
                                   gboolean            is_directory,
Packit ae235b
                                   GFileMonitorFlags   flags,
Packit ae235b
                                   GError            **error);
Packit ae235b
Packit ae235b
/* for various users in glib */
Packit ae235b
typedef void (* GFileMonitorCallback) (GFileMonitor      *monitor,
Packit ae235b
                                       GFile             *child,
Packit ae235b
                                       GFile             *other,
Packit ae235b
                                       GFileMonitorEvent  event,
Packit ae235b
                                       gpointer           user_data);
Packit ae235b
GFileMonitor *
Packit ae235b
g_local_file_monitor_new_in_worker (const gchar           *pathname,
Packit ae235b
                                    gboolean               is_directory,
Packit ae235b
                                    GFileMonitorFlags      flags,
Packit ae235b
                                    GFileMonitorCallback   callback,
Packit ae235b
                                    gpointer               user_data,
Packit ae235b
                                    GError               **error);
Packit ae235b
Packit ae235b
/* for implementations of GLocalFileMonitor */
Packit ae235b
GLIB_AVAILABLE_IN_2_44
Packit ae235b
gboolean
Packit ae235b
g_file_monitor_source_handle_event (GFileMonitorSource *fms,
Packit ae235b
                                    GFileMonitorEvent   event_type,
Packit ae235b
                                    const gchar        *child,
Packit ae235b
                                    const gchar        *rename_to,
Packit ae235b
                                    GFile              *other,
Packit ae235b
                                    gint64              event_time);
Packit ae235b
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_LOCAL_FILE_MONITOR_H__ */