2018-04-09 22:59:19 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QThread>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
2018-06-28 19:51:07 +02:00
|
|
|
class NativeMessaging
|
2018-04-09 22:59:19 +02:00
|
|
|
{
|
2018-04-28 15:20:18 +02:00
|
|
|
public:
|
2018-06-01 14:20:46 +02:00
|
|
|
// fourtf: don't add this class to the application class
|
2018-06-28 19:51:07 +02:00
|
|
|
NativeMessaging();
|
2018-04-09 22:59:19 +02:00
|
|
|
|
2018-06-28 19:51:07 +02:00
|
|
|
~NativeMessaging() = delete;
|
2018-04-09 22:59:19 +02:00
|
|
|
|
|
|
|
class ReceiverThread : public QThread
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void run() override;
|
2018-04-12 01:17:25 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void handleMessage(const QJsonObject &root);
|
2018-04-09 22:59:19 +02:00
|
|
|
};
|
|
|
|
|
2018-04-12 00:09:16 +02:00
|
|
|
void writeByteArray(QByteArray a);
|
2018-04-09 22:59:19 +02:00
|
|
|
void registerHost();
|
|
|
|
void openGuiMessageQueue();
|
|
|
|
void sendToGuiProcess(const QByteArray &array);
|
2018-06-13 13:27:10 +02:00
|
|
|
|
|
|
|
static std::string &getGuiMessageQueueName();
|
2018-04-09 22:59:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|