ECellText

ECellText

Synopsis

struct              ECellText;
ECell *             e_cell_text_new                     (const gchar *fontname,
                                                         GtkJustification justify);
ECell *             e_cell_text_construct               (ECellText *cell,
                                                         const gchar *fontname,
                                                         GtkJustification justify);
gchar *             e_cell_text_get_text                (ECellText *cell,
                                                         ETableModel *model,
                                                         gint col,
                                                         gint row);
void                e_cell_text_free_text               (ECellText *cell,
                                                         gchar *text);
void                e_cell_text_set_value               (ECellText *cell,
                                                         ETableModel *model,
                                                         gint col,
                                                         gint row,
                                                         const gchar *text);
gboolean            e_cell_text_set_selection           (ECellView *cell_view,
                                                         gint col,
                                                         gint row,
                                                         gint start,
                                                         gint end);
gboolean            e_cell_text_get_selection           (ECellView *cell_view,
                                                         gint col,
                                                         gint row,
                                                         gint *start,
                                                         gint *end);
void                e_cell_text_copy_clipboard          (ECellView *cell_view,
                                                         gint col,
                                                         gint row);
void                e_cell_text_paste_clipboard         (ECellView *cell_view,
                                                         gint col,
                                                         gint row);
void                e_cell_text_delete_selection        (ECellView *cell_view,
                                                         gint col,
                                                         gint row);
gchar *             e_cell_text_get_text_by_view        (ECellView *cell_view,
                                                         gint col,
                                                         gint row);

Object Hierarchy

  GObject
   +----ECell
         +----ECellText
               +----ECellDate
               +----ECellNumber
               +----ECellPercent
               +----ECellSize

Properties

  "bg-color-column"          gint                  : Read / Write
  "bold-column"              gint                  : Read / Write
  "color-column"             gint                  : Read / Write
  "editable"                 gboolean              : Read / Write
  "strikeout-column"         gint                  : Read / Write
  "underline-column"         gint                  : Read / Write

Signals

  "text-deleted"                                   : Run First
  "text-inserted"                                  : Run First

Description

Details

struct ECellText

struct ECellText;

e_cell_text_new ()

ECell *             e_cell_text_new                     (const gchar *fontname,
                                                         GtkJustification justify);

Creates a new ECell renderer that can be used to render strings that that come from the model. The value returned from the model is interpreted as being a gchar *.

The ECellText object support a large set of properties that can be configured through the Gtk argument system and allows the user to have a finer control of the way the string is displayed. The arguments supported allow the control of strikeout, underline, bold, and color.

The arguments "strikeout_column", "underline_column", "bold_column" and "color_column" set and return an integer that points to a column in the model that controls these settings. So controlling the way things are rendered is achieved by having special columns in the model that will be used to flag whether the text should be rendered with strikeout, or bolded. In the case of the "color_column" argument, the column in the model is expected to have a string that can be parsed by gdk_color_parse().

fontname :

this param is no longer used, but left here for api stability

justify :

Justification of the string in the cell.

Returns :

an ECell object that can be used to render strings.

e_cell_text_construct ()

ECell *             e_cell_text_construct               (ECellText *cell,
                                                         const gchar *fontname,
                                                         GtkJustification justify);

constructs the ECellText. To be used by subclasses and language bindings.

cell :

The cell to construct

fontname :

this param is no longer used, but left here for api stability

justify :

Justification of the string in the cell

Returns :

The ECellText.

e_cell_text_get_text ()

gchar *             e_cell_text_get_text                (ECellText *cell,
                                                         ETableModel *model,
                                                         gint col,
                                                         gint row);

e_cell_text_free_text ()

void                e_cell_text_free_text               (ECellText *cell,
                                                         gchar *text);

e_cell_text_set_value ()

void                e_cell_text_set_value               (ECellText *cell,
                                                         ETableModel *model,
                                                         gint col,
                                                         gint row,
                                                         const gchar *text);

e_cell_text_set_selection ()

