File indexing completed on 2024-04-28 08:31:13

0001 /*
0002     SPDX-FileCopyrightText: 2014 Vishesh Handa <me@vhanda.in>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef BALOO_FILEFETCHJOB_H
0008 #define BALOO_FILEFETCHJOB_H
0009 
0010 #include "ondemandextractor.h"
0011 #include <KJob>
0012 #include <QVariantMap>
0013 
0014 namespace Baloo
0015 {
0016 class FileFetchJob : public KJob
0017 {
0018     Q_OBJECT
0019 public:
0020     enum class UseRealtimeIndexing : char {
0021         Disabled = 0,
0022         Only,
0023         Fallback,
0024     };
0025     explicit FileFetchJob(const QStringList &urls, bool canEditAll, UseRealtimeIndexing useRealtime, QObject *parent = nullptr);
0026 
0027     QList<QVariantMap> data() const;
0028     bool canEditAll() const;
0029 
0030     void start() override;
0031 
0032 private Q_SLOTS:
0033     void doStart();
0034 
0035 private:
0036     QStringList m_urls;
0037     QList<QVariantMap> m_data;
0038     bool m_canEditAll;
0039     UseRealtimeIndexing m_useRealtime;
0040     Private::OnDemandExtractor m_extractor;
0041 };
0042 }
0043 
0044 #endif // BALOO_FILEFETCHJOB_H