CamelMimePart

## CamelMimePart CamelMimePart |

## Synopsis

                        CamelMimePart;
    CamelMimePart *     camel_mime_part_new                 (void);
    void                camel_mime_part_set_description     (CamelMimePart *mime_part,
                                                             const gchar *description);
    const     gchar *   camel_mime_part_get_description     (CamelMimePart *mime_part);
    void                camel_mime_part_set_disposition     (CamelMimePart *mime_part,
                                                             const gchar *disposition);
    const     gchar *   camel_mime_part_get_disposition     (CamelMimePart *mime_part);
    const CamelContentDisposition * camel_mime_part_get_content_disposition
                                                            (CamelMimePart *mime_part);
    void                camel_mime_part_set_filename        (CamelMimePart *mime_part,
                                                             const gchar *filename);
    const	  gchar *     camel_mime_part_get_filename        (CamelMimePart *mime_part);
    void                camel_mime_part_set_content_id      (CamelMimePart *mime_part,
                                                             const gchar *contentid);
    const	  gchar *     camel_mime_part_get_content_id      (CamelMimePart *mime_part);
    void                camel_mime_part_set_content_md5     (CamelMimePart *mime_part,
                                                             const gchar *md5sum);
    const	  gchar *     camel_mime_part_get_content_md5     (CamelMimePart *mime_part);
    void                camel_mime_part_set_content_location
                                                            (CamelMimePart *mime_part,
                                                             const gchar *location);
    const	  gchar *     camel_mime_part_get_content_location
                                                            (CamelMimePart *mime_part);
    void                camel_mime_part_set_encoding        (CamelMimePart *mime_part,
                                                             CamelTransferEncoding encoding);
    CamelTransferEncoding  camel_mime_part_get_encoding     (CamelMimePart *mime_part);
    void                camel_mime_part_set_content_languages
                                                            (CamelMimePart *mime_part,
                                                             GList *content_languages);
    const	  GList *     camel_mime_part_get_content_languages
                                                            (CamelMimePart *mime_part);
    void                camel_mime_part_set_content_type    (CamelMimePart *mime_part,
                                                             const gchar *content_type);
    CamelContentType *  camel_mime_part_get_content_type    (CamelMimePart *mime_part);
    gint                camel_mime_part_construct_from_parser
                                                            (CamelMimePart *mime_part,
                                                             CamelMimeParser *parser,
                                                             GError **error);
    void                camel_mime_part_set_content         (CamelMimePart *mime_part,
                                                             const gchar *data,
                                                             gint length,
                                                             const gchar *type);
    gsize               camel_mime_part_get_content_size    (CamelMimePart *mime_part);
    gboolean            camel_mime_part_construct_content_from_parser
                                                            (CamelMimePart *mime_part,
                                                             CamelMimeParser *mp,
                                                             GError **error);
    gboolean            camel_mime_message_build_preview    (CamelMimePart *mime_part,
                                                             CamelMessageInfo *info);

## Object Hierarchy

      GObject
       +----CamelObject
             +----CamelDataWrapper
                   +----CamelMedium
                         +----CamelMimePart
                               +----CamelMimeMessage

## Properties

      "content-id"               gchar*                : Read / Write
      "content-md5"              gchar*                : Read / Write
      "description"              gchar*                : Read / Write
      "disposition"              gchar*                : Read / Write

## Description

## Details

### CamelMimePart

    typedef struct _CamelMimePart CamelMimePart;

### camel_mime_part_new ()

    CamelMimePart *     camel_mime_part_new                 (void);

Create a new MIME part.

Returns : | a new CamelMimePart object

### camel_mime_part_set_description ()

    void                camel_mime_part_set_description     (CamelMimePart *mime_part,
                                                             const gchar *description);

Set a description on the MIME part.

`mime_part` : | a CamelMimePart object
`description` : | description of the MIME part

### camel_mime_part_get_description ()

    const     gchar *   camel_mime_part_get_description     (CamelMimePart *mime_part);

Get the description of the MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the description

### camel_mime_part_set_disposition ()

    void                camel_mime_part_set_disposition     (CamelMimePart *mime_part,
                                                             const gchar *disposition);

Set a disposition on the MIME part.

`mime_part` : | a CamelMimePart object
`disposition` : | disposition of the MIME part

### camel_mime_part_get_disposition ()

    const     gchar *   camel_mime_part_get_disposition     (CamelMimePart *mime_part);

Get the disposition of the MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the disposition

### camel_mime_part_get_content_disposition ()

    const CamelContentDisposition * camel_mime_part_get_content_disposition
                                                            (CamelMimePart *mime_part);

Get the disposition of the MIME part as a structure. Returned pointer is owned by mime_part.

`mime_part` : | a CamelMimePart object
Returns : | the disposition structure

Since 2.30

### camel_mime_part_set_filename ()

    void                camel_mime_part_set_filename        (CamelMimePart *mime_part,
                                                             const gchar *filename);

Set the filename on a MIME part.

`mime_part` : | a CamelMimePart object
`filename` : | filename given to the MIME part

### camel_mime_part_get_filename ()

    const	  gchar *     camel_mime_part_get_filename        (CamelMimePart *mime_part);

Get the filename of a MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the filename of the MIME part

