File indexing completed on 2025-04-27 03:58:10

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2007-06-05
0007  * Description : Multithreaded loader for thumbnails
0008  *
0009  * SPDX-FileCopyrightText: 2006-2008 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_THUMB_NAIL_TASK_H
0017 #define DIGIKAM_THUMB_NAIL_TASK_H
0018 
0019 // Qt includes
0020 
0021 #include <QImage>
0022 
0023 // Local includes
0024 
0025 #include "loadsavetask.h"
0026 
0027 namespace Digikam
0028 {
0029 
0030 class ThumbnailCreator;
0031 
0032 class ThumbnailLoadingTask : public SharedLoadingTask
0033 {
0034 public:
0035 
0036     explicit ThumbnailLoadingTask(LoadSaveThread* const thread,
0037                                   const LoadingDescription& description);
0038 
0039     void execute()     override;
0040     void postProcess() override;
0041     void setThumbResult(const LoadingDescription& loadingDescription,
0042                         const QImage& qimage);
0043 
0044 private:
0045 
0046     void setupCreator();
0047 
0048 private:
0049 
0050     QImage            m_qimage;
0051     ThumbnailCreator* m_creator;
0052 
0053 private:
0054 
0055     // Disable
0056     ThumbnailLoadingTask(const ThumbnailLoadingTask&)            = delete;
0057     ThumbnailLoadingTask& operator=(const ThumbnailLoadingTask&) = delete;
0058 };
0059 
0060 } // namespace Digikam
0061 
0062 #endif // DIGIKAM_THUMB_NAIL_TASK_H