1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 /* camel-multipart.h : class for a multipart 3 * 4 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) 5 * 6 * This library is free software: you can redistribute it and/or modify it 7 * under the terms of the GNU Lesser General Public License as published by 8 * the Free Software Foundation. 9 * 10 * This library is distributed in the hope that it will be useful, but 11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 13 * for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with this library. If not, see <http://www.gnu.org/licenses/>. 17 * 18 * Authors: Bertrand Guiheneuf <bertrand@helixcode.com> 19 */ 20 21 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION) 22 #error "Only <camel/camel.h> can be included directly." 23 #endif 24 25 #ifndef CAMEL_MULTIPART_H 26 #define CAMEL_MULTIPART_H 27 28 #include <camel/camel-data-wrapper.h> 29 #include <camel/camel-mime-parser.h> 30 #include <camel/camel-mime-part.h> 31 32 /* Standard GObject macros */ 33 #define CAMEL_TYPE_MULTIPART \ 34 (camel_multipart_get_type ()) 35 #define CAMEL_MULTIPART(obj) \ 36 (G_TYPE_CHECK_INSTANCE_CAST \ 37 ((obj), CAMEL_TYPE_MULTIPART, CamelMultipart)) 38 #define CAMEL_MULTIPART_CLASS(cls) \ 39 (G_TYPE_CHECK_CLASS_CAST \ 40 ((cls), CAMEL_TYPE_MULTIPART, CamelMultipartClass)) 41 #define CAMEL_IS_MULTIPART(obj) \ 42 (G_TYPE_CHECK_INSTANCE_TYPE \ 43 ((obj), CAMEL_TYPE_MULTIPART)) 44 #define CAMEL_IS_MULTIPART_CLASS(cls) \ 45 (G_TYPE_CHECK_CLASS_TYPE \ 46 ((cls), CAMEL_TYPE_MULTIPART)) 47 #define CAMEL_MULTIPART_GET_CLASS(obj) \ 48 (G_TYPE_INSTANCE_GET_CLASS \ 49 ((obj), CAMEL_TYPE_MULTIPART, CamelMultipartClass)) 50 51 G_BEGIN_DECLS 52 53 typedef struct _CamelMultipart CamelMultipart; 54 typedef struct _CamelMultipartClass CamelMultipartClass; 55 typedef struct _CamelMultipartPrivate CamelMultipartPrivate; 56 57 struct _CamelMultipart { 58 CamelDataWrapper parent; 59 CamelMultipartPrivate *priv; 60 }; 61 62 struct _CamelMultipartClass { 63 CamelDataWrapperClass parent_class; 64 65 void (*add_part) (CamelMultipart *multipart, 66 CamelMimePart *part); 67 CamelMimePart * (*get_part) (CamelMultipart *multipart, 68 guint index); 69 guint (*get_number) (CamelMultipart *multipart); 70 const gchar * (*get_boundary) (CamelMultipart *multipart); 71 void (*set_boundary) (CamelMultipart *multipart, 72 const gchar *boundary); 73 gint (*construct_from_parser) 74 (CamelMultipart *multipart, 75 CamelMimeParser *parser); 76 77 /* Padding for future expansion */ 78 gpointer reserved[20]; 79 }; 80 81 GType camel_multipart_get_type (void) G_GNUC_CONST; 82 CamelMultipart * 83 camel_multipart_new (void); 84 void camel_multipart_add_part (CamelMultipart *multipart, 85 CamelMimePart *part); 86 CamelMimePart * camel_multipart_get_part (CamelMultipart *multipart, 87 guint index); 88 guint camel_multipart_get_number (CamelMultipart *multipart); 89 const gchar * camel_multipart_get_boundary (CamelMultipart *multipart); 90 void camel_multipart_set_boundary (CamelMultipart *multipart, 91 const gchar *boundary); 92 const gchar * camel_multipart_get_preface (CamelMultipart *multipart); 93 void camel_multipart_set_preface (CamelMultipart *multipart, 94 const gchar *preface); 95 const gchar * camel_multipart_get_postface (CamelMultipart *multipart); 96 void camel_multipart_set_postface (CamelMultipart *multipart, 97 const gchar *postface); 98 gint camel_multipart_construct_from_parser 99 (CamelMultipart *multipart, 100 CamelMimeParser *parser); 101 102 G_END_DECLS 103 104 #endif /* CAMEL_MULTIPART_H */ 105