forked from LadybirdBrowser/ancient-history
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tab.h
69 lines (57 loc) · 1.62 KB
/
Tab.h
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
61
62
63
64
65
66
67
68
69
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, Matthew Costa <ucosty@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#define AK_DONT_REPLACE_STD
#include "History.h"
#include "WebView.h"
#include <QBoxLayout>
#include <QLineEdit>
#include <QToolBar>
#include <QWidget>
class Tab final : public QWidget {
Q_OBJECT
public:
explicit Tab(QMainWindow* window);
WebView& view() { return *m_view; }
void navigate(QString);
void debug_request(String const& request, String const& argument);
public slots:
void location_edit_return_pressed();
void search_edit_return_pressed();
void page_title_changed(QString);
void page_favicon_changed(QIcon);
void back();
void forward();
void home();
void reload();
void break_cache();
void open();
signals:
void title_changed(int id, QString);
void favicon_changed(int id, QIcon);
private:
QBoxLayout* m_layout;
QToolBar* m_toolbar { nullptr };
QToolBar* m_toolbar_buttons { nullptr };
QLineEdit* m_location_edit { nullptr };
QLineEdit* m_search_edit { nullptr };
WebView* m_view { nullptr };
QMainWindow* m_window { nullptr };
Browser::History m_history;
QString m_title;
QString m_open_file;
OwnPtr<QAction> m_back_action;
OwnPtr<QAction> m_forward_action;
OwnPtr<QAction> m_home_action;
OwnPtr<QAction> m_reload_action;
OwnPtr<QAction> m_break_cache_action;
OwnPtr<QAction> m_open_action;
OwnPtr<QAction> m_print_action;
OwnPtr<QAction> m_find_action;
OwnPtr<QAction> m_stop_action;
int tab_index();
};