File indexing completed on 2024-04-28 11:32:53

0001 /*
0002     This file is part of the KDE Baloo Project
0003     SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef QUERYRUNNABLE_H
0009 #define QUERYRUNNABLE_H
0010 
0011 #include "query.h"
0012 #include <QRunnable>
0013 #include <QObject>
0014 
0015 namespace Baloo {
0016 
0017 /**
0018  * @class QueryRunnable queryrunnable.h <Baloo/QueryRunnable>
0019  */
0020 class BALOO_CORE_EXPORT QueryRunnable : public QObject, public QRunnable
0021 {
0022     Q_OBJECT
0023 public:
0024     QueryRunnable(const Query& query, QObject* parent = nullptr);
0025     ~QueryRunnable() override;
0026     void run() override;
0027 
0028     void stop();
0029 
0030 Q_SIGNALS:
0031     void queryResult(Baloo::QueryRunnable* queryRunnable, const QString& filePath);
0032     void finished(Baloo::QueryRunnable* queryRunnable);
0033 
0034 private:
0035     class Private;
0036     Private* d;
0037 };
0038 
0039 }
0040 
0041 #endif // QUERYRUNNABLE_H