Nui
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
Nui::Dom::ChildlessElement Class Reference

The basic element cannot have children and does not hold explicit ownership of them. More...

#include <childless_element.hpp>

Inheritance diagram for Nui::Dom::ChildlessElement:
Inheritance graph
[legend]
Collaboration diagram for Nui::Dom::ChildlessElement:
Collaboration graph
[legend]

Public Member Functions

 ChildlessElement (HtmlElement const &elem)
 
 ChildlessElement (Nui::val val)
 
void setProperty (std::string_view key, std::string const &value)
 
void setProperty (std::string_view key, std::string_view value)
 
void setProperty (std::string_view key, char const *value)
 
void setProperty (std::string_view key, std::invocable< Nui::val > auto &&value)
 
template<typename T >
void setProperty (std::string_view key, std::optional< T > const &value)
 
void setProperty (std::string_view key, bool value)
 
template<typename... List>
void setProperty (std::string_view key, std::variant< List... > const &variant)
 
template<typename T >
requires std::integral< T > void setProperty (std::string_view key, T value)
 
template<typename T >
requires std::floating_point< T > void setProperty (std::string_view key, T value)
 
void addEventListener (std::string_view event, std::invocable< Nui::val > auto &&callback)
 
void setAttribute (std::string_view key, std::string const &value)
 
void setAttribute (std::string_view key, std::string_view value)
 
void setAttribute (std::string_view key, std::invocable< Nui::val > auto &&value)
 
void setAttribute (std::string_view key, char const *value)
 
void setAttribute (std::string_view key, bool value)
 
template<typename T >
requires std::integral< T > void setAttribute (std::string_view key, T value)
 
template<typename T >
requires std::floating_point< T > void setAttribute (std::string_view key, T value)
 
void setAttribute (std::string_view key, Nui::val value)
 
template<typename T >
void setAttribute (std::string_view key, std::optional< T > const &value)
 
template<typename... List>
void setAttribute (std::string_view key, std::variant< List... > const &variant)
 
void setNodeValue (std::string_view value)
 
void setNodeValue (std::string const &value)
 
- Public Member Functions inherited from Nui::Dom::BasicElement
 BasicElement (Nui::val val)
 
virtual ~BasicElement ()=default
 
Nui::val const & val () const
 
Nui::valval ()
 
 operator Nui::val const & () const
 
 operator Nui::val & ()
 
 operator Nui::val && () &&
 
template<class Derived >
std::shared_ptr< Derived > shared_from_base ()
 
template<class Derived >
std::weak_ptr< Derived > weak_from_base ()
 
std::string tagName () const
 
std::optional< std::string > namespaceUri () const
 

Protected Member Functions

 ChildlessElement ()
 
- Protected Member Functions inherited from Nui::Dom::BasicElement
 BasicElement ()
 

Static Protected Member Functions

static Nui::val createElement (HtmlElement const &element)
 

Additional Inherited Members

- Protected Attributes inherited from Nui::Dom::BasicElement
Nui::val element_
 

Detailed Description

The basic element cannot have children and does not hold explicit ownership of them.

To represent an actual HtmlElement use the Element class.

Constructor & Destructor Documentation

◆ ChildlessElement() [1/3]

Nui::Dom::ChildlessElement::ChildlessElement ( HtmlElement const &  elem)
inlineexplicit

◆ ChildlessElement() [2/3]

Nui::Dom::ChildlessElement::ChildlessElement ( Nui::val  val)
inlineexplicit

◆ ChildlessElement() [3/3]

Nui::Dom::ChildlessElement::ChildlessElement ( )
inlineexplicitprotected

Member Function Documentation

◆ addEventListener()

void Nui::Dom::ChildlessElement::addEventListener ( std::string_view  event,
std::invocable< Nui::val > auto &&  callback 
)
inline

◆ createElement()

static Nui::val Nui::Dom::ChildlessElement::createElement ( HtmlElement const &  element)
inlinestaticprotected

◆ setAttribute() [1/10]

void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
bool  value 
)
inline

◆ setAttribute() [2/10]

void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
char const *  value 
)
inline

◆ setAttribute() [3/10]

void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
Nui::val  value 
)
inline

◆ setAttribute() [4/10]

void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
std::invocable< Nui::val > auto &&  value 
)
inline

◆ setAttribute() [5/10]

template<typename T >
void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
std::optional< T > const &  value 
)
inline

◆ setAttribute() [6/10]

void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
std::string const &  value 
)
inline

◆ setAttribute() [7/10]

void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
std::string_view  value 
)
inline

◆ setAttribute() [8/10]

template<typename... List>
void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
std::variant< List... > const &  variant 
)
inline

◆ setAttribute() [9/10]

template<typename T >
requires std::integral<T> void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
value 
)
inline

◆ setAttribute() [10/10]

template<typename T >
requires std::floating_point<T> void Nui::Dom::ChildlessElement::setAttribute ( std::string_view  key,
value 
)
inline

◆ setNodeValue() [1/2]

void Nui::Dom::ChildlessElement::setNodeValue ( std::string const &  value)
inline

◆ setNodeValue() [2/2]

void Nui::Dom::ChildlessElement::setNodeValue ( std::string_view  value)
inline

◆ setProperty() [1/9]

void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
bool  value 
)
inline

◆ setProperty() [2/9]

void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
char const *  value 
)
inline

◆ setProperty() [3/9]

void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
std::invocable< Nui::val > auto &&  value 
)
inline

◆ setProperty() [4/9]

template<typename T >
void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
std::optional< T > const &  value 
)
inline

◆ setProperty() [5/9]

void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
std::string const &  value 
)
inline

◆ setProperty() [6/9]

void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
std::string_view  value 
)
inline

◆ setProperty() [7/9]

template<typename... List>
void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
std::variant< List... > const &  variant 
)
inline

◆ setProperty() [8/9]

template<typename T >
requires std::integral<T> void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
value 
)
inline

◆ setProperty() [9/9]

template<typename T >
requires std::floating_point<T> void Nui::Dom::ChildlessElement::setProperty ( std::string_view  key,
value 
)
inline

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