gmime-disposition

## gmime-disposition gmime-disposition — |

## Synopsis

    #define     GMIME_DISPOSITION_ATTACHMENT
    #define     GMIME_DISPOSITION_INLINE
                GMimeDisposition;
    GMimeDisposition* g_mime_disposition_new    (const char *disposition);
    void        g_mime_disposition_destroy      (GMimeDisposition *disposition);
    void        g_mime_disposition_set          (GMimeDisposition *disposition,
                                                 const char *value);
    const char* g_mime_disposition_get          (GMimeDisposition *disposition);
    void        g_mime_disposition_add_parameter
                                                (GMimeDisposition *disposition,
                                                 const char *attribute,
                                                 const char *value);
    const char* g_mime_disposition_get_parameter
                                                (GMimeDisposition *disposition,
                                                 const char *attribute);
    char*       g_mime_disposition_header       (GMimeDisposition *disposition,
                                                 gboolean fold);

## Description

## Details

### GMIME_DISPOSITION_ATTACHMENT

    #define GMIME_DISPOSITION_ATTACHMENT "attachment"

Standard attachment disposition.

### GMIME_DISPOSITION_INLINE

    #define GMIME_DISPOSITION_INLINE     "inline"

Standard inline disposition.

### GMimeDisposition

    typedef struct {
    	char *disposition;
    	GMimeParam *params;
    	GHashTable *param_hash;
    } GMimeDisposition;

### g_mime_disposition_new ()

    GMimeDisposition* g_mime_disposition_new    (const char *disposition);

Creates a new GMimeDisposition object.

`disposition` : | disposition header (and params)
Returns : | a new disposition object

### g_mime_disposition_destroy ()

    void        g_mime_disposition_destroy      (GMimeDisposition *disposition);

Destroy the disposition object.

`disposition` : | disposition object

### g_mime_disposition_set ()

    void        g_mime_disposition_set          (GMimeDisposition *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.

`disposition` : | disposition object
`value` : | disposition value

### g_mime_disposition_get ()

    const char* g_mime_disposition_get          (GMimeDisposition *disposition);

Gets the disposition or `NULL` on fail.

`disposition` : | disposition object
Returns : | the disposition string which is probably one of GMIME_DISPOSITION_ATTACHMENT or GMIME_DISPOSITION_INLINE.

### g_mime_disposition_add_parameter ()

    void        g_mime_disposition_add_parameter
                                                (GMimeDisposition *disposition,
                                                 const char *attribute,
                                                 const char *value);

Adds a new parameter of name `name` and value `value` to the disposition.

`disposition` : | disposition object
`attribute` : | parameter name
`value` : | parameter value

### g_mime_disposition_get_parameter ()

    const char* g_mime_disposition_get_parameter
                                                (GMimeDisposition *disposition,
                                                 const char *attribute);

Gets the value of the parameter `attribute`, or `NULL` on fail.

`disposition` : | disposition object
`attribute` : | parameter name
Returns : | the value of the parameter of name `attribute`.

### g_mime_disposition_header ()

    char*       g_mime_disposition_header       (GMimeDisposition *disposition,
                                                 gboolean fold);

Allocates a string buffer containing the Content-Disposition header represented by the disposition object `disposition`.

`disposition` : | disposition object
`fold` : | fold header if needed
Returns : | a string containing the disposition header