ladybird/Libraries/LibHTML/Frame.h
Andreas Kling 7bc9310170 LibHTML: Add a Frame class and use it for document layout width
Each HtmlView now has a main_frame(), which represents the main frame
of the web page. Frame inherits from TreeNode<Frame>, which will allow
us to someday implement a Frame tree (to support the <frame> element.)
2019-10-04 15:50:04 +02:00

32 lines
631 B
C++

#pragma once
#include <AK/Noncopyable.h>
#include <AK/RefPtr.h>
#include <AK/Weakable.h>
#include <LibDraw/Size.h>
#include <LibHTML/TreeNode.h>
class Document;
class Frame
: public TreeNode<Frame>
, public Weakable<Frame> {
public:
static NonnullRefPtr<Frame> create() { return adopt(*new Frame); }
~Frame();
const Document* document() const { return m_document; }
Document* document() { return m_document; }
void set_document(Document*);
const Size& size() const { return m_size; }
void set_size(const Size&);
private:
Frame();
RefPtr<Document> m_document;
Size m_size;
};