1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 3 /* 4 * GThumb 5 * 6 * Copyright (C) 2005-2008 Free Software Foundation, Inc. 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 #ifndef GTH_MONITOR_H 23 #define GTH_MONITOR_H 24 25 #include <gio/gio.h> 26 #include <glib-object.h> 27 #include "typedefs.h" 28 #include "gth-file-data.h" 29 30 G_BEGIN_DECLS 31 32 typedef enum { 33 GTH_MONITOR_EVENT_CREATED = 0, 34 GTH_MONITOR_EVENT_DELETED, /* used when a file or folder is deleted from disk */ 35 GTH_MONITOR_EVENT_CHANGED, 36 GTH_MONITOR_EVENT_REMOVED /* used when a file is removed from a catalog */ 37 } GthMonitorEvent; 38 39 #define GTH_TYPE_MONITOR (gth_monitor_get_type ()) 40 #define GTH_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTH_TYPE_MONITOR, GthMonitor)) 41 #define GTH_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTH_TYPE_MONITOR, GthMonitorClass)) 42 #define GTH_IS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTH_TYPE_MONITOR)) 43 #define GTH_IS_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTH_TYPE_MONITOR)) 44 #define GTH_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTH_TYPE_MONITOR, GthMonitorClass)) 45 46 typedef struct _GthMonitor GthMonitor; 47 typedef struct _GthMonitorClass GthMonitorClass; 48 typedef struct _GthMonitorPrivate GthMonitorPrivate; 49 50 struct _GthMonitor 51 { 52 GObject __parent; 53 GthMonitorPrivate *priv; 54 }; 55 56 struct _GthMonitorClass 57 { 58 GObjectClass __parent_class; 59 60 /*< signals >*/ 61 62 void (*icon_theme_changed) (GthMonitor *monitor); 63 void (*bookmarks_changed) (GthMonitor *monitor); 64 void (*shortcuts_changed) (GthMonitor *monitor); 65 void (*filters_changed) (GthMonitor *monitor); 66 void (*tags_changed) (GthMonitor *monitor); 67 void (*folder_changed) (GthMonitor *monitor, 68 GFile *parent, 69 GList *list /* GFile list */, 70 int position, 71 GthMonitorEvent event); 72 void (*file_renamed) (GthMonitor *monitor, 73 GFile *file, 74 GFile *new_file); 75 void (*metadata_changed) (GthMonitor *monitor, 76 GthFileData *file_data); 77 void (*emblems_changed) (GthMonitor *monitor, 78 GList *list /* GFile list */); 79 void (*entry_points_changed) (GthMonitor *monitor); 80 void (*order_changed) (GthMonitor *monitor, 81 GFile *file, 82 int *new_order); 83 }; 84 85 GType gth_monitor_get_type (void); 86 GthMonitor * gth_monitor_new (void); 87 void gth_monitor_pause (GthMonitor *monitor, 88 GFile *file); 89 void gth_monitor_resume (GthMonitor *monitor, 90 GFile *file); 91 void gth_monitor_icon_theme_changed (GthMonitor *monitor); 92 void gth_monitor_bookmarks_changed (GthMonitor *monitor); 93 void gth_monitor_shortcuts_changed (GthMonitor *monitor); 94 void gth_monitor_filters_changed (GthMonitor *monitor); 95 void gth_monitor_tags_changed (GthMonitor *monitor); 96 void gth_monitor_folder_changed (GthMonitor *monitor, 97 GFile *parent, 98 GList *list, /* GFile list */ 99 GthMonitorEvent event); 100 void gth_monitor_files_created_with_pos (GthMonitor *monitor, 101 GFile *parent, 102 GList *list, /* GFile list */ 103 int position); 104 void gth_monitor_file_renamed (GthMonitor *monitor, 105 GFile *file, 106 GFile *new_file); 107 void gth_monitor_files_deleted (GthMonitor *monitor, 108 GList *list /* GFile list */); 109 void gth_monitor_metadata_changed (GthMonitor *monitor, 110 GthFileData *file_data); 111 void gth_monitor_emblems_changed (GthMonitor *monitor, 112 GList *list /* GFile list */); 113 void gth_monitor_entry_points_changed (GthMonitor *monitor); 114 void gth_monitor_order_changed (GthMonitor *monitor, 115 GFile *file, 116 int *new_order); 117 118 G_END_DECLS 119 120 #endif /* GTH_MONITOR_H */ 121