File indexing completed on 2025-01-19 03:59:32

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-01-20
0007  * Description : new items finder.
0008  *
0009  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_NEW_ITEMS_FINDER_H
0016 #define DIGIKAM_NEW_ITEMS_FINDER_H
0017 
0018 // Qt includes
0019 
0020 #include <QObject>
0021 #include <QString>
0022 #include <QStringList>
0023 
0024 // Local includes
0025 
0026 #include "maintenancetool.h"
0027 #include "digikam_export.h"
0028 
0029 namespace Digikam
0030 {
0031 
0032 class DIGIKAM_GUI_EXPORT NewItemsFinder : public MaintenanceTool
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037 
0038     enum FinderMode
0039     {
0040         CompleteCollectionScan,   ///< Scan whole collection immediately.
0041         ScanDeferredFiles,        ///< Defer whole collection scan.
0042         ScheduleCollectionScan    ///< Scan immediately folders list passed in constructor.
0043     };
0044 
0045 public:
0046 
0047     explicit NewItemsFinder(const FinderMode mode = CompleteCollectionScan,
0048                             const QStringList& foldersToScan = QStringList(),
0049                             ProgressItem* const parent = nullptr);
0050     ~NewItemsFinder() override;
0051 
0052 private:
0053 
0054     void connectToScanController();
0055 
0056 private Q_SLOTS:
0057 
0058     void slotStart() override;
0059     void slotScanStarted(const QString&);
0060     void slotPartialScanDone(const QString&);
0061     void slotTotalFilesToScan(int);
0062     void slotFilesScanned(int);
0063     void slotCancel() override;
0064 
0065 private:
0066 
0067     class Private;
0068     Private* const d;
0069 };
0070 
0071 } // namespace Digikam
0072 
0073 #endif // DIGIKAM_NEW_ITEMS_FINDER_H