File indexing completed on 2025-01-19 03:55:51

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2015-06-15
0007  * Description : Manager for creating and starting IO jobs threads
0008  *
0009  * SPDX-FileCopyrightText: 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
0010  * SPDX-FileCopyrightText: 2018 by Maik Qualmann <metzpinguin at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_IO_JOBS_MANAGER_H
0017 #define DIGIKAM_IO_JOBS_MANAGER_H
0018 
0019 // Qt includes
0020 
0021 #include <QObject>
0022 #include <QUrl>
0023 
0024 // Local includes
0025 
0026 #include "digikam_export.h"
0027 #include "dtrashiteminfo.h"
0028 #include "iojobsthread.h"
0029 
0030 namespace Digikam
0031 {
0032 
0033 class IOJobData;
0034 
0035 class DIGIKAM_GUI_EXPORT IOJobsManager : public QObject
0036 {
0037     Q_OBJECT
0038 
0039 public:
0040 
0041     /**
0042      * @brief instance: returns the singleton of IO Jobs Manager
0043      * @return IOJobsManager global instance
0044      */
0045     static IOJobsManager* instance();
0046 
0047     /**
0048      * @brief startIOJobs: Starts a thread to copy, move, delete or rename items
0049      * @param data: IOJobData container with source and destination url
0050      * @return IOJobsThread pointer for signal/slot connection
0051      */
0052     IOJobsThread* startIOJobs(IOJobData* const data);
0053 
0054     /**
0055      * @brief Starts a thread for listing items inside trash for specific collection
0056      * @param collectionPath: the path for collection to list items for it's trash
0057      * @return IOJobsThread pointer for signal/slot connection
0058      */
0059     IOJobsThread* startDTrashItemsListingForCollection(const QString& collectionPath);
0060 
0061     /**
0062      * @brief Starts a thread for count trash items for all collections
0063      * @return IOJobsThread pointer for signal/slot connection
0064      */
0065     IOJobsThread* buildCollectionTrashCounters();
0066 
0067 private:
0068 
0069     // Disable
0070     IOJobsManager();
0071     explicit IOJobsManager(QObject*);
0072 
0073     friend class IOJobsManagerCreator;
0074 };
0075 
0076 } // namespace Digikam
0077 
0078 #endif // DIGIKAM_IO_JOBS_MANAGER_H