1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-medium.h : class for a medium object */
6 * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
7 * Michael Zucchi <notzed@ximian.com>
9 * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of version 2 of the GNU Lesser General Public
13 * License as published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
27 #ifndef CAMEL_MEDIUM_H
28 #define CAMEL_MEDIUM_H 1
30 #include <camel/camel-data-wrapper.h>
32 #define CAMEL_MEDIUM_TYPE (camel_medium_get_type ())
33 #define CAMEL_MEDIUM(obj) (CAMEL_CHECK_CAST((obj), CAMEL_MEDIUM_TYPE, CamelMedium))
34 #define CAMEL_MEDIUM_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MEDIUM_TYPE, CamelMediumClass))
35 #define CAMEL_IS_MEDIUM(o) (CAMEL_CHECK_TYPE((o), CAMEL_MEDIUM_TYPE))
45 CamelDataWrapper parent_object;
47 /* The content of the medium, as opposed to our parent
48 * CamelDataWrapper, which wraps both the headers and the
51 CamelDataWrapper *content;
55 CamelDataWrapperClass parent_class;
58 void (*add_header) (CamelMedium *medium, const char *name, const void *value);
59 void (*set_header) (CamelMedium *medium, const char *name, const void *value);
60 void (*remove_header) (CamelMedium *medium, const char *name);
61 const void * (*get_header) (CamelMedium *medium, const char *name);
63 GArray * (*get_headers) (CamelMedium *medium);
64 void (*free_headers) (CamelMedium *medium, GArray *headers);
66 CamelDataWrapper * (*get_content_object) (CamelMedium *medium);
67 void (*set_content_object) (CamelMedium *medium, CamelDataWrapper *content);
70 /* Standard Camel function */
71 CamelType camel_medium_get_type (void);
73 /* Header get/set interface */
74 void camel_medium_add_header (CamelMedium *medium, const char *name, const void *value);
75 void camel_medium_set_header (CamelMedium *medium, const char *name, const void *value);
76 void camel_medium_remove_header (CamelMedium *medium, const char *name);
77 const void *camel_medium_get_header (CamelMedium *medium, const char *name);
79 GArray *camel_medium_get_headers (CamelMedium *medium);
80 void camel_medium_free_headers (CamelMedium *medium, GArray *headers);
82 /* accessor methods */
83 CamelDataWrapper *camel_medium_get_content_object (CamelMedium *medium);
84 void camel_medium_set_content_object (CamelMedium *medium,
85 CamelDataWrapper *content);
89 #endif /* CAMEL_MEDIUM_H */