## ETableSortInfo

ETableSortInfo

## Synopsis

    struct              ETableSortInfo;
    ETableSortInfo *    e_table_sort_info_new               (struct _ETableSpecification *specification);
    void                e_table_sort_info_parse_context_push
                                                            (GMarkupParseContext *context,
                                                             struct _ETableSpecification *specification);
    ETableSortInfo *    e_table_sort_info_parse_context_pop (GMarkupParseContext *context);
    struct _ETableSpecification * e_table_sort_info_ref_specification
                                                            (ETableSortInfo *sort_info);
    gboolean            e_table_sort_info_get_can_group     (ETableSortInfo *sort_info);
    void                e_table_sort_info_set_can_group     (ETableSortInfo *sort_info,
                                                             gboolean can_group);
    guint               e_table_sort_info_grouping_get_count
                                                            (ETableSortInfo *sort_info);
    void                e_table_sort_info_grouping_truncate (ETableSortInfo *sort_info,
                                                             guint length);
    ETableColumnSpecification * e_table_sort_info_grouping_get_nth
                                                            (ETableSortInfo *sort_info,
                                                             guint n,
                                                             GtkSortType *out_sort_type);
    void                e_table_sort_info_grouping_set_nth  (ETableSortInfo *sort_info,
                                                             guint n,
                                                             ETableColumnSpecification *spec,
                                                             GtkSortType sort_type);
    guint               e_table_sort_info_sorting_get_count (ETableSortInfo *sort_info);
    void                e_table_sort_info_sorting_remove    (ETableSortInfo *sort_info,
                                                             guint n);
    void                e_table_sort_info_sorting_truncate  (ETableSortInfo *sort_info,
                                                             guint length);
    ETableColumnSpecification * e_table_sort_info_sorting_get_nth
                                                            (ETableSortInfo *sort_info,
                                                             guint n,
                                                             GtkSortType *out_sort_type);
    void                e_table_sort_info_sorting_set_nth   (ETableSortInfo *sort_info,
                                                             guint n,
                                                             ETableColumnSpecification *spec,
                                                             GtkSortType sort_type);
    void                e_table_sort_info_load_from_node    (ETableSortInfo *sort_info,
                                                             xmlNode *node,
                                                             gdouble state_version);
    xmlNode *           e_table_sort_info_save_to_node      (ETableSortInfo *sort_info,
                                                             xmlNode *parent);
    ETableSortInfo *    e_table_sort_info_duplicate         (ETableSortInfo *sort_info);

## Object Hierarchy

      GObject
       +----ETableSortInfo

## Properties

      "specification"            ETableSpecification*  : Read / Write / Construct Only

## Signals

      "group-info-changed"                             : Run Last
      "sort-info-changed"                              : Run Last

## Description

## Details

### struct ETableSortInfo

    struct ETableSortInfo;

### e_table_sort_info_new ()

    ETableSortInfo *    e_table_sort_info_new               (struct _ETableSpecification *specification);

This creates a new ETableSortInfo object that contains no grouping and no sorting defined as of yet. This object is used to keep track of multi-level sorting and multi-level grouping of an ETable.

`specification` : | an ETableSpecification
Returns : | A new ETableSortInfo object

### e_table_sort_info_parse_context_push ()

    void                e_table_sort_info_parse_context_push
                                                            (GMarkupParseContext *context,
                                                             struct _ETableSpecification *specification);

Creates a new ETableSortInfo from a segment of XML data being fed to `context`. Call this function for the appropriate opening tag from the `start_element` callback of a GMarkupParser, then call `e_table_sort_info_parse_context_pop()` for the corresponding closing tag from the `end_element` callback.

`context` : | a GMarkupParseContext
`specification` : | an ETableSpecification

### e_table_sort_info_parse_context_pop ()

    ETableSortInfo *    e_table_sort_info_parse_context_pop (GMarkupParseContext *context);

Creates a new ETableSortInfo from a segment of XML data being fed to `context`. Call `e_table_sort_info_parse_context_push()` for the appropriate opening tag from the `start_element` callback of a GMarkupParser, then call this function for the corresponding closing tag from the `end_element` callback.

Unreference the newly-created ETableSortInfo with `g_object_unref()` when finished with it.

`context` : | a GMarkupParseContext
Returns : | an ETableSortInfo

### e_table_sort_info_ref_specification ()

    struct _ETableSpecification * e_table_sort_info_ref_specification
                                                            (ETableSortInfo *sort_info);

Returns the ETableSpecification passed to `e_table_sort_info_new()`.

The returned ETableSpecification is referenced for thread-safety and must be unreferenced with `g_object_unref()` when finished with it.

`sort_info` : | an ETableSortInfo
Returns : | an ETableSpecification

### e_table_sort_info_get_can_group ()

    gboolean            e_table_sort_info_get_can_group     (ETableSortInfo *sort_info);

