37 virtual ~Widget() =
default;
38 Widget(Widget
const&) =
delete;
39 Widget& operator=(Widget
const&) =
delete;
40 Widget(Widget&&) =
delete;
41 Widget& operator=(Widget&&) =
delete;
57 virtual void setDragKey(std::optional<Key>
const& key) = 0;
74 virtual void setTestId(std::string_view testId) = 0;
89 virtual void setKeys(std::vector<std::string>
const& chords, std::function<
void(std::string)> onChord) = 0;
99 virtual void setOnHover(std::function<
void()> onHover) {
static_cast<void>(onHover); }
111 virtual void moveChild(Widget& child, std::size_t index) = 0;
129 virtual void setErrors(std::vector<std::string>
const& errors) = 0;
165 virtual void setIcon(std::string_view icon) = 0;
191 virtual void setOnChange(std::function<
void(std::string)> onChange) = 0;
195 virtual void setOnSubmit(std::function<
void(std::string)> onSubmit) = 0;
200 virtual void setOnCommit(std::function<
void(std::string)> onCommit) = 0;
205 virtual void setUnit(std::string_view unit) = 0;
216 virtual void setIcon(std::string_view icon) = 0;
222 virtual void setCaption(std::string_view label,
bool shown) = 0;
250 virtual void setOptions(std::vector<SelectOption>
const& options) = 0;
272 virtual void setCaption(std::string_view label,
bool shown) = 0;
300 virtual void setItems(std::vector<MenuEntry>
const& entries) = 0;
306 virtual void setOnActivate(std::function<
void(std::vector<std::size_t>)> onActivate) = 0;
395 virtual void setTabs(std::vector<std::string>
const& labels) = 0;
403 virtual void setOnSelect(std::function<
void(std::size_t)> onSelect) = 0;
466 virtual void setColumns(std::vector<TableColumn>
const& columns) = 0;
507 static_cast<void>(first);
508 static_cast<void>(count);
509 static_cast<void>(total);
517 static_cast<void>(onVisibleRangeChanged);
529 virtual void setExistingKeys(std::vector<Key>
const& keys) {
static_cast<void>(keys); }
537 virtual void setValue(std::optional<morph::time::Timestamp>
const& value) = 0;
541 virtual void setOnChange(std::function<
void(std::optional<morph::time::Timestamp>)> onChange) = 0;
547 virtual void setCaption(std::string_view label,
bool shown) = 0;
557 virtual void setRange(std::int64_t minimum, std::int64_t maximum, std::int64_t step) = 0;
565 virtual void setOnChange(std::function<
void(std::int64_t)> onChange) = 0;
570 virtual void setOnCommit(std::function<
void(std::int64_t)> onCommit) = 0;
578 virtual void setPath(std::string_view path) = 0;
582 virtual void setOnPicked(std::function<
void(std::string)> onPicked) = 0;
638 virtual void setIcon(std::string_view icon) = 0;
646 virtual void setValue(std::optional<double> value) = 0;
662 virtual void setCurrent(std::optional<std::size_t> index) = 0;
670 virtual void setItems(std::vector<KeyValueItem>
const& items) = 0;
686 virtual void setIcon(std::string_view icon) = 0;
725 virtual void setSizes(std::vector<int>
const& sizes) = 0;
729 virtual void setOnResize(std::function<
void(std::vector<int>)> onResize) = 0;
759 virtual void setAccept(std::vector<std::string>
const& extensions) = 0;
768 virtual void setOnDrop(std::function<
void(std::vector<std::string>)> onDrop) = 0;
780 virtual void setTextProp(std::string_view name, std::string_view value) = 0;
795 virtual void setOnEvent(std::function<
void(std::string event, std::string payload)> onEvent) = 0;
812 IViewBackend() =
default;
813 virtual ~IViewBackend() =
default;
814 IViewBackend(IViewBackend
const&) =
delete;
815 IViewBackend& operator=(IViewBackend
const&) =
delete;
816 IViewBackend(IViewBackend&&) =
delete;
817 IViewBackend& operator=(IViewBackend&&) =
delete;
916 int offsetMinutes) = 0;
990 static_cast<void>(parent);
991 static_cast<void>(request);
Justify
Where a stack places its spare length along its axis, while no shown child stretches.
Align
Where a child is placed across its container's axis: a column's horizontally, a row's vertically,...
virtual std::unique_ptr< CheckboxWidget > createCheckbox(ContainerWidget *parent)=0
Makes a check box.
virtual std::unique_ptr< ToastWidget > createToast(ContainerWidget *parent)=0
Makes a transient message.
virtual std::unique_ptr< PanelWidget > createPanel(ContainerWidget *parent)=0
Makes a titled frame.
virtual std::unique_ptr< DateTimeInputWidget > createDateTimeInput(ContainerWidget *parent, DateMode mode, int offsetMinutes)=0
Makes a date or date-and-time field.
virtual std::unique_ptr< TextWidget > createText(ContainerWidget *parent)=0
Makes read-only text.
virtual std::unique_ptr< SelectWidget > createSelect(ContainerWidget *parent, SelectStyle style)=0
Makes a choice of one option.
virtual std::unique_ptr< SplitterWidget > createSplitter(ContainerWidget *parent, Axis axis)=0
Makes a splitter.
virtual std::unique_ptr< CollapsibleWidget > createCollapsible(ContainerWidget *parent)=0
Makes a collapsible section.
virtual std::unique_ptr< DrawerWidget > createDrawer(ContainerWidget *parent, Side side)=0
Makes a drawer.
virtual std::unique_ptr< ProgressWidget > createProgress(ContainerWidget *parent)=0
Makes a progress bar.
virtual std::unique_ptr< ScrollWidget > createScroll(ContainerWidget *parent, Axis axis)=0
Makes a scroll area.
virtual std::unique_ptr< TableWidget > createTable(ContainerWidget *parent)=0
Makes a table.
virtual std::unique_ptr< EmptyStateWidget > createEmptyState(ContainerWidget *parent)=0
Makes an empty state.
virtual std::unique_ptr< ButtonWidget > createButton(ContainerWidget *parent)=0
Makes a push button.
virtual std::unique_ptr< CustomWidget > createCustom(ContainerWidget *parent, CustomRequest const &request)
Loads the component a custom node names, if this backend can. The only factory that may return null: ...
virtual std::unique_ptr< TabsWidget > createTabs(ContainerWidget *parent)=0
Makes a tab bar.
virtual std::unique_ptr< StepsWidget > createSteps(ContainerWidget *parent)=0
Makes a steps indicator.
virtual std::unique_ptr< SliderWidget > createSlider(ContainerWidget *parent)=0
Makes a slider.
virtual std::unique_ptr< SlotWidget > createSlot(ContainerWidget *parent)=0
Makes a slot.
virtual std::unique_ptr< BadgeWidget > createBadge(ContainerWidget *parent)=0
Makes a badge.
virtual std::unique_ptr< StackWidget > createStack(ContainerWidget *parent, Axis axis)=0
Makes a stack.
virtual std::unique_ptr< SpacerWidget > createSpacer(ContainerWidget *parent)=0
Makes empty space.
virtual std::unique_ptr< BusyWidget > createBusy(ContainerWidget *parent)=0
Makes a progress indicator.
virtual std::unique_ptr< BannerWidget > createBanner(ContainerWidget *parent)=0
Makes a banner.
virtual std::unique_ptr< FilePickerWidget > createFilePicker(ContainerWidget *parent, FilePickerMode mode)=0
Makes a file path field.
virtual std::unique_ptr< GridWidget > createGrid(ContainerWidget *parent)=0
Makes a grid.
virtual std::unique_ptr< MenuWidget > createMenu(ContainerWidget *parent)=0
Makes a command list.
virtual std::unique_ptr< DropZoneWidget > createDropZone(ContainerWidget *parent)=0
Makes a drop zone.
virtual std::unique_ptr< DialogWidget > createDialog(ContainerWidget *parent)=0
Makes a modal overlay.
virtual std::unique_ptr< KeyValueWidget > createKeyValue(ContainerWidget *parent)=0
Makes a key-value list.
virtual std::unique_ptr< TextInputWidget > createTextInput(ContainerWidget *parent, TextInputMode mode)=0
Makes a text field.
virtual void setOnChange(std::function< void(std::string)> onChange)=0
Sets what a user edit calls, with the whole new text.
virtual void setUnit(std::string_view unit)=0
Sets the unit the input shows, muted, at its trailing edge, inside the field; empty shows none....
virtual void setCaption(std::string_view label, bool shown)=0
Sets the field's label, and whether the input draws it as a visible caption above its control....
virtual void setDecimals(int decimals)=0
Sets the fraction digits a number is entered with: what a backend or a kit may use to align or format...
virtual void setPlaceholder(std::string_view placeholder)=0
Sets the text shown while the field is empty.
virtual void setIcon(std::string_view icon)=0
Sets the icon drawn at the field's leading edge; empty shows none. Called once, and only for a single...
virtual void setText(std::string_view text)=0
Replaces the text. Never calls the onChange handler. With the text the field already shows,...
virtual void setOnSubmit(std::function< void(std::string)> onSubmit)=0
Sets what a submit (Enter in single-line mode) calls, with the text.
virtual void setOnCommit(std::function< void(std::string)> onCommit)=0
Sets what a commit calls, with the text: Enter in single-line mode, before the submit,...
virtual void setText(std::string_view text)=0
Replaces the text.
virtual void setRole(TextRole role)=0
Sets the style.
UTC timestamps for morph actions.
What IViewBackend::createCustom asks for.
std::string name
The component's name, as the document's components declares it.
int minVersion
The lowest version of a host component that will do; a bundle component ignores it.
std::vector< std::string > props
The props the document declares for it; a component that does not declare each one is refused.
A widget's size request in both dimensions, and the bounds its extent is clamped into.
The toolkit-agnostic view tree: props, node kinds and their builders.
Tone
What a message or a mark conveys, mapped to the theme's colours.
Node collapsible(Collapsible spec)
A titled section the user opens and closes.
TextInputMode
How a TextInput edits.
TextRole
How a Text is styled; each backend maps a role to its theme.
DateMode
What a DateTimeInput edits.
std::function< void()> Action
A widget event handler taking no arguments.
SelectionMode
How many rows of a Table the user can select.
Side
The edge a Drawer slides in from, in reading direction.
FilePickerMode
Whether a FilePicker chooses an existing file or a file to write.
Node text(Text spec)
Static or bound text.
SelectStyle
How a Select presents its options.
Node row(Row spec)
Children laid out left to right.
std::variant< std::int64_t, std::string > Key
The identity of a Switch case, a Select option, a ForEach or Table row and a drag payload.
Node steps(Steps spec)
The steps of a process.
Axis
The direction a stack arranges, or a scroll area scrolls, its content.