mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
6ae8427fc6
* added try catch in nm * changelog * asdf * gh action
44 lines
733 B
C++
44 lines
733 B
C++
#pragma once
|
|
|
|
#include <QString>
|
|
#include <QThread>
|
|
#include <boost/optional.hpp>
|
|
#include <common/Atomic.hpp>
|
|
|
|
namespace chatterino {
|
|
|
|
class Application;
|
|
class Paths;
|
|
|
|
void registerNmHost(Paths &paths);
|
|
std::string &getNmQueueName(Paths &paths);
|
|
|
|
Atomic<boost::optional<QString>> &nmIpcError();
|
|
|
|
class NativeMessagingClient final
|
|
{
|
|
public:
|
|
void sendMessage(const QByteArray &array);
|
|
void writeToCout(const QByteArray &array);
|
|
};
|
|
|
|
class NativeMessagingServer final
|
|
{
|
|
public:
|
|
void start();
|
|
|
|
private:
|
|
class ReceiverThread : public QThread
|
|
{
|
|
public:
|
|
void run() override;
|
|
|
|
private:
|
|
void handleMessage(const QJsonObject &root);
|
|
};
|
|
|
|
ReceiverThread thread;
|
|
};
|
|
|
|
} // namespace chatterino
|