1 /* ============================================================ 2 * 3 * This file is a part of digiKam project 4 * https://www.digikam.org 5 * 6 * Date : 2006-30-08 7 * Description : batch thumbnails generator 8 * 9 * Copyright (C) 2006-2021 by Gilles Caulier <caulier dot gilles at gmail dot com> 10 * 11 * This program is free software; you can redistribute it 12 * and/or modify it under the terms of the GNU General 13 * Public License as published by the Free Software Foundation; 14 * either version 2, or (at your option) 15 * any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * ============================================================ */ 23 24 #ifndef DIGIKAM_THUMBS_GENERATOR_H 25 #define DIGIKAM_THUMBS_GENERATOR_H 26 27 // Qt includes 28 29 #include <QObject> 30 #include <QImage> 31 32 // Local includes 33 34 #include "album.h" 35 #include "maintenancetool.h" 36 37 namespace Digikam 38 { 39 40 class ThumbsGenerator : public MaintenanceTool 41 { 42 Q_OBJECT 43 44 public: 45 46 /** Constructor using Album Id as argument. If Id = -1, whole Albums collection is processed. 47 */ 48 explicit ThumbsGenerator(const bool rebuildAll, int albumId, ProgressItem* const parent = nullptr); 49 50 /** Constructor using AlbumList as argument. If list is empty, whole Albums collection is processed. 51 */ 52 ThumbsGenerator(const bool rebuildAll, const AlbumList& list, ProgressItem* const parent = nullptr); 53 ~ThumbsGenerator() override; 54 55 void setUseMultiCoreCPU(bool b) override; 56 57 private: 58 59 void init(const bool rebuildAll); 60 61 private Q_SLOTS: 62 63 void slotStart() override; 64 void slotCancel() override; 65 void slotAdvance(const QImage&); 66 67 private: 68 69 class Private; 70 Private* const d; 71 }; 72 73 } // namespace Digikam 74 75 #endif // DIGIKAM_THUMBS_GENERATOR_H 76