xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::skill::SubElement Class Referenceabstract

Base class for sub elements that can be edited using a SubElementList binding. More...

#include <xentara/workbench/skill/SubElement.hpp>

+ Inheritance diagram for xentara::workbench::skill::SubElement:

Public Member Functions

virtual ~SubElement ()=0
 Virtual destructor.
 
auto publishDisplayName () -> void
 
auto displayNameProperty () -> bindings::PropertyHandle
 Gets the display name property.
 
Callbacks
virtual auto displayName () const -> ui::String=0
 Gets the name of the element, as it should be shown in the sub element list.
 
virtual auto displayNamePropertyId () const -> bindings::PropertyId
 Gets the property ID of the display name property.
 
virtual auto makeBinding () -> std::unique_ptr< bindings::AbstractElementBinding >=0
 Called by the framework to create a binding for editing the sub element’s properties.
 
- Public Member Functions inherited from xentara::workbench::bindings::PropertyController
 PropertyController () noexcept=default
 Default constructor.
 
 PropertyController (const PropertyController &) noexcept
 Copy constructor that does not actually copy anything.
 
 PropertyController (PropertyController &&) noexcept
 Copy constructor that does not actually move anything.
 
constexpr auto operator= (const PropertyController &) noexcept -> PropertyController &
 Copy assignment operator that does not actually assign anything.
 
constexpr auto operator= (PropertyController &&) noexcept -> PropertyController &
 Move assignment operator that does not actually assign anything.
 
virtual ~PropertyController ()=0
 virtual destructor
 
template<typename Type , typename Value >
requires std::equality_comparable_with<const Type &, const Value &> && std::assignable_from<Type &, Value &&>
auto setProperty (Type &property, Value &&value) const -> bool
 Sets an address-based property, and publishes changes if necessary.
 
template<typename Type , PropertyChangedInvocable ChangeCallback>
auto subscribe (const Type &property, ChangeCallback &&changeCallback) -> Subscription
 Subscribes to an address-based property.
 
template<typename Type >
auto subscribe (const Type &property, SubscriptionCallbacks callbacks) -> Subscription
 Subscribes to an address-based property, with support for specialized callbacks.
 
template<typename Type >
auto publish (const Type &property, Action action=Action::ValueChanged, std::size_t index={}) const -> void
 Publishes a change to the value and state for an address-based property.
 
template<typename Type >
auto publishValue (const Type &property, Action action=Action::ValueChanged, std::size_t index={}) const -> void
 Publishes a change to only the value of an address-based property.
 
template<typename Type >
auto publishState (const Type &property) const -> void
 Publishes a change in only the state of an address-based property.
 
template<typename Type >
auto publishVisibility (const Type &property) const -> void
 Publishes a change in the visibility of an address-based property.
 
template<typename Type >
auto propertyState (const Type &property) const -> const utils::eh::expected< void, ui::String > &
 Gets the state of an address-based property.
 
template<typename Type >
auto propertyVisible (const Type &property) const -> bool
 Gets the visibility of an address-based property.
 
template<typename Type >
auto propertyId (const Type &property) const noexcept -> PropertyId
 Gets the ID of an address-based property.
 
template<typename Type >
auto propertyHandle (const Type &property) noexcept -> PropertyHandle
 Creates a handle for an address-based property.
 
template<PropertyChangedInvocable ChangeCallback>
auto subscribe (const PropertyId &propertyId, ChangeCallback &&changeCallback) -> Subscription
 Subscribes to a property.
 
auto subscribe (const PropertyId &propertyId, SubscriptionCallbacks callbacks) -> Subscription
 Subscribes to a property, with support for specialized callbacks.
 
auto publish (const PropertyId &propertyId, Action action=Action::ValueChanged, std::size_t index={}) const -> void
 Publishes a value and state change for a property.
 
auto publishValue (const PropertyId &propertyId, Action action=Action::ValueChanged, std::size_t index={}) const -> void
 Publishes a change to only the value of a property.
 
auto publishState (const PropertyId &propertyId) const -> void
 Publishes a change in the state of a property.
 
auto publishVisibility (const PropertyId &propertyId) const -> void
 Publishes a change in the visibility of a property.
 
auto propertyState (const PropertyId &propertyId) const -> const utils::eh::expected< void, ui::String > &
 Gets the state of a property.
 
auto propertyVisible (const PropertyId &propertyId) const -> bool
 Gets the visibility of a property.
 
auto propertyHandle (const PropertyId &propertyId) noexcept -> PropertyHandle
 Creates a handle for a property.
 