### camel_mime_part_set_content_id ()

    void                camel_mime_part_set_content_id      (CamelMimePart *mime_part,
                                                             const gchar *contentid);

Set the content-id field on a MIME part.

`mime_part` : | a CamelMimePart object
`contentid` : | content id

### camel_mime_part_get_content_id ()

    const	  gchar *     camel_mime_part_get_content_id      (CamelMimePart *mime_part);

Get the content-id field of a MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the content-id field of the MIME part

### camel_mime_part_set_content_md5 ()

    void                camel_mime_part_set_content_md5     (CamelMimePart *mime_part,
                                                             const gchar *md5sum);

Set the content-md5 field of the MIME part.

`mime_part` : | a CamelMimePart object
`md5sum` : | the md5sum of the MIME part

### camel_mime_part_get_content_md5 ()

    const	  gchar *     camel_mime_part_get_content_md5     (CamelMimePart *mime_part);

Get the content-md5 field of the MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the content-md5 field of the MIME part

### camel_mime_part_set_content_location ()

    void                camel_mime_part_set_content_location
                                                            (CamelMimePart *mime_part,
                                                             const gchar *location);

Set the content-location field of the MIME part.

`mime_part` : | a CamelMimePart object
`location` : | the content-location value of the MIME part

### camel_mime_part_get_content_location ()

    const	  gchar *     camel_mime_part_get_content_location
                                                            (CamelMimePart *mime_part);

Get the content-location field of a MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the content-location field of a MIME part

### camel_mime_part_set_encoding ()

    void                camel_mime_part_set_encoding        (CamelMimePart *mime_part,
                                                             CamelTransferEncoding encoding);

Set the Content-Transfer-Encoding to use on a MIME part.

`mime_part` : | a CamelMimePart object
`encoding` : | a CamelTransferEncoding

### camel_mime_part_get_encoding ()

    CamelTransferEncoding  camel_mime_part_get_encoding     (CamelMimePart *mime_part);

Get the Content-Transfer-Encoding of a MIME part.

`mime_part` : | a CamelMimePart object
Returns : | a CamelTransferEncoding

### camel_mime_part_set_content_languages ()

    void                camel_mime_part_set_content_languages
                                                            (CamelMimePart *mime_part,
                                                             GList *content_languages);

Set the Content-Languages field of a MIME part.

`mime_part` : | a CamelMimePart object
`content_languages` : | list of languages

### camel_mime_part_get_content_languages ()

    const	  GList *     camel_mime_part_get_content_languages
                                                            (CamelMimePart *mime_part);

Get the Content-Languages set on the MIME part.

`mime_part` : | a CamelMimePart object
Returns : | a GList of languages

### camel_mime_part_set_content_type ()

    void                camel_mime_part_set_content_type    (CamelMimePart *mime_part,
                                                             const gchar *content_type);

Set the content-type on a MIME part.

`mime_part` : | a CamelMimePart object
`content_type` : | content-type string

### camel_mime_part_get_content_type ()

    CamelContentType *  camel_mime_part_get_content_type    (CamelMimePart *mime_part);

Get the Content-Type of a MIME part.

`mime_part` : | a CamelMimePart object
Returns : | the parsed CamelContentType of the MIME part

### camel_mime_part_construct_from_parser ()

    gint                camel_mime_part_construct_from_parser
                                                            (CamelMimePart *mime_part,
                                                             CamelMimeParser *parser,
                                                             GError **error);

Constructs a MIME part from a parser.

`mime_part` : | a CamelMimePart object
`parser` : | a CamelMimeParser object
`error` : |
Returns : | `0` on success or `-1` on fail

### camel_mime_part_set_content ()

    void                camel_mime_part_set_content         (CamelMimePart *mime_part,
                                                             const gchar *data,
                                                             gint length,
                                                             const gchar *type);

Utility function used to set the content of a mime part object to be the provided data. If `length` is 0, this routine can be used as a way to remove old content (in which case `data` and `type` are ignored and may be `NULL`).

`mime_part` : | a CamelMimePart object
`data` : | data to put into the part
`length` : | length of `data`
`type` : | Content-Type of the data

### camel_mime_part_get_content_size ()

    gsize               camel_mime_part_get_content_size    (CamelMimePart *mime_part);

Get the decoded size of the MIME part's content.

`mime_part` : | a CamelMimePart object
Returns : | the size of the MIME part's content in bytes.

Since 2.22

### camel_mime_part_construct_content_from_parser ()

    gboolean            camel_mime_part_construct_content_from_parser
                                                            (CamelMimePart *mime_part,
                                                             CamelMimeParser *mp,
                                                             GError **error);

`mime_part` : |
`mp` : |
`error` : |
Returns : |

Since 2.24

### camel_mime_message_build_preview ()

    gboolean            camel_mime_message_build_preview    (CamelMimePart *mime_part,
                                                             CamelMessageInfo *info);

`mime_part` : |
`info` : |
Returns : |

Since 2.28

## Property Details

### The `"content-id"` property

      "content-id"               gchar*                : Read / Write

Default value: NULL

### The `"content-md5"` property

      "content-md5"              gchar*                : Read / Write

Default value: NULL

### The `"description"` property

      "description"              gchar*                : Read / Write

Default value: NULL

### The `"disposition"` property

      "disposition"              gchar*                : Read / Write

Default value: NULL