gboolean            e_cell_text_set_selection           (ECellView *cell_view,
                                                         gint col,
                                                         gint row,
                                                         gint start,
                                                         gint end);

Sets the selection of given text cell. If the current editing cell is not the given cell, this function will return FALSE;

If success, the [start, end) part of the text will be selected.

This API is most likely to be used by a11y implementations.

cell_view :

the given cell view

col :

column of the given cell in the view

row :

row of the given cell in the view

start :

start offset of the selection

end :

end offset of the selection

Returns :

whether the action is successful.

e_cell_text_get_selection ()

gboolean            e_cell_text_get_selection           (ECellView *cell_view,
                                                         gint col,
                                                         gint row,
                                                         gint *start,
                                                         gint *end);

Gets the selection of given text cell. If the current editing cell is not the given cell, this function will return FALSE;

This API is most likely to be used by a11y implementations.

cell_view :

the given cell view

col :

column of the given cell in the view

row :

row of the given cell in the view

start :

a pointer to an gint value indicates the start offset of the selection

end :

a pointer to an gint value indicates the end offset of the selection

Returns :

whether the action is successful.

e_cell_text_copy_clipboard ()

void                e_cell_text_copy_clipboard          (ECellView *cell_view,
                                                         gint col,
                                                         gint row);

Copys the selected text to clipboard.

This API is most likely to be used by a11y implementations.

cell_view :

the given cell view

col :

column of the given cell in the view

row :

row of the given cell in the view

e_cell_text_paste_clipboard ()

void                e_cell_text_paste_clipboard         (ECellView *cell_view,
                                                         gint col,
                                                         gint row);

Pastes the text from the clipboardt.

This API is most likely to be used by a11y implementations.

cell_view :

the given cell view

col :

column of the given cell in the view

row :

row of the given cell in the view

e_cell_text_delete_selection ()

void                e_cell_text_delete_selection        (ECellView *cell_view,
                                                         gint col,
                                                         gint row);

Deletes the selected text of the cell.

This API is most likely to be used by a11y implementations.

cell_view :

the given cell view

col :

column of the given cell in the view

row :

row of the given cell in the view

e_cell_text_get_text_by_view ()

gchar *             e_cell_text_get_text_by_view        (ECellView *cell_view,
                                                         gint col,
                                                         gint row);

Get the cell's text directly from CellEdit, during editting this cell, the cell's text value maybe inconsistant with the text got from table_model. The caller should free the text after using it.

This API is most likely to be used by a11y implementations.

cell_view :

the given cell view

col :

column of the given cell in the model

row :

row of the given cell in the model

Property Details

The "bg-color-column" property

  "bg-color-column"          gint                  : Read / Write

Allowed values: >= G_MAXULONG

Default value: -1


The "bold-column" property

  "bold-column"              gint                  : Read / Write

Allowed values: >= G_MAXULONG

Default value: -1


The "color-column" property

  "color-column"             gint                  : Read / Write

Allowed values: >= G_MAXULONG

Default value: -1


The "editable" property

  "editable"                 gboolean              : Read / Write

Default value: FALSE


The "strikeout-column" property

  "strikeout-column"         gint                  : Read / Write

Allowed values: >= G_MAXULONG

Default value: -1


The "underline-column" property

  "underline-column"         gint                  : Read / Write

Allowed values: >= G_MAXULONG

Default value: -1

Signal Details

The "text-deleted" signal

void                user_function                      (ECellText *ecelltext,
                                                        gpointer   arg1,
                                                        gint       arg2,
                                                        gint       arg3,
                                                        gint       arg4,
                                                        gint       arg5,
                                                        gpointer   user_data)      : Run First

The "text-inserted" signal

void                user_function                      (ECellText *ecelltext,
                                                        gpointer   arg1,
                                                        gint       arg2,
                                                        gint       arg3,
                                                        gint       arg4,
                                                        gint       arg5,
                                                        gpointer   user_data)      : Run First