2020-06-13 08:19:49 +00:00
|
|
|
/**
|
|
|
|
* Refresh service
|
|
|
|
*
|
|
|
|
* @author Pierre Hubert
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-06-13 12:14:01 +00:00
|
|
|
#include "notificationshelper.h"
|
2020-06-13 12:39:34 +00:00
|
|
|
#include "trayicon.h"
|
2020-06-13 09:28:08 +00:00
|
|
|
#include "wsclient.h"
|
|
|
|
|
2020-06-13 08:19:49 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class RefreshService : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
static void startService();
|
|
|
|
static void stopService();
|
|
|
|
|
2020-06-13 15:25:16 +00:00
|
|
|
static void signOutUser();
|
|
|
|
|
2020-06-13 12:14:01 +00:00
|
|
|
private slots:
|
|
|
|
void connectedToWebSocket();
|
2020-06-13 12:59:02 +00:00
|
|
|
void onNewNumberNotifications(NotificationsNumber number);
|
|
|
|
void onNewNeumberUnreadNotifs(int num);
|
|
|
|
void onNewNeumberUnreadConvs(int num);
|
2020-06-13 15:56:09 +00:00
|
|
|
void openComunic();
|
2020-06-14 13:10:06 +00:00
|
|
|
void openAboutDialog();
|
2020-06-13 15:33:43 +00:00
|
|
|
void confirmSignOut();
|
2020-06-13 12:14:01 +00:00
|
|
|
|
2020-06-13 08:19:49 +00:00
|
|
|
private:
|
|
|
|
RefreshService();
|
|
|
|
~RefreshService();
|
|
|
|
|
|
|
|
// Class members
|
|
|
|
static RefreshService *svc;
|
2020-06-13 12:14:01 +00:00
|
|
|
WsClient mWsClient;
|
|
|
|
NotificationsHelper mNotifsHelper;
|
2020-06-13 12:59:02 +00:00
|
|
|
NotificationsNumber mNumbers;
|
2020-06-13 12:39:34 +00:00
|
|
|
TrayIcon mTrayIcon;
|
2020-06-13 08:19:49 +00:00
|
|
|
};
|