Class: Gnm::Workbook

Inherits:
GOffice::Doc
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sheet_count) ⇒ Gnm::Workbook

sheets on it

Parameters:

  • sheet_count (Integer)

    initial number of sheets to create.

Class Method Details

.attach_view(wbv) ⇒ nil

Parameters:

Returns:

  • (nil)

.cmd_autofit_selection(wbc, sheet, is_cols) ⇒ nil

Parameters:

Returns:

  • (nil)

.cmd_dec_indent(wbc) ⇒ nil

Parameters:

Returns:

  • (nil)

.cmd_inc_indent(wbc) ⇒ nil

Parameters:

Returns:

  • (nil)

.cmd_resize_selected_colrow(wbc, sheet, is_cols, new_size_pixels) ⇒ nil

Parameters:

Returns:

  • (nil)

.cmd_wrap_sort(wbc, type) ⇒ nil

Parameters:

Returns:

  • (nil)

.detach_view(wbv) ⇒ nil

Parameters:

Returns:

  • (nil)

.foreach_cell_in_range(pos, cell_range, flags, handler, closure) ⇒ Gnm::Value

The supplied 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 is true, then callbacks are only invoked for existing cells.

Note: this function does not honour the CELL_ITER_IGNORE_SUBTOTAL flag.

Parameters:

  • pos (Gnm::EvalPos)

    The position the range is relative to.

  • cell_range (Gnm::Value)

    A value containing a range;

  • flags (Gnm::CellIterFlags)

    flags determining which cells to consider

  • handler (Gnm::CellIterFunc)

    The operator to apply to each cell.

  • closure (GObject)

    User data.

Returns:

  • (Gnm::Value)

    non-nil on error, or VALUE_TERMINATE if some the handler requested to stop (by returning non-nil).

.sheet_delete(sheet) ⇒ nil

This function detaches the given sheet from its parent workbook and invalidates all references to the deleted sheet from other sheets and clears all references in the clipboard to this sheet.

Parameters:

  • sheet (Gnm::Sheet)

    the #Sheet that we want to delete from its workbook

Returns:

  • (nil)

.sheet_move(sheet, direction) ⇒ nil

Moves the sheet up or down direction spots in the sheet list If direction is negative, move left. If positive, move right. for left.

Parameters:

  • sheet (Gnm::Sheet)

    #Sheet to move

  • direction (Integer)

    number of spots to move, positive for right and negative

Returns:

  • (nil)

Instance Method Details

#1904=(base1904) ⇒ nil

Parameters:

  • base1904 (Boolean)

Returns:

  • (nil)

#being_loaded=(being_loaded) ⇒ Boolean

Parameters:

  • being_loaded (Boolean)

Returns:

  • (Boolean)

    being-loaded

  • (Boolean)

    being-loaded

#being_loaded?Boolean

Returns being-loaded.

Returns:

  • (Boolean)

    being-loaded

#cells(comments, vis) ⇒ Array<Gnm::EvalPos>

Collects a GPtrArray of GnmEvalPos pointers for all cells in a workbook. No particular order should be assumed.

Parameters:

  • comments (Boolean)

    If true, include cells with only comments also.

  • vis (Gnm::SheetVisibility)

    How visible a sheet needs to be in order to be considered.

Returns:

  • (Array<Gnm::EvalPos>)

    the cells array

#date_convGOffice::DateConventions

Returns the date conventions in effect for the workbook.

Returns:

  • (GOffice::DateConventions)

    the date conventions in effect for the workbook.

#date_conv=(date_conv) ⇒ nil

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.

Parameters:

  • date_conv (GOffice::DateConventions)

    new date convention

Returns:

  • (nil)

#enable_recursive_dirty(enable) ⇒ Boolean

Parameters:

  • enable (Boolean)

Returns:

  • (Boolean)

#file_exporterGOffice::FileSaver

Returns the exporter for the Workbook.

Returns:

  • (GOffice::FileSaver)

    the exporter for the Workbook.

#file_exporter=(fs) ⇒ nil

Parameters:

  • fs (GOffice::FileSaver)

Returns:

  • (nil)

#file_saverGOffice::FileSaver

Returns the saver for the Workbook.

Returns:

  • (GOffice::FileSaver)

    the saver for the Workbook.

#find_command(is_undo, cmd) ⇒ Integer

(which would be a programmer error).

Parameters:

  • is_undo (Boolean)

    undo vs redo

  • cmd (GObject)

    command

Returns:

  • (Integer)

    the 1 based index of the cmd command, or 0 if it is not found

#foreach_name(globals_only, func, data) ⇒ nil

Parameters:

  • globals_only (Boolean)

    whether to apply only to global names.

  • func (GLib::HFunc)

    The operator to apply to each cell.

  • data (GObject)

    User data.

Returns:

  • (nil)

#iteration_enabled(enable) ⇒ nil

Parameters:

  • enable (Boolean)

Returns:

  • (nil)

#iteration_max_number(max_number) ⇒ nil

Parameters:

  • max_number (Integer)

Returns:

  • (nil)

#iteration_tolerance(tolerance) ⇒ nil

Parameters:

  • tolerance (Float)

Returns:

  • (nil)

#last_export_uriString

Returns the URI for export.

Returns:

  • (String)

    the URI for export.

