diff options
author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-08-09 12:34:48 +0000 |
---|---|---|
committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-08-09 12:34:48 +0000 |
commit | 607edbcd8689ea71ec57340204ed3d908a7cadbb (patch) | |
tree | 91961406adb5143e0c5072094d2d1a4846e6b6b0 /src/scenes/remote_control/remote_control_manager.h | |
parent | 34abe223f7648929f0c6b9132fbdc83e0353b51a (diff) | |
parent | fd5e881fdee35d21fd3e0728e5b927d04e64f459 (diff) | |
download | RWA.Support.DesktopApp-607edbcd8689ea71ec57340204ed3d908a7cadbb.tar.gz RWA.Support.DesktopApp-607edbcd8689ea71ec57340204ed3d908a7cadbb.tar.bz2 RWA.Support.DesktopApp-607edbcd8689ea71ec57340204ed3d908a7cadbb.zip |
Merge branch 'mr/feature/gitlab-ci' into 'master'
Add .gitlab-ci.yml
See merge request remotewebapp/rwa.support.desktopapp!2
Diffstat (limited to 'src/scenes/remote_control/remote_control_manager.h')
-rw-r--r-- | src/scenes/remote_control/remote_control_manager.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/scenes/remote_control/remote_control_manager.h b/src/scenes/remote_control/remote_control_manager.h new file mode 100644 index 0000000..4554724 --- /dev/null +++ b/src/scenes/remote_control/remote_control_manager.h @@ -0,0 +1,78 @@ +#ifndef REMOTE_CONTROL_MANAGER_H +#define REMOTE_CONTROL_MANAGER_H + +#include <QObject> + +#include "../../main_qmladaptor.h" +#include "../../DBusAPI.h" +#include "../../session.h" + +class RemoteControlManager : public QObject { + + Q_OBJECT + // this makes url available as a QML property + Q_PROPERTY(QString url READ getURL NOTIFY urlChanged) + // this makes pin available as a QML property + Q_PROPERTY(QString pin READ getPin NOTIFY pinChanged) + // this makes session_id available as a QML property + Q_PROPERTY(QString session_id READ getSessionID NOTIFY sessionIDChanged) + +public: + explicit RemoteControlManager(QQmlApplicationEngine *engine = nullptr, + MainQMLAdaptor *main_gui = nullptr, + DBusAPI *dbus_api = nullptr); + + bool setConnectButtonEnabled(bool enabled); + bool setConnectButtonChecked(bool checked); + bool setStatusIndicatorColor(bool active, QColor color = QColor(255,255,255)); + + QString translateStatusIndicatorText(QString status_code); + bool setStatusIndicatorText(QString status_text); + +private: + DBusAPI *_dbus_api; + MainQMLAdaptor *_main_gui; + QQmlApplicationEngine *_engine; + Session *_current_session; + QSet<Session*> *_sessions; + + void connectSession(Session *session); + void connectToDBusAPI(Session *session); + + bool refreshTimerIsRunning; + +signals: + void onConnectButtonClick(bool checked); + void pinChanged(QString pin); + void urlChanged(QString URL); + void sessionIDChanged(QString session_id); + +public slots: + void handleCopyToClipboardButtonClick(QString copy_data); + void handleConnectButtonClick(bool checked); + + void setCurrentSession(Session *session); + void addSession(Session *session); + bool removeSession(Session *session); + + void currentSessionStatusChanged(QString); + void currentSessionPinChanged(QString); + void currentSessionSessionIDChanged(QString); + void currentSessionUrlChanged(QString); + + QString getURL(); + QString getPin(); + QString getSessionID(); + Session* getCurrentSession(); + + void currentSessionStartFailed(QString error_message); + void currentSessionStopFailed(QString error_message); + void currentSessionStatusFailed(QString error_message); + void currentSessionUnexpectedStop(QString error_message); + + void currentSessionStartSucceeded(); + void currentSessionStopSucceeded(); + void currentSessionStatusSucceeded(); +}; + +#endif // REMOTECONTROLMANAGER_H |