forked from LadybirdBrowser/ancient-history
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBrowserWindow.h
56 lines (45 loc) · 1.22 KB
/
BrowserWindow.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
/*
* Copyright (c) 2022, Andreas Kling <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "Tab.h"
#include <AK/NonnullOwnPtrVector.h>
#include <LibCore/Forward.h>
#include <QIcon>
#include <QLineEdit>
#include <QMainWindow>
#include <QMenuBar>
#include <QTabBar>
#include <QTabWidget>
#include <QToolBar>
#pragma once
class WebView;
class BrowserWindow : public QMainWindow {
Q_OBJECT
public:
explicit BrowserWindow(Core::EventLoop&);
WebView& view() const { return m_current_tab->view(); }
int tab_index(Tab*);
virtual void closeEvent(QCloseEvent*) override;
public slots:
void tab_title_changed(int index, QString const&);
void tab_favicon_changed(int index, QIcon icon);
void new_tab();
void close_tab(int index);
void close_current_tab();
void about();
void repo();
void go_home();
void go_back();
void go_forward();
void go_reload();
void open_file();
private:
void debug_request(String const& request, String const& argument = "");
QTabWidget* m_tabs_container { nullptr };
QTabBar* m_tabs_bar { nullptr };
NonnullOwnPtrVector<Tab> m_tabs;
Tab* m_current_tab { nullptr };
Core::EventLoop& m_event_loop;
};