File: connection.h

package info (click to toggle)
plasma-browser-integration 6.3.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 2,044 kB
  • sloc: cpp: 2,989; javascript: 2,444; xml: 142; python: 77; sh: 46; makefile: 16
file content (33 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (3)
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
/*
    SPDX-FileCopyrightText: 2017 Kai Uwe Broulik <kde@privat.broulik.de>
    SPDX-FileCopyrightText: 2017 David Edmundson <davidedmundson@kde.org>

    SPDX-License-Identifier: MIT
*/

#pragma once

#include <QFile>
#include <QJsonObject>
#include <QObject>

/*
 * This class is responsible for managing all stdout/stdin connections emitting JSON
 */
class Connection : public QObject
{
    Q_OBJECT
public:
    static Connection *self();
    void sendData(const QJsonObject &data);

Q_SIGNALS:
    void dataReceived(const QJsonObject &data);

private:
    Connection();
    ~Connection() override = default;
    void readData();
    QFile m_stdOut;
    QFile m_stdIn;
};