File indexing completed on 2024-05-05 04:21:14

0001 /* ============================================================
0002  *
0003  * Date        : 2008-04-17
0004  * Description : Sane plugin interface for KDE
0005  *
0006  * Copyright (C) 2008 by Kare Sars <kare dot sars at iki dot fi>
0007  *
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public
0010  * License as published by the Free Software Foundation; either
0011  * version 2.1 of the License, or (at your option) version 3, or any
0012  * later version accepted by the membership of KDE e.V. (or its
0013  * successor approved by the membership of KDE e.V.), which shall
0014  * act as a proxy defined in Section 6 of version 3 of the license.
0015  *
0016  * This library is distributed in the hope that it will be useful,
0017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019  * Lesser General Public License for more details.
0020  *
0021  * You should have received a copy of the GNU Lesser General Public
0022  * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
0023  *
0024  * ============================================================ */
0025 
0026 #ifndef SANEDIALOG_H
0027 #define SANEDIALOG_H
0028 
0029 #include <KSaneWidget>
0030 
0031 #include <KPageDialog>
0032 
0033 class SaneDialog : public KPageDialog
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     explicit SaneDialog(QWidget *parent = nullptr);
0039     ~SaneDialog() override;
0040 
0041     bool setup();
0042 
0043 Q_SIGNALS:
0044     /**
0045      * Informs you that an image has scanned. @p id is the same as in the
0046      * @p preview() signal, if this image had been previewed before.
0047      *
0048      * Note, that those id's may not be properly implemented in the current
0049      * libkscan.
0050      * @param img the image
0051      * @param id the image's id
0052      */
0053     void finalImage(const QImage &img, int id);
0054 
0055 protected Q_SLOTS:
0056     void imageReady(const QImage &img);
0057 
0058 private:
0059     int nextId();
0060 
0061     KSaneIface::KSaneWidget *m_ksanew;
0062     QString m_openDev;
0063 
0064     int m_currentId;
0065 };
0066 
0067 #endif // SANEDIALOG_H