diff options
Diffstat (limited to 'src/qookie-cast-client.h')
-rw-r--r-- | src/qookie-cast-client.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/qookie-cast-client.h b/src/qookie-cast-client.h new file mode 100644 index 0000000..766b48b --- /dev/null +++ b/src/qookie-cast-client.h @@ -0,0 +1,34 @@ +// -*- c++ -*- +#include <QtCore> +#include <QtNetwork> + +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +// Qt4 support +#include <QWebView> +using WebView = QWebView; +#else +#include <QTextEdit> +using WebView = QTextEdit; +#endif + +class Server + : public QObject +{ + Q_OBJECT +public: + Server(WebView& webview, QObject *parent = 0); + +signals: + void dataReceived(QByteArray); + +private slots: + void newConnection(); + void disconnected(); + void readyRead(); + +private: + QTcpServer *server; + WebView& webview; + QString html; + int size{-1}; +}; |