2016-01-18 14:33:28 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2017-01-04 13:33:32 +00:00
|
|
|
// Copyright (C) 2013 - 2017, The pgAdmin Development Team
|
2016-01-18 14:33:28 +00:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
// WebViewWindow.h - Declaration of the custom web view widget
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef WEBVIEWWINDOW_H
|
|
|
|
#define WEBVIEWWINDOW_H
|
|
|
|
|
|
|
|
#include "pgAdmin4.h"
|
|
|
|
|
2016-02-23 09:10:49 +00:00
|
|
|
#if QT_VERSION >= 0x050000
|
2017-02-13 11:44:53 +00:00
|
|
|
#ifdef PGADMIN4_USE_WEBENGINE
|
2016-11-08 10:54:34 +00:00
|
|
|
#include <QtWebEngineWidgets>
|
|
|
|
#else
|
2016-01-18 14:33:28 +00:00
|
|
|
#include <QtWebKitWidgets>
|
2016-11-08 10:54:34 +00:00
|
|
|
#endif
|
2016-02-23 09:10:49 +00:00
|
|
|
#else
|
|
|
|
#include <QWebView>
|
|
|
|
#endif
|
2016-01-18 14:33:28 +00:00
|
|
|
|
2016-11-08 10:54:34 +00:00
|
|
|
// Override QWebEnginePage to handle link delegation
|
2017-02-13 11:44:53 +00:00
|
|
|
#ifdef PGADMIN4_USE_WEBENGINE
|
2016-11-08 10:54:34 +00:00
|
|
|
class WebEnginePage : public QWebEnginePage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
protected:
|
|
|
|
virtual bool acceptNavigationRequest(const QUrl & url, NavigationType type, bool isMainFrame);
|
|
|
|
QWebEnginePage *createWindow(QWebEnginePage::WebWindowType type);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void createTabWindow(QWebEnginePage * &);
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2017-02-13 11:44:53 +00:00
|
|
|
#ifdef PGADMIN4_USE_WEBENGINE
|
2016-11-08 10:54:34 +00:00
|
|
|
class WebViewWindow : public QWebEngineView
|
|
|
|
#else
|
2016-01-18 14:33:28 +00:00
|
|
|
class WebViewWindow : public QWebView
|
2016-11-08 10:54:34 +00:00
|
|
|
#endif
|
2016-01-18 14:33:28 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
WebViewWindow(QWidget *parent = NULL);
|
|
|
|
void setFirstLoadURL(const QString &url);
|
|
|
|
QString getFirstLoadURL() const;
|
|
|
|
void setTabIndex(const int &tabIndex);
|
|
|
|
int getTabIndex() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_url;
|
|
|
|
int m_tabIndex;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WEBVIEWWINDOW_H
|