### e_table_sort_info_set_can_group ()

    void                e_table_sort_info_set_can_group     (ETableSortInfo *sort_info,
                                                             gboolean can_group);

### e_table_sort_info_grouping_get_count ()

    guint               e_table_sort_info_grouping_get_count
                                                            (ETableSortInfo *sort_info);

`sort_info` : | an ETableSortInfo
Returns : | the number of grouping criteria in the object.

### e_table_sort_info_grouping_truncate ()

    void                e_table_sort_info_grouping_truncate (ETableSortInfo *sort_info,
                                                             guint length);

This routine can be used to reduce or grow the number of grouping criteria in the object.

`sort_info` : | an ETableSortInfo
`length` : | position where the truncation happens.

### e_table_sort_info_grouping_get_nth ()

    ETableColumnSpecification * e_table_sort_info_grouping_get_nth
                                                            (ETableSortInfo *sort_info,
                                                             guint n,
                                                             GtkSortType *out_sort_type);

`sort_info` : | an ETableSortInfo
`n` : | Item information to fetch.
`out_sort_type` : | return location for a GtkSortType value, or `NULL`
Returns : | the description of the `n`-th grouping criteria in the `info` object.

### e_table_sort_info_grouping_set_nth ()

    void                e_table_sort_info_grouping_set_nth  (ETableSortInfo *sort_info,
                                                             guint n,
                                                             ETableColumnSpecification *spec,
                                                             GtkSortType sort_type);

Sets the grouping criteria for index `n` to `spec` and `sort_type`.

`sort_info` : | an ETableSortInfo
`n` : | Item information to fetch.
`spec` : | an ETableColumnSpecification
`sort_type` : | a GtkSortType

### e_table_sort_info_sorting_get_count ()

    guint               e_table_sort_info_sorting_get_count (ETableSortInfo *sort_info);

### e_table_sort_info_sorting_remove ()

    void                e_table_sort_info_sorting_remove    (ETableSortInfo *sort_info,
                                                             guint n);

Removes the sorting element at the given index. The following sorting elements are moved down one place.

`sort_info` : | an ETableSortInfo
`n` : | the index of the element to remove

### e_table_sort_info_sorting_truncate ()

    void                e_table_sort_info_sorting_truncate  (ETableSortInfo *sort_info,
                                                             guint length);

This routine can be used to reduce or grow the number of sort criteria in the object.

`sort_info` : | an ETableSortInfo
`length` : | position where the truncation happens.

### e_table_sort_info_sorting_get_nth ()

    ETableColumnSpecification * e_table_sort_info_sorting_get_nth
                                                            (ETableSortInfo *sort_info,
                                                             guint n,
                                                             GtkSortType *out_sort_type);

`sort_info` : | an ETableSortInfo
`n` : | Item information to fetch.
`out_sort_type` : | return location for a GtkSortType value, or `NULL`
Returns : | the description of the `n`-th grouping criteria in the `info` object.

### e_table_sort_info_sorting_set_nth ()

    void                e_table_sort_info_sorting_set_nth   (ETableSortInfo *sort_info,
                                                             guint n,
                                                             ETableColumnSpecification *spec,
                                                             GtkSortType sort_type);

Sets the sorting criteria for index `n` to `spec` and `sort_type`.

`sort_info` : | an ETableSortInfo
`n` : | Item information to fetch.
`spec` : | an ETableColumnSpecification
`sort_type` : | a GtkSortType

### e_table_sort_info_load_from_node ()

    void                e_table_sort_info_load_from_node    (ETableSortInfo *sort_info,
                                                             xmlNode *node,
                                                             gdouble state_version);

This loads the state for the ETableSortInfo object `info` from the xml node `node`.

`sort_info` : | an ETableSortInfo
`node` : | pointer to the xmlNode that describes the sorting and grouping information

### e_table_sort_info_save_to_node ()

    xmlNode *           e_table_sort_info_save_to_node      (ETableSortInfo *sort_info,
                                                             xmlNode *parent);

This function is used

`sort_info` : | an ETableSortInfo
`parent` : | xmlNode that will be hosting the saved state of the `info` object.
Returns : | the node that has been appended to `parent` as a child containing the sorting and grouping information for this ETableSortInfo object.

### e_table_sort_info_duplicate ()

    ETableSortInfo *    e_table_sort_info_duplicate         (ETableSortInfo *sort_info);

## Property Details

### The `"specification"` property

      "specification"            ETableSpecification*  : Read / Write / Construct Only

Specification for the table state.

## Signal Details

### The `"group-info-changed"` signal

    void                user_function                      (ETableSortInfo *etablesortinfo,
                                                            gpointer        user_data)           : Run Last

### The `"sort-info-changed"` signal

    void                user_function                      (ETableSortInfo *etablesortinfo,
                                                            gpointer        user_data)           : Run Last