31 : attributeImpl_{RegularAttribute{.setter = std::move(setter)}}
33 , clearEvent_{std::move(clearEvent)}
40 .data = std::move(data),
43 , clearEvent_{std::move(clearEvent)}
46 std::string_view data,
50 .data = std::string{data},
53 , clearEvent_{std::move(clearEvent)}
70 void defer(
bool doDefer) &;
74 return std::move(*
this);
78 std::variant<std::monostate, RegularAttribute, StringDataAttribute> attributeImpl_{};
86 attribute.
defer(!attribute.defer());
87 return std::move(attribute);
Definition: attribute.hpp:15
Attribute(std::function< void(Dom::ChildlessElement &)> setter, std::function< EventContext::EventIdType(std::weak_ptr< Dom::ChildlessElement > &&element)> createEvent={}, std::function< void(EventContext::EventIdType const &)> clearEvent={})
Definition: attribute.hpp:27
void setOn(Dom::ChildlessElement &element) const
Definition: attribute.cpp:9
Attribute(Attribute &&)=default
std::function< void(EventContext::EventIdType const &)> getEventClear() const
Definition: attribute.cpp:21
Attribute(std::string data, std::function< EventContext::EventIdType(std::weak_ptr< Dom::ChildlessElement > &&element)> createEvent, std::function< void(EventContext::EventIdType const &)> clearEvent)
Definition: attribute.hpp:35
bool defer() const
Definition: attribute.cpp:41
Attribute & operator=(Attribute &&)=default
Attribute && defer(bool doDefer) &&
Definition: attribute.hpp:71
std::string const & stringData() const
Definition: attribute.cpp:26
Attribute & operator=(Attribute const &)=default
EventContext::EventIdType createEvent(std::weak_ptr< Dom::ChildlessElement > &&element) const
Definition: attribute.cpp:14
Attribute(Attribute const &)=default
Attribute(std::string_view data, std::function< EventContext::EventIdType(std::weak_ptr< Dom::ChildlessElement > &&element)> createEvent, std::function< void(EventContext::EventIdType const &)> clearEvent)
Definition: attribute.hpp:45
bool isStringData() const
Definition: attribute.cpp:36
bool isRegular() const
Definition: attribute.cpp:31
The basic element cannot have children and does not hold explicit ownership of them.
Definition: childless_element.hpp:19
EventRegistry::EventIdType EventIdType
Definition: event_context.hpp:40
Definition: file_dialog.hpp:6
Attribute && operator!(Attribute &&attribute)
Definition: attribute.hpp:84
Definition: attribute.hpp:18
std::function< void(Dom::ChildlessElement &)> setter
Definition: attribute.hpp:19
Definition: attribute.hpp:22
std::string data
Definition: attribute.hpp:23