1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2000-2012 Jeffrey Stedfast
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1
8 * of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __GMIME_PART_H__
23 #define __GMIME_PART_H__
28 #include <gmime/gmime-object.h>
29 #include <gmime/gmime-encodings.h>
30 #include <gmime/gmime-filter-best.h>
31 #include <gmime/gmime-data-wrapper.h>
35 #define GMIME_TYPE_PART (g_mime_part_get_type ())
36 #define GMIME_PART(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMIME_TYPE_PART, GMimePart))
37 #define GMIME_PART_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMIME_TYPE_PART, GMimePartClass))
38 #define GMIME_IS_PART(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMIME_TYPE_PART))
39 #define GMIME_IS_PART_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GMIME_TYPE_PART))
40 #define GMIME_PART_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMIME_TYPE_PART, GMimePartClass))
42 typedef struct _GMimePart GMimePart;
43 typedef struct _GMimePartClass GMimePartClass;
47 * @parent_object: parent #GMimeObject
48 * @encoding: a #GMimeContentEncoding
49 * @content_description: Content-Description string
50 * @content_location: Content-Location string
51 * @content_md5: Content-MD5 string
52 * @content: a #GMimeDataWrapper representing the MIME part's content
54 * A leaf-node MIME part object.
57 GMimeObject parent_object;
59 GMimeContentEncoding encoding;
60 char *content_description;
61 char *content_location;
64 GMimeDataWrapper *content;
67 struct _GMimePartClass {
68 GMimeObjectClass parent_class;
70 void (* set_content_object) (GMimePart *mime_part, GMimeDataWrapper *content);
74 GType g_mime_part_get_type (void);
77 GMimePart *g_mime_part_new (void);
78 GMimePart *g_mime_part_new_with_type (const char *type, const char *subtype);
80 /* accessor functions */
81 void g_mime_part_set_content_description (GMimePart *mime_part, const char *description);
82 const char *g_mime_part_get_content_description (GMimePart *mime_part);
84 void g_mime_part_set_content_id (GMimePart *mime_part, const char *content_id);
85 const char *g_mime_part_get_content_id (GMimePart *mime_part);
87 void g_mime_part_set_content_md5 (GMimePart *mime_part, const char *content_md5);
88 gboolean g_mime_part_verify_content_md5 (GMimePart *mime_part);
89 const char *g_mime_part_get_content_md5 (GMimePart *mime_part);
91 void g_mime_part_set_content_location (GMimePart *mime_part, const char *content_location);
92 const char *g_mime_part_get_content_location (GMimePart *mime_part);
94 void g_mime_part_set_content_encoding (GMimePart *mime_part, GMimeContentEncoding encoding);
95 GMimeContentEncoding g_mime_part_get_content_encoding (GMimePart *mime_part);
97 GMimeContentEncoding g_mime_part_get_best_content_encoding (GMimePart *mime_part, GMimeEncodingConstraint constraint);
99 void g_mime_part_set_filename (GMimePart *mime_part, const char *filename);
100 const char *g_mime_part_get_filename (GMimePart *mime_part);
102 void g_mime_part_set_content_object (GMimePart *mime_part, GMimeDataWrapper *content);
103 GMimeDataWrapper *g_mime_part_get_content_object (GMimePart *mime_part);
107 #endif /* __GMIME_PART_H__ */