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

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-01-31
0007  * Description : maintenance manager
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_MAINTENANCE_MNGR_H
0016 #define DIGIKAM_MAINTENANCE_MNGR_H
0017 
0018 // Qt includes
0019 
0020 #include <QObject>
0021 
0022 namespace Digikam
0023 {
0024 
0025 class MaintenanceSettings;
0026 class ProgressItem;
0027 
0028 class MaintenanceMngr : public QObject
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033 
0034     explicit MaintenanceMngr(QObject* const parent);
0035     ~MaintenanceMngr() override;
0036 
0037     void setSettings(const MaintenanceSettings& settings);
0038 
0039     void start();
0040     bool isRunning() const;
0041 
0042 Q_SIGNALS:
0043 
0044     void signalComplete();
0045 
0046 private Q_SLOTS:
0047 
0048     void slotToolCompleted(ProgressItem*);
0049     void slotToolCanceled(ProgressItem*);
0050 
0051 private:
0052 
0053     void stage1();  ///< Find New items
0054     void stage2();  ///< Database Cleanup
0055     void stage3();  ///< Update Thumbnails Build
0056     void stage4();  ///< Similarity Finger-prints
0057     void stage5();  ///< Find Duplicates
0058     void stage6();  ///< Faces Management
0059     void stage7();  ///< Image Quality Sorter
0060     void stage8();  ///< Autotags Assignment
0061     void stage9();  ///< Metadata Synchronizer
0062 
0063     void done();    ///< Called when all scheduled tools are done.
0064     void cancel();  ///< Called when a tool is canceled.
0065 
0066 private:
0067 
0068     class Private;
0069     Private* const d;
0070 };
0071 
0072 } // namespace Digikam
0073 
0074 #endif // DIGIKAM_MAINTENANCE_MNGR_H