|  |  |  | GMime Reference Manual |  | 
|---|---|---|---|---|
                    GMimePart;
GMimePart*          g_mime_part_new                     (void);
GMimePart*          g_mime_part_new_with_type           (const char *type,
                                                         const char *subtype);
void                g_mime_part_set_content_header      (GMimePart *mime_part,
                                                         const char *header,
                                                         const char *value);
const char*         g_mime_part_get_content_header      (GMimePart *mime_part,
                                                         const char *header);
void                g_mime_part_set_content_description (GMimePart *mime_part,
                                                         const char *description);
const char*         g_mime_part_get_content_description (const GMimePart *mime_part);
void                g_mime_part_set_content_id          (GMimePart *mime_part,
                                                         const char *content_id);
const char*         g_mime_part_get_content_id          (GMimePart *mime_part);
void                g_mime_part_set_content_md5         (GMimePart *mime_part,
                                                         const char *content_md5);
const char*         g_mime_part_get_content_md5         (GMimePart *mime_part);
gboolean            g_mime_part_verify_content_md5      (GMimePart *mime_part);
void                g_mime_part_set_content_location    (GMimePart *mime_part,
                                                         const char *content_location);
const char*         g_mime_part_get_content_location    (GMimePart *mime_part);
void                g_mime_part_set_content_type        (GMimePart *mime_part,
                                                         GMimeContentType *mime_type);
const GMimeContentType* g_mime_part_get_content_type    (GMimePart *mime_part);
void                g_mime_part_set_encoding            (GMimePart *mime_part,
                                                         GMimePartEncodingType encoding);
GMimePartEncodingType g_mime_part_get_encoding          (GMimePart *mime_part);
const char*         g_mime_part_encoding_to_string      (GMimePartEncodingType encoding);
GMimePartEncodingType g_mime_part_encoding_from_string  (const char *encoding);
void                g_mime_part_set_content_disposition_object
                                                        (GMimePart *mime_part,
                                                         GMimeDisposition *disposition);
void                g_mime_part_set_content_disposition (GMimePart *mime_part,
                                                         const char *disposition);
const char*         g_mime_part_get_content_disposition (GMimePart *mime_part);
void                g_mime_part_add_content_disposition_parameter
                                                        (GMimePart *mime_part,
                                                         const char *attribute,
                                                         const char *value);
const char*         g_mime_part_get_content_disposition_parameter
                                                        (GMimePart *mime_part,
                                                         const char *attribute);
void                g_mime_part_set_filename            (GMimePart *mime_part,
                                                         const char *filename);
const char*         g_mime_part_get_filename            (const GMimePart *mime_part);
void                g_mime_part_set_content             (GMimePart *mime_part,
                                                         const char *content,
                                                         size_t len);
void                g_mime_part_set_pre_encoded_content (GMimePart *mime_part,
                                                         const char *content,
                                                         size_t len,
                                                         GMimePartEncodingType encoding);
void                g_mime_part_set_content_byte_array  (GMimePart *mime_part,
                                                         GByteArray *content);
const char*         g_mime_part_get_content             (const GMimePart *mime_part,
                                                         size_t *len);
GMimeDataWrapper*   g_mime_part_get_content_object      (const GMimePart *mime_part);
void                g_mime_part_set_content_object      (GMimePart *mime_part,
                                                         GMimeDataWrapper *content);
ssize_t             g_mime_part_write_to_stream         (GMimePart *mime_part,
                                                         GMimeStream *stream);
char*               g_mime_part_to_string               (GMimePart *mime_part);
GMimePart* g_mime_part_new (void);
Creates a new MIME Part object with a default content-type of text/plain.
| Returns : | an empty MIME Part object with a default content-type of text/plain. | 
GMimePart* g_mime_part_new_with_type (const char *type, const char *subtype);
Creates a new MIME Part with a sepcified type.
| 
 | content-type | 
| 
 | content-subtype | 
| Returns : | an empty MIME Part object with the specified content-type. | 
void g_mime_part_set_content_header (GMimePart *mime_part, const char *header, const char *value);
Set an arbitrary MIME content header.
| 
 | mime part | 
| 
 | header name | 
| 
 | header value | 
const char* g_mime_part_get_content_header (GMimePart *mime_part, const char *header);
Gets the value of the requested header if it exists, or NULL
otherwise.
| 
 | mime part | 
| 
 | header name | 
| Returns : | the value of the content header header. | 
void g_mime_part_set_content_description (GMimePart *mime_part, const char *description);
Set the content description for the specified mime part.
| 
 | Mime part | 
| 
 | content description | 
const char* g_mime_part_get_content_description (const GMimePart *mime_part);
Gets the value of the Content-Description for the specified mime
part if it exists or NULL otherwise.
| 
 | Mime part | 
