syncthingtray/syncthingwidgets/webview/webviewdialog.h

58 lines
1.4 KiB
C
Raw Normal View History

2016-08-25 00:45:32 +02:00
#ifndef WEBVIEW_DIALOG_H
#define WEBVIEW_DIALOG_H
#ifndef SYNCTHINGWIDGETS_NO_WEBVIEW
2016-08-25 00:45:32 +02:00
#include "./webviewdefs.h"
2016-08-25 00:45:32 +02:00
#include "../settings/settings.h"
2016-09-03 20:14:52 +02:00
2016-08-25 00:45:32 +02:00
#include <QMainWindow>
QT_FORWARD_DECLARE_CLASS(WEB_VIEW_PROVIDER)
QT_FORWARD_DECLARE_CLASS(QWebEngineProfile)
2016-08-25 00:45:32 +02:00
2016-09-03 20:14:52 +02:00
namespace Settings {
struct ConnectionSettings;
}
2016-08-25 00:45:32 +02:00
namespace QtGui {
2017-05-01 03:34:43 +02:00
class SYNCTHINGWIDGETS_EXPORT WebViewDialog : public QMainWindow {
2016-08-25 00:45:32 +02:00
Q_OBJECT
public:
WebViewDialog(QWidget *parent = nullptr);
2018-10-10 21:26:46 +02:00
~WebViewDialog() override;
2016-08-25 00:45:32 +02:00
2020-03-08 13:50:32 +01:00
public Q_SLOTS:
void applySettings(const Data::SyncthingConnectionSettings &connectionSettings, bool aboutToShow);
const Data::SyncthingConnectionSettings &connectionSettings() const;
#if defined(SYNCTHINGWIDGETS_USE_WEBKIT)
2016-11-16 20:40:54 +01:00
bool isModalVisible() const;
#endif
void closeUnlessModalVisible();
2016-08-25 00:45:32 +02:00
protected:
2018-10-10 21:26:46 +02:00
void closeEvent(QCloseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
#if defined(SYNCTHINGWIDGETS_USE_WEBENGINE)
2018-10-10 21:26:46 +02:00
bool eventFilter(QObject *watched, QEvent *event) override;
#endif
2016-08-25 00:45:32 +02:00
private:
SYNCTHINGWIDGETS_WEB_VIEW *m_view;
Data::SyncthingConnectionSettings m_connectionSettings;
#if defined(SYNCTHINGWIDGETS_USE_WEBENGINE)
QWebEngineProfile *m_profile;
#endif
2016-08-25 00:45:32 +02:00
};
inline const Data::SyncthingConnectionSettings &WebViewDialog::connectionSettings() const
2016-09-03 20:14:52 +02:00
{
return m_connectionSettings;
2016-09-03 20:14:52 +02:00
}
} // namespace QtGui
2016-08-25 00:45:32 +02:00
#endif // SYNCTHINGWIDGETS_NO_WEBVIEW
2016-08-25 00:45:32 +02:00
#endif // WEBVIEW_DIALOG_H