logisheets_controller 1.16.1

Core spreadsheet engine for LogiSheets: formula evaluation, dependency tracking, and undo/redo.
Documentation
use logisheets_base::{
    BlockCellId, SheetId, StyleId,
    block_affect::BlockAffectTrait,
    id_fetcher::{IdFetcherTrait, SheetIdFetcherByIdxTrait},
    index_fetcher::IndexFetcherTrait,
};

use crate::style_manager::RawStyle;
use crate::{Error, edit_action::StyleUpdateType};

pub trait ContainerExecCtx:
    IdFetcherTrait + IndexFetcherTrait + BlockAffectTrait + SheetIdFetcherByIdxTrait
{
    // Get a new style id based on the old style id and the style update type.
    // Note that the old id won't be removed even if it is not used by any cell.
    fn get_new_style_id(
        &mut self,
        old_id: StyleId,
        update_type: StyleUpdateType,
    ) -> Result<StyleId, Error>;

    fn insert_style(&mut self, style: RawStyle) -> Result<StyleId, Error>;

    /// True if the given block cell sits in a field carrying a
    /// value-formula template. The container executor uses this to
    /// skip writing the user's raw `BlockInput.input` content into the
    /// cell — the formula manager will populate the cell from the
    /// schema's template instead.
    fn is_block_cell_templated(&self, sheet_id: SheetId, cell: &BlockCellId) -> bool;
}