| 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
| 2 | /* |
| 3 | * Copyright (C) 2010 Igalia S.L. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Library General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Library General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Library General Public License |
| 16 | * along with this library; see the file COPYING.LIB. If not, write to |
| 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | * Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #ifndef __SOUP_REQUESTER_H__ |
| 22 | #define __SOUP_REQUESTER_H__ 1 |
| 23 | |
| 24 | #ifdef LIBSOUP_USE_UNSTABLE_REQUEST_API |
| 25 | |
| 26 | #include <libsoup/soup-types.h> |
| 27 | |
| 28 | G_BEGIN_DECLS |
| 29 | |
| 30 | #define SOUP_TYPE_REQUESTER (soup_requester_get_type ()) |
| 31 | #define SOUP_REQUESTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_REQUESTER, SoupRequester)) |
| 32 | #define SOUP_REQUESTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_REQUESTER, SoupRequesterClass)) |
| 33 | #define SOUP_IS_REQUESTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_REQUESTER)) |
| 34 | #define SOUP_IS_REQUESTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_REQUESTER)) |
| 35 | #define SOUP_REQUESTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_REQUESTER, SoupRequesterClass)) |
| 36 | |
| 37 | typedef struct _SoupRequester SoupRequester; |
| 38 | typedef struct _SoupRequesterPrivate SoupRequesterPrivate; |
| 39 | |
| 40 | struct _SoupRequester { |
| 41 | GObject parent; |
| 42 | |
| 43 | SoupRequesterPrivate *priv; |
| 44 | }; |
| 45 | |
| 46 | typedef struct { |
| 47 | GObjectClass parent_class; |
| 48 | } SoupRequesterClass; |
| 49 | |
| 50 | SOUP_AVAILABLE_IN_2_34 |
| 51 | SOUP_DEPRECATED_IN_2_42 |
| 52 | GType soup_requester_get_type (void); |
| 53 | |
| 54 | SOUP_AVAILABLE_IN_2_34 |
| 55 | SOUP_DEPRECATED_IN_2_42 |
| 56 | SoupRequester *soup_requester_new (void); |
| 57 | |
| 58 | SOUP_AVAILABLE_IN_2_34 |
| 59 | SOUP_DEPRECATED_IN_2_42_FOR(soup_session_request) |
| 60 | SoupRequest *soup_requester_request (SoupRequester *requester, |
| 61 | const char *uri_string, |
| 62 | GError **error); |
| 63 | |
| 64 | SOUP_AVAILABLE_IN_2_34 |
| 65 | SOUP_DEPRECATED_IN_2_42_FOR(soup_session_request_uri) |
| 66 | SoupRequest *soup_requester_request_uri (SoupRequester *requester, |
| 67 | SoupURI *uri, |
| 68 | GError **error); |
| 69 | |
| 70 | SOUP_AVAILABLE_IN_2_34 |
| 71 | SOUP_DEPRECATED_IN_2_42_FOR(SOUP_REQUEST_ERROR) |
| 72 | GQuark soup_requester_error_quark (void); |
| 73 | #define SOUP_REQUESTER_ERROR soup_requester_error_quark () |
| 74 | |
| 75 | typedef enum { |
| 76 | SOUP_REQUESTER_ERROR_BAD_URI, |
| 77 | SOUP_REQUESTER_ERROR_UNSUPPORTED_URI_SCHEME |
| 78 | } SoupRequesterError; |
| 79 | |
| 80 | G_END_DECLS |
| 81 | |
| 82 | #endif /* LIBSOUP_USE_UNSTABLE_REQUEST_API */ |
| 83 | |
| 84 | #endif /* __SOUP_REQUESTER_H__ */ |
| 85 | |