Purpose

processjob.h
1/*
2 SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef PURPOSE_PROCESSJOB_H
8#define PURPOSE_PROCESSJOB_H
9
10#include "job.h"
11#include <QJsonObject>
12#include <QLocalServer>
13#include <QLocalSocket>
14#include <QPointer>
15#include <QProcess>
16
17namespace Purpose
18{
19/**
20 * @internal
21 *
22 * Purpose jobs can optionally run on an external process. This class interfaces
23 * with the external process.
24 */
25class ProcessJob : public Job
26{
28public:
29 ProcessJob(const QString &pluginPath, const QString &pluginType, const QJsonObject &data, QObject *parent);
30 ~ProcessJob() override;
31
32 void start() override;
33
34private:
35 void writeSocket();
36 void readSocket();
37 void processStateChanged(QProcess::ProcessState state);
38
39 QPointer<QProcess> m_process;
40
41 QString m_pluginPath;
42 QString m_pluginType;
43 QJsonObject m_data;
44 QLocalServer m_socket;
45 QPointer<QLocalSocket> m_localSocket;
46};
47
48}
49
50#endif
Job that will actually perform the sharing.
Definition job.h:34
QJsonObject data
Represents the data the job will have available to perform its task.
Definition job.h:39
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.