## CamelIMAPXListResponse CamelIMAPXListResponse — Stores an IMAP LIST response |

## Synopsis

    #include <camel/camel.h>

    struct              CamelIMAPXListResponse;
    CamelIMAPXListResponse * camel_imapx_list_response_new  (CamelIMAPXStream *stream,
                                                             GCancellable *cancellable,
                                                             GError **error);
    guint               camel_imapx_list_response_hash      (CamelIMAPXListResponse *response);
    gboolean            camel_imapx_list_response_equal     (CamelIMAPXListResponse *response_a,
                                                             CamelIMAPXListResponse *response_b);
    gint                camel_imapx_list_response_compare   (CamelIMAPXListResponse *response_a,
                                                             CamelIMAPXListResponse *response_b);
    const gchar *       camel_imapx_list_response_get_mailbox_name
                                                            (CamelIMAPXListResponse *response);
    gchar               camel_imapx_list_response_get_separator
                                                            (CamelIMAPXListResponse *response);
    #define             CAMEL_IMAPX_LIST_ATTR_NOINFERIORS
    #define             CAMEL_IMAPX_LIST_ATTR_NOSELECT
    #define             CAMEL_IMAPX_LIST_ATTR_MARKED
    #define             CAMEL_IMAPX_LIST_ATTR_UNMARKED
    #define             CAMEL_IMAPX_LIST_ATTR_NONEXISTENT
    #define             CAMEL_IMAPX_LIST_ATTR_SUBSCRIBED
    #define             CAMEL_IMAPX_LIST_ATTR_REMOTE
    #define             CAMEL_IMAPX_LIST_ATTR_HASCHILDREN
    #define             CAMEL_IMAPX_LIST_ATTR_HASNOCHILDREN
    void                camel_imapx_list_response_add_attribute
                                                            (CamelIMAPXListResponse *response,
                                                             const gchar *attribute);
    gboolean            camel_imapx_list_response_has_attribute
                                                            (CamelIMAPXListResponse *response,
                                                             const gchar *attribute);
    GHashTable *        camel_imapx_list_response_dup_attributes
                                                            (CamelIMAPXListResponse *response);
    GVariant *          camel_imapx_list_response_ref_extended_item
                                                            (CamelIMAPXListResponse *response,
                                                             const gchar *extended_item_tag);
    CamelStoreInfoFlags camel_imapx_list_response_get_summary_flags
                                                            (CamelIMAPXListResponse *response);

## Object Hierarchy

      GObject
       +----CamelIMAPXListResponse

## Description

CamelIMAPXListResponse encapsulates an IMAP LIST response, which consists of a set of mailbox attributes, a mailbox separator character, and the mailbox name. (Extended information for LIST responses, as described in RFC 5258, to be supported at a later date.)

CamelIMAPXListResponse can also convert the mailbox attributes to a CamelStoreInfoFlags / CamelFolderInfoFlags value for use with `camel_store_get_folder_info()`.

## Details

### struct CamelIMAPXListResponse

    struct CamelIMAPXListResponse;

Contains only private data that should be read and manipulated using the functions below.

Since 3.10

### camel_imapx_list_response_new ()

    CamelIMAPXListResponse * camel_imapx_list_response_new  (CamelIMAPXStream *stream,
                                                             GCancellable *cancellable,
                                                             GError **error);

Attempts to parse an IMAP LIST response from `stream` and, if successful, stores the response data in a new CamelIMAPXListResponse. If an error occurs, the function sets `error` and returns `NULL`.

`stream` : | a CamelIMAPXStream
`cancellable` : | a GCancellable
`error` : | return location for a GError, or `NULL`
Returns : | a CamelIMAPXListResponse, or `NULL`

Since 3.10

### camel_imapx_list_response_hash ()

    guint               camel_imapx_list_response_hash      (CamelIMAPXListResponse *response);

Generates a hash value for `response` based on the mailbox name. This function is intended for easily hashing a CamelIMAPXListResponse to add to a GHashTable or similar data structure.

`response` : | a CamelIMAPXListResponse
Returns : | a hash value for `response`

Since 3.10

### camel_imapx_list_response_equal ()

    gboolean            camel_imapx_list_response_equal     (CamelIMAPXListResponse *response_a,
                                                             CamelIMAPXListResponse *response_b);

Checks two CamelIMAPXListResponse instances for equality based on their mailbox names.

`response_a` : | the first CamelIMAPXListResponse
`response_b` : | the second CamelIMAPXListResponse
Returns : | `TRUE` if `response_a` and `response_b` are equal

Since 3.10

### camel_imapx_list_response_compare ()

    gint                camel_imapx_list_response_compare   (CamelIMAPXListResponse *response_a,
                                                             CamelIMAPXListResponse *response_b);

Compares two CamelIMAPXListResponse instances by their mailbox names.

