Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-multipart.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-multipart.h : class for a multipart */
3
4 /*
5  *
6  * Author :
7  *  Bertrand Guiheneuf <bertrand@helixcode.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_MULTIPART_H
31 #define CAMEL_MULTIPART_H
32
33 #include <camel/camel-data-wrapper.h>
34
35 /* Standard GObject macros */
36 #define CAMEL_TYPE_MULTIPART \
37         (camel_multipart_get_type ())
38 #define CAMEL_MULTIPART(obj) \
39         (G_TYPE_CHECK_INSTANCE_CAST \
40         ((obj), CAMEL_TYPE_MULTIPART, CamelMultipart))
41 #define CAMEL_MULTIPART_CLASS(cls) \
42         (G_TYPE_CHECK_CLASS_CAST \
43         ((cls), CAMEL_TYPE_MULTIPART, CamelMultipartClass))
44 #define CAMEL_IS_MULTIPART(obj) \
45         (G_TYPE_CHECK_INSTANCE_TYPE \
46         ((obj), CAMEL_TYPE_MULTIPART))
47 #define CAMEL_IS_MULTIPART_CLASS(cls) \
48         (G_TYPE_CHECK_CLASS_TYPE \
49         ((cls), CAMEL_TYPE_MULTIPART))
50 #define CAMEL_MULTIPART_GET_CLASS(obj) \
51         (G_TYPE_INSTANCE_GET_CLASS \
52         ((obj), CAMEL_TYPE_MULTIPART, CamelMultipartClass))
53
54 G_BEGIN_DECLS
55
56 struct _CamelMimeParser;
57
58 typedef struct _CamelMultipart CamelMultipart;
59 typedef struct _CamelMultipartClass CamelMultipartClass;
60
61 struct _CamelMultipart {
62         CamelDataWrapper parent;
63
64         GList *parts;
65         gchar *preface;
66         gchar *postface;
67 };
68
69 struct _CamelMultipartClass {
70         CamelDataWrapperClass parent_class;
71
72         /* Virtual methods */
73         void (*add_part) (CamelMultipart *multipart, CamelMimePart *part);
74         void (*add_part_at) (CamelMultipart *multipart, CamelMimePart *part, guint index);
75         void (*remove_part) (CamelMultipart *multipart, CamelMimePart *part);
76         CamelMimePart * (*remove_part_at) (CamelMultipart *multipart, guint index);
77         CamelMimePart * (*get_part) (CamelMultipart *multipart, guint index);
78         guint (*get_number) (CamelMultipart *multipart);
79         void (*set_boundary) (CamelMultipart *multipart, const gchar *boundary);
80         const gchar * (*get_boundary) (CamelMultipart *multipart);
81
82         gint (*construct_from_parser)(CamelMultipart *, struct _CamelMimeParser *);
83         /*int (*construct_from_stream)(CamelMultipart *, CamelStream *);*/
84 };
85
86 GType camel_multipart_get_type (void);
87
88 /* public methods */
89 CamelMultipart *    camel_multipart_new            (void);
90 void                camel_multipart_add_part       (CamelMultipart *multipart,
91                                                     CamelMimePart *part);
92 void                camel_multipart_add_part_at    (CamelMultipart *multipart,
93                                                     CamelMimePart *part,
94                                                     guint index);
95 void                camel_multipart_remove_part    (CamelMultipart *multipart,
96                                                     CamelMimePart *part);
97 CamelMimePart *     camel_multipart_remove_part_at (CamelMultipart *multipart,
98                                                     guint index);
99 CamelMimePart *     camel_multipart_get_part       (CamelMultipart *multipart,
100                                                     guint index);
101 guint               camel_multipart_get_number     (CamelMultipart *multipart);
102 void                camel_multipart_set_boundary   (CamelMultipart *multipart,
103                                                     const gchar *boundary);
104 const gchar *        camel_multipart_get_boundary   (CamelMultipart *multipart);
105
106 void                camel_multipart_set_preface    (CamelMultipart *multipart, const gchar *preface);
107 void                camel_multipart_set_postface   (CamelMultipart *multipart, const gchar *postface);
108
109 gint                camel_multipart_construct_from_parser (CamelMultipart *multipart, struct _CamelMimeParser *parser);
110
111 G_END_DECLS
112
113 #endif /* CAMEL_MULTIPART_H */