| Returns : | the content description for the specified mime part. | 
void g_mime_part_set_content_id (GMimePart *mime_part, const char *content_id);
Set the content id for the specified mime part.
| 
 | Mime part | 
| 
 | content id | 
const char* g_mime_part_get_content_id (GMimePart *mime_part);
Gets the content-id of the specified mime part if it exists, or
NULL otherwise.
| 
 | Mime part | 
| Returns : | the content id for the specified mime part. | 
void g_mime_part_set_content_md5 (GMimePart *mime_part, const char *content_md5);
Set the content md5 for the specified mime part.
| 
 | Mime part | 
| 
 | content md5 or NULLto generate the md5 digest. | 
const char* g_mime_part_get_content_md5 (GMimePart *mime_part);
Gets the md5sum contained in the Content-Md5 header of the
specified mime part if it exists, or NULL otherwise.
| 
 | Mime part | 
| Returns : | the content md5 for the specified mime part. | 
gboolean g_mime_part_verify_content_md5 (GMimePart *mime_part);
Verify the content md5 for the specified mime part.
| 
 | Mime part | 
| Returns : | TRUEif the md5 is valid orFALSEotherwise. Note: will
returnFALSEif the mime part does not contain a Content-MD5. | 
void g_mime_part_set_content_location (GMimePart *mime_part, const char *content_location);
Set the content location for the specified mime part.
| 
 | Mime part | 
| 
 | content location | 
const char* g_mime_part_get_content_location (GMimePart *mime_part);
Gets the value of the Content-Location header if it exists, or
NULL otherwise.
| 
 | Mime part | 
| Returns : | the content location for the specified mime part. | 
void g_mime_part_set_content_type (GMimePart *mime_part, GMimeContentType *mime_type);
Set the content type/subtype for the specified mime part.
| 
 | Mime part | 
| 
 | Mime content-type | 
const GMimeContentType* g_mime_part_get_content_type (GMimePart *mime_part);
Gets the Content-Type object for the given mime part or NULL on
error.
| 
 | Mime part | 
| Returns : | the content-type object for the specified mime part. | 
void g_mime_part_set_encoding (GMimePart *mime_part, GMimePartEncodingType encoding);
Set the content encoding for the specified mime part. Available values for the encoding are: GMIME_PART_ENCODING_DEFAULT, GMIME_PART_ENCODING_7BIT, GMIME_PART_ENCODING_8BIT, GMIME_PART_ENCODING_BINARY, GMIME_PART_ENCODING_BASE64 and GMIME_PART_ENCODING_QUOTEDPRINTABLE.
| 
 | Mime part | 
| 
 | Mime encoding | 
GMimePartEncodingType g_mime_part_get_encoding (GMimePart *mime_part);
Gets the content encoding of the mime part.
| 
 | Mime part | 
| Returns : | the content encoding for the specified mime part. The return value will be one of the following: GMIME_PART_ENCODING_DEFAULT, GMIME_PART_ENCODING_7BIT, GMIME_PART_ENCODING_8BIT, GMIME_PART_ENCODING_BINARY, GMIME_PART_ENCODING_BASE64, GMIME_PART_ENCODING_QUOTEDPRINTABLE or GMIME_PART_ENCODING_UUENCODE. | 
const char* g_mime_part_encoding_to_string (GMimePartEncodingType encoding);
Gets the string value of the content encoding.
| 
 | Mime encoding | 
| Returns : | the encoding type as a string. Available values for the encoding are: GMIME_PART_ENCODING_DEFAULT, GMIME_PART_ENCODING_7BIT, GMIME_PART_ENCODING_8BIT, GMIME_PART_ENCODING_BINARY, GMIME_PART_ENCODING_BASE64, GMIME_PART_ENCODING_QUOTEDPRINTABLE and GMIME_PART_ENCODING_UUENCODE. | 
GMimePartEncodingType g_mime_part_encoding_from_string (const char *encoding);
Gets the content encoding enumeration value based on the input string.
| 
 | Mime encoding in string format | 
| Returns : | the encoding string as a GMimePartEncodingType. Available values for the encoding are: GMIME_PART_ENCODING_DEFAULT, GMIME_PART_ENCODING_7BIT, GMIME_PART_ENCODING_8BIT, GMIME_PART_ENCODING_BINARY, GMIME_PART_ENCODING_BASE64, GMIME_PART_ENCODING_QUOTEDPRINTABLE and GMIME_PART_ENCODING_UUENCODE. | 
void                g_mime_part_set_content_disposition_object
                                                        (GMimePart *mime_part,
                                                         GMimeDisposition *disposition);
Set the content disposition for the specified mime part
| 
 | Mime part | 
| 
 | disposition object | 
void g_mime_part_set_content_disposition (GMimePart *mime_part, const char *disposition);
Set the content disposition for the specified mime part
| 
 | Mime part | 
