16#ifndef AEONGUI_ELEMENT_H
17#define AEONGUI_ELEMENT_H
24#include "aeongui/AttributeMap.hpp"
25#include "aeongui/StyleSheet.hpp"
26#include "aeongui/dom/DOMString.hpp"
31 typedef struct lwc_string_s lwc_string;
53 DLL
Element (
const DOMString& aTagName, AttributeMap&& aAttributes,
Node* aParent );
63 DLL
const DOMString&
tagName()
const;
67 DLL
const DOMString&
id()
const;
71 const std::vector<lwc_string*>&
classes()
const;
80 DLL
const DOMString*
getAttribute (
const DOMString& aName )
const;
85 DLL
void setAttribute (
const DOMString& aName,
const DOMString& aValue );
110 DLL
void ReselectCSS ( css_stylesheet* aDocumentStyleSheet =
nullptr );
113 DOMString mTagName{};
115 std::vector<lwc_string*> mClasses{};
116 DLL
void OnAncestorChanged()
override;
117 bool mIsHover{
false};
118 bool mIsActive{
false};
119 bool mIsFocus{
false};
120 css_stylesheet* mDocumentStyleSheet{
nullptr};
Abstract 2D rendering surface.
Definition Canvas.hpp:40
Represents a DOM Document.
Definition Document.hpp:40
const DOMString * getAttribute(const DOMString &aName) const
Get the value of a named attribute.
Definition Element.cpp:393
const std::vector< lwc_string * > & classes() const
Get the element's CSS class list.
Definition Element.cpp:384
void setFocus(bool aFocus)
Set the :focus pseudo-class state.
Definition Element.cpp:516
NodeType nodeType() const final
Get the node type (always ELEMENT_NODE).
Definition Element.cpp:372
AttributeMap mAttributes
The element's attribute map.
Definition Element.hpp:122
StyleSheetPtr mInlineStyleSheet
Inline style parsed from the style attribute.
Definition Element.hpp:123
virtual ~Element()
Virtual destructor.
Definition Element.cpp:263
void ApplyChildPaintAnimations(Canvas &aCanvas) const
Apply child paint animation overrides to the canvas.
Definition Element.cpp:323
void ApplyChildTransformAnimations(Canvas &aCanvas) const
Apply child transform animation overrides to the canvas.
Definition Element.cpp:295
bool isHover() const
Check the :hover pseudo-class state.
Definition Element.cpp:491
bool isActive() const
Check the :active pseudo-class state.
Definition Element.cpp:496
void ReselectCSS(css_stylesheet *aDocumentStyleSheet=nullptr)
Re-run CSS selection and compose with parent styles.
Definition Element.cpp:521
const AttributeMap & attributes() const
Get the element's attribute map.
Definition Element.cpp:388
const DOMString & id() const
Get the element's ID attribute value.
Definition Element.cpp:380
virtual void onAttributeChanged(const DOMString &aName, const DOMString &aValue)
Called after an attribute is changed via setAttribute.
Definition Element.cpp:409
void setActive(bool aActive)
Set the :active pseudo-class state.
Definition Element.cpp:511
void setAttribute(const DOMString &aName, const DOMString &aValue)
Set (or add) a named attribute.
Definition Element.cpp:403
void setHover(bool aHover)
Set the :hover pseudo-class state.
Definition Element.cpp:506
css_select_results * GetParentComputedStyles() const
Get computed styles from the parent element.
Definition Element.cpp:271
css_select_results * GetComputedStyles() const
Get this element's computed styles.
Definition Element.cpp:286
Element(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an element.
Definition Element.cpp:172
bool isFocus() const
Check the :focus pseudo-class state.
Definition Element.cpp:501
const DOMString & tagName() const
Get the tag name.
Definition Element.cpp:376
SelectResultsPtr mComputedStyles
Computed CSS styles for this element.
Definition Element.hpp:124
NodeType
DOM node type constants.
Definition Node.hpp:46
Node(Node *aParent=nullptr)
Construct a node with an optional parent.
Definition Node.cpp:29