Newer
Older
#ifndef DOCUMENTCOMPONENT_H
#define DOCUMENTCOMPONENT_H
#include <GL/glew.h>
#include "Component.h"
#include "ComponentBuilder.h"
#include "../opengl/Window.h"
#include "../../html/Node.h"
#include "../../URL.h"
#include "../../networking/HTTPResponse.h"
#include "MultiComponent.h"
class DocumentComponent : public MultiComponent {
public:
DocumentComponent(const float rawX, const float rawY, const float rawWidth, const float rawHeight, const int passedWindowWidth, const int passedWindowHeight);
void render();
void createComponentTree(const std::shared_ptr<Node> node, const std::shared_ptr<Component> &parentComponent);
std::shared_ptr<Component> searchComponentTree(const std::shared_ptr<Component> &component, const int x, const int y);
void navTo(const std::string url);
void setDOM(const std::shared_ptr<Node> rootNode);
std::shared_ptr<Node> domRootNode = nullptr;
ComponentBuilder componentBuilder;
URL currentURL;
bool domDirty = false;
int scrollY = 0;
int scrollHeight = 0;
};
//bool setWindowContent(URL const& url);
//void handleRequest(const HTTPResponse &response);