# e-table-header-utils

## Name

e-table-header-utils --

## Synopsis

    int         e_table_header_compute_height   (ETableCol *ecol,
                                                 GtkStyle *style,
                                                 GdkFont *font);
    void        e_table_header_draw_button      (GdkDrawable *drawable,
                                                 ETableCol *ecol,
                                                 GtkStyle *style,
                                                 GdkFont *font,
                                                 GtkStateType state,
                                                 GtkWidget *widget,
                                                 GdkGC *gc,
                                                 int x,
                                                 int y,
                                                 int width,
                                                 int height,
                                                 int button_width,
                                                 int button_height,
                                                 ETableColArrow arrow);
    void        e_table_draw_elided_string      (GdkDrawable *drawable,
                                                 GdkFont *font,
                                                 GdkGC *gc,
                                                 int x,
                                                 int y,
                                                 const char *str,
                                                 int max_width,
                                                 gboolean center);

## Description

## Details

### e_table_header_compute_height ()

    int         e_table_header_compute_height   (ETableCol *ecol,
                                                 GtkStyle *style,
                                                 GdkFont *font);

Computes the minimum height required for a table header button.

`ecol` : | Table column description.
`style` : |
`font` : |
Returns : | The height of the button, in pixels.

### e_table_header_draw_button ()

    void        e_table_header_draw_button      (GdkDrawable *drawable,
                                                 ETableCol *ecol,
                                                 GtkStyle *style,
                                                 GdkFont *font,
                                                 GtkStateType state,
                                                 GtkWidget *widget,
                                                 GdkGC *gc,
                                                 int x,
                                                 int y,
                                                 int width,
                                                 int height,
                                                 int button_width,
                                                 int button_height,
                                                 ETableColArrow arrow);

Draws a button suitable for a table header.

`drawable` : | Destination drawable.
`ecol` : | Table column for the header information.
`style` : | Style to use for drawing the button.
`font` : |
`state` : | State of the table widget.
`widget` : | The table widget.
`gc` : |
`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.

### e_table_draw_elided_string ()

    void        e_table_draw_elided_string      (GdkDrawable *drawable,
                                                 GdkFont *font,
                                                 GdkGC *gc,
                                                 int x,
                                                 int y,
                                                 const char *str,
                                                 int max_width,
                                                 gboolean center);

Draws a string, possibly trimming it so that it fits inside the specified maximum width. If it does not fit, an elision indicator is drawn after the last character that does fit.

`drawable` : | Destination drawable.
`font` : | Font for the text.
`gc` : | GC to use for drawing.
`x` : | X insertion point for the string.
`y` : | Y insertion point for the string's baseline.
`str` : | the string we're drawing, passed in so we can change the layout if it needs eliding.
`max_width` : | Maximum width in which the string must fit.
`center` : | Whether to center the string in the available area if it does fit.