morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::CollectionModel Class Reference

The immutable model of a v-* view document. More...

#include <collection.hpp>

Public Member Functions

CollectionKind kind () const noexcept
 How the row editor is presented.
std::string_view title () const noexcept
 v-title, or the query's type.
std::string_view query () const noexcept
 v-query: the action whose result rows are listed.
std::string_view rowKey () const noexcept
 v-rowKey: the row member that identifies a row (id by default).
std::span< CollectionColumn const > columns () const noexcept
 v-columns, hidden ones included.
std::optional< CollectionAction > const & rowAction () const noexcept
 v-rowAction: the editor's action and its bind entries.
std::span< CollectionAction const > actions () const noexcept
 v-actions.

Static Public Member Functions

static std::expected< CollectionModel, SchemaError > fromSchema (std::string_view viewJson)
 Reads a view document.

Detailed Description

The immutable model of a v-* view document.

Definition at line 86 of file collection.hpp.

Member Function Documentation

◆ fromSchema()

std::expected< CollectionModel, SchemaError > morph::forms::CollectionModel::fromSchema ( std::string_view viewJson)
inlinestaticnodiscard

Reads a view document.

Parameters
viewJsonThe document, in the vocabulary views::viewSchemaJson<V>() emits.
Returns
The model, or the error naming the malformed key.

Definition at line 92 of file collection.hpp.

◆ kind()

CollectionKind morph::forms::CollectionModel::kind ( ) const
inlinenodiscardnoexcept

How the row editor is presented.

Returns
The kind.

Definition at line 151 of file collection.hpp.

◆ title()

std::string_view morph::forms::CollectionModel::title ( ) const
inlinenodiscardnoexcept

v-title, or the query's type.

Returns
The title.

Definition at line 155 of file collection.hpp.

◆ query()

std::string_view morph::forms::CollectionModel::query ( ) const
inlinenodiscardnoexcept

v-query: the action whose result rows are listed.

Returns
The action type.

Definition at line 159 of file collection.hpp.

◆ rowKey()

std::string_view morph::forms::CollectionModel::rowKey ( ) const
inlinenodiscardnoexcept

v-rowKey: the row member that identifies a row (id by default).

Returns
The member name.

Definition at line 163 of file collection.hpp.

◆ columns()

std::span< CollectionColumn const > morph::forms::CollectionModel::columns ( ) const
inlinenodiscardnoexcept

v-columns, hidden ones included.

Returns
The columns.

Definition at line 167 of file collection.hpp.

◆ rowAction()

std::optional< CollectionAction > const & morph::forms::CollectionModel::rowAction ( ) const
inlinenodiscardnoexcept

v-rowAction: the editor's action and its bind entries.

Returns
The row action, or std::nullopt.

Definition at line 171 of file collection.hpp.

◆ actions()

std::span< CollectionAction const > morph::forms::CollectionModel::actions ( ) const
inlinenodiscardnoexcept

v-actions.

Returns
The actions.

Definition at line 175 of file collection.hpp.


The documentation for this class was generated from the following file: