aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.h
blob: d5d703b3250151d8aea233086702f997b2e6a298 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
/* camel-mime-part.h : class for a mime part */

/* 
 *
 * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
 *      Michael Zucchi <notzed@helixcode.com>
 *
 * Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com)
 *
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */


#ifndef CAMEL_MIME_PART_H
#define CAMEL_MIME_PART_H 1


#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus }*/

#include <camel/camel-medium.h>
#include <camel/camel-mime-utils.h>
#include <camel/camel-mime-parser.h>

#define CAMEL_MIME_PART_TYPE     (camel_mime_part_get_type ())
#define CAMEL_MIME_PART(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_MIME_PART_TYPE, CamelMimePart))
#define CAMEL_MIME_PART_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MIME_PART_TYPE, CamelMimePartClass))
#define CAMEL_IS_MIME_PART(o)    (CAMEL_CHECK_TYPE((o), CAMEL_MIME_PART_TYPE))

/* note, if you change this, make sure you change the 'encodings' array in camel-mime-part.c */
enum _CamelMimePartEncodingType {
        CAMEL_MIME_PART_ENCODING_DEFAULT,
        CAMEL_MIME_PART_ENCODING_7BIT,
        CAMEL_MIME_PART_ENCODING_8BIT,
        CAMEL_MIME_PART_ENCODING_BASE64,
        CAMEL_MIME_PART_ENCODING_QUOTEDPRINTABLE,
        CAMEL_MIME_PART_ENCODING_BINARY,
        CAMEL_MIME_PART_NUM_ENCODINGS
};
typedef enum _CamelMimePartEncodingType CamelMimePartEncodingType;


/* Do not change these values directly, you would regret it one day */
struct _CamelMimePart
{
    CamelMedium parent_object;
    
    /* All fields here are -** PRIVATE **- */ 
    gchar *description;
    CamelMimeDisposition *disposition;
    gchar *content_id;
    gchar *content_MD5;
    GList *content_languages;
    CamelMimePartEncodingType encoding;
    
    CamelContentType *content_type;

    struct _header_raw *headers; /* mime headers */
};

typedef struct _CamelMimePartClass {
    CamelMediumClass parent_class;
    
    /* Virtual methods */
    int (*construct_from_parser) (CamelMimePart *, CamelMimeParser *);
} CamelMimePartClass;

/* Standard Camel function */
CamelType camel_mime_part_get_type (void);

/* public methods */
CamelMimePart *  camel_mime_part_new                    (void);

void             camel_mime_part_set_description    (CamelMimePart *mime_part, const gchar *description);
const     gchar *camel_mime_part_get_description    (CamelMimePart *mime_part);

void             camel_mime_part_set_disposition    (CamelMimePart *mime_part, const gchar *disposition);
const     gchar *camel_mime_part_get_disposition    (CamelMimePart *mime_part);

void             camel_mime_part_set_filename       (CamelMimePart *mime_part, const gchar *filename);
const     gchar *camel_mime_part_get_filename       (CamelMimePart *mime_part);

void             camel_mime_part_set_content_id     (CamelMimePart *mime_part, const char *contentid);
const     gchar *camel_mime_part_get_content_id     (CamelMimePart *mime_part);

void         camel_mime_part_set_content_MD5    (CamelMimePart *mime_part, const char *);
const     gchar *camel_mime_part_get_content_MD5    (CamelMimePart *mime_part);

void             camel_mime_part_set_encoding       (CamelMimePart *mime_part, CamelMimePartEncodingType type);
CamelMimePartEncodingType camel_mime_part_get_encoding  (CamelMimePart *mime_part);

void         camel_mime_part_set_content_languages  (CamelMimePart *mime_part, GList *content_languages);
const     GList *camel_mime_part_get_content_languages  (CamelMimePart *mime_part);

/* FIXME: what about content-type parameters?   what about major/minor parts? */
void               camel_mime_part_set_content_type     (CamelMimePart *mime_part, gchar *content_type);
CamelContentType  *camel_mime_part_get_content_type (CamelMimePart *mime_part);

const     gchar *         camel_mime_part_encoding_to_string   (CamelMimePartEncodingType encoding);
CamelMimePartEncodingType camel_mime_part_encoding_from_string (const gchar *string);

/* construction */
int     camel_mime_part_construct_from_parser  (CamelMimePart *, CamelMimeParser *);

