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 */

etions'>-0/+123 * Fix a typo.thierry2009-02-281-1/+1 * Upgrade to 1.04 and make fetchable again.thierry2009-02-272-3/+3 * Use my @FreeBSD.org email for the rest of my portsmakc2009-02-211-1/+1 * - Update to 20090215miwi2009-02-202-4/+4 * 2009-01-19 games/emacs-chess: has been broken for more than 6 monthsmiwi2009-02-046-122/+0 * - Use GNOME macro instead of ${MASTER_SITE_GNOME}, removearaujo2009-02-021-1/+1 * - Update download locationpav2009-01-311-1/+1 * Fix path for xfs default configuration file.flz2009-01-292-2/+3 * - update to 20090104 versionpgollucci2009-01-275-495/+15 * Update to 2.28ahze2009-01-262-4/+4 * - Update X.org ports to 7.4+ (few ports are more recent than the katamari).flz2009-01-2431-108/+56 * - Update fntsample to 3.0pav2009-01-212-21/+54 * - Update to 4.1.8amdmi32009-01-173-36/+27 * - Update to maintainer mail adressmiwi2009-01-161-1/+1 * - Fix plist with perl 5.8.9pav2009-01-151-0/+2 * - Add some more contributed programming fontsrafan2009-01-133-9/+54 * Fix the plist, bump the PORTREVISION.mezz2009-01-122-2/+2 * Presenting GNOME 2.24 for FreeBSD.marcus2009-01-108-26/+49 * - USE_GZIP does not need to be defined last few yearspav2009-01-091-1/+0 * Add a patch for removing four bogus Japanese glyphs as a workaround.hrs2008-12-312-0/+95 * Mark broken and deprecated: these fonts are unfetchable and we are notthierry2008-12-302-1/+9 * - Update to 4.28.stefan2008-12-194-204/+182 * Reset gurkan@phys.ethz.ch due to maintainer-timeouts and no response tolinimon2008-12-161-1/+1 * - Improve description a littlepav2008-12-121-1/+4 * Inconsolata is a monospace font.pav2008-12-124-0/+40 * Reset mita@jp.FreeBSD.org due to long period of inactivity.linimon2008-12-081-1/+1 * - use DOCSDIRitetcu2008-11-242-14/+12 * Update to wqy font set:delphij2008-11-037-53/+153 * MonteCarlo is a bitmap font suitable for code editors. All the charactersmiwi2008-11-024-0/+45 * - Fix reference to X11BASE in pkg-descr.lippe2008-10-263-10/+7 * Install the proprietary license text as advertised in pkg-message.stefan2008-10-252-1/+5 * Profont - The ultimate programming font.amdmi32008-10-115-0/+53 * Update to 2.27ahze2008-10-022-4/+4 * - Update to 20080907miwi2008-09-302-4/+4 * Reset infofarmer due to maintainer-timeouts and no response to email.linimon2008-09-074-4/+4 * - Update to 20080820miwi2008-08-264-8/+8 * Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-2/+0 * Reset conrads@cox.net due to lack of time to work on FreeBSD.linimon2008-08-203-3/+3 * - Update to 20080808miwi2008-08-154-8/+8 * - Update to 20080706miwi2008-08-134-8/+8 * Update to 2.26ahze2008-08-112-4/+4 * - Remove duplicates from MAKE_ENV after inclusion of CC and CXX in default MA...pav2008-07-251-1/+1 * GNU Unifont is a free bitmap font that coversmiwi2008-07-194-0/+41 * - Update to 20080620miwi2008-07-192-6/+6 * - Update to 0.5.4pav2008-07-083-6/+6 * [UPDATE] sysutils/gnu-unifont update and category moved to x11-fonts & jfbter...edwin2008-07-055-49/+18 * Update to 2.1.13.marcus2008-07-052-4/+4 * Remove references about /usr/X11R6 from pkg-message.olgeni2008-06-217-14/+14 * Update to 0.45mat2008-06-202-4/+4 * Upgrade to 1.171.thierry2008-06-183-7/+6 * Update to 0.44mat2008-06-123-27/+74 * Upgrade to the latest version, named 1.0 (PORTEPOCH bumped).thierry2008-06-123-7/+7 * - Update to 0.5.3pav2008-06-093-5/+4 * Update to 1.20mat2008-06-062-4/+4 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-064-2/+4 * - Fix pkg-plist.lippe2008-05-302-8/+2 * - Add common code to support for cmake based ports.miwi2008-05-281-12/+2 * Update to 2.25ahze2008-05-272-5/+4 * Add port x11-fonts/kaputa:sat2008-05-205-0/+60 * Add port x11-fonts/tmu:sat2008-05-195-0/+72 * Add port x11-fonts/code2001:sat2008-05-105-0/+60 * Reset aaron's port maintainerships due to many maintainer-timeouts.linimon2008-04-291-1/+1 * Reset jylefort's port maintainerships. portmgr has taken his commit bitlinimon2008-04-291-1/+1 * - Build-depend on gawsat2008-04-281-0/+1 * - Update to 2.8sat2008-04-242-4/+4 * * ttf-malayalam:thierry2008-04-244-4/+22 * - Fix build after xorg cleanupmiwi2008-04-211-1/+1 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-2078-170/+179 * - Take advantage of CPAN macro from bsd.sites.mk, change ${MASTER_SITE_PERL_C...araujo2008-04-173-6/+3 * - Update to 0.4.2rafan2008-04-132-4/+4 * Change maintainers e-mail address.ehaupt2008-04-111-2/+2 * - Move from versioned tcl/tk CATEGORIES to simple tcl and tk categoriespav2008-04-091-1/+1 * Upgrade to 1.17, switch to mkfontscale / mkfontdir and run fc-cache.thierry2008-04-093-20/+17 * - Update to 0.4.1pav2008-04-073-17/+24 * - Makefile cosmetic changes.lippe2008-04-032-14/+13 * This ttf-indic-fonts is a set of TrueType andthierry2008-04-036-0/+304 * Linux Libertine is a font family with a serif typeface. These fontsthierry2008-04-025-0/+77 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-267-13/+7 * Fix plistahze2008-03-262-130/+60 * add SHA256 checksums and reformat Makefileedwin2008-03-252-20/+31 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-257-14/+9 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-251-1/+1 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-244-8/+4 * The FreeBSD GNOME team is proud to annunce the release of GNOME 2.22.0 formarcus2008-03-244-92/+13 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-242-5/+2 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-244-8/+4 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-232-4/+2 * - Remove USE_XLIB in favor of USE_XORGmiwi2008-03-221-2/+1 * - Remove USE_GETOPT_LONG which is a no-op since March 2007pav2008-03-201-1/+0 * Add gnu-unifont 1.0.0, unicode font.vanilla2008-03-194-0/+73 * Update to 2.24ahze2008-03-192-4/+4 * - Remove USE_X_PREFIXbeech2008-03-181-3/+2 * - Remove dependency on X_CLIENTS_PORTS and USE_X_PREFIXmiwi2008-03-141-4/+4 * - Chase devel/sdl12 shlib version bumpmiwi2008-03-131-0/+1 * - Mark xtrans as a BUILD_DEPENDS only (unless specified otherwise with :both)flz2008-03-133-2/+4 * - This actually installs a one line shell script that executed mkfontscale, sopav2008-03-121-0/+3 * - Fix BUILD_DEPENDSgahr2008-03-111-2/+4 * - Remove dependency on X_CLIENTS_PORTgahr2008-03-111-4/+2 * Get Commodore 64 font installed under the X Window System.miwi2008-03-114-0/+40 * - XFree86 support was removed few hours ago - unbreak INDEXpav2008-03-081-14/+8 * remove USE_XLIBoliver2008-03-081-4/+14 * Remove support for XFree8-4.flz2008-03-0833-5035/+6 * Update to 2.23ahze2008-02-242-4/+4 * Fontmatrix is a graphical font manager. Targeted audience are mostlymiwi2008-02-175-0/+75 * Update my address.wxs2008-02-041-1/+1 * - Dependancy fixtabthorpe2008-01-271-3/+4 * Fix PCF Font parser buffer overflow (CVE-2008-0006).flz2008-01-232-1/+25 * Update to 2.22ahze2008-01-013-28/+26 * - Update to 0.43gabor2007-12-273-7/+8 * pass maintainership to Intron <intron@intron.ac>dryice2007-12-241-1/+1 * Remove extra whitespace.olgeni2007-12-241-1/+1 * fix the fonts.alias directory. Thanks Intron <intron@intron.ac> for pointingdryice2007-12-231-2/+2 * Update to 2.21ahze2007-12-213-23/+23 * Add patch that fixes a buffer overflow.flz2007-10-312-0/+12 * Presenting GNOME 2.20.1 and all related works for FreeBSD. The officialmarcus2007-10-252-10/+11 * Replace ttmkfdir by mkfontscale & mkfontdir to install correct files.thierry2007-10-211-7/+12 * Replace ttmkfdir by mkfontscale & mkfontdir to install correct files.thierry2007-10-211-8/+13 * - Drop Maintainershipmiwi2007-10-091-1/+1 * Update to 1.0.5 (security fix).flz2007-10-082-5/+4 * - Sort category Makefilessat2007-10-061-3/+3 * Replace #!/usr/bin/perl with ${PERL}. Bump PORTREVISION.hrs2007-09-281-1/+4 * Dominic is a new dad, and will be too busy for a while to work on ports.linimon2007-09-241-2/+1 * new port: x11-fonts/fonts-indicedwin2007-09-245-0/+63 * Update to 2.20ahze2007-09-194-283/+4 * - Update X.org ports to 7.3.flz2007-09-1415-11/+29 * Welcome bsd.perl.mk. Add support for constructs such as USE_PERL5=5.8.0+.linimon2007-09-081-7/+1 * - Update to 2.7sat2007-09-042-4/+4 * - Reduce dependencies[1].hrs2007-09-023-11/+19 * Update to 2.19ahze2007-08-063-8/+4 * Add a missing dependency on docbook-410 when building fontconfig withmarcus2007-07-291-0/+1 * - Set --mandir and --infodir in CONFIGURE_ARGS if the configure scriptrafan2007-07-232-2/+0 * - Drop maintainershippav2007-07-16