## ETableHeader ETableHeader |

## Synopsis

    struct              ETableHeader;
    ETableHeader *      e_table_header_new                  (void);
    void                e_table_header_add_column           (ETableHeader *eth,
                                                             ETableCol *tc,
                                                             gint pos);
    ETableCol *         e_table_header_get_column           (ETableHeader *eth,
                                                             gint column);
    ETableCol *         e_table_header_get_column_by_spec   (ETableHeader *eth,
                                                             ETableColumnSpecification *spec);
    ETableCol *         e_table_header_get_column_by_col_idx
                                                            (ETableHeader *eth,
                                                             gint col_idx);
    gint                e_table_header_count                (ETableHeader *eth);
    gint                e_table_header_index                (ETableHeader *eth,
                                                             gint col);
    gint                e_table_header_get_index_at         (ETableHeader *eth,
                                                             gint x_offset);
    ETableCol **        e_table_header_get_columns          (ETableHeader *eth);
    gint                e_table_header_get_selected         (ETableHeader *eth);
    gint                e_table_header_total_width          (ETableHeader *eth);
    gint                e_table_header_min_width            (ETableHeader *eth);
    void                e_table_header_move                 (ETableHeader *eth,
                                                             gint source_index,
                                                             gint target_index);
    void                e_table_header_remove               (ETableHeader *eth,
                                                             gint idx);
    void                e_table_header_set_size             (ETableHeader *eth,
                                                             gint idx,
                                                             gint size);
    void                e_table_header_set_selection        (ETableHeader *eth,
                                                             gboolean allow_selection);
    gint                e_table_header_col_diff             (ETableHeader *eth,
                                                             gint start_col,
                                                             gint end_col);
    void                e_table_header_calc_widths          (ETableHeader *eth);
    GList *             e_table_header_get_selected_indexes (ETableHeader *eth);
    void                e_table_header_update_horizontal    (ETableHeader *eth);
    gint                e_table_header_prioritized_column   (ETableHeader *eth);
    gboolean            (*ETableColCheckFunc)               (ETableCol *col,
                                                             gpointer user_data);
    ETableCol *         e_table_header_prioritized_column_selected
                                                            (ETableHeader *eth,
                                                             ETableColCheckFunc check_func,
                                                             gpointer user_data);
    gdouble             e_table_header_compute_height       (ETableCol *ecol,
                                                             GtkWidget *widget);
    gdouble             e_table_header_width_extras         (GtkWidget *widget);
    enum                ETableColArrow;
    void                e_table_header_draw_button          (cairo_t *cr,
                                                             ETableCol *ecol,
                                                             GtkWidget *widget,
                                                             gint x,
                                                             gint y,
                                                             gint width,
                                                             gint height,
                                                             gint button_width,
                                                             gint button_height,
                                                             ETableColArrow arrow);

## Object Hierarchy

      GObject
       +----ETableHeader

## Properties

      "sort-info"                ETableSortInfo*       : Read / Write
      "width"                    gdouble               : Read / Write
      "width-extras"             gdouble               : Read / Write

## Signals

      "dimension-change"                               : Run Last
      "expansion-change"                               : Run Last
      "request-width"                                  : Run Last
      "structure-change"                               : Run Last

## Description

## Details

### struct ETableHeader

    struct ETableHeader;

### e_table_header_new ()

    ETableHeader *      e_table_header_new                  (void);

Returns : | A new `ETableHeader` object.

### e_table_header_add_column ()

    void                e_table_header_add_column           (ETableHeader *eth,
                                                             ETableCol *tc,
                                                             gint pos);

This function adds the `tc` ETableCol definition into the `eth` ETableHeader at position `pos`. This is the way you add new ETableCols to the ETableHeader. The header will assume ownership of the `tc`; you should not unref it after you add it.

This function will emit the "structure_change" signal on the `eth` object. The ETableCol is assumed

`eth` : | the table header to add the column to.
`tc` : | the ETableCol definition
`pos` : | position where the ETableCol will go.

### e_table_header_get_column ()

    ETableCol *         e_table_header_get_column           (ETableHeader *eth,
                                                             gint column);

`eth` : | the ETableHeader to query
`column` : | the column inside the `eth`.
Returns : | The ETableCol at `column` in the `eth` object

### e_table_header_get_column_by_spec ()

    ETableCol *         e_table_header_get_column_by_spec   (ETableHeader *eth,
                                                             ETableColumnSpecification *spec);

Returns the ETableCol having `spec` as the column specification, or `NULL` if there is no matching ETableCol.

`eth` : | the ETableHeader to query
`spec` : | an ETableColumnSpecification
Returns : | an ETableCol, or `NULL`

### e_table_header_get_column_by_col_idx ()

    ETableCol *         e_table_header_get_column_by_col_idx
                                                            (ETableHeader *eth,
                                                             gint col_idx);

### e_table_header_count ()

    gint                e_table_header_count                (ETableHeader *eth);

`eth` : | the ETableHeader to query
Returns : | the number of columns in this ETableHeader.

### e_table_header_index ()

    gint                e_table_header_index                (ETableHeader *eth,
                                                             gint col);

ETableHeaders contain the visual list of columns that the user will view. The visible columns will typically map to different columns in the ETableModel (because the user reordered the data for example).

`eth` : | the ETableHeader to query
`col` : | the column to fetch.
Returns : | the column that contains pixel `x_offset`, or -1 if no column inside this ETableHeader contains that pixel.

### e_table_header_get_index_at ()

    gint                e_table_header_get_index_at         (ETableHeader *eth,
                                                             gint x_offset);

### e_table_header_get_columns ()

    ETableCol **        e_table_header_get_columns          (ETableHeader *eth);

