2010-10-13 Sergio Villar Senin <svillar@igalia.com>
[WebKit-https.git] / WebCore / platform / network / soup / cache / soup-directory-input-stream.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2010 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 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.
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  * Library General Public License for more details.
15  *
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.
20  */
21
22 #ifndef WEBKIT_SOUP_DIRECTORY_INPUT_STREAM_H
23 #define WEBKIT_SOUP_DIRECTORY_INPUT_STREAM_H 1
24
25 #include <gio/gio.h>
26 #include <libsoup/soup-types.h>
27 #include <libsoup/soup-message-body.h>
28
29 G_BEGIN_DECLS
30
31 #define WEBKIT_TYPE_SOUP_DIRECTORY_INPUT_STREAM            (webkit_soup_directory_input_stream_get_type ())
32 #define WEBKIT_SOUP_DIRECTORY_INPUT_STREAM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_TYPE_SOUP_DIRECTORY_INPUT_STREAM, WebKitSoupDirectoryInputStream))
33 #define WEBKIT_SOUP_DIRECTORY_INPUT_STREAM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), WEBKIT_TYPE_SOUP_DIRECTORY_INPUT_STREAM, WebKitSoupDirectoryInputStreamClass))
34 #define WEBKIT_IS_SOUP_DIRECTORY_INPUT_STREAM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_TYPE_SOUP_DIRECTORY_INPUT_STREAM))
35 #define WEBKIT_IS_SOUP_DIRECTORY_INPUT_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), WEBKIT_TYPE_SOUP_DIRECTORY_INPUT_STREAM))
36 #define WEBKIT_SOUP_DIRECTORY_INPUT_STREAM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), WEBKIT_TYPE_SOUP_DIRECTORY_INPUT_STREAM, WebKitSoupDirectoryInputStreamClass))
37
38 typedef struct _WebKitSoupDirectoryInputStream WebKitSoupDirectoryInputStream;
39 typedef struct _WebKitSoupDirectoryInputStreamClass WebKitSoupDirectoryInputStreamClass;
40
41 struct _WebKitSoupDirectoryInputStream {
42         GInputStream parent;
43
44         GFileEnumerator *enumerator;
45         char *uri;
46         SoupBuffer *buffer;
47         gboolean done;
48 };
49
50 struct _WebKitSoupDirectoryInputStreamClass {
51         GInputStreamClass parent_class;
52 };
53
54 GType          webkit_soup_directory_input_stream_get_type (void);
55
56 GInputStream *webkit_soup_directory_input_stream_new (GFileEnumerator *enumerator,
57                                                       SoupURI         *uri);
58
59
60 G_END_DECLS
61
62 #endif /* WEBKIT_SOUP_DIRECTORY_INPUT_STREAM_H */