Textractor/GUI/extensions.h

33 lines
728 B
C
Raw Normal View History

2018-07-26 22:42:21 -07:00
#ifndef EXTENSIONS_H
#define EXTENSIONS_H
2018-08-22 12:24:55 -04:00
#include "qtcommon.h"
#include <shared_mutex>
2018-07-26 22:42:21 -07:00
2018-07-29 14:36:45 -07:00
struct InfoForExtension
{
const char* name;
int64_t value;
InfoForExtension* next;
~InfoForExtension() { if (next) delete next; };
};
class Extension
{
public:
static bool DispatchSentence(std::wstring& sentence, std::unordered_map<std::string, int64_t> miscInfo);
static void Load(QString extenName);
static void SendToBack(QString extenName);
static void Unload(QString extenName);
static QVector<QString> GetNames();
QString name;
wchar_t* (*callback)(const wchar_t*, const InfoForExtension*);
private:
inline static std::shared_mutex extenMutex;
inline static QVector<Extension> extensions;
};
2018-07-26 22:42:21 -07:00
#endif // EXTENSIONS_H