## GMimeContentDisposition GMimeContentDisposition — Content-Disposition fields |

## Functions

GMimeContentDisposition * | g_mime_content_disposition_new ()
GMimeContentDisposition * | g_mime_content_disposition_parse ()
gboolean | g_mime_content_disposition_is_attachment ()
void | g_mime_content_disposition_set_disposition ()
const char * | g_mime_content_disposition_get_disposition ()
GMimeParamList * | g_mime_content_disposition_get_parameters ()
void | g_mime_content_disposition_set_parameter ()
const char * | g_mime_content_disposition_get_parameter ()
char * | g_mime_content_disposition_encode ()

## Types and Values

#define | GMIME_DISPOSITION_ATTACHMENT
#define | GMIME_DISPOSITION_INLINE
struct | GMimeContentDisposition

## Object Hierarchy

        GObject
        ╰── GMimeContentDisposition

## Description

A GMimeContentDisposition represents the pre-parsed contents of a Content-Disposition header field.

## Functions

### g_mime_content_disposition_new ()

    GMimeContentDisposition *
    g_mime_content_disposition_new (void);

Creates a new GMimeContentDisposition object.

#### Returns

a new GMimeContentDisposition object.

### g_mime_content_disposition_parse ()

    GMimeContentDisposition *
    g_mime_content_disposition_parse (GMimeParserOptions *options,
                                      const char *str);

Parses the input string into a GMimeContentDisposition object.

#### Parameters

options | a GMimeParserOptions or `NULL`. | [nullable]
str | Content-Disposition field value |

#### Returns

a new GMimeContentDisposition object.

[transfer full]

### g_mime_content_disposition_is_attachment ()

    gboolean
    g_mime_content_disposition_is_attachment
                                   (GMimeContentDisposition *disposition);

Determines if a Content-Disposition has a value of "attachment".

#### Parameters

disposition | a GMimeContentDisposition object |

#### Returns

`TRUE` if the value matches "attachment", otherwise `FALSE`.

### g_mime_content_disposition_set_disposition ()

    void
    g_mime_content_disposition_set_disposition
                                   (GMimeContentDisposition *disposition,
                                    const char *value);

Sets the disposition to `value` which may be one of GMIME_DISPOSITION_ATTACHMENT or GMIME_DISPOSITION_INLINE or, by your choice, any other string which would indicate how the MIME part should be displayed by the MUA.

#### Parameters

disposition | a GMimeContentDisposition object |
value | disposition value |

### g_mime_content_disposition_get_disposition ()

    const char *
    g_mime_content_disposition_get_disposition
                                   (GMimeContentDisposition *disposition);

Gets the disposition or `NULL` on fail.

#### Parameters

disposition | a GMimeContentDisposition object |

#### Returns

the disposition string which is probably one of GMIME_DISPOSITION_ATTACHMENT or GMIME_DISPOSITION_INLINE.

### g_mime_content_disposition_get_parameters ()

    GMimeParamList *
    g_mime_content_disposition_get_parameters
                                   (GMimeContentDisposition *disposition);

Gets the Content-Disposition parameter list.

#### Parameters

disposition | a GMimeContentDisposition object |

#### Returns

the Content-Disposition's parameter list.

[transfer none]

### g_mime_content_disposition_set_parameter ()

    void
    g_mime_content_disposition_set_parameter
                                   (GMimeContentDisposition *disposition,
                                    const char *name,
                                    const char *value);

Sets a parameter on the Content-Disposition.

Note: The `name` should be in US-ASCII while the `value` should be in UTF-8.

#### Parameters

disposition | a GMimeContentDisposition object |
name | parameter name |
value | parameter value |

### g_mime_content_disposition_get_parameter ()

    const char *
    g_mime_content_disposition_get_parameter
                                   (GMimeContentDisposition *disposition,
                                    const char *name);

Gets the parameter value specified by `name` if it's available.

#### Parameters

disposition | a GMimeContentDisposition object |
name | parameter name |

#### Returns

the value of the requested parameter or `NULL` if the parameter is not set. If the parameter is set, the returned string will be in UTF-8.

### g_mime_content_disposition_encode ()

    char *
    g_mime_content_disposition_encode (GMimeContentDisposition *disposition,
                                       GMimeFormatOptions *options);

Encodes the Content-Disposition header.

#### Parameters

disposition | a GMimeContentDisposition object |
options | a GMimeFormatOptions or `NULL`. | [nullable]

#### Returns

a new string containing the encoded header value.

## Types and Values

### GMIME_DISPOSITION_ATTACHMENT

    #define GMIME_DISPOSITION_ATTACHMENT "attachment"

Standard attachment disposition.

### GMIME_DISPOSITION_INLINE

    #define GMIME_DISPOSITION_INLINE     "inline"

Standard inline disposition.

### struct GMimeContentDisposition

    struct GMimeContentDisposition;

A data structure representing a Content-Disposition.

#### Members