#last_export_uri=(uri) ⇒ nil

Parameters:

  • uri (String)

Returns:

  • (nil)

#mark_dirtynil

Returns:

  • (nil)

#optimize_stylenil

Returns:

  • (nil)

#queue_all_recalcnil

Returns:

  • (nil)

#queue_volatile_recalcnil

Returns:

  • (nil)

#recalcnil

Computes all dependents in wb that have been flaged as requiring recomputation.

NOTE! This does not recalc dependents in other workbooks.

Returns:

  • (nil)

#recalc_allnil

Queues all dependents for recalc and recalculates.

Returns:

  • (nil)

#recalc_mode=(recalc_mode) ⇒ Boolean

Parameters:

  • recalc_mode (Boolean)

Returns:

  • (Boolean)

    recalc-mode

  • (Boolean)

    recalc-mode

#recalc_mode?Boolean

Returns recalc-mode.

Returns:

  • (Boolean)

    recalc-mode

#recalcmodeBoolean

Returns:

  • (Boolean)

#recalcmode=(enable) ⇒ nil

Parameters:

  • enable (Boolean)

Returns:

  • (nil)

#set_saveinfo(lev, saver) ⇒ Boolean

If level is sufficiently advanced, assign the info. FIXME : Add a check to ensure the name is unique.

Parameters:

  • lev (GOffice::FileFormatLevel)

    the file format level

  • saver (GOffice::FileSaver)

    the file saver.

Returns:

  • (Boolean)

    true if save info was set and history may require updating

#share_expressions(freeit) ⇒ Gnm::ExprSharer

Parameters:

  • freeit (Boolean)

Returns:

  • (Gnm::ExprSharer)

#sheet_add(pos, columns, rows) ⇒ Gnm::Sheet

Create and name a new sheet, putting it at position pos. The sheet returned is not ref'd. (The ref belongs to the workbook.)

Parameters:

  • pos (Integer)

    position to add, -1 meaning at end.

  • columns (Integer)

    the sheet columns number.

  • rows (Integer)

    the sheet rows number.

Returns:

#sheet_add_with_type(sheet_type, pos, columns, rows) ⇒ Gnm::Sheet

Create and name a new sheet, putting it at position pos. The sheet returned is not ref'd. (The ref belongs to the workbook.)

Parameters:

  • sheet_type (Gnm::SheetType)

    the sheet type.

  • pos (Integer)

    position to add, -1 meaning append.

  • columns (Integer)

    the sheet columns number.

  • rows (Integer)

    the sheet rows number.

Returns:

#sheet_attach(new_sheet) ⇒ nil

Add new_sheet to wb, placing it at the end. SURPRISE: This assumes a ref to the sheet.

Parameters:

Returns:

  • (nil)

#sheet_attach_at_pos(new_sheet, pos) ⇒ nil

Add new_sheet to wb, placing it at pos.

Parameters:

  • new_sheet (Gnm::Sheet)

    A #Sheet

  • pos (Integer)

    position to attach new_sheet at, -1 meaning at the end

Returns:

  • (nil)

#sheet_by_index(i) ⇒ Gnm::Sheet

Returns A #Sheet.

Parameters:

  • i (Integer)

    the sheet index we are looking for.

Returns:

#sheet_by_name(sheet_name) ⇒ Gnm::Sheet

Returns A #Sheet.

Parameters:

  • sheet_name (String)

    the sheet name we are looking for. This is case insensitive.

Returns:

#sheet_countInteger

Returns:

  • (Integer)

#sheet_get_free_name(base, always_suffix, handle_counter) ⇒ String

Gets a new unquoted name for a sheets such that it does not exist on the workbook.

Parameters:

  • base (String)

    base for the name, e. g. "Sheet"

  • always_suffix (Boolean)

    if true, add suffix even if the name "base" is not in use.

  • handle_counter (Boolean)

    strip counter if necessary

Returns:

  • (String)

    a unique sheet name

#sheet_rename(sheet_indices, new_names, cc) ⇒ Boolean

Adjusts the names of the sheets. We assume that everything is valid. If in doubt call workbook_sheet_reorder_check first.

Parameters:

  • sheet_indices (GLib::SList<Integer>)

    list of sheet indices (ignore -1)

  • new_names (GLib::SList<String>)

    list of new names

  • cc (GOffice::CmdContext)

Returns:

  • (Boolean)

    false when it was successful

#sheet_reorder(new_order) ⇒ Boolean

Adjusts the order of the sheets.

Returns false when it was successful

Parameters:

  • new_order (GLib::SList<Gnm::Sheet>)

    list of #Sheet

Returns:

  • (Boolean)

#sheet_sizeGnm::SheetSize

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.

Returns:

  • (Gnm::SheetSize)

    the current sheet size for wb. If sheets are

#sheet_state_restore(wss) ⇒ nil

Parameters:

  • wss (Gnm::WorkbookSheetState)

Returns:

  • (nil)

#sheetsArray<Gnm::Sheet>

Get an ordered list of the sheets in the workbook

Returns:

#sheets0GLib::SList<Gnm::Sheet>

Get an ordered list of the sheets in the workbook

Returns:

#update_graphsnil

Returns:

  • (nil)

#update_history(type) ⇒ nil

Parameters:

Returns:

  • (nil)