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        : 2013-08-14
0007  * Description : Thread actions task for thumbs generator.
0008  *
0009  * SPDX-FileCopyrightText: 2013-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_THUMBS_TASK_H
0016 #define DIGIKAM_THUMBS_TASK_H
0017 
0018 // Qt includes
0019 
0020 #include <QImage>
0021 
0022 // Local includes
0023 
0024 #include "actionthreadbase.h"
0025 
0026 namespace Digikam
0027 {
0028 
0029 class LoadingDescription;
0030 class MaintenanceData;
0031 
0032 class ThumbsTask : public ActionJob
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037 
0038     explicit ThumbsTask();
0039     ~ThumbsTask() override;
0040 
0041     void setMaintenanceData(MaintenanceData* const data = nullptr);
0042 
0043 Q_SIGNALS:
0044 
0045     void signalFinished(const QImage&);
0046 
0047 protected:
0048 
0049     void run() override;
0050 
0051 private Q_SLOTS:
0052 
0053     void slotThumbnailLoaded(const LoadingDescription& loadingDescription,
0054                              const QImage& image);
0055 
0056 private:
0057 
0058     // Disable
0059     ThumbsTask(QObject*) = delete;
0060 
0061 private:
0062 
0063     class Private;
0064     Private* const d;
0065 };
0066 
0067 } // namespace Digikam
0068 
0069 #endif // DIGIKAM_THUMBS_TASK_H