Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-stream-buffer.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-stream-buffer.h :stream which buffers another stream */
3
4 /*
5  *
6  * Author :
7  *  Michael Zucchi <notzed@ximian.com>
8  *
9  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of version 2 of the GNU Lesser General Public
13  * License as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
23  * USA
24  */
25
26 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
27 #error "Only <camel/camel.h> can be included directly."
28 #endif
29
30 #ifndef CAMEL_STREAM_BUFFER_H
31 #define CAMEL_STREAM_BUFFER_H
32
33 #include <stdio.h>
34 #include <camel/camel-stream.h>
35
36 /* Standard GObject macros */
37 #define CAMEL_TYPE_STREAM_BUFFER \
38         (camel_stream_buffer_get_type ())
39 #define CAMEL_STREAM_BUFFER(obj) \
40         (G_TYPE_CHECK_INSTANCE_CAST \
41         ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBuffer))
42 #define CAMEL_STREAM_BUFFER_CLASS(cls) \
43         (G_TYPE_CHECK_CLASS_CAST \
44         ((cls), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferClass))
45 #define CAMEL_IS_STREAM_BUFFER(obj) \
46         (G_TYPE_CHECK_INSTANCE_TYPE \
47         ((obj), CAMEL_TYPE_STREAM_BUFFER))
48 #define CAMEL_IS_STREAM_BUFFER_CLASS(cls) \
49         (G_TYPE_CHECK_CLASS_TYPE \
50         ((cls), CAMEL_TYPE_STREAM_BUFFER))
51 #define CAMEL_STREAM_BUFFER_GET_CLASS(obj) \
52         (G_TYPE_INSTANCE_GET_CLASS \
53         ((obj), CAMEL_TYPE_STREAM_BUFFER, CamelStreamBufferClass))
54
55 G_BEGIN_DECLS
56
57 typedef struct _CamelStreamBuffer CamelStreamBuffer;
58 typedef struct _CamelStreamBufferClass CamelStreamBufferClass;
59 typedef struct _CamelStreamBufferPrivate CamelStreamBufferPrivate;
60
61 typedef enum {
62         CAMEL_STREAM_BUFFER_BUFFER = 0,
63         CAMEL_STREAM_BUFFER_NONE,
64         CAMEL_STREAM_BUFFER_READ = 0x00,
65         CAMEL_STREAM_BUFFER_WRITE = 0x80,
66         CAMEL_STREAM_BUFFER_MODE = 0x80
67 } CamelStreamBufferMode;
68
69 struct _CamelStreamBuffer {
70         CamelStream parent;
71         CamelStreamBufferPrivate *priv;
72 };
73
74 struct _CamelStreamBufferClass {
75         CamelStreamClass parent_class;
76
77         void            (*init)         (CamelStreamBuffer *stream_buffer,
78                                          CamelStream *stream,
79                                          CamelStreamBufferMode mode);
80         void            (*init_vbuf)    (CamelStreamBuffer *stream_buffer,
81                                          CamelStream *stream,
82                                          CamelStreamBufferMode mode,
83                                          gchar *buf,
84                                          guint32 size);
85 };
86
87 GType           camel_stream_buffer_get_type    (void);
88 CamelStream *   camel_stream_buffer_new         (CamelStream *stream,
89                                                  CamelStreamBufferMode mode);
90 CamelStream *   camel_stream_buffer_new_with_vbuf
91                                                 (CamelStream *stream,
92                                                  CamelStreamBufferMode mode,
93                                                  gchar *buf,
94                                                  guint32 size);
95 gint            camel_stream_buffer_gets        (CamelStreamBuffer *sbf,
96                                                  gchar *buf,
97                                                  guint max,
98                                                  GCancellable *cancellable,
99                                                  GError **error);
100 gchar *         camel_stream_buffer_read_line   (CamelStreamBuffer *sbf,
101                                                  GCancellable *cancellable,
102                                                  GError **error);
103
104 G_END_DECLS
105
106 #endif /* CAMEL_STREAM_BUFFER_H */