KSaneCore
interface.cpp
133 qCDebug(KSANECORE_LOG) << "sane_open(\"" << deviceName << "\", &handle) failed! status = " << sane_strstatus(status);
141Interface::OpenStatus Interface::openRestrictedDevice(const QString &deviceName, const QString &userName, const QString &password)
168 qCDebug(KSANECORE_LOG) << "sane_open(\"" << deviceName << "\", &handle) failed! status = " << sane_strstatus(status);
363 JsonOption[QLatin1String("Type")] = QLatin1String(QMetaEnum::fromType<KSaneCore::Option::OptionType>().valueToKey(option->type()));
364 JsonOption[QLatin1String("State")] = QLatin1String(QMetaEnum::fromType<KSaneCore::Option::OptionState>().valueToKey(option->state()));
365 JsonOption[QLatin1String("Unit")] = QLatin1String(QMetaEnum::fromType<KSaneCore::Option::OptionUnit>().valueToKey(option->valueUnit()));
372 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:86
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:378
int setOptionsMap(const QMap< QString, QString > &options)
This method can be used to write many parameter values at once.
Definition interface.cpp:416
void stopScan()
This method is used to cancel a scan or prevent an automatic new scan.
Definition interface.cpp:300
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:141
bool reloadDevicesList(DeviceType type=AllDevices)
Get the list of available scanning devices.
Definition interface.cpp:96
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:383
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:109
void lockScanImage()
Locks the mutex protecting the QImage pointer of scanImage() from concurrent access during scanning.
Definition interface.cpp:325
void unlockScanImage()
Unlocks the mutex protecting the QImage pointer of scanImage() from concurrent access during scanning...
Definition interface.cpp:332
QMap< QString, QString > getOptionsMap()
This method reads the available parameters and their values and returns them in a QMap (Name,...
Definition interface.cpp:402
QJsonObject scannerDeviceToJson()
Returns a JSON object containing the device name, model and vendor.
Definition interface.cpp:339
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:352
QImage * scanImage() const
Gives direct access to the QImage that is used to store the image data retrieved from the scanner.
Definition interface.cpp:317
void setPreviewResolution(float dpi)
This function is used to set the preferred resolution for scanning the preview.
Definition interface.cpp:91
QString deviceName() const
This method returns the internal device name of the currently opened scanner.
Definition interface.cpp:76
A wrapper class providing access to the internal KSaneBaseOption to access all options provided by KS...
Definition option.h:29
OptionType type() const
This function the type of the option as determined by KSANECore.
Definition option.cpp:60
OptionUnit valueUnit() const
This function returns an enum specifying whether the values of the option have a unit,...
Definition option.cpp:123
QVariant minimumValue() const
This function returns the minimum value for the option.
Definition option.cpp:69
bool setValue(const QVariant &value)
This slot allows to change the current value of the option.
Definition option.cpp:141
bool storeCurrentData()
This function temporarily stores the current value in a member variable.
Definition option.cpp:150
QVariantList valueList() const
This function returns the list of possible values if the option is of type OptionType::TypeValueList.
Definition option.cpp:96
QVariant value() const
This function returns the currently active value for the option.
Definition option.cpp:114
QVariant maximumValue() const
This function returns the maximum value for the option.
Definition option.cpp:78
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()
float toFloat(bool *ok) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:54:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:54:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.