2022-01-08 06:51:24 +00:00
|
|
|
#ifndef GLOBAL_GLOBALBROADCASTER_H
|
|
|
|
#define GLOBAL_GLOBALBROADCASTER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2022-05-13 16:00:23 +00:00
|
|
|
#include <vector>
|
2023-03-25 12:10:28 +00:00
|
|
|
#include <QWebEngineProfile>
|
2022-04-23 08:15:23 +00:00
|
|
|
#include "config.hh"
|
2022-01-08 06:51:24 +00:00
|
|
|
|
2022-04-23 08:15:23 +00:00
|
|
|
struct ActiveDictIds
|
|
|
|
{
|
2022-01-08 06:51:24 +00:00
|
|
|
QString word;
|
|
|
|
QStringList dictIds;
|
2022-04-23 08:15:23 +00:00
|
|
|
};
|
2022-01-08 06:51:24 +00:00
|
|
|
|
|
|
|
class GlobalBroadcaster : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2022-04-23 08:15:23 +00:00
|
|
|
private:
|
|
|
|
Config::Preferences * preference;
|
2022-10-15 05:58:24 +00:00
|
|
|
QSet<QString> whitelist;
|
2022-06-07 13:22:37 +00:00
|
|
|
|
2022-01-08 06:51:24 +00:00
|
|
|
public:
|
2022-04-23 08:15:23 +00:00
|
|
|
void setPreference( Config::Preferences * _pre );
|
|
|
|
Config::Preferences * getPreference();
|
|
|
|
GlobalBroadcaster( QObject * parent = nullptr );
|
2022-05-13 16:00:23 +00:00
|
|
|
void addWhitelist(QString host);
|
|
|
|
bool existedInWhitelist(QString host);
|
2022-04-23 08:15:23 +00:00
|
|
|
static GlobalBroadcaster * instance();
|
2022-11-24 12:34:21 +00:00
|
|
|
unsigned currentGroupId;
|
2023-03-24 11:52:38 +00:00
|
|
|
QString translateLineText{};
|
2023-03-25 12:10:28 +00:00
|
|
|
QWebEngineProfile * profile;
|
2022-06-07 13:22:37 +00:00
|
|
|
|
2022-01-08 06:51:24 +00:00
|
|
|
signals:
|
2022-05-14 09:22:34 +00:00
|
|
|
void dictionaryChanges( ActiveDictIds ad );
|
2022-07-16 22:54:53 +00:00
|
|
|
void dictionaryClear( ActiveDictIds ad );
|
2022-01-08 06:51:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GLOBAL_GLOBALBROADCASTER_H
|