File indexing completed on 2025-01-19 03:51:26
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2012-12-31 0007 * Description : time adjust actions using threads. 0008 * 0009 * SPDX-FileCopyrightText: 2012 by Smit Mehta <smit dot meh at gmail dot com> 0010 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * SPDX-FileCopyrightText: 2018-2021 by Maik Qualmann <metzpinguin at gmail dot com> 0012 * 0013 * SPDX-License-Identifier: GPL-2.0-or-later 0014 * 0015 * ============================================================ */ 0016 0017 #ifndef DIGIKAM_TIME_ADJUST_TASK_H 0018 #define DIGIKAM_TIME_ADJUST_TASK_H 0019 0020 // Qt includes 0021 0022 #include <QUrl> 0023 0024 // Local includes 0025 0026 #include "timeadjustthread.h" 0027 #include "actionthreadbase.h" 0028 #include "timeadjustcontainer.h" 0029 0030 using namespace Digikam; 0031 0032 namespace DigikamGenericTimeAdjustPlugin 0033 { 0034 0035 class TimeAdjustTask : public ActionJob 0036 { 0037 Q_OBJECT 0038 0039 public: 0040 0041 explicit TimeAdjustTask(const QUrl& url, TimeAdjustThread* const thread); 0042 ~TimeAdjustTask() override; 0043 0044 void setSettings(const TimeAdjustContainer& settings); 0045 0046 Q_SIGNALS: 0047 0048 void signalProcessStarted(const QUrl&); 0049 void signalDateTimeForUrl(const QUrl&, const QDateTime&, bool); 0050 void signalProcessEnded(const QUrl&, const QDateTime&, const QDateTime&, int); 0051 0052 protected: 0053 0054 void run() override; 0055 0056 private: 0057 0058 // Disable 0059 TimeAdjustTask(QObject*) = delete; 0060 0061 private: 0062 0063 class Private; 0064 Private* const d; 0065 }; 0066 0067 // ------------------------------------------------------------------ 0068 0069 class TimePreviewTask : public ActionJob 0070 { 0071 Q_OBJECT 0072 0073 public: 0074 0075 explicit TimePreviewTask(const QUrl& url, TimeAdjustThread* const thread); 0076 ~TimePreviewTask() override; 0077 0078 void setSettings(const TimeAdjustContainer& settings); 0079 0080 Q_SIGNALS: 0081 0082 void signalPreviewReady(const QUrl&, const QDateTime&, const QDateTime&); 0083 0084 protected: 0085 0086 void run() override; 0087 0088 private: 0089 0090 // Disable 0091 TimePreviewTask(QObject*) = delete; 0092 0093 private: 0094 0095 class Private; 0096 Private* const d; 0097 }; 0098 0099 } // namespace DigikamGenericTimeAdjustPlugin 0100 0101 #endif // DIGIKAM_TIME_ADJUST_TASK