Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-http-stream.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
4  *
5  *  Copyright 2002 Ximian, Inc. (www.ximian.com)
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program 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
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22
23
24 #ifndef __CAMEL_HTTP_STREAM_H__
25 #define __CAMEL_HTTP_STREAM_H__
26
27 #include <camel/camel-mime-parser.h>
28 #include <camel/camel-mime-utils.h>
29 #include <camel/camel-stream.h>
30 #include <camel/camel-url.h>
31
32 #define CAMEL_HTTP_STREAM_TYPE     (camel_http_stream_get_type ())
33 #define CAMEL_HTTP_STREAM(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_HTTP_STREAM_TYPE, CamelHttpStream))
34 #define CAMEL_HTTP_STREAM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_HTTP_STREAM_TYPE, CamelHttpStreamClass))
35 #define CAMEL_IS_HTTP_STREAM(o)    (CAMEL_CHECK_TYPE((o), CAMEL_HTTP_STREAM_TYPE))
36
37 G_BEGIN_DECLS
38
39 typedef enum {
40         /*CAMEL_HTTP_METHOD_OPTIONS,*/
41         CAMEL_HTTP_METHOD_GET,
42         CAMEL_HTTP_METHOD_HEAD,
43         /*CAMEL_HTTP_METHOD_POST,*/
44         /*CAMEL_HTTP_METHOD_PUT,*/
45         /*CAMEL_HTTP_METHOD_DELETE,*/
46         /*CAMEL_HTTP_METHOD_TRACE,*/
47         /*CAMEL_HTTP_METHOD_CONNECT*/
48 } CamelHttpMethod;
49
50
51 typedef struct _CamelHttpStreamClass CamelHttpStreamClass;
52
53 struct _CamelHttpStream {
54         CamelStream parent_object;
55         
56         CamelMimeParser *parser;
57         
58         CamelContentType *content_type;
59         struct _camel_header_raw *headers;
60         
61         CamelHttpMethod method;
62         struct _CamelSession *session;
63         CamelURL *url;
64         
65         char *user_agent;
66         
67         /* proxy info */
68         CamelURL *proxy;
69         char *authrealm;
70         char *authpass;
71         
72         int statuscode;
73         
74         CamelStream *raw;
75         CamelStream *read;
76 };
77
78 struct _CamelHttpStreamClass {
79         CamelStreamClass parent_class;
80         
81         /* Virtual methods */
82 };
83
84 /* Standard Camel function */
85 CamelType camel_http_stream_get_type (void);
86
87 /* public methods */
88 CamelStream *camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, CamelURL *url);
89
90 void camel_http_stream_set_user_agent (CamelHttpStream *http_stream, const char *user_agent);
91
92 void camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url);
93 void camel_http_stream_set_proxy_authrealm (CamelHttpStream *http_stream, const char *proxy_authrealm);
94 void camel_http_stream_set_proxy_authpass (CamelHttpStream *http_stream, const char *proxy_authpass);
95
96 CamelContentType *camel_http_stream_get_content_type (CamelHttpStream *http_stream);
97
98 G_END_DECLS
99
100 #endif /* __CAMEL_HTTP_STREAM_H__ */