File indexing completed on 2025-01-19 03:53:32

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2015-06-05
0007  * Description : Manager for creating and starting DB jobs threads
0008  *
0009  * SPDX-FileCopyrightText: 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_DB_JOBS_MANAGER_H
0016 #define DIGIKAM_DB_JOBS_MANAGER_H
0017 
0018 // Qt includes
0019 
0020 #include <QObject>
0021 
0022 // Local includes
0023 
0024 #include "dbjobinfo.h"
0025 #include "dbjobsthread.h"
0026 #include "digikam_export.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class DIGIKAM_DATABASE_EXPORT DBJobsManager : public QObject
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036 
0037     /**
0038      * @brief instance: returns DBJobsManager singleton
0039      * @return DBJobsManager global instance
0040      */
0041     static DBJobsManager* instance();
0042 
0043     /**
0044      * @brief startGPSJobThread: creates and starts GPS Job Thread
0045      * @param jInfo: holds job info about the DB job
0046      * @return GPSDBJobsThread instance for signal/slot connection
0047      */
0048     GPSDBJobsThread* startGPSJobThread(const GPSDBJobInfo& jInfo);
0049 
0050     /**
0051      * @brief startTagsJobThread: creates and starts Tag Job Thread
0052      * @param jInfo: holds job info about the DB job
0053      * @return TagsDBJobsThread instance for signal/slot connection
0054      */
0055     TagsDBJobsThread* startTagsJobThread(const TagsDBJobInfo& jInfo);
0056 
0057     /**
0058      * @brief startDatesJobThread: creates and starts Dates Job Thread
0059      * @param jInfo: holds job info about the DB job
0060      * @return DatesDBJobsThread instance for signal/slot connection
0061      */
0062     DatesDBJobsThread* startDatesJobThread(const DatesDBJobInfo& jInfo);
0063 
0064     /**
0065      * @brief startAlbumsJobThread: creates and starts Albums Job Thread
0066      * @param jInfo: holds job info about the DB job
0067      * @return AlbumsDBJobsThread instance for signal/slot connection
0068      */
0069     AlbumsDBJobsThread* startAlbumsJobThread(const AlbumsDBJobInfo& jInfo);
0070 
0071     /**
0072      * @brief startSearchesJobThread: creates and starts Searches Job Thread
0073      * @param jInfo: holds job info about the DB job
0074      * @return SearchesDBJobsThread instance for signal/slot connection
0075      */
0076     SearchesDBJobsThread* startSearchesJobThread(const SearchesDBJobInfo& jInfo);
0077 
0078 private:
0079 
0080     // Disable
0081     DBJobsManager();
0082     explicit DBJobsManager(QObject*) = delete;
0083 
0084     friend class DBJobsManagerCreator;
0085 };
0086 
0087 } // namespace Digikam
0088 
0089 #endif // DIGIKAM_DB_JOBS_MANAGER_H