2010-10-13 Sergio Villar Senin <svillar@igalia.com>
[WebKit-https.git] / WebCore / platform / network / soup / cache / soup-http-input-stream.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2006, 2007, 2009 Red Hat, Inc.
4  * Copyright (C) 2010 Igalia, S.L.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser 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.
10  *
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  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General
17  * Public License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __WEBKIT_SOUP_HTTP_INPUT_STREAM_H__
23 #define __WEBKIT_SOUP_HTTP_INPUT_STREAM_H__
24
25 #include <gio/gio.h>
26 #include <libsoup/soup-types.h>
27
28 G_BEGIN_DECLS
29
30 #define WEBKIT_TYPE_SOUP_HTTP_INPUT_STREAM         (webkit_soup_http_input_stream_get_type ())
31 #define WEBKIT_SOUP_HTTP_INPUT_STREAM(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), WEBKIT_TYPE_SOUP_HTTP_INPUT_STREAM, WebKitSoupHTTPInputStream))
32 #define WEBKIT_SOUP_HTTP_INPUT_STREAM_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), WEBKIT_TYPE_SOUP_HTTP_INPUT_STREAM, WebKitSoupHTTPInputStreamClass))
33 #define WEBKIT_IS_SOUP_HTTP_INPUT_STREAM(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), WEBKIT_TYPE_SOUP_HTTP_INPUT_STREAM))
34 #define WEBKIT_IS_SOUP_HTTP_INPUT_STREAM_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), WEBKIT_TYPE_SOUP_HTTP_INPUT_STREAM))
35 #define WEBKIT_SOUP_HTTP_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), WEBKIT_TYPE_SOUP_HTTP_INPUT_STREAM, WebKitSoupHTTPInputStreamClass))
36
37 typedef struct WebKitSoupHTTPInputStream WebKitSoupHTTPInputStream;
38 typedef struct WebKitSoupHTTPInputStreamClass WebKitSoupHTTPInputStreamClass;
39
40 struct WebKitSoupHTTPInputStream {
41         GInputStream parent;
42 };
43
44 struct WebKitSoupHTTPInputStreamClass {
45         GInputStreamClass parent_class;
46
47         /* Padding for future expansion */
48         void (*_g_reserved1)(void);
49         void (*_g_reserved2)(void);
50         void (*_g_reserved3)(void);
51         void (*_g_reserved4)(void);
52         void (*_g_reserved5)(void);
53 };
54
55 GType webkit_soup_http_input_stream_get_type (void) G_GNUC_CONST;
56
57 WebKitSoupHTTPInputStream *webkit_soup_http_input_stream_new (SoupSession         *session,
58                                                               SoupMessage         *msg);
59
60 gboolean             webkit_soup_http_input_stream_send (WebKitSoupHTTPInputStream *httpstream,
61                                                          GCancellable        *cancellable,
62                                                          GError             **error);
63
64 void                 webkit_soup_http_input_stream_send_async (WebKitSoupHTTPInputStream *httpstream,
65                                                                int io_priority,
66                                                                GCancellable        *cancellable,
67                                                                GAsyncReadyCallback callback,
68                                                                gpointer user_data);
69 gboolean             webkit_soup_http_input_stream_send_finish (WebKitSoupHTTPInputStream *httpstream,
70                                                                 GAsyncResult        *result,
71                                                                 GError             **error);
72
73 SoupMessage         *webkit_soup_http_input_stream_get_message (WebKitSoupHTTPInputStream *httpstream);
74
75 G_END_DECLS
76
77 #endif /* __WEBKIT_SOUP_HTTP_INPUT_STREAM_H__ */