1 | // Copyright (C) 2021 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef RESOURCECLIENT_H |
5 | #define RESOURCECLIENT_H |
6 | |
7 | #include "message.h" |
8 | #include <QtNetwork/qlocalsocket.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | class ResourceClient : public QObject |
13 | { |
14 | Q_OBJECT |
15 | public: |
16 | ResourceClient(const QString &serverName); |
17 | |
18 | void init(); |
19 | |
20 | Q_SIGNALS: |
21 | void messageReceived(Message::MessagePtr message); |
22 | void connected(); |
23 | |
24 | public Q_SLOTS: |
25 | void sendMessage(const Message::MessagePtr &message); |
26 | |
27 | private: |
28 | QString m_serverName; |
29 | QLocalSocket m_socket; |
30 | }; |
31 | |
32 | QT_END_NAMESPACE |
33 | |
34 | #endif // RESOURCECLIENT_H |
35 |