| 1 | #ifndef COMMCLIENT_H |
| 2 | #define COMMCLIENT_H |
| 3 | |
| 4 | #include "OpenMSXConnection.h" |
| 5 | #include <QObject> |
| 6 | #include <memory> |
| 7 | |
| 8 | class CommandBase; |
| 9 | class QString; |
| 10 | |
| 11 | class CommClient : public QObject |
| 12 | { |
| 13 | Q_OBJECT |
| 14 | public: |
| 15 | static CommClient& instance(); |
| 16 | |
| 17 | void sendCommand(CommandBase* command); |
| 18 | void connectToOpenMSX(std::unique_ptr<OpenMSXConnection> conn); |
| 19 | |
| 20 | void closeConnection(); |
| 21 | |
| 22 | signals: |
| 23 | void connectionReady(); |
| 24 | void connectionTerminated(); |
| 25 | void logParsed(const QString& level, const QString& message); |
| 26 | void updateParsed(const QString& type, const QString& name, const QString& message); |
| 27 | |
| 28 | private: |
| 29 | CommClient() = default; |
| 30 | ~CommClient() override; |
| 31 | |
| 32 | private: |
| 33 | std::unique_ptr<OpenMSXConnection> connection; |
| 34 | }; |
| 35 | |
| 36 | #endif // COMMCLIENT_H |