Debian Codegraph @

src/encryption/SelfVerificationStatus.h

raw symbols SCIP
1 // SPDX-FileCopyrightText: Nheko Contributors
2 //
3 // SPDX-License-Identifier: GPL-3.0-or-later
4
5 #pragma once
6
7 #include <QObject>
8 #include <QQmlEngine>
9
10 class SelfVerificationStatus : public QObject
11 {
12 Q_OBJECT
13
14 QML_ELEMENT
15 QML_SINGLETON
16
17 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
18 Q_PROPERTY(bool hasSSSS READ hasSSSS NOTIFY hasSSSSChanged)
19
20 public:
21 SelfVerificationStatus(QObject *o = nullptr);
22 enum Status
23 {
24 AllVerified,
25 NoMasterKey,
26 UnverifiedMasterKey,
27 UnverifiedDevices,
28 };
29 Q_ENUM(Status)
30
31 Q_INVOKABLE void
32 setupCrosssigning(bool useSSSS, const QString &password, bool useOnlineKeyBackup);
33 Q_INVOKABLE void verifyMasterKey();
34 Q_INVOKABLE void verifyMasterKeyWithPassphrase();
35 Q_INVOKABLE void verifyUnverifiedDevices();
36
37 Status status() const { return status_; }
38 bool hasSSSS() const { return hasSSSS_; }
39
40 signals:
41 void statusChanged();
42 void hasSSSSChanged();
43 void setupCompleted();
44 void showRecoveryKey(QString key);
45 void setupFailed(QString message);
46
47 public slots:
48 void invalidate();
49
50 private:
51 Status status_ = AllVerified;
52 bool hasSSSS_ = true;
53 };