KSaneCore

batchdelayoption.cpp
1/*
2 * SPDX-FileCopyrightText: 2021 Alexander Stippich <a.stippich@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6
7#include "batchdelayoption.h"
8#include <ksanecore_debug.h>
9
10namespace KSaneCore
11{
12
13BatchDelayOption::BatchDelayOption()
14{
15 m_optionType = Option::TypeInteger;
16}
17
18Option::OptionState BatchDelayOption::state() const
19{
20 return Option::StateActive;
21 ;
22}
23
24QString BatchDelayOption::name() const
25{
26 return BatchDelayOptionName;
27}
28
29QString BatchDelayOption::title() const
30{
31 return i18n("Batch mode time delay");
32}
33
34QString BatchDelayOption::description() const
35{
36 return i18n("Specify the time delay between each scan when batch mode is enabled.");
37}
38
39QVariant BatchDelayOption::minimumValue() const
40{
41 return 0;
42}
43
44QVariant BatchDelayOption::maximumValue() const
45{
46 return 300;
47}
48
49QVariant BatchDelayOption::stepValue() const
50{
51 return 1;
52}
53
54QVariant BatchDelayOption::value() const
55{
56 return m_delayValue;
57}
58
59QString BatchDelayOption::valueAsString() const
60{
61 return QString::number(m_delayValue);
62}
63
64Option::OptionUnit BatchDelayOption::valueUnit() const
65{
66 return Option::UnitSecond;
67}
68
69bool BatchDelayOption::setValue(const QVariant &val)
70{
71 bool ok;
72 int newValue = val.toInt(&ok);
73 if (ok && newValue != m_delayValue) {
74 m_delayValue = newValue;
75 Q_EMIT valueChanged(m_delayValue);
76 }
77 return ok;
78}
79
80} // NameSpace KSaneCore
81
82#include "moc_batchdelayoption.cpp"
OptionState
This enumeration describes the current statue of the value of the option, indicating if this option s...
Definition option.h:46
OptionUnit
This enumeration describes the unit of the value of the option, if any.
Definition option.h:40
QString i18n(const char *text, const TYPE &arg...)
Q_EMITQ_EMIT
QString number(double n, char format, int precision)
int toInt(bool *ok) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:57:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.