xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::bindings::ElementBinding< ConcreteElement > Class Template Reference

Base class for UI bindings for a certain type of element. More...

#include <xentara/workbench/bindings/ElementBinding.hpp>

+ Inheritance diagram for xentara::workbench::bindings::ElementBinding< ConcreteElement >:

Public Types

using Base = ElementBinding
 An alias for this class, to make inheriting constructors easier.
 
using Element = ConcreteElement
 An alias for the element.
 

Public Member Functions

 ElementBinding (Element &element)
 Constructor that sets the element.
 
constexpr auto element () const noexcept -> Element &
 Returns the element.
 
template<typename Type >
requires std::derived_from<ConcreteElement, PropertyController>
auto propertyId (const Type &property) const noexcept -> PropertyId
 Gets the ID of a variable-based property of the element.
 
template<typename Type >
requires std::derived_from<ConcreteElement, PropertyController>
auto propertyHandle (const Type &property) noexcept -> PropertyHandle
 Creates a handle for a variable-based property of the element.
 
auto propertyHandle (const PropertyId &propertyId) noexcept -> PropertyHandle
 Creates a handle for a property of the element.
 
- Public Member Functions inherited from xentara::workbench::bindings::AbstractElementBinding
virtual ~AbstractElementBinding ()=0
 Virtual destructor.
 
virtual auto populateUi (ui::Form form) -> void=0
 Populate the ui with the contents of the given form.
 

Detailed Description

template<typename ConcreteElement>
class xentara::workbench::bindings::ElementBinding< ConcreteElement >

Base class for UI bindings for a certain type of element.

Template Parameters
ConcreteElementThe element class the binding is for

Member Typedef Documentation

◆ Base

template<typename ConcreteElement >
using xentara::workbench::bindings::ElementBinding< ConcreteElement >::Base = ElementBinding

An alias for this class, to make inheriting constructors easier.

◆ Element

template<typename ConcreteElement >
using xentara::workbench::bindings::ElementBinding< ConcreteElement >::Element = ConcreteElement

An alias for the element.

Constructor & Destructor Documentation

◆ ElementBinding()

template<typename ConcreteElement >
xentara::workbench::bindings::ElementBinding< ConcreteElement >::ElementBinding ( Element element)

Constructor that sets the element.

Member Function Documentation

◆ element()

template<typename ConcreteElement >
constexpr auto xentara::workbench::bindings::ElementBinding< ConcreteElement >::element ( ) const -> Element &
constexprnoexcept

Returns the element.

Returns
The element that was passed to the constructor

◆ propertyHandle() [1/2]

template<typename ConcreteElement >
auto xentara::workbench::bindings::ElementBinding< ConcreteElement >::propertyHandle ( const PropertyId propertyId) -> PropertyHandle
noexcept

Creates a handle for a property of the element.

Precondition
This function is only available if the element is derived from PropertyController.
Parameters
propertyIdThe ID of the property to create the handle for.
Returns
The handle

◆ propertyHandle() [2/2]

template<typename ConcreteElement >
template<typename Type >
requires std::derived_from<ConcreteElement, PropertyController>
auto xentara::workbench::bindings::ElementBinding< ConcreteElement >::propertyHandle ( const Type &  property) -> PropertyHandle
noexcept

Creates a handle for a variable-based property of the element.

Precondition
This function is only available if the element is derived from PropertyController.
Parameters
propertyA reference to the variable holding the property’s value.
Returns
The handle

◆ propertyId()

template<typename ConcreteElement >
template<typename Type >
requires std::derived_from<ConcreteElement, PropertyController>
auto xentara::workbench::bindings::ElementBinding< ConcreteElement >::propertyId ( const Type &  property) const -> PropertyId
noexcept

Gets the ID of a variable-based property of the element.

Precondition
This function is only available if the element is derived from PropertyController.
Parameters
propertyA reference to the variable holding the property’s value.
Returns
The ID