struct EE::Graphics::RichText::InlineItem

A single item in the inline formatting tree.

#include <richtext.hpp>

struct InlineItem {
    // structs

    struct AtomicBox;
    struct Box;
    struct TextRun;

    // fields

    std::variant<TextRun, Box, AtomicBox> data;

    // construction

    InlineItem();
    InlineItem(TextRun run);
    InlineItem(Box box);
    InlineItem(AtomicBox box);

    // methods

    TextRun& asTextRun();
    const TextRun& asTextRun() const;
    Box& asBox();
    const Box& asBox() const;
    AtomicBox& asAtomicBox();
    const AtomicBox& asAtomicBox() const;
    bool isTextRun() const;
    bool isBox() const;
    bool isAtomicBox() const;
};