- Public Member Functions inherited from xentara::workbench::bindings::PropertyContainer
 PropertyContainer () noexcept=default
 Default constructor.
 
 PropertyContainer (const PropertyContainer &other)
 Copy constructor.
 
 PropertyContainer (PropertyContainer &&other) noexcept
 Move constructor.
 
auto operator= (const PropertyContainer &rhs) -> PropertyContainer &
 Copy assignment operator.
 
auto operator= (PropertyContainer &&rhs) noexcept -> PropertyContainer &
 Move assignment operator that does not actually assign anything.
 
virtual ~PropertyContainer ()=0
 Virtual destructor.
 
auto setEnclosingPropertyContainer (PropertyContainer &enclosingContainer, SetEnclosingPropertyContainerOptions options={}) -> void
 Sets the enclosing container.
 
auto resetEnclosingPropertyContainer (SetEnclosingPropertyContainerOptions options={}) -> void
 Resets the enclosing container.
 
auto enclosingPropertyContainer () const -> PropertyContainer *
 Gets the enclosing container.
 
auto propertyErrorCount () const -> std::size_t
 Gets the number of error properties, including those of sub containers.
 
template<std::invocable Callback>
auto subscribeToPropertyErrorCount (Callback &&callback) -> ErrorCountSubscription
 Subscribes to a property.
 
auto forEachCrossReference (const ForEachCrossReferenceFunction &function, ForEachCrossReferenceOptions options={}) noexcept -> void
 Calls a function for each cross reference contained within the container.
 

Additional Inherited Members

- Protected Member Functions inherited from xentara::workbench::bindings::PropertyContainer
auto subPropertyContainerAdded (const PropertyContainer &container) -> void
 Must be called by derived classes if a sub container was added.
 
auto subPropertyContainerRemoved (const PropertyContainer &container) -> void
 Must be called by derived classes if a sub container was removed.
 
auto subPropertyContainerListChanged (SubPropertyContainerListChangedOptions options={}) -> void
 Must be called by derived classes if the list of sub containers changed completely.
 
auto subPropertyContainerListCopied (const PropertyContainer &other, SubPropertyContainerListChangedOptions options={}) -> void
 Must be called by derived classes if the list of sub containers was copied from another container.
 
auto subPropertyContainerListMoved (PropertyContainer &other, SubPropertyContainerListChangedOptions options={}) -> void
 Must be called by derived classes if the list of sub containers was moved from another container.
 
auto subPropertyContainerListSwapped (PropertyContainer &other, SubPropertyContainerListChangedOptions options={}) -> void
 Must be called by derived classes if the list of sub containers was swapped with another container.
 
auto localPropertyErrorCountChanged () -> void
 Must be called by derived classes if the value returned by localPropertyErrorCount() has changed.
 
auto raisePropertyNotification (const PropertyId &propertyId) const -> void
 Passes a property notification to the enclosing container.
 

Detailed Description

Base class for sub elements that can be edited using a SubElementList binding.

Constructor & Destructor Documentation

◆ ~SubElement()

xentara::workbench::skill::SubElement::~SubElement ( )
pure virtualdefault

Virtual destructor.

Member Function Documentation

◆ displayName()

virtual auto xentara::workbench::skill::SubElement::displayName ( ) const -> ui::String
pure virtual

Gets the name of the element, as it should be shown in the sub element list.

Returns
The name of the element, in UTF-8 encoding.

◆ displayNameProperty()

auto xentara::workbench::skill::SubElement::displayNameProperty ( ) -> bindings::PropertyHandle

Gets the display name property.

Returns
The property used to track chnages to the display name.

◆ displayNamePropertyId()

virtual auto xentara::workbench::skill::SubElement::displayNamePropertyId ( ) const -> bindings::PropertyId
virtual

Gets the property ID of the display name property.

Default Implementation
The default implementation returns *"displayName"_propertyId*.
Returns
The property ID used to track changes to the display name.

◆ makeBinding()

virtual auto xentara::workbench::skill::SubElement::makeBinding ( ) -> std::unique_ptr< bindings::AbstractElementBinding >
pure virtual

Called by the framework to create a binding for editing the sub element’s properties.

This callback is called whenever the user tries to edit the properties of the element. The binding defines the UI elements that should be shown, and how these UI elements affect the properties of the skill element.

The binding will normally bind the user interface to member functions or member variables of the element being edited. To facilitate this, you can derive your binding class from bindings::ElementBinding rather than bindings::AbstractElementBinding.

Returns
A user interface binding for the element.

◆ publishDisplayName()

auto xentara::workbench::skill::SubElement::publishDisplayName ( ) -> void