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/camel-medium.c | |
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/camel-medium.c')
-rw-r--r-- | camel/camel-medium.c | 62 |
1 files changed, 58 insertions, 4 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); +} + + +/* **** */ |