goldendict-ng/globalbroadcaster.h

34 lines
696 B
C
Raw Normal View History

#ifndef GLOBAL_GLOBALBROADCASTER_H
#define GLOBAL_GLOBALBROADCASTER_H
#include <QObject>
#include <vector>
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;
std::vector<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();
2022-06-07 13:22:37 +00:00
signals:
void dictionaryChanges( ActiveDictIds ad );
};
#endif // GLOBAL_GLOBALBROADCASTER_H