1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4 Copyright (C) 2001 Eazel, Inc
5 Copyright (C) 2002 Seth Nickell
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.
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.
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.
22 Author: Michael Fleming <mfleming@eazel.com>
23 Seth Nickell <snickell@stanford.edu>
26 #ifndef GNOME_VFS_STANDARD_CALLBACKS_H
27 #define GNOME_VFS_STANDARD_CALLBACKS_H
29 #include <glib/gtypes.h>
30 #include <libgnomevfs/gnome-vfs-uri.h>
35 * defined callback structures
39 * hook name: "simple-authentication"
40 * In arg: GnomeVFSModuleCallbackAuthenticationIn *
41 * Out arg: GnomeVFSModuleCallbacAuthenticationOut *
43 * Called when access to a URI requires a username/password
45 #define GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION "simple-authentication"
48 * hook name: "http:proxy-authentication"
49 * In arg: GnomeVFSModuleCallbackAuthenticationIn *
50 * Out arg: GnomeVFSModuleCallbackAuthenticationOut *
52 * Called when access to an HTTP proxy requires a username/password
54 #define GNOME_VFS_MODULE_CALLBACK_HTTP_PROXY_AUTHENTICATION "http:proxy-authentication"
57 char *uri; /* Full URI of operation */
58 char *realm; /* for HTTP auth, NULL for others */
59 gboolean previous_attempt_failed;
60 /* TRUE if there were credentials specified
61 * for this request, but they resulted in
62 * an authorization error.
63 * ("you gave me the wrong pw!")
65 * FALSE if there were no credentials specified
66 * but they are required to continue
70 AuthTypeBasic, /* Password will be transmitted unencrypted */
71 AuthTypeDigest /* Digest is transferred, not plaintext credentials */
74 /* Reserved "padding" to avoid future breaks in ABI compatibility */
78 } GnomeVFSModuleCallbackAuthenticationIn;
81 char *username; /* will be freed by g_free,
82 * NULL indicates no auth should be provided;
83 * if the request requires authn, the operation
84 * will fail with a GNOME_VFS_ERROR_ACCESS_DENIED
87 char *password; /* will be freed by g_free */
89 /* Reserved "padding" to avoid future breaks in ABI compatibility */
93 } GnomeVFSModuleCallbackAuthenticationOut;
96 * hook name: "http:send-additional-headers"
97 * In arg: GnomeVFSModuleCallbackAdditionalHeadersIn *
98 * Out arg: GnomeVFSModuleCallbackAdditionalHeadersOut *
100 * Called before sending headers to an HTTP server.
103 #define GNOME_VFS_MODULE_CALLBACK_HTTP_SEND_ADDITIONAL_HEADERS "http:send-additional-headers"
106 GnomeVFSURI *uri; /* URI of operation */
108 /* Reserved "padding" to avoid future breaks in ABI compatibility */
111 } GnomeVFSModuleCallbackAdditionalHeadersIn;
114 GList *headers; /* list of headers, will be freeed */
116 /* Reserved "padding" to avoid future breaks in ABI compatibility */
119 } GnomeVFSModuleCallbackAdditionalHeadersOut;
122 * hook name: "http:received-headers"
123 * In arg: GnomeVFSModuleCallbackReceivedHeadersIn *
124 * Out arg: GnomeVFSModuleCallbackReceivedHeadersOut *
126 * Called after receiving the HTTP headers from the server.
129 #define GNOME_VFS_MODULE_CALLBACK_HTTP_RECEIVED_HEADERS "http:received-headers"
132 GnomeVFSURI *uri; /* URI of operation */
133 GList *headers; /* list of headers */
135 /* Reserved "padding" to avoid future breaks in ABI compatibility */
138 } GnomeVFSModuleCallbackReceivedHeadersIn;
143 /* Reserved "padding" to avoid future breaks in ABI compatibility */
146 } GnomeVFSModuleCallbackReceivedHeadersOut;
149 * hook name: "status-message"
150 * In arg: GnomeVFSModuleCallbackStatusMessageIn *
151 * Out arg: GnomeVFSModuleCallbackStatusMessageOut *
153 * Called when a GnomeVFS API or module has a status message to return to
157 #define GNOME_VFS_MODULE_CALLBACK_STATUS_MESSAGE "status-message"
160 char *uri; /* Full URI of operation */
161 char *message; /* A message indicating the current state or
162 * NULL if there is no message */
163 int percentage; /* Percentage indicating completeness 0-100 or
164 * -1 if there is no progress percentage to
167 /* Reserved "padding" to avoid future breaks in ABI compatibility */
170 } GnomeVFSModuleCallbackStatusMessageIn;
173 int dummy; /* empty structs not allowed */
175 /* Reserved "padding" to avoid future breaks in ABI compatibility */
178 } GnomeVFSModuleCallbackStatusMessageOut;
182 #endif /* GNOME_VFS_STANDARD_CALLBACKS_H */