Annotation of win32/gnome/gmime-x.x.x/gmime-part.h, revision 1.1
1.1 ! paf 1: /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
! 2: /*
! 3: * Authors: Jeffrey Stedfast <fejj@helixcode.com>
! 4: *
! 5: * Copyright 2000 Helix Code, Inc. (www.helixcode.com)
! 6: *
! 7: * This program is free software; you can redistribute it and/or modify
! 8: * it under the terms of the GNU General Public License as published by
! 9: * the Free Software Foundation; either version 2 of the License, or
! 10: * (at your option) any later version.
! 11: *
! 12: * This program is distributed in the hope that it will be useful,
! 13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
! 14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 15: * GNU General Public License for more details.
! 16: *
! 17: * You should have received a copy of the GNU General Public License
! 18: * along with this program; if not, write to the Free Software
! 19: * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
! 20: *
! 21: */
! 22:
! 23: #ifndef __GMIME_PART_H__
! 24: #define __GMIME_PART_H__
! 25:
! 26: #ifdef __cplusplus
! 27: extern "C" {
! 28: //#pragma }
! 29: #endif /* __cplusplus */
! 30:
! 31: #include <glib.h>
! 32: #include <stdio.h>
! 33: #include "gmime-object.h"
! 34: #include "gmime-param.h"
! 35: #include "gmime-header.h"
! 36: #include "gmime-content-type.h"
! 37: #include "gmime-disposition.h"
! 38: #include "gmime-data-wrapper.h"
! 39: #include "gmime-stream.h"
! 40:
! 41:
! 42: struct _GMimePart {
! 43: GMimeObject parent_object;
! 44:
! 45: GMimeHeader *headers;
! 46:
! 47: GMimeContentType *mime_type;
! 48: GMimePartEncodingType encoding;
! 49: GMimeDisposition *disposition;
! 50: char *description;
! 51: char *content_id;
! 52: char *content_md5;
! 53: char *content_location;
! 54:
! 55: GMimeDataWrapper *content;
! 56:
! 57: GList *children; /* of type GMimePart */
! 58: };
! 59:
! 60: typedef struct _GMimePart GMimePart;
! 61:
! 62: #define GMIME_PART_TYPE g_str_hash ("GMimePart")
! 63: #define GMIME_IS_PART(object) (object && ((GMimeObject *) object)->type == GMIME_PART_TYPE)
! 64: #define GMIME_PART(object) ((GMimePart *) object)
! 65:
! 66: typedef void (*GMimePartFunc) (GMimePart *part, gpointer data);
! 67:
! 68: /* constructors */
! 69: GMimePart *g_mime_part_new (void);
! 70: GMimePart *g_mime_part_new_with_type (const char *type, const char *subtype);
! 71:
! 72: /* accessor functions */
! 73: void g_mime_part_set_content_header (GMimePart *mime_part, const char *header, const char *value);
! 74: const char *g_mime_part_get_content_header (GMimePart *mime_part, const char *header);
! 75:
! 76: void g_mime_part_set_content_description (GMimePart *mime_part, const char *description);
! 77: const char *g_mime_part_get_content_description (const GMimePart *mime_part);
! 78:
! 79: void g_mime_part_set_content_id (GMimePart *mime_part, const char *content_id);
! 80: const char *g_mime_part_get_content_id (GMimePart *mime_part);
! 81:
! 82: void g_mime_part_set_content_md5 (GMimePart *mime_part, const char *content_md5);
! 83: gboolean g_mime_part_verify_content_md5 (GMimePart *mime_part);
! 84: const char *g_mime_part_get_content_md5 (GMimePart *mime_part);
! 85:
! 86: void g_mime_part_set_content_location (GMimePart *mime_part, const char *content_location);
! 87: const char *g_mime_part_get_content_location (GMimePart *mime_part);
! 88:
! 89: void g_mime_part_set_content_type (GMimePart *mime_part, GMimeContentType *mime_type);
! 90: const GMimeContentType *g_mime_part_get_content_type (GMimePart *mime_part);
! 91:
! 92: void g_mime_part_set_encoding (GMimePart *mime_part, GMimePartEncodingType encoding);
! 93: GMimePartEncodingType g_mime_part_get_encoding (GMimePart *mime_part);
! 94: const char *g_mime_part_encoding_to_string (GMimePartEncodingType encoding);
! 95: GMimePartEncodingType g_mime_part_encoding_from_string (const char *encoding);
! 96:
! 97: void g_mime_part_set_content_disposition_object (GMimePart *mime_part, GMimeDisposition *disposition);
! 98: void g_mime_part_set_content_disposition (GMimePart *mime_part, const char *disposition);
! 99: const char *g_mime_part_get_content_disposition (GMimePart *mime_part);
! 100:
! 101: void g_mime_part_add_content_disposition_parameter (GMimePart *mime_part, const char *attribute,
! 102: const char *value);
! 103: const char *g_mime_part_get_content_disposition_parameter (GMimePart *mime_part, const char *attribute);
! 104:
! 105: void g_mime_part_set_filename (GMimePart *mime_part, const char *filename);
! 106: const char *g_mime_part_get_filename (const GMimePart *mime_part);
! 107:
! 108: void g_mime_part_set_boundary (GMimePart *mime_part, const char *boundary);
! 109: const char *g_mime_part_get_boundary (GMimePart *mime_part);
! 110:
! 111: void g_mime_part_set_content_byte_array (GMimePart *mime_part, GByteArray *content);
! 112: void g_mime_part_set_content (GMimePart *mime_part, const char *content, size_t len);
! 113: void g_mime_part_set_pre_encoded_content (GMimePart *mime_part, const char *content,
! 114: size_t len, GMimePartEncodingType encoding);
! 115:
! 116: /*void g_mime_part_set_content_stream (GMimePart *mime_part, GMimeStream *content);*/
! 117:
! 118: void g_mime_part_set_content_object (GMimePart *mime_part, GMimeDataWrapper *content);
! 119: const GMimeDataWrapper *g_mime_part_get_content_object (const GMimePart *mime_part);
! 120: const char *g_mime_part_get_content (const GMimePart *mime_part, size_t *len);
! 121:
! 122: void g_mime_part_add_subpart (GMimePart *mime_part, GMimePart *subpart);
! 123:
! 124: /* utility functions */
! 125: void g_mime_part_write_to_stream (GMimePart *mime_part, GMimeStream *stream);
! 126: char *g_mime_part_to_string (GMimePart *mime_part);
! 127:
! 128: void g_mime_part_foreach (GMimePart *mime_part, GMimePartFunc callback, gpointer data);
! 129:
! 130: const GMimePart *g_mime_part_get_subpart_from_content_id (GMimePart *mime_part, const char *content_id);
! 131:
! 132: #ifdef __cplusplus
! 133: }
! 134: #endif /* __cplusplus */
! 135:
! 136: #endif /* __GMIME_PART_H__ */
E-mail: