1 files changed, 38 insertions, 0 deletions
diff --git a/src/DeviceVerificationFlow.h b/src/DeviceVerificationFlow.h
new file mode 100644
index 00000000..038f1e13
--- /dev/null
+++ b/src/DeviceVerificationFlow.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <QObject>
+
+class QTimer;
+
+class DeviceVerificationFlow : public QObject
+{
+ Q_OBJECT
+ // Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
+
+public:
+ enum Method
+ {
+ Decimal,
+ Emoji
+ };
+ Q_ENUM(Method)
+
+ DeviceVerificationFlow(QObject *parent = nullptr);
+
+public slots:
+ //! accepts a verification and starts the verification flow
+ void acceptVerificationRequest();
+ //! cancels a verification flow
+ void cancelVerification();
+ //! Completes the verification flow
+ void acceptDevice();
+
+signals:
+ void verificationRequestAccepted(Method method);
+ void deviceVerified();
+ void timedout();
+ void verificationCanceled();
+
+private:
+ QTimer *timeout = nullptr;
+};
|