-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaincontroller.h
42 lines (33 loc) · 917 Bytes
/
maincontroller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MAINCONTROLLER_H
#define MAINCONTROLLER_H
#include <QObject>
#include <QMutex>
#include "mainview.h"
#include "stringserver.h"
#include "screen.h"
class MainController : public QObject
{
Q_OBJECT
public:
explicit MainController(MainView *view, int port, bool parseJSON, QObject *parent = 0);
~MainController();
signals:
void readyToSend();
void notReadyToSend();
public slots:
Q_INVOKABLE bool sendString(QString msg);
private slots:
void onMessageAvailable(QByteArray ba);
void onClientConnected(void);
void onClientDisconnected(void);
void setJsonProperty(QString object, QString property, QString value);
void setProperty(QString object, QString property, QString value);
private:
MainView *m_view;
StringServer *m_stringServer;
Screen *m_screen;
qint32 m_clients;
QMutex m_mutex;
bool m_parseJSON;
};
#endif // MAINCONTROLLER_H