Commit 7db9b8b7 authored by Alexander Stippich's avatar Alexander Stippich
Browse files

remove optionsList API from KSaneWidget again

parent c2928858
......@@ -11,8 +11,6 @@ target_sources(KF5Sane PRIVATE
twainiface.cpp
ktwain_widget.cpp
../src/ksanewidget.h
../src/ksaneoption.h
ksaneoption.cpp
)
generate_export_header(KF5Sane BASE_NAME KSane)
......
/* ============================================================
*
* SPDX-FileCopyrightText: 2014 Gregor Mitsch : port to KDE5 frameworks
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*
* ============================================================ */
#include "ksaneoption.h"
namespace KSaneIface
{
class KSaneOptionPrivate {
};
KSaneOption::KSaneOption(QObject *parent) : QObject(parent), d(std::unique_ptr<KSaneOptionPrivate>(new KSaneOptionPrivate()))
{
}
KSaneOption::~KSaneOption()
= default;
KSaneOption::KSaneOptionState KSaneOption::state() const
{
return StateDisabled;
}
QString KSaneOption::name() const
{
return QString();
}
QString KSaneOption::title() const
{
return QString();
}
QString KSaneOption::description() const
{
return QString();
}
KSaneOption::KSaneOptionType KSaneOption::type() const
{
return TypeDetectFail;
}
QVariant KSaneOption::minimumValue() const
{
return QVariant();
}
QVariant KSaneOption::maximumValue() const
{
return QVariant();
}
QVariant KSaneOption::stepValue() const
{
return QVariant();
}
QVariantList KSaneOption::valueList() const
{
return QVariantList();
}
QVariant KSaneOption::value() const
{
return QVariant();
}
KSaneOption::KSaneOptionUnit KSaneOption::valueUnit() const
{
return UnitNone;
}
int KSaneOption::valueSize() const
{
return 0;
}
bool KSaneOption::setValue(const QVariant &value)
{
return false;
}
bool KSaneOption::storeCurrentData()
{
return false;
}
bool KSaneOption::restoreSavedData()
{
return false;
}
} // NameSpace KSaneIface
......@@ -189,16 +189,4 @@ void KSaneWidget::setSelection(QPointF lefttop, QPointF rightbottom)
void KSaneWidget::setOptionsCollapsed(bool) {}
void KSaneWidget::setScanButtonHidden(bool) {}
void KSaneWidget::initGetDeviceList() const {}
QList<KSaneOption *> KSaneWidget::getOptionsList()
{
return QList<KSaneOption *>();
}
KSaneOption *KSaneWidget::getOption(KSaneOptionName optionEnum)
{
return nullptr;
}
KSaneOption *KSaneWidget::getOption(QString optionName)
{
return nullptr;
}
} // NameSpace KSaneIface
......@@ -517,21 +517,6 @@ void KSaneWidget::setPreviewResolution(float dpi)
d->m_previewDPI = dpi;
}
QList<KSaneOption *> KSaneWidget::getOptionsList()
{
return d->m_ksaneCoreInterface->getOptionsList();
}
KSaneOption *KSaneWidget::getOption(KSaneWidget::KSaneOptionName optionEnum)
{
return d->m_ksaneCoreInterface->getOption(static_cast<KSaneCore::KSaneOptionName>(optionEnum));
}
KSaneOption *KSaneWidget::getOption(QString optionName)
{
return d->m_ksaneCoreInterface->getOption(optionName);
}
void KSaneWidget::getOptVals(QMap <QString, QString> &opts)
{
opts.clear();
......
......@@ -58,37 +58,6 @@ public:
ErrorGeneral, /**< The error string should contain an error message. */
Information /**< There is some information to the user. */
} ScanStatus;
/** This enumeration is used to obtain a specific option with getOption(KSaneOptionName)
* or getOptionIndex(KSaneOptionName).
* Depending on the backend, not all options are available, nor this list is complete.
* For the remaining options, getOptionsList() must be used. */
enum KSaneOptionName {
SourceOption,
ScanModeOption,
BitDepthOption,
ResolutionOption,
TopLeftXOption,
TopLeftYOption,
BottomRightXOption,
BottomRightYOption,
FilmTypeOption,
NegativeOption,
InvertColorOption,
PageSizeOption,
ThresholdOption,
XResolutionOption,
YResolutionOption,
PreviewOption,
WaitForButtonOption,
BrightnessOption,
ContrastOption,
GammaRedOption,
GammaGreenOption,
GammaBlueOption,
BlackLevelOption,
WhiteLevelOption,
};
struct DeviceInfo {
QString name; /* unique device name */
......@@ -232,24 +201,6 @@ public:
* @note if the set value is not supported, the cloasest one is used
* @note setting the value 0 means that the default calculated value should be used */
void setPreviewResolution(float dpi);
/** This function returns all available options when a device is opened.
* @return list containing pointers to all KSaneOptions provided by the backend.
* Becomes invalid when closing a device.
* The pointers must not be deleted by the client. */
QList<KSaneOption *> getOptionsList();
/** This function returns a specific option.
* @param optionEnum the enum specifying the option.
* @return pointer to the KSaneOption. Returns a nullptr in case the options
* is not available for the currently opened device. */
KSaneOption *getOption(KSaneOptionName optionEnum);
/** This function returns a specific option.
* @param optionName the internal name of the option defined by SANE.
* @return pointer to the KSaneOption. Returns a nullptr in case the options
* is not available for the currently opened device. */
KSaneOption *getOption(QString optionName);
/** This method reads the available parameters and their values and
* returns them in a QMap (Name, value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment