Fix FSF address (Tobias Mueller, #470445)
[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 1999, 2000 Ximian, Inc. (www.ximian.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
27 #ifndef CAMEL_MULTIPART_H
28 #define CAMEL_MULTIPART_H 1
29
30 #include <camel/camel-data-wrapper.h>
31
32 #define CAMEL_MULTIPART_TYPE     (camel_multipart_get_type ())
33 #define CAMEL_MULTIPART(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_TYPE, CamelMultipart))
34 #define CAMEL_MULTIPART_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_TYPE, CamelMultipartClass))
35 #define CAMEL_IS_MULTIPART(o)    (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_TYPE))
36
37 G_BEGIN_DECLS
38
39 struct _CamelMimeParser;
40
41 struct _CamelMultipart
42 {
43         CamelDataWrapper parent_object;
44
45         GList *parts;
46         gchar *preface;
47         gchar *postface;
48 };
49
50 typedef struct {
51         CamelDataWrapperClass parent_class;
52
53         /* Virtual methods */
54         void (*add_part) (CamelMultipart *multipart, CamelMimePart *part);
55         void (*add_part_at) (CamelMultipart *multipart, CamelMimePart *part, guint index);
56         void (*remove_part) (CamelMultipart *multipart, CamelMimePart *part);
57         CamelMimePart * (*remove_part_at) (CamelMultipart *multipart, guint index);
58         CamelMimePart * (*get_part) (CamelMultipart *multipart, guint index);
59         guint (*get_number) (CamelMultipart *multipart);
60         void (*set_boundary) (CamelMultipart *multipart, const char *boundary);
61         const gchar * (*get_boundary) (CamelMultipart *multipart);
62
63         int (*construct_from_parser)(CamelMultipart *, struct _CamelMimeParser *);
64         /*int (*construct_from_stream)(CamelMultipart *, CamelStream *);*/
65
66 } CamelMultipartClass;
67
68 /* Standard Camel function */
69 CamelType camel_multipart_get_type (void);
70
71
72 /* public methods */
73 CamelMultipart *    camel_multipart_new            (void);
74 void                camel_multipart_add_part       (CamelMultipart *multipart,
75                                                     CamelMimePart *part);
76 void                camel_multipart_add_part_at    (CamelMultipart *multipart,
77                                                     CamelMimePart *part,
78                                                     guint index);
79 void                camel_multipart_remove_part    (CamelMultipart *multipart,
80                                                     CamelMimePart *part);
81 CamelMimePart *     camel_multipart_remove_part_at (CamelMultipart *multipart,
82                                                     guint index);
83 CamelMimePart *     camel_multipart_get_part       (CamelMultipart *multipart,
84                                                     guint index);
85 guint               camel_multipart_get_number     (CamelMultipart *multipart);
86 void                camel_multipart_set_boundary   (CamelMultipart *multipart,
87                                                     const char *boundary);
88 const char *        camel_multipart_get_boundary   (CamelMultipart *multipart);
89
90 void                camel_multipart_set_preface    (CamelMultipart *multipart, const char *preface);
91 void                camel_multipart_set_postface   (CamelMultipart *multipart, const char *postface);
92
93 int                 camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *parser);
94
95 G_END_DECLS
96
97 #endif /* CAMEL_MULTIPART_H */