/* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote * * SPDX-License-Identifier: GPL-3.0 */ #ifndef SMOLBOTE_TABWIDGET_H #define SMOLBOTE_TABWIDGET_H #include #include #include class QAction; class QMenu; class WebView; class WebProfile; class QWebEnginePage; class SubWindow; class TabWidget : public QTabWidget { Q_OBJECT public: struct TabInformation { WebProfile *profile; QString title; int historyIndex; QByteArray historyBuffer; }; explicit TabWidget(SubWindow *parent = nullptr); ~TabWidget() override; public slots: int addTab(WebView *view); void removeTab(int index); int restoreLastTab(); void restoreTabMenu(QMenu *menu); protected: void contextMenuEvent(QContextMenuEvent *event) override; void mousePressEvent(QMouseEvent *event) override; private: SubWindow *m_parent; int current = -1; int previous = -1; QMenu *tabContextMenu; QQueue m_closedTabs; }; #endif // SMOLBOTE_TABWIDGET_H