2022-07-05 22:18:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Tab.h"
|
2022-07-06 13:36:49 +00:00
|
|
|
#include <AK/NonnullOwnPtrVector.h>
|
2022-07-05 17:42:45 +00:00
|
|
|
#include <LibCore/Forward.h>
|
2022-07-05 04:53:11 +00:00
|
|
|
#include <QIcon>
|
2022-07-03 19:26:51 +00:00
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QMainWindow>
|
2022-07-05 22:18:21 +00:00
|
|
|
#include <QMenuBar>
|
2022-07-12 09:41:11 +00:00
|
|
|
#include <QTabBar>
|
2022-07-05 22:18:21 +00:00
|
|
|
#include <QTabWidget>
|
2022-07-03 19:26:51 +00:00
|
|
|
#include <QToolBar>
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class WebView;
|
|
|
|
|
|
|
|
class BrowserWindow : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-09-07 18:33:15 +00:00
|
|
|
explicit BrowserWindow();
|
2022-07-03 19:26:51 +00:00
|
|
|
|
2022-07-05 22:18:21 +00:00
|
|
|
WebView& view() const { return m_current_tab->view(); }
|
2022-07-03 19:26:51 +00:00
|
|
|
|
2022-07-05 22:18:21 +00:00
|
|
|
int tab_index(Tab*);
|
2022-07-05 17:42:45 +00:00
|
|
|
|
2022-07-05 19:10:50 +00:00
|
|
|
public slots:
|
2022-07-05 22:18:21 +00:00
|
|
|
void tab_title_changed(int index, QString const&);
|
|
|
|
void tab_favicon_changed(int index, QIcon icon);
|
|
|
|
void new_tab();
|
2022-07-06 13:36:49 +00:00
|
|
|
void close_tab(int index);
|
2022-07-19 10:16:46 +00:00
|
|
|
void close_current_tab();
|
2022-09-12 07:22:43 +00:00
|
|
|
void open_next_tab();
|
|
|
|
void open_previous_tab();
|
2022-07-05 19:10:50 +00:00
|
|
|
|
2022-07-03 19:26:51 +00:00
|
|
|
private:
|
2022-07-08 12:14:40 +00:00
|
|
|
void debug_request(String const& request, String const& argument = "");
|
|
|
|
|
2022-07-05 22:18:21 +00:00
|
|
|
QTabWidget* m_tabs_container { nullptr };
|
2022-07-12 09:41:11 +00:00
|
|
|
QTabBar* m_tabs_bar { nullptr };
|
2022-07-06 13:36:49 +00:00
|
|
|
NonnullOwnPtrVector<Tab> m_tabs;
|
2022-07-05 22:18:21 +00:00
|
|
|
Tab* m_current_tab { nullptr };
|
2022-07-03 19:26:51 +00:00
|
|
|
};
|