1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-multipart.h : class for a multipart */
7 * Bertrand Guiheneuf <bertrand@helixcode.com>
9 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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.
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.
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
26 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
27 #error "Only <camel/camel.h> can be included directly."
30 #ifndef CAMEL_MULTIPART_H
31 #define CAMEL_MULTIPART_H
33 #include <camel/camel-data-wrapper.h>
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))
56 struct _CamelMimeParser;
58 typedef struct _CamelMultipart CamelMultipart;
59 typedef struct _CamelMultipartClass CamelMultipartClass;
61 struct _CamelMultipart {
62 CamelDataWrapper parent;
69 struct _CamelMultipartClass {
70 CamelDataWrapperClass parent_class;
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);
82 gint (*construct_from_parser)(CamelMultipart *, struct _CamelMimeParser *);
83 /*int (*construct_from_stream)(CamelMultipart *, CamelStream *);*/
86 GType camel_multipart_get_type (void);
89 CamelMultipart * camel_multipart_new (void);
90 void camel_multipart_add_part (CamelMultipart *multipart,
92 void camel_multipart_add_part_at (CamelMultipart *multipart,
95 void camel_multipart_remove_part (CamelMultipart *multipart,
97 CamelMimePart * camel_multipart_remove_part_at (CamelMultipart *multipart,
99 CamelMimePart * camel_multipart_get_part (CamelMultipart *multipart,
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);
106 void camel_multipart_set_preface (CamelMultipart *multipart, const gchar *preface);
107 void camel_multipart_set_postface (CamelMultipart *multipart, const gchar *postface);
109 gint camel_multipart_construct_from_parser (CamelMultipart *multipart, struct _CamelMimeParser *parser);
113 #endif /* CAMEL_MULTIPART_H */