This repository was archived by the owner on Mar 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathaccountmanager_p.h
56 lines (42 loc) · 1.76 KB
/
accountmanager_p.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef QTDATASYNC_ACCOUNTMANAGER_P_H
#define QTDATASYNC_ACCOUNTMANAGER_P_H
#include <QtCore/QPointer>
#include "qtdatasync_global.h"
#include "exchangeengine_p.h"
#include "rep_accountmanager_p_source.h"
namespace QtDataSync {
//not exported, because base class is not too
class AccountManagerPrivate : public AccountManagerPrivateSource
{
Q_OBJECT
public:
explicit AccountManagerPrivate(ExchangeEngine *engineParent);
QString setupName() const override;
QString deviceName() const override;
QByteArray deviceFingerprint() const override;
QString lastError() const override;
void setDeviceName(QString deviceName) override;
void importAccountInternal(const JsonObject &importData, bool keepData);
void importAccountTrustedInternal(const JsonObject &importData, const QString &password, bool keepData);
public Q_SLOTS:
void listDevices() override;
void removeDevice(QUuid deviceId) override;
void updateExchangeKey() override;
void resetAccount(bool keepData) override;
void changeRemote(const RemoteConfig &config, bool keepData) override;
void exportAccount(QUuid id, bool includeServer) override;
void exportAccountTrusted(QUuid id, bool includeServer, const QString &password) override;
void importAccount(const JsonObject &importData, bool keepData) override;
void importAccountTrusted(const JsonObject &importData, const QString &password, bool keepData) override;
void replyToLogin(QUuid deviceId, bool accept) override;
private Q_SLOTS:
void requestLogin(const DeviceInfo &deviceInfo);
private:
QPointer<ExchangeEngine> _engine;
Logger *_logger;
QSet<QUuid> _loginRequests;
QJsonObject serializeExportData(const ExportData &data) const;
ExportData deserializeExportData(const QJsonObject &importData) const;
};
}
#endif // QTDATASYNC_ACCOUNTMANAGER_P_H