1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
---|
2 | /* gnome-vfs-messages.h - Status message reporting for GNOME Virtual File |
---|
3 | System. |
---|
4 | |
---|
5 | Copyright (C) 1999 Free Software Foundation |
---|
6 | |
---|
7 | The Gnome Library is free software; you can redistribute it and/or |
---|
8 | modify it under the terms of the GNU Library General Public License as |
---|
9 | published by the Free Software Foundation; either version 2 of the |
---|
10 | License, or (at your option) any later version. |
---|
11 | |
---|
12 | The Gnome Library is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
15 | Library General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU Library General Public |
---|
18 | License along with the Gnome Library; see the file COPYING.LIB. If not, |
---|
19 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
20 | Boston, MA 02111-1307, USA. |
---|
21 | |
---|
22 | Author: Havoc Pennington <hp@redhat.com> */ |
---|
23 | |
---|
24 | #ifndef _GNOME_VFS_MESSAGES_H |
---|
25 | #define _GNOME_VFS_MESSAGES_H |
---|
26 | |
---|
27 | /* The GnomeVFSMessageCallbacks object is intended to be used |
---|
28 | * internally by the handle and async handle to manage lists of status |
---|
29 | * callbacks. Although it may make sense to have |
---|
30 | * handle_get_message_callbacks() and then let people use this API |
---|
31 | * directly. */ |
---|
32 | |
---|
33 | /* FIXME bugzilla.eazel.com 1143 |
---|
34 | should we have a priority enum of some kind, and pass it to |
---|
35 | the status callback? Netscape doesn't distinguish any of the status |
---|
36 | messages but you probably could if you wanted. */ |
---|
37 | |
---|
38 | /* FIXME bugzilla.eazel.com 1141 |
---|
39 | this isn't thread safe (well, one thread per |
---|
40 | GnomeVFSMessageCallbacks, there's no static data) - can multiple |
---|
41 | threads be using the same file handle? */ |
---|
42 | |
---|
43 | #include <glib.h> |
---|
44 | |
---|
45 | #include <libgnomevfs/gnome-vfs.h> |
---|
46 | |
---|
47 | typedef struct GnomeVFSMessageCallbacks GnomeVFSMessageCallbacks; |
---|
48 | |
---|
49 | /* Used to report user-friendly status messages you might want to display. */ |
---|
50 | typedef void (* GnomeVFSStatusCallback) (const gchar *message, |
---|
51 | gpointer callback_data); |
---|
52 | |
---|
53 | GnomeVFSMessageCallbacks* |
---|
54 | gnome_vfs_message_callbacks_new (void); |
---|
55 | |
---|
56 | void gnome_vfs_message_callbacks_destroy |
---|
57 | (GnomeVFSMessageCallbacks *cbs); |
---|
58 | |
---|
59 | guint gnome_vfs_message_callbacks_add (GnomeVFSMessageCallbacks *cbs, |
---|
60 | GnomeVFSStatusCallback callback, |
---|
61 | gpointer user_data); |
---|
62 | |
---|
63 | guint gnome_vfs_message_callbacks_add_full |
---|
64 | (GnomeVFSMessageCallbacks *cbs, |
---|
65 | GnomeVFSStatusCallback callback, |
---|
66 | gpointer user_data, |
---|
67 | GDestroyNotify notify); |
---|
68 | |
---|
69 | void gnome_vfs_message_callbacks_remove |
---|
70 | (GnomeVFSMessageCallbacks *cbs, |
---|
71 | guint num); |
---|
72 | |
---|
73 | void gnome_vfs_message_callbacks_remove_by_func |
---|
74 | (GnomeVFSMessageCallbacks *cbs, |
---|
75 | GnomeVFSStatusCallback callback); |
---|
76 | |
---|
77 | void gnome_vfs_message_callbacks_remove_by_data |
---|
78 | (GnomeVFSMessageCallbacks *cbs, |
---|
79 | gpointer user_data); |
---|
80 | |
---|
81 | void gnome_vfs_message_callbacks_remove_by_func_and_data |
---|
82 | (GnomeVFSMessageCallbacks *cbs, |
---|
83 | GnomeVFSStatusCallback callback, |
---|
84 | gpointer user_data); |
---|
85 | |
---|
86 | void gnome_vfs_message_callbacks_emit (GnomeVFSMessageCallbacks *cbs, |
---|
87 | const gchar *message); |
---|
88 | |
---|
89 | #endif /* _GNOME_VFS_MESSAGES_H */ |
---|