ECell: Evolution Utilities Reference Manual

## ECell ECell |

## Functions

gboolean | (*ETableSearchFunc) ()
ECellView * | e_cell_new_view ()
void | e_cell_kill_view ()
gint | e_cell_event ()
void | e_cell_realize ()
void | e_cell_unrealize ()
void | e_cell_draw ()
void | e_cell_print ()
gdouble | e_cell_print_height ()
gint | e_cell_max_width ()
gint | e_cell_max_width_by_row ()
gboolean | e_cell_max_width_by_row_implemented ()
gchar * | e_cell_get_bg_color ()
void | e_cell_style_updated ()
void | e_cell_focus ()
void | e_cell_unfocus ()
gint | e_cell_height ()
gpointer | e_cell_enter_edit ()
void | e_cell_leave_edit ()
gpointer | e_cell_save_state ()
void | e_cell_load_state ()
void | e_cell_free_state ()

## Types and Values

enum | ECellFlags
enum | ECellActions
struct | ECellView

## Object Hierarchy

        GObject
        ╰── ECell
            ├── ECellToggle
            ├── ECellPopup
            ├── ECellText
            ├── ECellHbox
            ├── ECellPixbuf
            ├── ECellTree
            ╰── ECellVbox

## Description

## Functions

### ETableSearchFunc ()

    gboolean
    (*ETableSearchFunc) (gconstpointer haystack,
                         const gchar *needle);

### e_cell_new_view ()

    ECellView *
    e_cell_new_view (ECell *ecell,
                     ETableModel *table_model,
                     gpointer e_table_item_view);

ECell renderers new to be bound to a table_model and to the actual view during their life time to actually render the data. This method is invoked by the ETableItem canvas item to instatiate a new view of the ECell.

This is invoked when the ETableModel is attached to the ETableItem (a CanvasItem that can render ETableModels in the screen).

#### Parameters

ecell | the Ecell that will create the new view |
table_model | the table model the ecell is bound to |
e_table_item_view | an ETableItem object (the CanvasItem that reprensents the view of the table) |

#### Returns

a new ECellView for this `ecell` on the `table_model` displayed on the `e_table_item_view` .

### e_cell_kill_view ()

    void
    e_cell_kill_view (ECellView *ecell_view);

This method it used to destroy a view of an ECell renderer

#### Parameters

ecell_view | view to be destroyed. |

### e_cell_event ()

    gint
    e_cell_event (ECellView *ecell_view,
                  GdkEvent *event,
                  gint model_col,
                  gint view_col,
                  gint row,
                  ECellFlags flags,
                  ECellActions *actions);

Dispatches the event `event` to the `ecell_view` for.

#### Parameters

ecell_view | The ECellView where the event will be dispatched |
event | The GdkEvent. |
model_col | the column in the model |
view_col | the column in the view |
row | the row |
flags | flags about the current state |
actions | a second return value in case the cell wants to take some action (specifically grabbing & ungrabbing) |

#### Returns

processing state from the GdkEvent handling.

### e_cell_realize ()

    void
    e_cell_realize (ECellView *ecell_view);

This function is invoked to give a chance to the ECellView to allocate any resources it needs from Gdk, equivalent to the GtkWidget::realize signal.

#### Parameters

ecell_view | The ECellView to be realized. |

### e_cell_unrealize ()

    void
    e_cell_unrealize (ECellView *ecell_view);

This function is invoked to give a chance to the ECellView to release any resources it allocated during the realize method, equivalent to the GtkWidget::unrealize signal.

#### Parameters

ecell_view | The ECellView to be unrealized. |

### e_cell_draw ()

    void
    e_cell_draw (ECellView *ecell_view,
                 cairo_t *cr,
                 gint model_col,
                 gint view_col,
                 gint row,
                 ECellFlags flags,
                 gint x1,
                 gint y1,
                 gint x2,
                 gint y2);

This instructs the ECellView to render itself into the Cairo context. The region to be drawn in given by (x1,y1)-(x2,y2).

The most important flags are `E_CELL_SELECTED` and `E_CELL_FOCUSED`, other flags include alignments and justifications.

#### Parameters

ecell_view | the ECellView to redraw |
cr | a Cairo context |
model_col | the column in the model being drawn. |
view_col | the column in the view being drawn (what the model maps to). |
row | the row being drawn |
flags | rendering flags. |
x1 | boudary for the rendering |
y1 | boudary for the rendering |
x2 | boudary for the rendering |
y2 | boudary for the rendering |

### e_cell_print ()

    void
    e_cell_print (ECellView *ecell_view,
                  GtkPrintContext *context,
                  gint model_col,
                  gint view_col,
                  gint row,
                  gdouble width,
                  gdouble height);

FIXME:

### e_cell_print_height ()

    gdouble
    e_cell_print_height (ECellView *ecell_view,
                         GtkPrintContext *context,
                         gint model_col,
                         gint view_col,
                         gint row,
                         gdouble width);

### e_cell_max_width ()

    gint
    e_cell_max_width (ECellView *ecell_view,
                      gint model_col,
                      gint view_col);

#### Parameters

