diff options
author | bertrand <Bertrand.Guiheneuf@aful.org> | 1999-08-25 23:44:35 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-08-25 23:44:35 +0800 |
commit | 686273e70da67d8844344f0b8ccc592ca7e92f50 (patch) | |
tree | ba722c5e7437f5b50dc1ee9dfff7afa9948a448a /camel | |
parent | 6881fd1bf710f0ce0bd55f9975855bb23622077a (diff) | |
download | gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.tar gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.tar.gz gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.tar.bz2 gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.tar.lz gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.tar.xz gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.tar.zst gsoc2013-evolution-686273e70da67d8844344f0b8ccc592ca7e92f50.zip |
these methods are in CamelMedium now.
1999-08-25 bertrand <Bertrand.Guiheneuf@aful.org>
* camel/camel-medium.c (_set_content_object):
(_get_content_object): these methods are
in CamelMedium now.
Going to revamp MimePart soon so that it inherits from CamelMedium.
svn path=/trunk/; revision=1141
Diffstat (limited to 'camel')
-rw-r--r-- | camel/camel-medium.c | 62 | ||||
-rw-r--r-- | camel/camel-medium.h | 6 | ||||
-rw-r--r-- | camel/camel-mime-part.c | 4 |
3 files changed, 67 insertions, 5 deletions
diff --git a/camel/camel-medium.c b/camel/camel-medium.c index 8414432a07..b6a3ffc9fc 100644 --- a/camel/camel-medium.c +++ b/camel/camel-medium.c @@ -37,12 +37,14 @@ static CamelDataWrapperClass *parent_class=NULL; /* Returns the class for a CamelMedium */ -#define CMP_CLASS(so) CAMEL_MEDIUM_CLASS (GTK_OBJECT(so)->klass) +#define CM_CLASS(so) CAMEL_MEDIUM_CLASS (GTK_OBJECT(so)->klass) static void _add_header (CamelMedium *medium, gchar *header_name, gchar *header_value); static void _remove_header (CamelMedium *medium, const gchar *header_name); static const gchar *_get_header (CamelMedium *medium, const gchar *header_name); +static CamelDataWrapper *_get_content_object(CamelMedium *medium); +static void _set_content_object(CamelMedium *medium, CamelDataWrapper *content); static void _finalize (GtkObject *object); @@ -121,6 +123,9 @@ _finalize (GtkObject *object) } + +/* **** */ + static void _add_header (CamelMedium *medium, gchar *header_name, gchar *header_value) { @@ -144,10 +149,12 @@ _add_header (CamelMedium *medium, gchar *header_name, gchar *header_value) void camel_medium_add_header (CamelMedium *medium, gchar *header_name, gchar *header_value) { - CMP_CLASS(medium)->add_header(medium, header_name, header_value); + CM_CLASS(medium)->add_header(medium, header_name, header_value); } +/* **** */ + static void _remove_header (CamelMedium *medium, const gchar *header_name) @@ -172,10 +179,12 @@ _remove_header (CamelMedium *medium, const gchar *header_name) void camel_medium_remove_header (CamelMedium *medium, const gchar *header_name) { - CMP_CLASS(medium)->remove_header(medium, header_name); + CM_CLASS(medium)->remove_header(medium, header_name); } +/* **** */ + static const gchar * _get_header (CamelMedium *medium, const gchar *header_name) @@ -192,6 +201,51 @@ _get_header (CamelMedium *medium, const gchar *header_name) const gchar * camel_medium_get_header (CamelMedium *medium, const gchar *header_name) { - return CMP_CLASS(medium)->get_header (medium, header_name); + return CM_CLASS(medium)->get_header (medium, header_name); +} + + +/* **** */ + + +static CamelDataWrapper * +_get_content_object (CamelMedium *medium) +{ + return medium->content; + +} + + +CamelDataWrapper * +camel_medium_get_content_object (CamelMedium *medium) +{ + return CM_CLASS(medium)->get_content_object (medium); } + +/* **** */ + + +static void +_set_content_object (CamelMedium *medium, CamelDataWrapper *content) +{ + GMimeContentField *object_content_field; + + CAMEL_LOG_FULL_DEBUG ("Entering CamelMedium::set_content_object\n"); + if (medium->content) { + CAMEL_LOG_FULL_DEBUG ("CamelMedium::set_content_object unreferencing old content object\n"); + gtk_object_unref (GTK_OBJECT (medium->content)); + } + gtk_object_ref (GTK_OBJECT (content)); + medium->content = content; + +} + +void +camel_medium_set_content_object (CamelMedium *medium, CamelDataWrapper *content) +{ + CM_CLASS(medium)->set_content_object (medium, content); +} + + +/* **** */ diff --git a/camel/camel-medium.h b/camel/camel-medium.h index c35466336c..d39b5898ad 100644 --- a/camel/camel-medium.h +++ b/camel/camel-medium.h @@ -48,7 +48,6 @@ typedef struct GHashTable *headers; - GMimeContentField *content_type; CamelDataWrapper *content; /* part real content */ } CamelMedium; @@ -63,6 +62,9 @@ typedef struct { void (*remove_header) (CamelMedium *medium, const gchar *header_name); const gchar * (*get_header) (CamelMedium *medium, const gchar *header_name); + CamelDataWrapper * (*get_content_object) (CamelMedium *medium); + void (*set_content_object) (CamelMedium *medium, CamelDataWrapper *content); + } CamelMediumClass; @@ -77,6 +79,8 @@ void camel_medium_remove_header (CamelMedium *medium, const gchar *header_name); const gchar *camel_medium_get_header (CamelMedium *medium, const gchar *header_name); +CamelDataWrapper *camel_medium_get_content_object (CamelMedium *medium); +void camel_medium_set_content_object (CamelMedium *medium, CamelDataWrapper *content); #ifdef __cplusplus diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index edab1636b6..1620eb771f 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -572,6 +572,8 @@ _get_content_object(CamelMimePart *mime_part) return mime_part->content; } + + const CamelDataWrapper * camel_mime_part_get_content_object(CamelMimePart *mime_part) { @@ -579,6 +581,8 @@ camel_mime_part_get_content_object(CamelMimePart *mime_part) } + + static void _set_content_object(CamelMimePart *mime_part, CamelDataWrapper *content) { |