forked from Aseman-Land/TelegramQML
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelegramnotificationhandler.h
More file actions
53 lines (41 loc) · 1.37 KB
/
telegramnotificationhandler.h
File metadata and controls
53 lines (41 loc) · 1.37 KB
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
#ifndef TELEGRAMNOTIFICATIONHANDLER_H
#define TELEGRAMNOTIFICATIONHANDLER_H
#include "tqobject.h"
#include "telegramqml_global.h"
class UpdatesType;
class Peer;
class User;
class Update;
class Chat;
class MessageFwdHeader;
class TelegramEngine;
class TelegramNotificationHandlerPrivate;
class TELEGRAMQMLSHARED_EXPORT TelegramNotificationHandler : public TqObject
{
Q_OBJECT
Q_PROPERTY(TelegramEngine* engine READ engine WRITE setEngine NOTIFY engineChanged)
Q_PROPERTY(int unreadCount READ unreadCount NOTIFY unreadCountChanged)
Q_PROPERTY(int globalUnreadCount READ globalUnreadCount NOTIFY globalUnreadCountChanged)
public:
TelegramNotificationHandler(QObject *parent = 0);
~TelegramNotificationHandler();
void setEngine(TelegramEngine *engine);
TelegramEngine *engine() const;
int unreadCount() const;
int globalUnreadCount() const;
static QStringList requiredProperties();
Q_SIGNALS:
void engineChanged();
void unreadCountChanged();
void globalUnreadCountChanged();
void newMessage(const QString &title, const QString &message, const QString &peerKey);
public Q_SLOTS:
protected:
virtual void onUpdates(const UpdatesType &update);
virtual void refreshUnreads();
void insertUpdate(const Update &update);
void refresh();
private:
TelegramNotificationHandlerPrivate *p;
};
#endif // TELEGRAMNOTIFICATIONHANDLER_H