File indexing completed on 2024-04-21 03:51:48

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 #include <memory>
0016 
0017 namespace Baloo {
0018 
0019 /**
0020  * @class QueryRunnable queryrunnable.h <Baloo/QueryRunnable>
0021  */
0022 class BALOO_CORE_EXPORT QueryRunnable : public QObject, public QRunnable
0023 {
0024     Q_OBJECT
0025 public:
0026     QueryRunnable(const Query& query, QObject* parent = nullptr);
0027     ~QueryRunnable() override;
0028     void run() override;
0029 
0030     void stop();
0031 
0032 Q_SIGNALS:
0033     void queryResult(Baloo::QueryRunnable* queryRunnable, const QString& filePath);
0034     void finished(Baloo::QueryRunnable* queryRunnable);
0035 
0036 private:
0037     class Private;
0038     std::unique_ptr<Private> const d;
0039 };
0040 
0041 }
0042 
0043 #endif // QUERYRUNNABLE_H