syncthingtray/widgets/webview/webviewdialog.h

58 lines
1.3 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);
~WebViewDialog();
public slots:
void applySettings(const Data::SyncthingConnectionSettings &connectionSettings);
const Data::SyncthingConnectionSettings &settings() 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:
void closeEvent(QCloseEvent *event);
2016-11-01 17:16:27 +01:00
void keyPressEvent(QKeyEvent *event);
#if defined(SYNCTHINGWIDGETS_USE_WEBENGINE)
bool eventFilter(QObject *watched, QEvent *event);
#endif
2016-08-25 00:45:32 +02:00
private:
SYNCTHINGWIDGETS_WEB_VIEW *m_view;
Data::SyncthingConnectionSettings m_settings;
#if defined(SYNCTHINGWIDGETS_USE_WEBENGINE)
QWebEngineProfile *m_profile;
#endif
2016-08-25 00:45:32 +02:00
};
inline const Data::SyncthingConnectionSettings &WebViewDialog::settings() const
2016-09-03 20:14:52 +02:00
{
return m_settings;
}
} // 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