GMimeMultipart

## GMimeMultipart GMimeMultipart — MIME multiparts |

## Synopsis

    struct              GMimeMultipart;
    GMimeMultipart *    g_mime_multipart_new                (void);
    GMimeMultipart *    g_mime_multipart_new_with_subtype   (const char *subtype);
    void                g_mime_multipart_set_preface        (GMimeMultipart *multipart,
                                                             const char *preface);
    const char *        g_mime_multipart_get_preface        (GMimeMultipart *multipart);
    void                g_mime_multipart_set_postface       (GMimeMultipart *multipart,
                                                             const char *postface);
    const char *        g_mime_multipart_get_postface       (GMimeMultipart *multipart);
    void                g_mime_multipart_set_boundary       (GMimeMultipart *multipart,
                                                             const char *boundary);
    const char *        g_mime_multipart_get_boundary       (GMimeMultipart *multipart);
    int                 g_mime_multipart_get_count          (GMimeMultipart *multipart);
    gboolean            g_mime_multipart_contains           (GMimeMultipart *multipart,
                                                             GMimeObject *part);
    int                 g_mime_multipart_index_of           (GMimeMultipart *multipart,
                                                             GMimeObject *part);
    void                g_mime_multipart_add                (GMimeMultipart *multipart,
                                                             GMimeObject *part);
    void                g_mime_multipart_clear              (GMimeMultipart *multipart);
    void                g_mime_multipart_insert             (GMimeMultipart *multipart,
                                                             int index,
                                                             GMimeObject *part);
    gboolean            g_mime_multipart_remove             (GMimeMultipart *multipart,
                                                             GMimeObject *part);
    GMimeObject *       g_mime_multipart_remove_at          (GMimeMultipart *multipart,
                                                             int index);
    GMimeObject *       g_mime_multipart_replace            (GMimeMultipart *multipart,
                                                             int index,
                                                             GMimeObject *replacement);
    GMimeObject *       g_mime_multipart_get_part           (GMimeMultipart *multipart,
                                                             int index);
    void                g_mime_multipart_foreach            (GMimeMultipart *multipart,
                                                             GMimeObjectForeachFunc callback,
                                                             gpointer user_data);
    GMimeObject *       g_mime_multipart_get_subpart_from_content_id
                                                            (GMimeMultipart *multipart,
                                                             const char *content_id);

## Object Hierarchy

      GObject
       +----GMimeObject
             +----GMimeMultipart
                   +----GMimeMultipartEncrypted
                   +----GMimeMultipartSigned

## Description

A GMimeMultipart represents all multipart MIME container parts.

## Details

### struct GMimeMultipart

    struct GMimeMultipart;

A base MIME multipart object.

### g_mime_multipart_new ()

    GMimeMultipart *    g_mime_multipart_new                (void);

Creates a new MIME multipart object with a default content-type of multipart/mixed.

Returns : | an empty MIME multipart object with a default content-type of multipart/mixed.

### g_mime_multipart_new_with_subtype ()

    GMimeMultipart *    g_mime_multipart_new_with_subtype   (const char *subtype);

Creates a new MIME multipart object with a content-type of multipart/`subtype`.

`subtype` : | content-type subtype
Returns : | an empty MIME multipart object with a content-type of multipart/`subtype`.

### g_mime_multipart_set_preface ()

    void                g_mime_multipart_set_preface        (GMimeMultipart *multipart,
                                                             const char *preface);

Sets the preface on the multipart.

`multipart` : | a GMimeMultipart object
`preface` : | preface

### g_mime_multipart_get_preface ()

    const char *        g_mime_multipart_get_preface        (GMimeMultipart *multipart);

Gets the preface on the multipart.

`multipart` : | a GMimeMultipart object
Returns : | a pointer to the preface string on the multipart.

### g_mime_multipart_set_postface ()

    void                g_mime_multipart_set_postface       (GMimeMultipart *multipart,
                                                             const char *postface);

Sets the postface on the multipart.

`multipart` : | a GMimeMultipart object
`postface` : | postface

### g_mime_multipart_get_postface ()

    const char *        g_mime_multipart_get_postface       (GMimeMultipart *multipart);

Gets the postface on the multipart.

`multipart` : | a GMimeMultipart object
Returns : | a pointer to the postface string on the multipart.

### g_mime_multipart_set_boundary ()

    void                g_mime_multipart_set_boundary       (GMimeMultipart *multipart,
                                                             const char *boundary);

Sets `boundary` as the boundary on the multipart. If `boundary` is `NULL`, then a boundary will be auto-generated for you.

