Initialize the gmime for upstream
[platform/upstream/gmime.git] / gmime / gmime-disposition.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*  GMime
3  *  Copyright (C) 2000-2012 Jeffrey Stedfast
4  *
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.
9  *
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.
14  *
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
18  *  02110-1301, USA.
19  */
20
21
22 #ifndef __GMIME_DISPOSITION_H__
23 #define __GMIME_DISPOSITION_H__
24
25 #include <glib.h>
26 #include <glib-object.h>
27
28 #include <gmime/gmime-param.h>
29
30 G_BEGIN_DECLS
31
32 #define GMIME_TYPE_CONTENT_DISPOSITION              (g_mime_content_disposition_get_type ())
33 #define GMIME_CONTENT_DISPOSITION(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), g_mime_content_disposition_get_type (), GMimeContentDisposition))
34 #define GMIME_CONTENT_DISPOSITION_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), g_mime_content_disposition_get_type (), GMimeContentDispositionClass))
35 #define GMIME_IS_CONTENT_DISPOSITION(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), g_mime_content_disposition_get_type ()))
36 #define GMIME_IS_CONTENT_DISPOSITION_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), g_mime_content_disposition_get_type ()))
37 #define GMIME_CONTENT_DISPOSITION_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), g_mime_content_disposition_get_type (), GMimeContentDispositionClass))
38
39 typedef struct _GMimeContentDisposition GMimeContentDisposition;
40 typedef struct _GMimeContentDispositionClass GMimeContentDispositionClass;
41
42 /**
43  * GMIME_DISPOSITION_ATTACHMENT:
44  *
45  * Standard attachment disposition.
46  **/
47 #define GMIME_DISPOSITION_ATTACHMENT "attachment"
48
49
50 /**
51  * GMIME_DISPOSITION_INLINE:
52  *
53  * Standard inline disposition.
54  **/
55 #define GMIME_DISPOSITION_INLINE     "inline"
56
57
58 /**
59  * GMimeContentDisposition:
60  * @parent_object: parent #GObject
61  * @param_hash: parameter hash table keyed by param name
62  * @params: a #GMimeParam list
63  * @disposition: disposition
64  *
65  * A data structure representing a Content-Disposition.
66  **/
67 struct _GMimeContentDisposition {
68         GObject parent_object;
69         
70         GHashTable *param_hash;
71         GMimeParam *params;
72         
73         gpointer priv;
74         
75         char *disposition;
76 };
77
78 struct _GMimeContentDispositionClass {
79         GObjectClass parent_class;
80         
81 };
82
83 GType g_mime_content_disposition_get_type (void);
84
85
86 GMimeContentDisposition *g_mime_content_disposition_new (void);
87 GMimeContentDisposition *g_mime_content_disposition_new_from_string (const char *str);
88
89 void g_mime_content_disposition_set_disposition (GMimeContentDisposition *disposition, const char *value);
90 const char *g_mime_content_disposition_get_disposition (GMimeContentDisposition *disposition);
91
92 void g_mime_content_disposition_set_params (GMimeContentDisposition *disposition, GMimeParam *params);
93 const GMimeParam *g_mime_content_disposition_get_params (GMimeContentDisposition *disposition);
94
95 void g_mime_content_disposition_set_parameter (GMimeContentDisposition *disposition,
96                                                const char *attribute, const char *value);
97 const char *g_mime_content_disposition_get_parameter (GMimeContentDisposition *disposition,
98                                                       const char *attribute);
99
100 char *g_mime_content_disposition_to_string (GMimeContentDisposition *disposition, gboolean fold);
101
102 G_END_DECLS
103
104 #endif /* __GMIME_DISPOSITION_H__ */