-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathauthenticator.h
45 lines (36 loc) · 1.11 KB
/
authenticator.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
#ifndef IKOOSKAR_BLL_AUTHENTICATOR_H
#define IKOOSKAR_BLL_AUTHENTICATOR_H
#include "DAL/CloudAuth/cloudauth.h"
#include "DAL/LocalAuth/localauth.h"
#include "licensestatus.h"
namespace ikoOSKAR {
namespace BLL {
using namespace ikoOSKAR::DAL;
class Authenticator : public QObject {
Q_OBJECT
private:
CloudAuth cloudAuth;
LocalAuth localAuth;
public:
static Authenticator* getInstance();
void login();
void signupLicensed(QString serial);
void signupDemo();
int getDemoRemainings();
void decreaseDemoRemainingsByOne();
bool isDemo();
QString getSerial();
const LicenseStatus getLicenseStatus();
private:
inline static Authenticator* instance = nullptr;
Authenticator();
bool synchronizeLicense(const QString& serial);
bool synchronizeDemo();
signals:
void success(const QString& message = "");
void error(const QString& errorMessage = "");
void demoUpdated();
};
} // namespace BLL
} // namespace ikoOSKAR
#endif // IKOOSKAR_BLL_AUTHENTICATOR_H