/usr/include/kscan.h is in kdelibs5-dev 4:4.8.4-4+deb7u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | /* This file is part of the KDE libraries
Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KSCAN_H
#define KSCAN_H
#include <kio/kio_export.h>
#include <kpagedialog.h>
#include <kcomponentdata.h> // KDE5: remove include
#include <kpluginfactory.h> // KDE5: remove include
class QByteArray;
class QImage;
/**
* This is a base class for scanning dialogs. You can derive from this class
* and implement your own dialog. An implementation is available in
* kdegraphics/libkscan.
*
* Application developers that wish to add scanning support to their program
* can use the static method @p KScanDialog::getScanDialog() to get an instance
* of the user's preferred scanning dialog.
*
* Typical usage looks like this (e.g. in a slotShowScanDialog() method):
*
* \code
* if ( !m_scanDialog ) {
* m_scanDialog = KScanDialog::getScanDialog( this );
* if ( !m_scanDialog ) // no scanning support installed?
* return;
*
* connect( m_scanDialog, SIGNAL( finalImage( const QImage&, int )),
* SLOT( slotScanned( const QImage&, int ) ));
* }
*
* if ( m_scanDialog->setup() ) // only if scanner configured/available
* m_scanDialog->show();
* \endcode
*
* This will create and show a non-modal scanning dialog. Connect to more
* signals if you like.
*
* @short A baseclass and accessor for Scanning Dialogs
* @author Carsten Pfeiffer <pfeiffer@kde.org>
*/
class KIO_EXPORT KScanDialog : public KPageDialog
{
Q_OBJECT
public:
/**
* Creates the user's preferred scanning dialog and returns it,
* or 0L if no scan-support
* is available. Pass a suitable @p parent widget, if you like. If you
* don't you have to 'delete' the returned pointer yourself.
* @param parent the QWidget's parent, or 0
* @return the KScanDialog, or 0 if the function failed
*/
static KScanDialog * getScanDialog( QWidget *parent = 0 );
/**
* Destructs the scan dialog.
*/
~KScanDialog();
/**
* Reimplement this if you need to set up some things, before showing the
* dialog, e.g. to ask the user for the scanner device to use. If you
* return false (e.g. there is no device available or the user aborted
* device selection), the dialog will not be shown.
*
* @return true by default.
*/
virtual bool setup();
protected:
/**
* Constructs the scan dialog. If you implement an own dialog, you can
* customize it with the usual KPageDialog flags.
*
* @param dialogFace The KPageDialog::FaceType
* @param buttonMask An ORed mask of all buttons (see
* KDialog::ButtonCode)
* @param parent The QWidget's parent, or 0
* @see KPageDialog
*/
explicit KScanDialog( int dialogFace = Tabbed,
int buttonMask = Close|Help,
QWidget *parent = 0 );
/**
* Returns the current id for an image. You can use that in your subclass
* for the signals. The id is used in the signals to let people know
* which preview and which text-recognition belongs to which scan.
*
* @return the current id for the image
* @see nextId
* @see finalImage
* @see preview
* @see textRecognized
*/
int id() const;
/**
* Returns the id for the next image. You can use that in your subclass
* for the signals.
*
* @return the id for the next image
* @see id
* @see finalImage
* @see preview
* @see textRecognized
*
*/
int nextId();
Q_SIGNALS:
/**
* Informs you that an image has been previewed.
* @param img the image
* @param id the image's id
*/
void preview( const QImage &img, int id );
/**
* Informs you that an image has scanned. @p id is the same as in the
* @p preview() signal, if this image had been previewed before.
*
* Note, that those id's may not be properly implemented in the current
* libkscan.
* @param img the image
* @param id the image's id
*/
void finalImage( const QImage &img, int id );
/**
* Informs you that the image with the id @p id has been run through
* text-recognition. The text is in the QString parameter. In the future,
* a compound document, using rich text will be used instead.
*
* @param text the text that has been recognized
* @param id the id of the image
*/
void textRecognized( const QString &text, int id );
private:
class KScanDialogPrivate;
KScanDialogPrivate *const d;
};
/**
* Base class for OCR Dialogs.
*/
class KIO_EXPORT KOCRDialog : public KPageDialog
{
Q_OBJECT
public:
/**
* Creates the user's preferred OCR dialog and returns it,
* or 0L if no OCR-support
* is available. Pass a suitable @p parent widget, if you like. If you
* don't you have to 'delete' the returned pointer yourself.
* @param parent the QWidget's parent, or 0
* @return the KOCRDialog, or 0 if the function failed
*/
static KOCRDialog * getOCRDialog( QWidget *parent = 0 );
~KOCRDialog();
protected:
/**
* Constructs the OCR dialog. If you implement an own dialog, you can
* customize it with the usual KPageDialog flags.
*
* @param dialogFace the KPageDialog::FaceType
* @param buttonMask a ORed mask of all buttons (see
* KDialog::ButtonCode)
* @param parent the QWidget's parent, or 0
* @param modal if true the dialog is model
*/
explicit KOCRDialog( int dialogFace=Tabbed, int buttonMask = Close|Help,
QWidget *parent=0L, bool modal=false );
/**
* Returns the current id for an image. You can use that in your subclass
* for the signals. The id is used in the signals to let people know
* which text-recognition belongs to which scan.
*
* @return the current id for the image
* @see nextId
* @see textRecognized
*/
int id() const;
/**
* Returns the id for the next image. You can use that in your subclass
* for the signals.
*
* @return the id for the next image
* @see id
* @see textRecognized
*/
int nextId();
Q_SIGNALS:
/**
* Informs you that the image with the id @p id has been run through
* text-recognition. The text is in the QString parameter. In the future,
* a compound document, using rich text will be used instead.
*
* @param text the text that has been recognized
* @param id the id of the image
*/
void textRecognized( const QString &text, int id );
private:
class KOCRDialogPrivate;
KOCRDialogPrivate * const d;
};
#endif // KSCAN_H
|