Falkon Develop
Cross-platform Qt-based web browser
tabbedwebview.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2015 David Rosca <nowrep@gmail.com>
4* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
5*
6* This program is free software: you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation, either version 3 of the License, or
9* (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18* ============================================================ */
19#ifndef TABBEDWEBVIEW_H
20#define TABBEDWEBVIEW_H
21
22#include "qzcommon.h"
23#include "webview.h"
24
25class QLabel;
26class QHostInfo;
27
28class BrowserWindow;
29class TabWidget;
30class WebPage;
31class WebTab;
32class Menu;
33
35{
36 Q_OBJECT
37public:
38 explicit TabbedWebView(WebTab* webTab);
39
40 void setPage(WebPage* page);
41
42 // BrowserWindow can be null!
43 BrowserWindow* browserWindow() const;
44 void setBrowserWindow(BrowserWindow* window);
45
46 WebTab* webTab() const;
47
48 QString getIp() const;
49 int tabIndex() const;
50
51 QWidget* overlayWidget() override;
52 void closeView() override;
53 void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position) override;
54
55 bool isFullScreen() override;
56 void requestFullScreen(bool enable) override;
57
58Q_SIGNALS:
59 void wantsCloseTab(int);
60 void ipChanged(const QString&);
61
62public Q_SLOTS:
63 void setAsCurrentTab();
64 void userLoadAction(const LoadRequest &req);
65
66private Q_SLOTS:
67 void slotLoadStarted();
68 void slotLoadFinished();
69 void slotLoadProgress(int prog);
70 void linkHovered(const QString &link);
71 void setIp(const QHostInfo &info);
72
73 void inspectElement();
74
75private:
76 void _contextMenuEvent(QContextMenuEvent *event) override;
77 void _mouseMoveEvent(QMouseEvent *event) override;
78
79 BrowserWindow* m_window;
80 WebTab* m_webTab;
81 Menu* m_menu;
82
83 QString m_currentIp;
84};
85
86#endif // TABBEDWEBVIEW_H
void ipChanged(const QString &)
void wantsCloseTab(int)
Definition: webtab.h:40
virtual QWidget * overlayWidget()=0
virtual void closeView()=0
void slotLoadStarted()
Definition: webview.cpp:413
virtual void requestFullScreen(bool enable)=0
virtual bool isFullScreen()=0
void slotLoadFinished(bool ok)
Definition: webview.cpp:434
void setPage(WebPage *page)
Definition: webview.cpp:137
virtual void _contextMenuEvent(QContextMenuEvent *event)
Definition: webview.cpp:1237
virtual void _mouseMoveEvent(QMouseEvent *event)
Definition: webview.cpp:1160
virtual void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position)=0
void slotLoadProgress(int progress)
Definition: webview.cpp:422
#define FALKON_EXPORT
Definition: qzcommon.h:28