diff --git a/browser/dom.hpp b/browser/dom.hpp new file mode 100644 index 0000000..8e8dbe5 --- /dev/null +++ b/browser/dom.hpp @@ -0,0 +1,55 @@ +#pragma once + +#include +#include +#include + +namespace dom { + +enum class Elements { + Box, + Text, +}; + +class Element { +public: + Element() = default; + Element(const Element&) = default; + Element(Element&&) = delete; + auto operator=(const Element&) -> Element& = default; + auto operator=(Element&&) -> Element& = default; + virtual ~Element() = default; + + [[nodiscard]] virtual auto element_type() const noexcept -> Elements = 0; + [[nodiscard]] virtual auto parent() noexcept -> std::shared_ptr + = 0; +}; + +class Box final : public Element { +public: + Box() = default; + [[nodiscard]] auto element_type() const noexcept -> Elements override + { + return Elements::Text; + }; + auto add_child() noexcept { } + +private: + std::vector> children; +}; + +class Text final : public Element { +public: + Text(std::string value) + : value { std::move(value) } + { } + [[nodiscard]] auto element_type() const noexcept -> Elements override + { + return Elements::Text; + }; + +private: + std::string value; +}; + +} diff --git a/browser/graphics.hpp b/browser/graphics.hpp new file mode 100644 index 0000000..bbd3fef --- /dev/null +++ b/browser/graphics.hpp @@ -0,0 +1,12 @@ +#pragma once + +class Graphics { +public: + Graphics(const Graphics&) = default; + Graphics(Graphics&&) = default; + auto operator=(const Graphics&) -> Graphics& = default; + auto operator=(Graphics&&) -> Graphics& = default; + virtual ~Graphics() = default; + +private: +};