mirror-chatterino2/src/singletons/NativeMessaging.hpp
nerix 1043f9f803
Remove Unnecessary Includes in Headers (#4275)
* refactor: remove unnecessary includes in headers

* fix: formatting

* chore: changelog

* fix: scrollbar

* fix: suggestions and old appbase remains

* fix: suggestion

* fix: missing Qt forward declarations

* fix: another qt include

* fix: includes for precompiled-headers=off

* Add missing `<memory>` includes

* Add missing `#pragma once`

* Fix tests

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2022-12-31 14:41:01 +00:00

44 lines
734 B
C++

#pragma once
#include "common/Atomic.hpp"
#include <boost/optional.hpp>
#include <QString>
#include <QThread>
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