SheetXL - v1.0.2
    Preparing search index...

    Interface IContent

    What a movable draws: a chart, a picture, a shape, a slicer, a control.

    Content owns what identifies it, and the movable owns where it is drawn. Content can exist with no movable: a picture used as a sheet background is not placed by one.

    The movable owns its placement (bounds, rotation, flip) but the content says which of these it can take: a kind that defines acceptRotation can be turned and one that defines acceptFlip can be mirrored. A kind that defines neither, such as a chart, is placed by its bounds alone.

    interface IContent {
        acceptFlip?(flip: Flip): Flip;
        acceptRotation?(degrees: number): number;
        delete(options?: ITransaction.OperationOptions): void;
        getConnections?(
            width: number,
            height: number,
            options?: ConnectionsOptions,
        ): readonly Connection[] | null;
        getDefaultAnchorType?(): IAnchored.Type;
        getDescription(): string | null;
        getId(): string;
        getMovable(): IMovable | null;
        getName?(): string | null;
        getReferences(): ICellRanges | null;
        getType(): string;
        getTypeDescription(): string;
        isDefaultLockAspectRatio?(): boolean;
        isDeleted(): boolean;
        setDescription(description: string | null): this;
        setName?(name: string): this;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    • The flip this content takes when asked to mirror as flip states.

      Parameters

      Returns Flip

      Defined by content that can be mirrored, such as a shape or a picture; absent, the content cannot: a frame dragged through its opposite edge is moved there but not mirrored, as Excel does with a chart. Must be pure, as acceptRotation is. A connector may accept each axis on its own.

    • The rotation this content takes when asked to turn by degrees, clockwise.

      Parameters

      • degrees: number

      Returns number

      Defined by content that can be turned, such as a shape or a picture; absent, the content cannot and no rotate handle is offered. Must be pure: it is asked throughout a gesture to draw its preview, and the answer is what the movable stores.

    • The points a connector's end may be glued to, in a width by height frame of this content, before the frame is placed.

      Parameters

      Returns readonly Connection[] | null

      Absent, the four edge midpoints — top, left, bottom, right, numbered in that order, each leaving straight out — as Excel offers on a picture, a chart, a slicer or a control. A shape is the exception and answers its geometry's own sites (a triangle's three, a connector's none); a group answers none, since Excel glues to a group's members and never to the group. Must be synchronous: null means the content cannot answer yet and will call options.onReady when it can.

    • How a movable of this content moves and sizes with the cells under it when it is added without an anchor type.

      Returns IAnchored.Type

      Absent, it moves and sizes with them (IAnchored.Type.TwoCell), as Excel inserts a shape or a chart. A picture moves with its cell but keeps its size.

    • Returns the alternative text used by assistive technologies, or null if none has been set.

      Returns string | null

    • Returns the id of the content.

      Returns string

    • Returns the movable that places the content on the sheet, or null if it is not placed by one.

      Returns IMovable | null

    • Returns the name, or null if the content has none.

      Returns string | null

      Not defined for content that is never named.

    • Returns the cells the content names - a chart's series, a control's linked cell, a slicer's column - or null when it names none.

      Returns ICellRanges | null

      Not where the movable sits: that is IMovable.getRange. The references are formulas the calculation engine holds, so they follow the cells they name through inserts, deletes, cuts, sheet renames and undo, and ContentEvents.onReferencesChange is announced when they have. A reference to deleted cells is left out. Without a running engine the references read as they were set.

    • Returns an immutable type string.

      Returns string

    • Returns a label for the kind of content, such as Chart or Picture.

      Returns string

    • Whether a movable of this content keeps its aspect ratio when resized from a corner, when it states no lock of its own.

      Returns boolean

      Absent, it does not. A picture does.

    • Returns true if the content has been deleted.

      Returns boolean

    • Set the alternative text used by assistive technologies.

      Parameters

      • description: string | null

      Returns this

    • Set the name.

      Parameters

      • name: string

        The name of the content.

      Returns this