summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML/Frame.h
blob: 38a8d8bedb72aa8b0c31c80beb097f8016b4ea47 (plain)
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
#pragma once

#include <AK/Function.h>
#include <AK/Noncopyable.h>
#include <AK/RefPtr.h>
#include <LibDraw/Rect.h>
#include <LibDraw/Size.h>
#include <LibHTML/TreeNode.h>

class Document;

class Frame : public TreeNode<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&);

    void set_needs_display(const Rect&);
    Function<void(const Rect&)> on_set_needs_display;

private:
    Frame();

    RefPtr<Document> m_document;
    Size m_size;
};