`multipart` : | a GMimeMultipart object
`boundary` : | boundary or `NULL` to autogenerate one

### g_mime_multipart_get_boundary ()

    const char *        g_mime_multipart_get_boundary       (GMimeMultipart *multipart);

Gets the boundary on the multipart. If the internal boundary is `NULL`, then an auto-generated boundary will be set on the multipart and returned.

`multipart` : | a GMimeMultipart object
Returns : | the boundary on the multipart.

### g_mime_multipart_get_count ()

    int                 g_mime_multipart_get_count          (GMimeMultipart *multipart);

Gets the number of mime parts contained within the multipart.

`multipart` : | a GMimeMultipart object
Returns : | the number of mime parts contained within the multipart.

### g_mime_multipart_contains ()

    gboolean            g_mime_multipart_contains           (GMimeMultipart *multipart,
                                                             GMimeObject *part);

Checks if `part` is contained within `multipart`.

`multipart` : | a GMimeMultipart object
`part` : | mime part
Returns : | `TRUE` if `part` is a subpart of `multipart` or `FALSE` otherwise.

### g_mime_multipart_index_of ()

    int                 g_mime_multipart_index_of           (GMimeMultipart *multipart,
                                                             GMimeObject *part);

Gets the index of `part` within `multipart`.

`multipart` : | a GMimeMultipart object
`part` : | mime part
Returns : | the index of `part` within `multipart` or `-1` if not found.

### g_mime_multipart_add ()

    void                g_mime_multipart_add                (GMimeMultipart *multipart,
                                                             GMimeObject *part);

Adds a mime part to the multipart.

`multipart` : | a GMimeMultipart object
`part` : | a GMimeObject

### g_mime_multipart_clear ()

    void                g_mime_multipart_clear              (GMimeMultipart *multipart);

Removes all subparts from `multipart`.

`multipart` : | a GMimeMultipart object

### g_mime_multipart_insert ()

    void                g_mime_multipart_insert             (GMimeMultipart *multipart,
                                                             int index,
                                                             GMimeObject *part);

Inserts the specified mime part into the multipart at the position `index`.

`multipart` : | a GMimeMultipart object
`index` : | position to insert the mime part
`part` : | mime part

### g_mime_multipart_remove ()

    gboolean            g_mime_multipart_remove             (GMimeMultipart *multipart,
                                                             GMimeObject *part);

Removes the specified mime part from the multipart.

`multipart` : | a GMimeMultipart object
`part` : | mime part
Returns : | `TRUE` if the part was removed or `FALSE` otherwise.

### g_mime_multipart_remove_at ()

    GMimeObject *       g_mime_multipart_remove_at          (GMimeMultipart *multipart,
                                                             int index);

Removes the mime part at position `index` from the multipart.

`multipart` : | a GMimeMultipart object
`index` : | position of the mime part to remove
Returns : | the mime part that was removed or `NULL` if the part was not contained within the multipart.

### g_mime_multipart_replace ()

    GMimeObject *       g_mime_multipart_replace            (GMimeMultipart *multipart,
                                                             int index,
                                                             GMimeObject *replacement);

Replaces the mime part at position `index` within `multipart` with `replacement`.

`multipart` : | a GMimeMultipart object
`index` : | position of the mime part to replace
`replacement` : | a GMimeObject to use as the replacement
Returns : | the mime part that was replaced or `NULL` if the part was not contained within the multipart.

### g_mime_multipart_get_part ()

    GMimeObject *       g_mime_multipart_get_part           (GMimeMultipart *multipart,
                                                             int index);

Gets the mime part at position `index` within the multipart.

`multipart` : | a GMimeMultipart object
`index` : | position of the mime part
Returns : | the mime part at position `index`.

### g_mime_multipart_foreach ()

    void                g_mime_multipart_foreach            (GMimeMultipart *multipart,
                                                             GMimeObjectForeachFunc callback,
                                                             gpointer user_data);

Recursively calls `callback` on each of `multipart`'s subparts.

`multipart` : | a GMimeMultipart
`callback` : | function to call for each of `multipart`'s subparts.
`user_data` : | user-supplied callback data

### g_mime_multipart_get_subpart_from_content_id ()

    GMimeObject *       g_mime_multipart_get_subpart_from_content_id
                                                            (GMimeMultipart *multipart,
                                                             const char *content_id);

Gets the mime part with the content-id `content_id` from the multipart `multipart`.

`multipart` : | a multipart
`content_id` : | the content id of the part to look for
Returns : | the GMimeObject whose content-id matches the search string, or `NULL` if a match cannot be found.