1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2000-2012 Jeffrey Stedfast
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1
8 * of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __GMIME_CONTENT_TYPE_H__
23 #define __GMIME_CONTENT_TYPE_H__
26 #include <glib-object.h>
28 #include <gmime/gmime-param.h>
32 #define GMIME_TYPE_CONTENT_TYPE (g_mime_content_type_get_type ())
33 #define GMIME_CONTENT_TYPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), g_mime_content_type_get_type (), GMimeContentType))
34 #define GMIME_CONTENT_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), g_mime_content_type_get_type (), GMimeContentTypeClass))
35 #define GMIME_IS_CONTENT_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), g_mime_content_type_get_type ()))
36 #define GMIME_IS_CONTENT_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), g_mime_content_type_get_type ()))
37 #define GMIME_CONTENT_TYPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), g_mime_content_type_get_type (), GMimeContentTypeClass))
39 typedef struct _GMimeContentType GMimeContentType;
40 typedef struct _GMimeContentTypeClass GMimeContentTypeClass;
44 * @parent_object: parent #GObject
45 * @param_hash: parameter hash keyed by param name
46 * @params: a #GMimeParam list
48 * @subtype: media subtype
50 * A data structure representing a Content-Type.
52 struct _GMimeContentType {
53 GObject parent_object;
55 GHashTable *param_hash;
64 struct _GMimeContentTypeClass {
65 GObjectClass parent_class;
69 GType g_mime_content_type_get_type (void);
72 GMimeContentType *g_mime_content_type_new (const char *type, const char *subtype);
73 GMimeContentType *g_mime_content_type_new_from_string (const char *str);
75 char *g_mime_content_type_to_string (GMimeContentType *mime_type);
77 gboolean g_mime_content_type_is_type (GMimeContentType *mime_type, const char *type, const char *subtype);
79 void g_mime_content_type_set_media_type (GMimeContentType *mime_type, const char *type);
80 const char *g_mime_content_type_get_media_type (GMimeContentType *mime_type);
82 void g_mime_content_type_set_media_subtype (GMimeContentType *mime_type, const char *subtype);
83 const char *g_mime_content_type_get_media_subtype (GMimeContentType *mime_type);
85 void g_mime_content_type_set_params (GMimeContentType *mime_type, GMimeParam *params);
86 const GMimeParam *g_mime_content_type_get_params (GMimeContentType *mime_type);
88 void g_mime_content_type_set_parameter (GMimeContentType *mime_type, const char *attribute, const char *value);
89 const char *g_mime_content_type_get_parameter (GMimeContentType *mime_type, const char *attribute);
93 #endif /* __GMIME_CONTENT_TYPE_H__ */