diff options
author | Loren Burkholder <computersemiexpert@outlook.com> | 2023-06-28 17:00:34 -0400 |
---|---|---|
committer | Loren Burkholder <computersemiexpert@outlook.com> | 2023-07-06 08:35:37 -0400 |
commit | fedc178827c5648b0ccbdd2cd08dcebc920ac416 (patch) | |
tree | 7c6c59b60899d8c7a321bea8fe44c7d04f79040f /src/ReCaptcha.h | |
parent | ff4c16c34fc031b113ee366b6787c9d226e68703 (diff) |
Port the reCAPTCHA dialog to QML
Diffstat (limited to 'src/ReCaptcha.h')
-rw-r--r-- | src/ReCaptcha.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ReCaptcha.h b/src/ReCaptcha.h new file mode 100644 index 00000000..84d65478 --- /dev/null +++ b/src/ReCaptcha.h @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include <QQmlEngine> + +class ReCaptcha : public QObject +{ + Q_OBJECT + QML_ELEMENT + QML_UNCREATABLE("") + + Q_PROPERTY(QString context MEMBER m_context CONSTANT) + Q_PROPERTY(QString session MEMBER m_session CONSTANT) + +public: + ReCaptcha(const QString &session, const QString &context, QObject *parent = nullptr); + + Q_INVOKABLE void openReCaptcha(); + Q_INVOKABLE void confirm() { emit confirmation(); } + Q_INVOKABLE void cancel() { emit cancelled(); } + +signals: + void confirmation(); + void cancelled(); + +private: + QString m_session; + QString m_context; +}; |