8#ifndef KSANE_BASE_OPTION_H
9#define KSANE_BASE_OPTION_H
16#include <KLocalizedString>
22#include <sane/saneopts.h>
27#define SANE_TRANSLATION_DOMAIN "sane-backends"
32inline QString sane_i18n(
const char *text) {
33 return i18nd(SANE_TRANSLATION_DOMAIN, text);
37class BaseOption :
public QObject
44 BaseOption(
const SANE_Handle handle,
const int index);
45 ~BaseOption()
override;
48 bool needsPolling()
const;
49 virtual void readOption();
50 virtual void readValue();
55 virtual QString description()
const;
58 virtual QVariant minimumValue()
const;
59 virtual QVariant maximumValue()
const;
62 virtual QVariantList valueList()
const;
63 virtual QVariantList internalValueList()
const;
65 virtual int valueSize()
const;
66 virtual QString valueAsString()
const;
68 bool storeCurrentData();
69 bool restoreSavedData();
72 void optionsNeedReload();
73 void valuesNeedReload();
74 void optionReloaded();
75 void valueChanged(
const QVariant &value);
79 virtual bool setValue(
const QVariant &value);
83 static SANE_Word toSANE_Word(
unsigned char *data);
84 static void fromSANE_Word(
unsigned char *data, SANE_Word from);
85 bool writeData(
void *data);
86 void beginOptionReload();
87 void endOptionReload();
89 SANE_Handle m_handle =
nullptr;
91 const SANE_Option_Descriptor *m_optDesc =
nullptr;
92 unsigned char *m_data=
nullptr;
OptionType
This enumeration describes the type of the option.
OptionState
This enumeration describes the current statue of the value of the option, indicating if this option s...
OptionUnit
This enumeration describes the unit of the value of the option, if any.
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
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
KDE's Doxygen guidelines are available online.