Gnm.Workbook¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|
||
r/w |
Enable automatic recalculation. |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
doc |
r |
Class Details¶
- class Gnm.Workbook(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod attach_view(wbv)¶
- Parameters:
wbv (
Gnm.WorkbookView
) –
- classmethod cmd_autofit_selection(wbc, sheet, is_cols)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) –sheet (
Gnm.Sheet
) –is_cols (
bool
) –
- classmethod cmd_dec_indent(wbc)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) –
- classmethod cmd_inc_indent(wbc)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) –
- classmethod cmd_resize_selected_colrow(wbc, sheet, is_cols, new_size_pixels)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) –sheet (
Gnm.Sheet
) –is_cols (
bool
) –new_size_pixels (
int
) –
- classmethod cmd_wrap_sort(wbc, type)¶
- Parameters:
wbc (
Gnm.WorkbookControl
) –type (
int
) –
- classmethod detach_view(wbv)¶
- Parameters:
wbv (
Gnm.WorkbookView
) –
- classmethod foreach_cell_in_range(pos, cell_range, flags, handler, closure)¶
- Parameters:
pos (
Gnm.EvalPos
) – The position the range is relative to.cell_range (
Gnm.Value
) – AGOffice.value
containing a range;flags (
Gnm.CellIterFlags
) – flags determining which cells to considerhandler (
Gnm.CellIterFunc
) – The operator to apply to each cell.
- Returns:
non-
None
on error, or VALUE_TERMINATE if some the handler requested to stop (by returning non-None
).- Return type:
The supplied
GOffice.value
must be a cellrange. The range bounds are calculated relative to the eval position and normalized. For each existing cell in the range specified, invoke the callback routine. If the only_existing flag isTrue
, then callbacks are only invoked for existing cells.Note: this function does not honour the
Gnm.CellIterFlags.IGNORE_SUBTOTAL
flag.
- classmethod new()¶
- Returns:
A new empty
Gnm.Workbook
with a unique name.- Return type:
- classmethod new_with_sheets(sheet_count)¶
- Parameters:
sheet_count (
int
) – initial number of sheets to create.- Returns:
a
Gnm.Workbook
with sheet_count allocated sheets on it- Return type:
- classmethod sheet_delete(sheet)¶
-
This function detaches the given sheet from its parent
GOffice.workbook
and invalidates all references to the deleted sheet from other sheets and clears all references in the clipboard to this sheet.
- classmethod sheet_move(sheet, direction)¶
- Parameters:
Moves the sheet up or down direction spots in the sheet list If direction is negative, move left. If positive, move right.
- cells(comments, vis)¶
- Parameters:
comments (
bool
) – If true, include cells with only comments also.vis (
Gnm.SheetVisibility
) – How visible a sheet needs to be in order to be considered.
- Returns:
the cells array
- Return type:
Collects a
GLib.PtrArray
ofGnm.EvalPos
pointers for all cells in aGOffice.workbook
. No particular order should be assumed.
- date_conv()¶
- Returns:
the date conventions in effect for the
GOffice.workbook
.- Return type:
- find_command(is_undo, cmd)¶
- foreach_name(globals_only, func, *data)¶
- Parameters:
globals_only (
bool
) – whether to apply only to global names.func (
GLib.HFunc
) – The operator to apply to each cell.
- get_file_exporter()¶
- Returns:
the exporter for the
Gnm.Workbook
.- Return type:
- get_file_saver()¶
- Returns:
the saver for the
Gnm.Workbook
.- Return type:
- get_sheet_size()¶
- Returns:
the current sheet size for self. If sheets are not of uniform size, this will be some size that is big enough in both directions for all sheets. That size isn’t necessarily one that could be used to create a new sheet.
- Return type:
- mark_dirty()¶
- optimize_style()¶
- queue_all_recalc()¶
- queue_volatile_recalc()¶
- recalc()¶
Computes all dependents in self that have been flaged as requiring recomputation.
NOTE! This does not recalc dependents in other workbooks.
- recalc_all()¶
Queues all dependents for recalc and recalculates.
- set_date_conv(date_conv)¶
- Parameters:
date_conv (
GOffice.DateConventions
) – new date convention
Sets the date convention date_conv. NOTE : THIS IS NOT A SMART ROUTINE. If you want to actually change this We’ll need to recalc and rerender everything. That will need to be done externally.
- set_file_exporter(fs)¶
- Parameters:
fs (
GOffice.FileSaver
) –
- set_saveinfo(lev, saver)¶
- Parameters:
lev (
GOffice.FileFormatLevel
) – the file format levelsaver (
GOffice.FileSaver
orNone
) – the file saver.
- Returns:
True
if save info was set and history may require updatingFIXME : Add a check to ensure the name is unique.
- Return type:
If level is sufficiently advanced, assign the info.
- Parameters:
freeit (
bool
) –- Return type:
- sheet_add(pos, columns, rows)¶
- Parameters:
- Returns:
the new sheet.
- Return type:
Create and name a new sheet, putting it at position pos. The sheet returned is not ref’d. (The ref belongs to the
GOffice.workbook
.)
- sheet_add_with_type(sheet_type, pos, columns, rows)¶
- Parameters:
sheet_type (
Gnm.SheetType
) – the sheet type.pos (
int
) – position to add, -1 meaning append.columns (
int
) – the sheet columns number.rows (
int
) – the sheet rows number.
- Returns:
the new sheet.
- Return type:
Create and name a new sheet, putting it at position pos. The sheet returned is not ref’d. (The ref belongs to the
GOffice.workbook
.)
- sheet_attach(new_sheet)¶
-
Add new_sheet to self, placing it at the end. SURPRISE: This assumes a ref to the sheet.
- sheet_attach_at_pos(new_sheet, pos)¶
- Parameters:
Add new_sheet to self, placing it at pos.
- sheet_by_index(i)¶
- sheet_by_name(sheet_name)¶
- sheet_get_free_name(base, always_suffix, handle_counter)¶
- Parameters:
- Returns:
a unique sheet name
- Return type:
Gets a new unquoted name for a sheets such that it does not exist on the
GOffice.workbook
.
- sheet_rename(sheet_indices, new_names, cc)¶
- Parameters:
sheet_indices ([
int
]) – list of sheet indices (ignore -1)new_names ([
str
]) – list of new namescc (
GOffice.CmdContext
) –
- Returns:
False
when it was successful- Return type:
Adjusts the names of the sheets. We assume that everything is valid. If in doubt call workbook_sheet_reorder_check first.
- sheet_state_restore(wss)¶
- Parameters:
wss (
Gnm.WorkbookSheetState
) –
- sheets()¶
- Returns:
the sheets list.
- Return type:
Get an ordered list of the sheets in the
GOffice.workbook
- update_graphs()¶
- update_history(type)¶
- Parameters:
type (
Gnm.FileSaveAsStyle
) –
- do_sheet_added() virtual¶
- do_sheet_deleted() virtual¶
- do_sheet_order_changed() virtual¶
Signal Details¶
- Gnm.Workbook.signals.sheet_added(workbook)¶
- Signal Name:
sheet-added
- Flags:
- Parameters:
workbook (
Gnm.Workbook
) – The object which received the signal
- Gnm.Workbook.signals.sheet_deleted(workbook)¶
- Signal Name:
sheet-deleted
- Flags:
- Parameters:
workbook (
Gnm.Workbook
) – The object which received the signal
- Gnm.Workbook.signals.sheet_order_changed(workbook)¶
- Signal Name:
sheet-order-changed
- Flags:
- Parameters:
workbook (
Gnm.Workbook
) – The object which received the signal
Property Details¶
- Gnm.Workbook.props.being_loaded¶
-
Gnm.Workbook
is currently being loaded.