1/*
2 This file is part of the KDE Baloo Project
3 SPDX-FileCopyrightText: 2021 Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef COMMANDPIPE_H
9#define COMMANDPIPE_H
10
11#include <QDataStream>
12#include <QObject>
13
14class QIODevice;
15
16namespace Baloo {
17namespace Private {
18
19/**
20 * Bidirectional communication pipe
21 *
22 */
23class ControllerPipe : public QObject
24{
25 Q_OBJECT
26
27public:
28 ControllerPipe(QIODevice* commandPipe, QIODevice* statusPipe);
29
30 void processIds(const QVector<quint64>& ids);
31
32Q_SIGNALS:
33 void urlStarted(const QString& url);
34 void urlFinished(const QString& url);
35 void urlFailed(const QString& url);
36 void batchFinished();
37
38public Q_SLOTS:
39 void processStatusData();
40
41private:
42 QDataStream m_commandStream;
43 QDataStream m_statusStream;
44};
45
46class WorkerPipe : public QObject
47{
48 Q_OBJECT
49
50public:
51 WorkerPipe(QIODevice* commandPipe, QIODevice* statusPipe);
52
53 void urlStarted(const QString& url);
54 void urlFinished(const QString& url);
55 void urlFailed(const QString& url);
56 void batchFinished();
57
58public Q_SLOTS:
59 void processIdData();
60
61Q_SIGNALS:
62 void newDocumentIds(const QVector<quint64>& ids);
63 void inputEnd();
64
65private:
66 QDataStream m_commandStream;
67 QDataStream m_statusStream;
68};
69
70} // namespace Private
71} // namespace Baloo
72#endif
73

source code of baloo/src/file/extractor/commandpipe.h