goldendict-ng/globalbroadcaster.h
Xiao YiFang e6ab87ca73 fix:add ifr local scheme
due to iframe security policy and x-frame-option .
the website online dictionary can not work in qt 5.15.2+ version.
this is a workaround to pass through the restriction.
2022-05-15 22:54:26 +08:00

32 lines
694 B
C++

#ifndef GLOBAL_GLOBALBROADCASTER_H
#define GLOBAL_GLOBALBROADCASTER_H
#include <QObject>
#include <vector>
#include "config.hh"
struct ActiveDictIds
{
QString word;
QStringList dictIds;
};
class GlobalBroadcaster : public QObject
{
Q_OBJECT
private:
Config::Preferences * preference;
std::vector<QString> whitelist;
public:
void setPreference( Config::Preferences * _pre );
Config::Preferences * getPreference();
GlobalBroadcaster( QObject * parent = nullptr );
void addWhitelist(QString host);
bool existedInWhitelist(QString host);
static GlobalBroadcaster * instance();
signals:
void dictionaryChanges( ActiveDictIds ad );
};
#endif // GLOBAL_GLOBALBROADCASTER_H