/* utility functions */
void        camel_mime_part_set_content            (CamelMimePart *camel_mime_part,
                            const char *content, int length, const char *type);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* CAMEL_MIME_PART_H */

lass='insertions'>+4 * Update deskutils/calibre to 2.79.0madpilot2017-02-113-5/+4 * Update to 1.1.36culot2017-02-072-10/+11 * - Remove inclusion of bsd.default-versions.mk from ftp/curl/Makefile sotijl2017-02-061-11/+0 * Revert deprecation/broken. It turned out that an old configuration setting on myehaupt2017-02-041-4/+0 * Unbreak the INDEX build after r432934.danfe2017-02-011-2/+2 * - Update to 1.11.4danilo2017-01-294-25/+11 * Update deskutils/calibre to 2.78.0.madpilot2017-01-272-4/+4 * Mark BROKEN, DEPRECATED and set EXPIRATION_DATE to 3 months. The panel pluginehaupt2017-01-261-0/+4 * Reset sanpei@'s ports after 18 months of inactivity.rene2017-01-231-1/+1 * Update WWW: SF redirects to https://sourceforge.net/projects/<PROJECT_NAME>/sunpoet2017-01-213-3/+3 * Update to 0.9.34ehaupt2017-01-173-7/+10 * Update calibre to 2.77.0madpilot2017-01-162-5/+4 * - Always check OPSYS along with OSVERSIONamdmi32017-01-121-1/+1 * Move devel/py-gflags to devel/py-python-gflags and update to 3.1.0sunpoet2017-01-111-5/+5 * - Remove always-true/false conditions after FreeBSD 9, 10.1, 10.2 EOLamdmi32017-01-093-53/+1 * Chase update of graphics/poppler (and slaves ports) in revision r430777olivierd2017-01-072-1/+2 * LIB_DEPENDS=libglib-2.0.so should be USE_GNOME=glib20.adamw2017-01-071-12/+11 * devel/boost-*: update to 1.63.0jbeich2017-01-067-7/+7 * Remove BROKEN_FreeBSD_9sunpoet2017-01-012-4/+0 * Update calibre to 2.76.0.madpilot2016-12-312-4/+4 * deskutils/genius: Update to 1.0.22woodsb022016-12-283-5/+29 * - Remove bogus (in presence of USE_GITHUB) USES=tar*amdmi32016-12-2712-12/+12 * Update calibre to 2.75.1madpilot2016-12-263-4/+5 * - Update to 0.0.20161120amdmi32016-12-252-5/+5 * Update to 3.11.vanilla2016-12-242-3/+4 * Update to 0.43.vanilla2016-12-242-5/+4 * Update calibre to 2.75.0.madpilot2016-12-242-4/+4 * Data::ICal::DateTime - convenience methods for using Data::ICal withmatthew2016-12-245-0/+45 * Update to 1.5ehaupt2016-12-233-6/+78 * deskutils/semantik: update to 0.9.5avilla2016-12-233-8/+17 * - Update to 5.30.7amdmi32016-12-212-4/+4 * Get rid of QT_PREFIX in favour of PREFIX.tcberner2016-12-191-1/+1 * deskutils/gourmet: fix incorrect python rangerm2016-12-181-1/+1 * Horde package update:mm2016-12-182-4/+4 * Horde package update:mm2016-12-174-8/+8 * Add go-for-it 1.4.7, stylish to-do list with built-in productivityehaupt2016-12-165-0/+50 * deskutils/gourmet: update sqlalchemy dependencyrm2016-12-151-2/+2 * Stepping down as maintainer for some ports.johans2016-12-151-1/+1 * deskutils/gourmet: fix runtimerm2016-12-152-3/+38 * Update sqlalchemy dependency of deskutils/griffith and games/childsplayrene2016-12-141-2/+2 * Update calibre to 2.74.0madpilot2016-12-123-5/+5 * multimedia/ffmpeg: update to 3.2.2jbeich2016-12-112-2/+2 * Remove libintl.so.9 compatibility link that was added in r374303 totijl2016-12-0914-9/+14 * Remove libiconv.so.3 compatibility link that was added in r374303 totijl2016-12-094-3/+4 * Remove libart_lgpl_2.so.5 compatibility link that was added in r374303 totijl2016-12-093-3/+3 * Remove libcurl.so.7 compatibility link that was added in r374303 totijl2016-12-094-4/+4 * Remove libxslt.so.2 and libexslt.so.8 compatibility links that were added intijl2016-12-081-1/+1 * - Update security/cryptopp to 5.6.5jhale2016-12-071-1/+1 * http://github.com redirects to https://github.com, spare everyone a redirect.mat2016-12-021-2/+1 * - Update to 16.1.20161107danilo2016-12-022-7/+9 * Update to 2.2.4jhale2016-12-012-4/+4 * - Upgrade to 1.4.3 and unbreak.kuriyama2016-11-293-14/+13 * Update security/gpgme-* to 1.8.0jhale2016-11-273-3/+3 * Update calibre to 2.73.0.madpilot2016-11-262-5/+4 * Fixup USE_GITHUB usage.mat2016-11-262-4/+3 * Add explicit build dependency on the python symlink, currently it reliesantoine2016-11-251-1/+2 * Remove expired port:rene2016-11-248-187/+0 * - Add LICENSEamdmi32016-11-241-1/+4 * - Don't install COPYING with docsamdmi32016-11-242-5/+5 * devel/boost-*: update to 1.62.0jbeich2016-11-237-4/+7 * Fix conflict between libqgpgme from deskutils/kdepimlibs4 and security/qgpgme...tcberner2016-11-235-17/+27 * deskutils/virt-manager: fix spice consolenovel2016-11-212-0/+36 * Bump PORTREVISIONS for ports depending on the canonical version of GCC andgerald2016-11-205-2/+5 * deskutils/pal: Document ncurses, readline requirements, honor flagsmarino2016-11-203-13/+37 * devel/icu: update to 58.1jbeich2016-11-201-0/+1 * Convert to USES=pyqt.madpilot2016-11-191-18/+3 * Update calibre to 2.72.0.madpilot2016-11-193-4/+5 * deskutils/ical: unbreak with libc++ 3.9jbeich2016-11-181-0/+11 * Reset edwin's ports, he has handed in his commit bit.rene2016-11-172-2/+2 * - Fix LICENSEamdmi32016-11-161-1/+1 * Mark as broken on various tier-2 archs.linimon2016-11-141-0/+2 * - Remove redundant definitions of IPV6_DESC and [OPEN]SSL_DESC when closelydanfe2016-11-141-4/+3 * - Update to 0.3.4olivierd2016-11-143-8/+8 * Clean up TEST_DEPENDS, devel/py-unittest2 was removed at 2016-09-26rene2016-11-141-1/+0 * deskutils/vboxgtk: remove bogus dependencyrm2016-11-131-1/+1 * Bump PORTREVISION to chrase comms/gammu's shared library version.vanilla2016-11-131-0/+1 * Horde package update:mm2016-11-122-4/+4 * Horde package update:mm2016-11-092-4/+4 * Remove broken optionantoine2016-11-091-10/+3 * - Upgrade fet to 5.30.5madpilot2016-11-062-4/+4 * deskutils/taskwarrior: Update to 2.5.1koobs2016-11-039-158/+12 * Cleanup no longer needed CHMOD usage after r424898.mat2016-11-031-4/+10 * - Fix LICENSEamdmi32016-11-019-45/+44 * - Update spice-gtk to 0.33madpilot2016-11-015-95/+82 * - Update calibre to 2.71.0madpilot2016-11-013-8/+8 * www/py-cssutils: track PORTEPOCH in consumersjbeich2016-10-291-2/+2 * devel/py-pytz: track PORTEPOCH in consumersjbeich2016-10-291-1/+1 * - Mark BROKEN on 9 i386:amdmi32016-10-261-0/+2 * deskutils/xfce4-notification-daemon: Mark DEPRECATEDwoodsb022016-10-231-0/+3 * deskutils/gnome-contacts: bump PORTREVISIONmarino2016-10-231-1/+1 * deskutils/gnome-contacts: restore CHEESE optionmarino2016-10-231-2/+13 * ${RM} already has -f.mat2016-10-2112-13/+13 * - Mark BROKEN on 9.x: does not build:amdmi32016-10-211-0/+2 * Reassign makc's ports back to the pool.rakuco2016-10-202-2/+2 * deskutils/py-khal: Update to 0.7.1feld2016-10-193-6/+7 * Introduce new extensible virtual categories for KDEtcberner2016-10-194-12/+4 * deskutils/(py-)spice-gtk: Fix build including with gold linkermarino2016-10-175-13/+47 * - Update calibre to 2.70.0madpilot2016-10-153-15/+9 * Update math/libqalculate to 0.9.10jhale2016-10-151-1/+1 * devel/nspr, security/nss: drop version from SONAMEjbeich2016-10-091-1/+1 * Mark BROKEN: fails to buildantoine2016-10-091-0/+2 * - Update to 0.12.1amdmi32016-10-062-4/+5 * deskutils/spice-gtk: update to 0.32novel2016-10-043-46/+46 * - Update to 0.3.3ehaupt2016-10-033-24/+5 * Update to version 0.0.20160925pawel2016-10-012-5/+5 * Let USES=localbase add -L${LOCALBASE}/lib to LIBS instead of LDFLAGS.tijl2016-10-012-4/+4 * Update calibre to 2.69.0madpilot2016-10-012-5/+4 * - update to 4.8.0jgh2016-09-302-6/+7 * - Fix LICENSEamdmi32016-09-292-6/+8 * - Update devel/icu to 57.1.tijl2016-09-241-0/+1 * Update email address to jrm@FreeBSD.org for ports that I maintainjrm2016-09-241-1/+1 * Update calibre to 2.68.0madpilot2016-09-162-4/+4 * Unbreak by switching to GitHub and upgrade to the latest (no releasethierry2016-09-165-71/+38 * Unmark broken on powerpc64swills2016-09-156-12/+0 * GOOGLE_CODE has gone away.mat2016-09-148-2/+15 * Update to 0.2.2olivierd2016-09-142-4/+4 * - Add LICENSEamdmi32016-09-132-12/+19 * - Fix LICENSEamdmi32016-09-121-8/+9 * - Update to 0.2.1, it's now hosted on xfce.orgolivierd2016-09-123-8/+7 * - Update to 0.3.2ehaupt2016-09-105-15/+26 * Most commonly used build systems support silent builds, when theyamdmi32016-09-101-1/+0 * - Update calibre to 2.67.0madpilot2016-09-093-9/+12 * Horde package update:mm2016-09-086-12/+12 * - Fix plist for GTK2 modeamdmi32016-09-072-4/+3 * - Update to 0.3.1ehaupt2016-09-073-6/+15 * Chase update of Poppler after revision r421386olivierd2016-09-062-1/+2 * deskutils/gnome-contacts: remove CHEESE optionmarino2016-09-051-10/+2 * - Fix build on 11+amdmi32016-09-042-2/+22 * Update to 2.66.0madpilot2016-09-023-5/+5 * deskutils/gnome-contacts: Fix buildpi2016-09-021-5/+25 * Update to 2.65.1.madpilot2016-08-283-8/+9 * Update to version 5.30.3pawel2016-08-262-4/+4 * Replace Mk/bsd.kde4.mk by Mk/Uses/kde.mk in preparation for KDE Frameworks andtcberner2016-08-2427-62/+63 * Update gnome-maps to 3.18.4.kwm2016-08-243-4/+5 * - Update to 0.42amdmi32016-08-242-4/+4 * Update gnome-maps to 3.18.3.1.kwm2016-08-232-4/+13 * Update to 2.2.3.madpilot2016-08-222-5/+4 * Update sqlalchemy dependency to not depend on an expired versionrene2016-08-221-2/+2 * deskutils/xchm: drop maintainershiprm2016-08-181-1/+1 * - Fix licenseamdmi32016-08-172-8/+7 * New port: devel/grantlee5 and Uses/grantlee.mktcberner2016-08-152-5/+2 * Remove www/pecl-APC, it doesn't work with PHP 5.5+.mat2016-08-151-3/+1 * - Add NO_ARCHamdmi32016-08-143-15/+16 * - Update to 2.64.0madpilot2016-08-134-27/+4 * Add a rc script and have taskd run as an unprivileged userskreuzer2016-08-124-17/+86 * - Update to version 1.7.2pawel2016-08-101-1/+1 * deskutils/puush: 0.0.1 -> 0.0.2pi2016-08-092-4/+4 * Fix build with mono 4.4.romain2016-08-091-0/+13 * Register devel/dbus as LIB_DEPENDS (prompted by stage-qa).ehaupt2016-08-081-2/+4 * Pacify portlint and stage-qaehaupt2016-08-084-12/+17 * Bump PORTREVISION (forgotten in previous commit)ehaupt2016-08-081-1/+1 * Register missing LIB_DEPENDS, USES, USE_GNOMEehaupt2016-08-081-2/+6