aboutsummaryrefslogtreecommitdiffstats
path: root/tools/materialeditor/resourceclient.h
blob: b38888ba885a1104bf2bac4e2d847b7cc6ad8f85 (plain)
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
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef RESOURCECLIENT_H
#define RESOURCECLIENT_H

#include "message.h"
#include <QtNetwork/qlocalsocket.h>

QT_BEGIN_NAMESPACE

class ResourceClient : public QObject
{
    Q_OBJECT
public:
    ResourceClient(const QString &serverName);

    void init();

Q_SIGNALS:
    void messageReceived(Message::MessagePtr message);
    void connected();

public Q_SLOTS:
    void sendMessage(const Message::MessagePtr &message);

private:
    QString m_serverName;
    QLocalSocket m_socket;
};

QT_END_NAMESPACE

#endif // RESOURCECLIENT_H