KSaneCore
interface.cpp
128 qCDebug(KSANECORE_LOG) << "sane_open(\"" << deviceName << "\", &handle) failed! status = " << sane_strstatus(status);
136Interface::OpenStatus Interface::openRestrictedDevice(const QString &deviceName, const QString &userName, const QString &password)
163 qCDebug(KSANECORE_LOG) << "sane_open(\"" << deviceName << "\", &handle) failed! status = " << sane_strstatus(status);
275 JsonOption[QLatin1String("Type")] = QLatin1String(QMetaEnum::fromType<KSaneCore::Option::OptionType>().valueToKey(option->type()));
276 JsonOption[QLatin1String("State")] = QLatin1String(QMetaEnum::fromType<KSaneCore::Option::OptionState>().valueToKey(option->state()));
277 JsonOption[QLatin1String("Unit")] = QLatin1String(QMetaEnum::fromType<KSaneCore::Option::OptionUnit>().valueToKey(option->valueUnit()));
284 JsonOption[QLatin1String("Internal value list")] = QJsonArray::fromVariantList(option->internalValueList());
static void authorization(SANE_String_Const resource, SANE_Char *username, SANE_Char *password)
static function called by sane_open to get authorization from user
Definition authentication.cpp:94
This class provides the core interface for accessing the scan controls and options.
Definition interface.h:34
QList< Option * > getOptionsList()
This function returns all available options when a device is opened.
Definition interface.cpp:290
int setOptionsMap(const QMap< QString, QString > &options)
This method can be used to write many parameter values at once.
Definition interface.cpp:328
void stopScan()
This method is used to cancel a scan or prevent an automatic new scan.
Definition interface.cpp:212
OptionName
This enumeration is used to obtain a specific option with getOption(KSaneOptionName).
Definition interface.h:63
OpenStatus openRestrictedDevice(const QString &deviceName, const QString &userName, const QString &password)
This method opens the specified scanner device with a specified username and password.
Definition interface.cpp:136
bool reloadDevicesList(DeviceType type=AllDevices)
Get the list of available scanning devices.
Definition interface.cpp:91
QString deviceModel() const
This method returns the model of the currently opened scanner.
Definition interface.cpp:86
Option * getOption(OptionName optionEnum)
This function returns a specific option.
Definition interface.cpp:295
QString deviceVendor() const
This method returns the vendor name of the currently opened scanner.
Definition interface.cpp:81
OpenStatus openDevice(const QString &deviceName)
This method opens the specified scanner device and adds the scan options to the options list.
Definition interface.cpp:104
void lockScanImage()
Locks the mutex protecting the QImage pointer of scanImage() from concurrent access during scanning.
Definition interface.cpp:237
void unlockScanImage()
Unlocks the mutex protecting the QImage pointer of scanImage() from concurrent access during scanning...
Definition interface.cpp:244
QMap< QString, QString > getOptionsMap()
This method reads the available parameters and their values and returns them in a QMap (Name,...
Definition interface.cpp:314
QJsonObject scannerDeviceToJson()
Returns a JSON object containing the device name, model and vendor.
Definition interface.cpp:251
void scanFinished(KSaneCore::Interface::ScanStatus status, const QString &strStatus)
This signal is emitted when the scanning has ended.
void batchModeCountDown(int remainingSeconds)
This signal is emitted for the count down when in batch mode.
QJsonObject scannerOptionsToJson()
Returns a JSON Object with all available data for all scanner options.
Definition interface.cpp:264
QImage * scanImage() const
Gives direct access to the QImage that is used to store the image data retrieved from the scanner.
Definition interface.cpp:229
QString deviceName() const
This method returns the internal device name of the currently opened scanner.
Definition interface.cpp:76
void scanProgress(int percent)
This signal is emitted for progress information during a scan.
A wrapper class providing access to the internal KSaneBaseOption to access all options provided by KS...
Definition option.h:29
bool setValue(const QVariant &value)
This slot allows to change the current value of the option.
Definition option.cpp:141
Q_SCRIPTABLE CaptureState status()
QString i18n(const char *text, const TYPE &arg...)
const char * constData() const const
QJsonArray fromVariantList(const QVariantList &list)
QJsonValue value(QLatin1StringView key) const const
QString toString() const const
bool contains(const Key &key) const const
iterator end()
iterator find(const Key &key)
size_type remove(const Key &key)
QMetaEnum fromType()
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
bool disconnect(const QMetaObject::Connection &connection)
bool isEmpty() const const
QByteArray toLatin1() const const
void finished()
void timeout()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.