syncthingtray/widgets/webview/webviewdialog.h
Martchus 49ff5a7b65 Move widgets from tray app to separate lib
So settings pages, web view and other widgets
can be used in other components such as the
Dolphin plugin and Plasmoid, too.
2017-04-23 18:31:18 +02:00

55 lines
1.2 KiB
C++

#ifndef WEBVIEW_DIALOG_H
#define WEBVIEW_DIALOG_H
#ifndef SYNCTHINGWIDGETS_NO_WEBVIEW
#include "./webviewdefs.h"
#include "../settings/settings.h"
#include <QMainWindow>
QT_FORWARD_DECLARE_CLASS(WEB_VIEW_PROVIDER)
namespace Settings {
struct ConnectionSettings;
}
namespace QtGui {
class SYNCTHINGWIDGETS_EXPORT WebViewDialog : public QMainWindow
{
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)
bool isModalVisible() const;
#endif
void closeUnlessModalVisible();
protected:
void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent *event);
#if defined(SYNCTHINGWIDGETS_USE_WEBENGINE)
bool eventFilter(QObject *watched, QEvent *event);
#endif
private:
SYNCTHINGWIDGETS_WEB_VIEW *m_view;
Data::SyncthingConnectionSettings m_settings;
};
inline const Data::SyncthingConnectionSettings &WebViewDialog::settings() const
{
return m_settings;
}
}
#endif // SYNCTHINGWIDGETS_NO_WEBVIEW
#endif // WEBVIEW_DIALOG_H