goldendict-ng/globalbroadcaster.h

39 lines
851 B
C
Raw Normal View History

#ifndef GLOBAL_GLOBALBROADCASTER_H
#define GLOBAL_GLOBALBROADCASTER_H
#include <QObject>
#include <vector>
#include <QWebEngineProfile>
2022-04-23 08:15:23 +00:00
#include "config.hh"
2022-04-23 08:15:23 +00:00
struct ActiveDictIds
{
QString word;
QStringList dictIds;
2022-04-23 08:15:23 +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
public:
2022-04-23 08:15:23 +00:00
void setPreference( Config::Preferences * _pre );
Config::Preferences * getPreference();
GlobalBroadcaster( QObject * parent = nullptr );
void addWhitelist(QString host);
bool existedInWhitelist(QString host);
2022-04-23 08:15:23 +00:00
static GlobalBroadcaster * instance();
unsigned currentGroupId;
QString translateLineText{};
QWebEngineProfile * profile;
2022-06-07 13:22:37 +00:00
signals:
void dictionaryChanges( ActiveDictIds ad );
void dictionaryClear( ActiveDictIds ad );
};
#endif // GLOBAL_GLOBALBROADCASTER_H