File indexing completed on 2024-04-21 15:12:09

0001 /************************************************************************
0002  *                                  *
0003  *  This file is part of Kooka, a scanning/OCR application using    *
0004  *  Qt <http://www.qt.io> and KDE Frameworks <http://www.kde.org>.  *
0005  *                                  *
0006  *  Copyright (C) 2008-2016 Jonathan Marten <jjm@keelhaul.me.uk>    *
0007  *                                  *
0008  *  Kooka is free software; you can redistribute it and/or modify it    *
0009  *  under the terms of the GNU Library General Public License as    *
0010  *  published by the Free Software Foundation and appearing in the  *
0011  *  file COPYING included in the packaging of this file;  either    *
0012  *  version 2 of the License, or (at your option) any later version.    *
0013  *                                  *
0014  *  As a special exception, permission is given to link this program    *
0015  *  with any version of the KADMOS OCR/ICR engine (a product of     *
0016  *  reRecognition GmbH, Kreuzlingen), and distribute the resulting  *
0017  *  executable without including the source code for KADMOS in the  *
0018  *  source distribution.                        *
0019  *                                  *
0020  *  This program is distributed in the hope that it will be useful, *
0021  *  but WITHOUT ANY WARRANTY; without even the implied warranty of  *
0022  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *
0023  *  GNU General Public License for more details.            *
0024  *                                  *
0025  *  You should have received a copy of the GNU General Public       *
0026  *  License along with this program;  see the file COPYING.  If     *
0027  *  not, see <http://www.gnu.org/licenses/>.                *
0028  *                                  *
0029  ************************************************************************/
0030 
0031 #ifndef ADDDEVICEDIALOG_H
0032 #define ADDDEVICEDIALOG_H
0033 
0034 #include "kookascan_export.h"
0035 
0036 #include "dialogbase.h"
0037 
0038 class QComboBox;
0039 class KLineEdit;
0040 class QPushButton;
0041 
0042 /**
0043  * @short A dialogue to allow the user to manually enter a scan device.
0044  *
0045  * Intended to be used in the case where the scanner device cannot be
0046  * automatically detected by SANE.
0047  *
0048  * @author Jonathan Marten
0049  */
0050 
0051 class KOOKASCAN_EXPORT AddDeviceDialog : public DialogBase
0052 {
0053     Q_OBJECT
0054 
0055 public:
0056     /**
0057      * Constructor.
0058      *
0059      * @param parent Parent widget
0060      * @param caption Caption for the dialogue
0061      **/
0062     explicit AddDeviceDialog(QWidget *parent, const QString &caption);
0063 
0064     /**
0065      * Destructor.
0066      *
0067      **/
0068     virtual ~AddDeviceDialog() {}
0069 
0070     /**
0071      * Get the entered value from the "Scanner device name" field.
0072      *
0073      * @return The SANE device name as entered by the user.
0074      **/
0075     QByteArray getDevice() const;
0076 
0077     /**
0078      * Get the entered value from the "Description" field.
0079      *
0080      * @return The device description as entered by the user.
0081      **/
0082     QString getDescription() const;
0083 
0084     /**
0085      * Get the selected value from the "Device type" combo box.
0086      *
0087      * @return The device type as selected by the user.
0088      **/
0089     QByteArray getType() const;
0090 
0091 protected slots:
0092     void slotTextChanged();
0093 
0094 private:
0095     KLineEdit *mDevEdit;
0096     KLineEdit *mDescEdit;
0097     QComboBox *mTypeCombo;
0098 };
0099 
0100 #endif                          // ADDDEVICEDIALOG_H