File indexing completed on 2024-04-28 15:39:47
0001 // SPDX-FileCopyrightText: 2012-2022 Jesper K. Pedersen <blackie@kde.org> 0002 // 0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 0005 #ifndef BACKGROUNDJOBS_EXTRACTONETHUMBNAILJOB_H 0006 #define BACKGROUNDJOBS_EXTRACTONETHUMBNAILJOB_H 0007 0008 #include <BackgroundTaskManager/JobInterface.h> 0009 #include <kpabase/FileName.h> 0010 0011 class QImage; 0012 0013 namespace BackgroundJobs 0014 { 0015 0016 /** 0017 \brief \ref BackgroundTaskManager::JobInterface "background job" for extracting the length of a video file. 0018 \see \ref videothumbnails 0019 */ 0020 class ExtractOneThumbnailJob : public BackgroundTaskManager::JobInterface 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 ExtractOneThumbnailJob(const DB::FileName &fileName, int index, BackgroundTaskManager::Priority priority); 0026 void execute() override; 0027 QString title() const override; 0028 QString details() const override; 0029 int index() const; 0030 void cancel(); 0031 0032 private Q_SLOTS: 0033 void frameLoaded(const QImage &); 0034 0035 private: 0036 DB::FileName frameName() const; 0037 0038 DB::FileName m_fileName; 0039 int m_index; 0040 bool m_wasCanceled; 0041 }; 0042 0043 } // namespace BackgroundJobs 0044 0045 #endif // BACKGROUNDJOBS_EXTRACTONETHUMBNAILJOB_H 0046 // vi:expandtab:tabstop=4 shiftwidth=4: