|
xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
|
Meta-Information about an element class. More...
#include <xentara/workbench/skill/Element.hpp>
Inheritance diagram for xentara::workbench::skill::Element::Class:Public Types | |
| using | I18n = i18n::Context<"workbench::skill::Element::Class"> |
| The translation context that should be used for displayName() | |
Public Member Functions | |
| virtual | ~Class ()=0 |
| Virtual destructor. | |
| virtual auto | name () const -> std::string_view=0 |
| Gets the name of the element class. | |
| virtual auto | uuid () const -> utils::core::Uuid=0 |
| Gets the UUID of the element class. | |
| virtual auto | displayName () const -> ui::String=0 |
| Gets the user facing name of the class. | |
| virtual auto | menuText () const -> ui::String=0 |
| Gets the menu text used for the class. | |
| virtual auto | newElementName () const -> std::string_view=0 |
| Gets the name of newly created elements of this class. | |
| virtual auto | category () const -> model::ElementCategory=0 |
| Gets the element category. | |
| virtual auto | allowChildElement (const Class &elementClass) const -> bool |
| Called by the framework to determine if it is allowed to create a child element. | |
| virtual auto | elementFactory () const -> const AbstractElementFactory &=0 |
| Returns a factory for creating new elements. | |
Meta-Information about an element class.
| using xentara::workbench::skill::Element::Class::I18n = i18n::Context<"workbench::skill::Element::Class"> |
The translation context that should be used for displayName()
|
pure virtualdefault |
Virtual destructor.
|
virtual |
Called by the framework to determine if it is allowed to create a child element.
| elementClass | The class for the new element |
Reimplemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Gets the element category.
This callback returns the element category best suited for this element.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Gets the user facing name of the class.
The display name is a short description of the class used to identify it to end users. The display name should be a short, internationalized text like “Modbus TCP device” or “reflective memory segment”. You should use the helper type I18n to internationalize the display name.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Returns a factory for creating new elements.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Gets the menu text used for the class.
The menu text is the text under which the class appears in the “New Element” menu. The menu text should use title case, like “Modbus TCP Device” or “Reflective Memory Segment”.
If the element type can only be the child of one or more specific parents, then the menu text can be context sensitive. For example, since an S7 data block can only be a child of an S7 PLC, the menu text can simply be “Data Block”, rather that “S7 Data Block”.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Gets the name of the element class.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Gets the name of newly created elements of this class.
The new element name should be in English, should title case, and should not be internationalized. The new element name should reflect what a user is likely to want to name the element, rather than the full element type. For example, an S/ PLC’s new element name should be “PLC” rather than “S7 PLC”, as it is unlikely that the user will want to include the PLC type in the name.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.
|
pure virtual |
Gets the UUID of the element class.
Implemented in xentara::workbench::skill::Element::ConcreteClass< DerivedElement, kName, kUuid, DisplayName, MenuText, kNewElementName, kCategory >, and xentara::workbench::skill::PlaceholderElement< DerivedElement, kClassName, kUuid, DisplayName, MenuText, kNewElementName, kCategory, kIsIncomplete >::Class.