-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHtmlNode.h
More file actions
60 lines (45 loc) · 1.22 KB
/
HtmlNode.h
File metadata and controls
60 lines (45 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// HtmlNode.h
// Musee
//
// Created by Denis Stadniczuk on 24/06/14.
// Copyright (c) 2014 Denis Stadniczuk. All rights reserved.
//
#ifndef __Musee__HtmlNode__
#define __Musee__HtmlNode__
#include <iostream>
#include "CssStyle.h"
class HtmlElement;
class HtmlDocument;
typedef enum {
TEXT,
ELEMENT
} NodeType;
class HtmlNode {
NodeType type;
protected:
float calculatedX;
float calculatedY;
float calculatedZ;
float offsetW;
float offsetH;
float scrollW;
float scrollH;
HtmlDocument *doc;
HtmlElement *parent;
std::string tagName;
public:
HtmlNode(NodeType type);
NodeType getNodeType();
void setDocument(HtmlDocument *document);
HtmlDocument* document();
void setParent(HtmlElement *parent);
HtmlElement* parentNode();
std::string getTagName();
CssStyle calculatedStyle;
CssStyle style;
virtual std::string toString() {return "";};
void setCalculatedBounds(float x, float y, float z, float offsetWidth, float offsetHeight, float scrollWidth, float scrollHeight);
void getCalculatedBounds(float &x, float &y, float &z, float &offsetWidth, float &offsetHeight, float &scrollWidth, float &scrollHeight);
};
#endif /* defined(__Musee__HtmlNode__) */