`response_a` : | the first CamelIMAPXListResponse
`response_b` : | the second CamelIMAPXListResponse
Returns : | a negative value if `response_a` compares before `response_b`, zero if they compare equal, or a positive value if `response_a` compares after `response_b`

Since 3.10

### camel_imapx_list_response_get_mailbox_name ()

    const gchar *       camel_imapx_list_response_get_mailbox_name
                                                            (CamelIMAPXListResponse *response);

Returns the mailbox name for `response`.

`response` : | a CamelIMAPXListResponse
Returns : | the mailbox name

Since 3.10

### camel_imapx_list_response_get_separator ()

    gchar               camel_imapx_list_response_get_separator
                                                            (CamelIMAPXListResponse *response);

Returns the mailbox path separator character for `response`.

`response` : | a CamelIMAPXListResponse
Returns : | the mailbox path separator character

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_NOINFERIORS

    #define CAMEL_IMAPX_LIST_ATTR_NOINFERIORS "\\NoInferiors"

Refer to RFC 3501 section 7.2.2.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_NOSELECT

    #define CAMEL_IMAPX_LIST_ATTR_NOSELECT		"\\NoSelect"

Refer to RFC 3501 section 7.2.2.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_MARKED

    #define CAMEL_IMAPX_LIST_ATTR_MARKED		"\\Marked"

Refer to RFC 3501 section 7.2.2.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_UNMARKED

    #define CAMEL_IMAPX_LIST_ATTR_UNMARKED		"\\Unmarked"

Refer to RFC 3501 section 7.2.2.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_NONEXISTENT

    #define CAMEL_IMAPX_LIST_ATTR_NONEXISTENT "\\NonExistent"

Refer to RFC 5258 section 3.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_SUBSCRIBED

    #define CAMEL_IMAPX_LIST_ATTR_SUBSCRIBED "\\Subscribed"

Refer to RFC 5258 section 3.1.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_REMOTE

    #define CAMEL_IMAPX_LIST_ATTR_REMOTE		"\\Remote"

Refer to RFC 5258 section 3.1.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_HASCHILDREN

    #define CAMEL_IMAPX_LIST_ATTR_HASCHILDREN "\\HasChildren"

Refer to RFC 5258 section 4.

Since 3.10

### CAMEL_IMAPX_LIST_ATTR_HASNOCHILDREN

    #define CAMEL_IMAPX_LIST_ATTR_HASNOCHILDREN "\\HasNoChildren"

Refer to RFC 5258 section 4.

Since 3.10

### camel_imapx_list_response_add_attribute ()

    void                camel_imapx_list_response_add_attribute
                                                            (CamelIMAPXListResponse *response,
                                                             const gchar *attribute);

Adds a mailbox attribute to `response`. The `attribute` should be one of the LIST attribute macros defined above.

`response` : | a CamelIMAPXListResponse
`attribute` : | a mailbox attribute

Since 3.10

### camel_imapx_list_response_has_attribute ()

    gboolean            camel_imapx_list_response_has_attribute
                                                            (CamelIMAPXListResponse *response,
                                                             const gchar *attribute);

Returns whether `response` includes the given mailbox attribute. The `attribute` should be one of the LIST attribute macros defined above.

`response` : | a CamelIMAPXListResponse
`attribute` : | a mailbox attribute
Returns : | `TRUE` if `response` has `attribute`, or else `FALSE`

Since 3.10

### camel_imapx_list_response_dup_attributes ()

    GHashTable *        camel_imapx_list_response_dup_attributes
                                                            (CamelIMAPXListResponse *response);

Returns a GHashTable of mailbox attributes to be used as a set. Use `g_hash_table_contains()` and `g_hash_table_get_keys()` to query for and list all mailbox attributes, respectively.

The hash table keys are all internalized strings and must not be freed. Free the returned GHashTable with `g_hash_table_destroy()` when finished with it.

`response` : | a CamelIMAPXListResponse
Returns : | a newly-created GHashTable

Since 3.10

### camel_imapx_list_response_ref_extended_item ()

    GVariant *          camel_imapx_list_response_ref_extended_item
                                                            (CamelIMAPXListResponse *response,
                                                             const gchar *extended_item_tag);

Returns the extended item value for `extended_item_tag` as a GVariant. The type of the GVariant depends on the extended item. If no value for `extended_item_tag` exists, the function returns `NULL`.

The returned GVariant is referenced for thread-safety and should be unreferenced with `g_variant_unref()` when finished with it.

`response` : | a CamelIMAPXListResponse
`extended_item_tag` : | an extended item tag
Returns : | a GVariant, or `NULL`

Since 3.10

### camel_imapx_list_response_get_summary_flags ()

    CamelStoreInfoFlags camel_imapx_list_response_get_summary_flags
                                                            (CamelIMAPXListResponse *response);

Converts the relevant mailbox attribute flags in `response` to a CamelStoreInfoFlags value.

`response` : | a CamelIMAPXListResponse
Returns : | a CamelStoreInfoFlags value

Since 3.10