digiKam
imageresizejob.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2007-11-09
7  * Description : resize image job.
8  *
9  * Copyright (C) 2007-2022 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) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_IMAGE_RESIZE_JOB_H
24 #define DIGIKAM_IMAGE_RESIZE_JOB_H
25 
26 // Qt includes
27 
28 #include <QString>
29 #include <QMutex>
30 #include <QUrl>
31 
32 // Local includes
33 
34 #include "actionthreadbase.h"
35 #include "mailsettings.h"
36 
37 using namespace Digikam;
38 
40 {
41 
42 class ImageResizeJob : public ActionJob
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit ImageResizeJob(int* count = nullptr);
49  ~ImageResizeJob() override;
50 
51 public:
52 
53  QUrl m_orgUrl;
54  QString m_destName;
56  int* m_count;
57 
58 Q_SIGNALS:
59 
60  void startingResize(const QUrl& orgUrl);
61  void finishedResize(const QUrl& orgUrl, const QUrl& emailUrl, int percent);
62  void failedResize(const QUrl& orgUrl, const QString& errString, int percent);
63 
64 private:
65 
66  void run() override;
67  bool imageResize(MailSettings* const settings,
68  const QUrl& orgUrl,
69  const QString& destName,
70  QString& err);
71 
72 private:
73 
74  QMutex m_mutex;
75 
76 private:
77 
78  // Disable
79  explicit ImageResizeJob(QObject*) = delete;
80 };
81 
82 } // namespace DigikamGenericSendByMailPlugin
83 
84 #endif // DIGIKAM_IMAGE_RESIZE_JOB_H
Definition: imageresizejob.h:43
void finishedResize(const QUrl &orgUrl, const QUrl &emailUrl, int percent)
QUrl m_orgUrl
Definition: imageresizejob.h:53
int * m_count
Definition: imageresizejob.h:56
QString m_destName
Definition: imageresizejob.h:54
void failedResize(const QUrl &orgUrl, const QString &errString, int percent)
MailSettings * m_settings
Definition: imageresizejob.h:55
Definition: actionthreadbase.h:45
Definition: imageresizejob.cpp:44
Definition: datefolderview.cpp:43