mime.h

Go to the documentation of this file.
00001 /*
00002  * Purple
00003  *
00004  * Purple is the legal property of its developers, whose names are too
00005  * numerous to list here. Please refer to the COPYRIGHT file distributed
00006  * with this source distribution
00007  *
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or (at
00011  * your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301,
00021  * USA.
00022  */
00023 
00024 #ifndef _PURPLE_MIME_H
00025 #define _PURPLE_MIME_H
00026 
00027 #include <glib.h>
00028 #include <glib/glist.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00045 typedef struct _PurpleMimeDocument PurpleMimeDocument;
00046 
00050 typedef struct _PurpleMimePart PurpleMimePart;
00051 
00055 PurpleMimeDocument *purple_mime_document_new(void);
00056 
00062 void purple_mime_document_free(PurpleMimeDocument *doc);
00063 
00071 PurpleMimeDocument *purple_mime_document_parse(const char *buf);
00072 
00081 PurpleMimeDocument *purple_mime_document_parsen(const char *buf, gsize len);
00082 
00086 void purple_mime_document_write(PurpleMimeDocument *doc, GString *str);
00087 
00096 GList *purple_mime_document_get_fields(PurpleMimeDocument *doc);
00097 
00107 const char *purple_mime_document_get_field(PurpleMimeDocument *doc,
00108                      const char *field);
00109 
00119 void purple_mime_document_set_field(PurpleMimeDocument *doc,
00120                   const char *field,
00121                   const char *value);
00122 
00130 GList *purple_mime_document_get_parts(PurpleMimeDocument *doc);
00131 
00137 PurpleMimePart *purple_mime_part_new(PurpleMimeDocument *doc);
00138 
00139 
00148 GList *purple_mime_part_get_fields(PurpleMimePart *part);
00149 
00150 
00160 const char *purple_mime_part_get_field(PurpleMimePart *part,
00161                      const char *field);
00162 
00167 char *purple_mime_part_get_field_decoded(PurpleMimePart *part,
00168                        const char *field);
00169 
00179 void purple_mime_part_set_field(PurpleMimePart *part,
00180                   const char *field,
00181                   const char *value);
00182 
00190 const char *purple_mime_part_get_data(PurpleMimePart *part);
00191 
00202 void purple_mime_part_get_data_decoded(PurpleMimePart *part,
00203                      guchar **data, gsize *len);
00204 
00211 gsize purple_mime_part_get_length(PurpleMimePart *part);
00212 
00213 void purple_mime_part_set_data(PurpleMimePart *part, const char *data);
00214 
00215 #ifdef __cplusplus
00216 }
00217 #endif
00218 
00219 #endif