File indexing completed on 2025-01-19 03:51:17
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2007-09-09 0007 * Description : scanner dialog 0008 * 0009 * SPDX-FileCopyrightText: 2007-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_SCAN_DIALOG_H 0016 #define DIGIKAM_SCAN_DIALOG_H 0017 0018 // Qt includes 0019 0020 #include <QCloseEvent> 0021 #include <QWidget> 0022 #include <QImage> 0023 0024 // KDE include 0025 0026 #include <ksanewidget.h> 0027 0028 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 0029 # include <ksane_version.h> 0030 #endif 0031 0032 // Local includes 0033 0034 #include "dplugindialog.h" 0035 0036 using namespace Digikam; 0037 using namespace KSaneIface; 0038 0039 namespace DigikamGenericDScannerPlugin 0040 { 0041 0042 class ScanDialog : public DPluginDialog 0043 { 0044 Q_OBJECT 0045 0046 public: 0047 0048 explicit ScanDialog(KSaneWidget* const saneWdg, QWidget* const parent = nullptr); 0049 ~ScanDialog() override; 0050 0051 void setTargetDir(const QString& targetDir); 0052 0053 protected: 0054 0055 void closeEvent(QCloseEvent*) override; 0056 0057 Q_SIGNALS: 0058 0059 void signalImportedImage(const QUrl&); 0060 0061 private Q_SLOTS: 0062 0063 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 0064 0065 void slotSaveImage(const QImage&); 0066 0067 #elif KSANE_VERSION < QT_VERSION_CHECK(21,8,0) 0068 0069 void slotSaveImage(QByteArray&, int, int, int, int); 0070 0071 #else 0072 0073 void slotSaveImage(const QImage&); 0074 0075 #endif 0076 0077 void slotThreadProgress(const QUrl&, int); 0078 void slotThreadDone(const QUrl&, bool); 0079 void slotDialogFinished(); 0080 0081 private: 0082 0083 class Private; 0084 Private* const d; 0085 }; 0086 0087 } // namespace DigikamGenericDScannerPlugin 0088 0089 #endif // DIGIKAM_SCAN_DIALOG_H