aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/WebViewStack.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/WebViewStack.hpp')
-rw-r--r--src/widgets/WebViewStack.hpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/widgets/WebViewStack.hpp b/src/widgets/WebViewStack.hpp
index aa463cc..c975d16 100644
--- a/src/widgets/WebViewStack.hpp
+++ b/src/widgets/WebViewStack.hpp
@@ -8,6 +8,8 @@
#include "Configuration.hpp"
#include "widgets/WebView.hpp"
+using WebViewId = qsizetype;
+
enum OpenType : uint8_t {
OpenUrl,
OpenUrlInTab,
@@ -31,28 +33,31 @@ public:
void open_url(const QUrl &url, OpenType open_type = OpenType::OpenUrl);
std::vector<QUrl> urls();
- QList<Tab> get_tab_list();
- uint32_t current_web_view_index();
+ QList<Tab> get_webview_list();
+ uint32_t current_webview_index();
uint32_t count();
QUrl current_url();
- void focus_web_view(qsizetype index);
+ void focus_webview(WebViewId index);
void next();
void previous();
- void close(qsizetype index);
+ void close(WebViewId index);
void close_current();
+ void webview_history_back(WebViewId webview_id, qsizetype history_index);
+ void webview_history_forward(WebViewId webview_id, qsizetype history_index);
+
private slots:
- void on_new_web_view_request(const QWebEngineNewWindowRequest &request);
+ void on_new_webview_request(const QWebEngineNewWindowRequest &request);
protected:
void set_current_url(const QUrl &url);
- WebView *create_new_web_view(const QUrl &url, bool focus = false);
+ WebView *create_new_webview(const QUrl &url, bool focus = false);
private:
const Configuration *configuration;
QWebEngineProfile *profile;
QStackedLayout *layout;
- QList<WebView *> web_view_list;
+ QList<WebView *> webview_list;
};