-
Notifications
You must be signed in to change notification settings - Fork 1
/
discount.h
57 lines (39 loc) · 1.12 KB
/
discount.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
57
#ifndef DISCOUNT_H
#define DISCOUNT_H
#include <QObject>
#include <QDiscord>
#include <QFile>
#include <QCoreApplication>
#include <QDebug>
#include "discountguild.h"
class Discount : public QObject
{
Q_OBJECT
Q_PROPERTY(QString token MEMBER m_token)
Q_PROPERTY(QDiscord* qdiscord READ discordAPI())
Q_PROPERTY(QList<QObject*> guilds MEMBER m_guildList NOTIFY guildsChanged )
Q_SIGNALS:
void loginStarted();
void loginSucceeded();
void loginFailed();
void guildsChanged();
public:
explicit Discount(QObject *parent = nullptr);
QDiscord *discordAPI() {return _discord;}
Q_INVOKABLE void doLogin(QString tokenText);
//Q_INVOKABLE QVariantList getGuilds();
QList<QObject *> getGuildList() const;
Q_INVOKABLE void updateGuildList();
private:
void messageReceived(QDiscordMessage message);
void loginSuccess();
void loginFail();
QString m_sDiscordCDNUrl;
QString Discount::getUserAvatar( QDiscordUser* user );
QDiscord *_discord;
QList<QObject *> m_guildList;
QString m_token;
signals:
public slots:
};
#endif // DISCOUNT_H