digiKam
saveimgthread.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 : 2009-10-11
7  * Description : save image thread for scanned data
8  *
9  * Copyright (C) 2009-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_SAVE_IMG_THREAD_H
24 #define DIGIKAM_SAVE_IMG_THREAD_H
25 
26 #include <ksane_version.h>
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QThread>
32 #include <QString>
33 #include <QUrl>
34 #if KSANE_VERSION < QT_VERSION_CHECK(21,8,0)
35 #include <QByteArray>
36 #else
37 #include <QImage>
38 #endif
39 
41 {
42 
43 class SaveImgThread : public QThread
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit SaveImgThread(QObject* const parent);
50  ~SaveImgThread() override;
51 
52  void setTargetFile(const QUrl& url, const QString& format);
53  void setScannerModel(const QString& make, const QString& model);
54 
55 #if KSANE_VERSION < QT_VERSION_CHECK(21,8,0)
56 
57  void setImageData(const QByteArray& ksaneData, int width, int height,
58  int bytesPerLine, int ksaneFormat);
59 
60 #else
61 
62  void setImageData(const QImage& imageData);
63 
64 #endif
65 
66 Q_SIGNALS:
67 
68  void signalProgress(const QUrl&, int);
69  void signalComplete(const QUrl&, bool);
70 
71 private:
72 
73  void run() override;
74 
75 private:
76 
77  class Private;
78  Private* const d;
79 };
80 
81 } // namespace DigikamGenericDScannerPlugin
82 
83 #endif // DIGIKAM_SAVE_IMG_THREAD_H
Definition: saveimgthread.h:44
void setTargetFile(const QUrl &url, const QString &format)
Definition: saveimgthread.cpp:113
void setScannerModel(const QString &make, const QString &model)
Definition: saveimgthread.cpp:119
SaveImgThread(QObject *const parent)
Definition: saveimgthread.cpp:77
void setImageData(const QImage &imageData)
Definition: saveimgthread.cpp:106
~SaveImgThread() override
Definition: saveimgthread.cpp:83
Definition: dscannerplugin.cpp:46