2012-01-21 20:27:45 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 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
|
|
|
|
2014-02-19 22:12:32 +01:00
|
|
|
class QUPZILLA_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
|
|
|
|
2014-04-04 17:03:44 +02:00
|
|
|
void setWebPage(WebPage* page);
|
|
|
|
|
|
|
|
BrowserWindow* browserWindow() const;
|
|
|
|
void setBrowserWindow(BrowserWindow* window);
|
2012-01-21 20:27:45 +01:00
|
|
|
|
|
|
|
WebTab* webTab() const;
|
2012-02-24 21:03:44 +01:00
|
|
|
TabWidget* tabWidget() const;
|
2012-01-21 20:27:45 +01:00
|
|
|
|
|
|
|
QString getIp() const;
|
|
|
|
int tabIndex() const;
|
|
|
|
|
2014-04-01 16:32:55 +02:00
|
|
|
QWidget* overlayWidget();
|
2012-01-21 20:27:45 +01:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void wantsCloseTab(int);
|
|
|
|
void ipChanged(QString);
|
|
|
|
void changed();
|
|
|
|
|
|
|
|
public 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
|
|
|
|
2012-01-21 20:27:45 +01:00
|
|
|
void closeView();
|
2012-02-24 21:03:44 +01:00
|
|
|
void openNewTab();
|
2014-03-19 21:27:43 +01:00
|
|
|
void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position);
|
|
|
|
|
2012-01-21 20:27:45 +01:00
|
|
|
private 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);
|
2012-01-21 20:27:45 +01:00
|
|
|
void urlChanged(const QUrl &url);
|
|
|
|
void linkHovered(const QString &link, const QString &title, const QString &content);
|
|
|
|
void setIp(const QHostInfo &info);
|
|
|
|
|
2012-01-22 11:49:58 +01:00
|
|
|
void inspectElement();
|
2012-01-21 20:27:45 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void contextMenuEvent(QContextMenuEvent* event);
|
|
|
|
void mouseMoveEvent(QMouseEvent* event);
|
|
|
|
|
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
|