mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-31 10:00:46 +03:00
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#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:
|
|
//! sends a verification request
|
|
void sendVerificationRequest();
|
|
//! accepts a verification
|
|
void acceptVerificationRequest();
|
|
//! starts the verification flow
|
|
void startVerificationRequest();
|
|
//! cancels a verification flow
|
|
void cancelVerification();
|
|
//! Completes the verification flow
|
|
void acceptDevice();
|
|
|
|
signals:
|
|
void verificationRequestAccepted(Method method);
|
|
void deviceVerified();
|
|
void timedout();
|
|
void verificationCanceled();
|
|
|
|
private:
|
|
//! generates a unique transaction id
|
|
std::string generate_txn_id();
|
|
|
|
QTimer *timeout = nullptr;
|
|
std::string transaction_id;
|
|
};
|