2012-01-21 20:27:45 +01:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2015-05-22 23:30:51 +02:00
|
|
|
* Copyright (C) 2010-2015 David Rosca <nowrep@gmail.com>
|
2018-01-28 18:35:44 +01:00
|
|
|
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
|
2012-01-21 20:27:45 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
|
|
|
#ifndef TABBEDWEBVIEW_H
|
|
|
|
#define TABBEDWEBVIEW_H
|
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2012-01-21 20:27:45 +01:00
|
|
|
#include "webview.h"
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
class QLabel;
|
|
|
|
class QHostInfo;
|
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
class BrowserWindow;
|
2012-01-21 20:27:45 +01:00
|
|
|
class TabWidget;
|
|
|
|
class WebPage;
|
|
|
|
class WebTab;
|
2012-01-24 23:28:18 +01:00
|
|
|
class Menu;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT TabbedWebView : public WebView
|
2012-01-21 20:27:45 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-04-04 17:03:44 +02:00
|
|
|
explicit TabbedWebView(WebTab* webTab);
|
2012-01-21 20:27:45 +01:00
|
|
|
|
2018-01-28 18:35:44 +01:00
|
|
|
void setPage(WebPage* page);
|
2014-04-04 17:03:44 +02:00
|
|
|
|
2014-04-11 22:23:42 +02:00
|
|
|
// BrowserWindow can be null!
|
2014-04-04 17:03:44 +02:00
|
|
|
BrowserWindow* browserWindow() const;
|
|
|
|
void setBrowserWindow(BrowserWindow* window);
|
2012-01-21 20:27:45 +01:00
|
|
|
|
|
|
|
WebTab* webTab() const;
|
|
|
|
|
|
|
|
QString getIp() const;
|
|
|
|
int tabIndex() const;
|
|
|
|
|
2019-03-01 17:08:50 +01:00
|
|
|
QWidget* overlayWidget() override;
|
|
|
|
void closeView() override;
|
|
|
|
void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position) override;
|
2012-01-21 20:27:45 +01:00
|
|
|
|
2019-03-01 17:08:50 +01:00
|
|
|
bool isFullScreen() override;
|
|
|
|
void requestFullScreen(bool enable) override;
|
2015-10-05 17:39:52 +02:00
|
|
|
|
2018-02-25 13:33:07 +01:00
|
|
|
Q_SIGNALS:
|
2012-01-21 20:27:45 +01:00
|
|
|
void wantsCloseTab(int);
|
2019-01-11 07:40:51 +01:00
|
|
|
void ipChanged(const QString&);
|
2012-01-21 20:27:45 +01:00
|
|
|
|
2018-02-25 13:33:07 +01:00
|
|
|
public Q_SLOTS:
|
2013-02-10 10:38:12 +01:00
|
|
|
void setAsCurrentTab();
|
2014-03-19 21:27:43 +01:00
|
|
|
void userLoadAction(const LoadRequest &req);
|
2012-07-13 11:04:14 +02:00
|
|
|
|
2018-02-25 13:33:07 +01:00
|
|
|
private Q_SLOTS:
|
2014-04-01 18:47:19 +02:00
|
|
|
void slotLoadStarted();
|
2012-01-21 20:27:45 +01:00
|
|
|
void slotLoadFinished();
|
2014-04-01 18:47:19 +02:00
|
|
|
void slotLoadProgress(int prog);
|
2015-05-22 23:30:51 +02:00
|
|
|
void linkHovered(const QString &link);
|
2012-01-21 20:27:45 +01:00
|
|
|
void setIp(const QHostInfo &info);
|
|
|
|
|
2012-01-22 11:49:58 +01:00
|
|
|
void inspectElement();
|
2012-01-21 20:27:45 +01:00
|
|
|
|
|
|
|
private:
|
2019-03-01 17:08:50 +01:00
|
|
|
void _contextMenuEvent(QContextMenuEvent *event) override;
|
|
|
|
void _mouseMoveEvent(QMouseEvent *event) override;
|
2012-01-21 20:27:45 +01:00
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
BrowserWindow* m_window;
|
2012-01-21 20:27:45 +01:00
|
|
|
WebTab* m_webTab;
|
2012-01-24 23:28:18 +01:00
|
|
|
Menu* m_menu;
|
2012-01-21 20:27:45 +01:00
|
|
|
|
2013-05-12 22:55:53 +02:00
|
|
|
QString m_currentIp;
|
2012-01-21 20:27:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TABBEDWEBVIEW_H
|