`eth` : | The ETableHeader to query
Returns : | A NULL terminated array of the ETableCols contained in the ETableHeader `eth`. Note that every returned ETableCol in the array has been referenced, to release this information you need to g_free the buffer returned and you need to g_object_unref every element returned

### e_table_header_get_selected ()

    gint                e_table_header_get_selected         (ETableHeader *eth);

`eth` : | The ETableHeader to query
Returns : | The number of selected columns in the `eth` object.

### e_table_header_total_width ()

    gint                e_table_header_total_width          (ETableHeader *eth);

`eth` : | The ETableHeader to query
Returns : | the number of pixels used by the `eth` object when rendered on screen

### e_table_header_min_width ()

    gint                e_table_header_min_width            (ETableHeader *eth);

`eth` : | The ETableHeader to query
Returns : | the minimum number of pixels required by the `eth` object.

### e_table_header_move ()

    void                e_table_header_move                 (ETableHeader *eth,
                                                             gint source_index,
                                                             gint target_index);

This function moves the column `source_index` to `target_index` inside the `eth` ETableHeader. The signals "dimension_change" and "structure_change" will be emmited

`eth` : | The ETableHeader to operate on.
`source_index` : | the source column to move.
`target_index` : | the target location for the column

### e_table_header_remove ()

    void                e_table_header_remove               (ETableHeader *eth,
                                                             gint idx);

Removes the column at `idx` position in the ETableHeader `eth`. This emmits the "structure_change" signal on the `eth` object.

`eth` : | The ETableHeader to operate on.
`idx` : | the index to the column to be removed.

### e_table_header_set_size ()

    void                e_table_header_set_size             (ETableHeader *eth,
                                                             gint idx,
                                                             gint size);

### e_table_header_set_selection ()

    void                e_table_header_set_selection        (ETableHeader *eth,
                                                             gboolean allow_selection);

### e_table_header_col_diff ()

    gint                e_table_header_col_diff             (ETableHeader *eth,
                                                             gint start_col,
                                                             gint end_col);

Computes the number of pixels between the columns `start_col` and `end_col`.

`eth` : | the ETableHeader to query.
`start_col` : | the starting column
`end_col` : | the ending column.
Returns : | the number of pixels between `start_col` and `end_col` on the `eth` ETableHeader object

### e_table_header_calc_widths ()

    void                e_table_header_calc_widths          (ETableHeader *eth);

### e_table_header_get_selected_indexes ()

    GList *             e_table_header_get_selected_indexes (ETableHeader *eth);

### e_table_header_update_horizontal ()

    void                e_table_header_update_horizontal    (ETableHeader *eth);

### e_table_header_prioritized_column ()

    gint                e_table_header_prioritized_column   (ETableHeader *eth);

### ETableColCheckFunc ()

    gboolean            (*ETableColCheckFunc)               (ETableCol *col,
                                                             gpointer user_data);

### e_table_header_prioritized_column_selected ()

    ETableCol *         e_table_header_prioritized_column_selected
                                                            (ETableHeader *eth,
                                                             ETableColCheckFunc check_func,
                                                             gpointer user_data);

### e_table_header_compute_height ()

    gdouble             e_table_header_compute_height       (ETableCol *ecol,
                                                             GtkWidget *widget);

Computes the minimum height required for a table header button.

`ecol` : | Table column description.
`widget` : | The widget from which to build the PangoLayout.
Returns : | The height of the button, in pixels.

### e_table_header_width_extras ()

    gdouble             e_table_header_width_extras         (GtkWidget *widget);

### enum ETableColArrow

    typedef enum {
    	E_TABLE_COL_ARROW_NONE = 0,
    	E_TABLE_COL_ARROW_UP,
    	E_TABLE_COL_ARROW_DOWN
    } ETableColArrow;

`E_TABLE_COL_ARROW_NONE` |
`E_TABLE_COL_ARROW_UP` |
`E_TABLE_COL_ARROW_DOWN` |

### e_table_header_draw_button ()

    void                e_table_header_draw_button          (cairo_t *cr,
                                                             ETableCol *ecol,
                                                             GtkWidget *widget,
                                                             gint x,
                                                             gint y,
                                                             gint width,
                                                             gint height,
                                                             gint button_width,
                                                             gint button_height,
                                                             ETableColArrow arrow);

Draws a button suitable for a table header.

`cr` : | a cairo context
`ecol` : | Table column for the header information.
`widget` : | The table widget.
`x` : | Leftmost coordinate of the button.
`y` : | Topmost coordinate of the button.
`width` : | Width of the region to draw.
`height` : | Height of the region to draw.
`button_width` : | Width for the complete button.
`button_height` : | Height for the complete button.
`arrow` : | Arrow type to use as a sort indicator.

## Property Details

### The `"sort-info"` property

      "sort-info"                ETableSortInfo*       : Read / Write

Sort Info.

### The `"width"` property

      "width"                    gdouble               : Read / Write

Width.

Allowed values: >= 0

Default value: 0

### The `"width-extras"` property

      "width-extras"             gdouble               : Read / Write

Width of Extras.

Allowed values: >= 0

Default value: 0

## Signal Details

### The `"dimension-change"` signal

    void                user_function                      (ETableHeader *etableheader,
                                                            gint          arg1,
                                                            gpointer      user_data)         : Run Last

### The `"expansion-change"` signal

    void                user_function                      (ETableHeader *etableheader,
                                                            gpointer      user_data)         : Run Last

### The `"request-width"` signal

    gint                user_function                      (ETableHeader *etableheader,
                                                            gint          arg1,
                                                            gpointer      user_data)         : Run Last

### The `"structure-change"` signal

    void                user_function                      (ETableHeader *etableheader,
                                                            gpointer      user_data)         : Run Last