mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
client
now works on windows
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#ifdef INTERNAL
|
||||
#define EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
#define EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
Q_FORWARD_DECLARE_OBJC_CLASS(QWebSocket);
|
||||
Q_FORWARD_DECLARE_OBJC_CLASS(QTimer);
|
||||
using json = nlohmann::json;
|
||||
@@ -9,7 +16,7 @@ using json = nlohmann::json;
|
||||
* @brief Class wrapping a WebSocket connection
|
||||
*
|
||||
*/
|
||||
class Web_socket_wrapper : public QObject
|
||||
class EXPORT Web_socket_wrapper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -27,6 +34,18 @@ class Web_socket_wrapper : public QObject
|
||||
begin = 0
|
||||
};
|
||||
|
||||
enum class Log_level_enum : int
|
||||
{
|
||||
trace,
|
||||
debug,
|
||||
info,
|
||||
warn,
|
||||
err,
|
||||
critical,
|
||||
off,
|
||||
n_levels
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enumeration of events
|
||||
*
|
||||
@@ -121,7 +140,7 @@ class Web_socket_wrapper : public QObject
|
||||
*/
|
||||
void inhibit_events(bool inhibit);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when the WebSocket is connected
|
||||
*
|
||||
@@ -145,6 +164,8 @@ class Web_socket_wrapper : public QObject
|
||||
*/
|
||||
void on_event_cb(json &data);
|
||||
|
||||
void log_signal(const char *filename_in, int line_in, const char *funcname_in, int level, QString msg);
|
||||
|
||||
private Q_SLOTS:
|
||||
/**
|
||||
* @brief Internal slot for handling WebSocket connection established
|
||||
|
||||
Reference in New Issue
Block a user