| 
 | disposition | 
const char* g_mime_part_get_content_disposition (GMimePart *mime_part);
Gets the content disposition if set or NULL otherwise.
| 
 | Mime part | 
| Returns : | the content disposition for the specified mime part. | 
void                g_mime_part_add_content_disposition_parameter
                                                        (GMimePart *mime_part,
                                                         const char *attribute,
                                                         const char *value);
Add a content-disposition parameter to the specified mime part.
| 
 | Mime part | 
| 
 | parameter name | 
| 
 | parameter value | 
const char*         g_mime_part_get_content_disposition_parameter
                                                        (GMimePart *mime_part,
                                                         const char *attribute);
Gets the value of the Content-Disposition parameter specified by
attribute, or NULL if the parameter does not exist.
| 
 | Mime part | 
| 
 | parameter name | 
| Returns : | the value of a previously defined content-disposition
parameter specified by attribute. | 
void g_mime_part_set_filename (GMimePart *mime_part, const char *filename);
Sets the "filename" parameter on the Content-Disposition and also sets the "name" parameter on the Content-Type.
| 
 | Mime part | 
| 
 | the filename of the Mime Part's content | 
const char* g_mime_part_get_filename (const GMimePart *mime_part);
Gets the filename of the specificed mime part, or NULL if the mime
part does not have the filename or name parameter set.
| 
 | Mime part | 
| Returns : | the filename of the specified MIME Part. It first checks to see if the "filename" parameter was set on the Content-Disposition and if not then checks the "name" parameter in the Content-Type. | 
void g_mime_part_set_content (GMimePart *mime_part, const char *content, size_t len);
g_mime_part_set_content is deprecated and should not be used in newly-written code.
WARNING: This interface is deprecated. Use
g_mime_part_set_content_object() instead.
Sets the content of the Mime Part (only non-multiparts)
| 
 | Mime part | 
| 
 | raw mime part content | 
| 
 | raw content length | 
void g_mime_part_set_pre_encoded_content (GMimePart *mime_part, const char *content, size_t len, GMimePartEncodingType encoding);
g_mime_part_set_pre_encoded_content is deprecated and should not be used in newly-written code.
WARNING: This interface is deprecated. Use
g_mime_part_set_content_object() instead.
Sets the encoding type and raw content on the mime part after decoding the content.
| 
 | Mime part | 
| 
 | encoded mime part content | 
| 
 | length of the content | 
| 
 | content encoding | 
void g_mime_part_set_content_byte_array (GMimePart *mime_part, GByteArray *content);
g_mime_part_set_content_byte_array is deprecated and should not be used in newly-written code.
WARNING: This interface is deprecated. Use
g_mime_part_set_content_object() instead.
Sets the content of the Mime Part (only non-multiparts)
| 
 | Mime part | 
| 
 | raw mime part content. | 
const char* g_mime_part_get_content (const GMimePart *mime_part, size_t *len);
g_mime_part_get_content is deprecated and should not be used in newly-written code.
Gets the raw contents of the mime part and sets len to the length
of the raw data buffer.
WARNING: This interface is deprecated. Use
g_mime_part_get_content_object() instead.
| 
 | MIME part object | 
| 
 | pointer to the content length | 
| Returns : | a const char * pointer to the raw contents of the MIME Part
and sets lento the length of the buffer. Note: textual content
will not be converted to UTF-8. Also note that this buffer will not
be nul-terminated and may in fact contain nul bytes mid-buffer so
you MUST treat the data returned as raw binary data even if the
content type is text. | 
GMimeDataWrapper* g_mime_part_get_content_object (const GMimePart *mime_part);
Gets the internal data-wrapper of the specified mime part, or NULL
on error.
| 
 | MIME part object | 
| Returns : | the data-wrapper for the mime part's contents. | 
void g_mime_part_set_content_object (GMimePart *mime_part, GMimeDataWrapper *content);
Sets the content object on the mime part.
| 
 | MIME Part | 
| 
 | content object | 
ssize_t g_mime_part_write_to_stream (GMimePart *mime_part, GMimeStream *stream);
g_mime_part_write_to_stream is deprecated and should not be used in newly-written code.
Writes the contents of the MIME Part to stream.
WARNING: This interface is deprecated. Use
g_mime_object_write_to_stream() instead.
| 
 | MIME Part | 
| 
 | output stream | 
| Returns : | the number of bytes written or -1on fail. | 
char* g_mime_part_to_string (GMimePart *mime_part);
g_mime_part_to_string is deprecated and should not be used in newly-written code.
Allocates a string buffer containing the MIME Part.
WARNING: This interface is deprecated. Use
g_mime_object_to_string() instead.
| 
 | MIME Part | 
| Returns : | an allocated string containing the MIME Part. |