ecell_view | the ECellView that will leave editing |
model_col | the column in the model |
view_col | the column in the view. |

#### Returns

the maximum width for the ECellview at `model_col` which is being rendered as `view_col`

### e_cell_max_width_by_row ()

    gint
    e_cell_max_width_by_row (ECellView *ecell_view,
                             gint model_col,
                             gint view_col,
                             gint row);

#### Parameters

ecell_view | the ECellView that we are curious about |
model_col | the column in the model |
view_col | the column in the view. |
row | The row in the model. |

#### Returns

the maximum width for the ECellview at `model_col` which is being rendered as `view_col` for the data in `row` .

### e_cell_max_width_by_row_implemented ()

    gboolean
    e_cell_max_width_by_row_implemented (ECellView *ecell_view);

#### Parameters

ecell_view | the ECellView that we are curious about |

#### Returns

the maximum width for the ECellview at `model_col` which is being rendered as `view_col` for the data in `row` .

### e_cell_get_bg_color ()

    gchar *
    e_cell_get_bg_color (ECellView *ecell_view,
                         gint row);

### e_cell_style_updated ()

    void
    e_cell_style_updated (ECellView *ecell_view);

### e_cell_focus ()

    void
    e_cell_focus (ECellView *ecell_view,
                  gint model_col,
                  gint view_col,
                  gint row,
                  gint x1,
                  gint y1,
                  gint x2,
                  gint y2);

### e_cell_unfocus ()

    void
    e_cell_unfocus (ECellView *ecell_view);

### e_cell_height ()

    gint
    e_cell_height (ECellView *ecell_view,
                   gint model_col,
                   gint view_col,
                   gint row);

#### Parameters

ecell_view | the ECellView. |
model_col | the column in the model |
view_col | the column in the view. |
row | the row to me measured |

#### Returns

the height of the cell at `model_col` , `row` rendered at `view_col` , `row` .

### e_cell_enter_edit ()

    gpointer
    e_cell_enter_edit (ECellView *ecell_view,
                       gint model_col,
                       gint view_col,
                       gint row);

Notifies the ECellView that it is about to enter editing mode for `model_col` , `row` rendered at `view_col` , `row` .

#### Parameters

ecell_view | the ECellView that will enter editing |
model_col | the column in the model |
view_col | the column in the view |
row | the row |

### e_cell_leave_edit ()

    void
    e_cell_leave_edit (ECellView *ecell_view,
                       gint model_col,
                       gint view_col,
                       gint row,
                       gpointer edit_context);

Notifies the ECellView that editing is finished at `model_col` , `row` rendered at `view_col` , `row` .

#### Parameters

ecell_view | the ECellView that will leave editing |
model_col | the column in the model |
view_col | the column in the view |
row | the row |
edit_context | the editing context |

### e_cell_save_state ()

    gpointer
    e_cell_save_state (ECellView *ecell_view,
                       gint model_col,
                       gint view_col,
                       gint row,
                       gpointer edit_context);

#### Parameters

ecell_view | the ECellView to save |
model_col | the column in the model |
view_col | the column in the view |
row | the row |
edit_context | the editing context |

#### Returns

The save state.

Requests that the ECellView return a gpointer representing the state of the ECell. This is primarily intended for things like selection or scrolling.

### e_cell_load_state ()

    void
    e_cell_load_state (ECellView *ecell_view,
                       gint model_col,
                       gint view_col,
                       gint row,
                       gpointer edit_context,
                       gpointer save_state);

Requests that the ECellView load from the given save state.

#### Parameters

ecell_view | the ECellView to load |
model_col | the column in the model |
view_col | the column in the view |
row | the row |
edit_context | the editing context |
save_state | the save state to load from |

### e_cell_free_state ()

    void
    e_cell_free_state (ECellView *ecell_view,
                       gint model_col,
                       gint view_col,
                       gint row,
                       gpointer save_state);

Requests that the ECellView free the given save state.

#### Parameters

ecell_view | the ECellView |
model_col | the column in the model |
view_col | the column in the view |
row | the row |
save_state | the save state to free |

## Types and Values

### enum ECellFlags

#### Members

E_CELL_SELECTED |  |
E_CELL_JUSTIFICATION |  |
E_CELL_JUSTIFY_CENTER |  |
E_CELL_JUSTIFY_LEFT |  |
E_CELL_JUSTIFY_RIGHT |  |
E_CELL_JUSTIFY_FILL |  |
E_CELL_ALIGN_LEFT |  |
E_CELL_ALIGN_RIGHT |  |
E_CELL_FOCUSED |  |
E_CELL_EDITING |  |
E_CELL_CURSOR |  |
E_CELL_PREEDIT |  |

### enum ECellActions

#### Members

E_CELL_GRAB |  |
E_CELL_UNGRAB |  |

### struct ECellView

    struct ECellView {
    	ECell *ecell;
    	ETableModel *e_table_model;
    	void        *e_table_item_view;

    	gint   focus_x1, focus_y1, focus_x2, focus_y2;
    	gint   focus_col, focus_row;

    	void  (*kill_view_cb) (struct _ECellView *, gpointer);
    	GList *kill_view_cb_data;
    };