AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
Document.hpp
1/*
2Copyright (C) 2019,2020,2023,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_DOCUMENT_H
17#define AEONGUI_DOCUMENT_H
18#include <cstdint>
19#include <vector>
20#include <memory>
21#include <algorithm>
22#include "aeongui/Platform.hpp"
23#include "aeongui/Canvas.hpp"
24#include "aeongui/StyleSheet.hpp"
25#include "aeongui/dom/Node.hpp"
26#include "aeongui/dom/USVString.hpp"
27namespace AeonGUI
28{
29 namespace DOM
30 {
31 //class Element; // Forward declaration
37 class Document : public Node
38 {
39 public:
41 DLL Document();
45 DLL void Load ( const USVString& aFilename );
47 DLL ~Document();
51 DLL void Draw ( Canvas& aCanvas ) const;
55 DLL const USVString& url() const;
59 DLL NodeType nodeType() const final;
61 private:
62 void Load ();
63 void Unload ();
64 //Element* mDocumentElement{};
65 StyleSheetPtr mStyleSheet{};
66 USVString mUrl{};
67 };
68 }
69}
70#endif
Platform-specific DLL import/export macros and compiler helpers.
Abstract 2D rendering surface.
Definition Canvas.hpp:39
~Document()
Destructor. Unloads the document.
Definition Document.cpp:148
void Draw(Canvas &aCanvas) const
Draw the document onto a canvas.
Definition Document.cpp:153
void Load(const USVString &aFilename)
Load a document from a file.
Definition Document.cpp:81
Document()
Default constructor. Creates an empty document.
const USVString & url() const
Get the document URL.
Definition Document.cpp:125
NodeType nodeType() const final
Get the node type (always DOCUMENT_NODE).
Definition Document.cpp:76
NodeType
DOM node type constants.
Definition Node.hpp:44
Node(Node *aParent=nullptr)
Construct a node with an optional parent.
Definition Node.cpp:25