1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2009 Red Hat, Inc.
4 * Copyright (C) 2010 Igalia, S.L.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef WEBKIT_SOUP_REQUEST_H
23 #define WEBKIT_SOUP_REQUEST_H 1
25 #include <libsoup/soup.h>
30 #define WEBKIT_TYPE_SOUP_REQUEST (webkit_soup_request_get_type ())
31 #define WEBKIT_SOUP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_TYPE_SOUP_REQUEST, WebKitSoupRequest))
32 #define WEBKIT_SOUP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WEBKIT_TYPE_SOUP_REQUEST, WebKitSoupRequestClass))
33 #define WEBKIT_IS_SOUP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_TYPE_SOUP_REQUEST))
34 #define WEBKIT_IS_SOUP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WEBKIT_TYPE_SOUP_REQUEST))
35 #define WEBKIT_SOUP_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WEBKIT_TYPE_SOUP_REQUEST, WebKitSoupRequestClass))
37 typedef struct _WebKitSoupRequest WebKitSoupRequest;
38 typedef struct _WebKitSoupRequestPrivate WebKitSoupRequestPrivate;
39 typedef struct _WebKitSoupRequestClass WebKitSoupRequestClass;
41 struct _WebKitSoupRequest {
44 WebKitSoupRequestPrivate *priv;
47 struct _WebKitSoupRequestClass {
50 gboolean (*check_uri)(WebKitSoupRequest *req_base,
54 GInputStream * (*send)(WebKitSoupRequest *request,
55 GCancellable *cancellable,
57 void (*send_async)(WebKitSoupRequest *request,
58 GCancellable *cancellable,
59 GAsyncReadyCallback callback,
61 GInputStream * (*send_finish)(WebKitSoupRequest *request,
65 goffset (*get_content_length)(WebKitSoupRequest *request);
66 const char * (*get_content_type)(WebKitSoupRequest *request);
69 GType webkit_soup_request_get_type (void);
71 #define WEBKIT_SOUP_REQUEST_URI "uri"
72 #define WEBKIT_SOUP_REQUEST_SESSION "session"
74 GInputStream *webkit_soup_request_send (WebKitSoupRequest *request,
75 GCancellable *cancellable,
77 void webkit_soup_request_send_async (WebKitSoupRequest *request,
78 GCancellable *cancellable,
79 GAsyncReadyCallback callback,
81 GInputStream *webkit_soup_request_send_finish (WebKitSoupRequest *request,
85 SoupURI *webkit_soup_request_get_uri (WebKitSoupRequest *request);
86 SoupSession *webkit_soup_request_get_session (WebKitSoupRequest *request);
88 goffset webkit_soup_request_get_content_length (WebKitSoupRequest *request);
89 const char *webkit_soup_request_get_content_type (WebKitSoupRequest *request);
91 /* Used by WebKitSoupRequestFile and WebKitSoupRequestData. Ideally
92 * should be located in some util file but I'll place it here as it
93 * will be removed with libsoup 2.32.1 that will ship fixed versions
94 * of soup_uri_decode/normalize
96 gchar *webkit_soup_request_uri_decoded_copy (const char *part, int length);
100 #endif /* WEBKIT_SOUP_REQUEST_H */