KSaneCore

pagesizeoption.h
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#ifndef KSANE_PAGESIZE_OPTION_H
8#define KSANE_PAGESIZE_OPTION_H
9
10#include <QList>
11
12#include "baseoption.h"
13
14namespace KSaneCore
15{
16
17static const QString PageSizeOptionName = QStringLiteral("KSane::PageSize");
18
19class PageSizeOption : public BaseOption
20{
22
23public:
24 PageSizeOption(BaseOption *m_optionTopLeftX,
25 BaseOption *m_optionTopLeftY,
26 BaseOption *m_optionBottomRightX,
27 BaseOption *m_optionBottomRightY,
28 BaseOption *m_optionResolution);
29
30 QVariant value() const override;
31 QString valueAsString() const override;
32
33 Option::OptionState state() const override;
34 QString name() const override;
35 QString title() const override;
36 QString description() const override;
37 QVariantList valueList() const override;
38
39public Q_SLOTS:
40 bool setValue(const QVariant &value) override;
41
42private Q_SLOTS:
43 void optionTopLeftXUpdated();
44 void optionTopLeftYUpdated();
45 void optionBottomRightXUpdated();
46 void optionBottomRightYUpdated();
47
48private:
49 double ensureMilliMeter(BaseOption *option, double value);
50
51 BaseOption *m_optionTopLeftX;
52 BaseOption *m_optionTopLeftY;
53 BaseOption *m_optionBottomRightX;
54 BaseOption *m_optionBottomRightY;
55 BaseOption *m_optionResolution;
56 int m_currentIndex = -1;
57 Option::OptionState m_state = Option::StateDisabled;
58 QVariantList m_availableSizesListNames;
59 QList<QSizeF> m_availableSizesList;
60};
61
62} // namespace KSaneCore
63
64#endif // KSANE_PAGESIZE_OPTION_H
OptionState
This enumeration describes the current statue of the value of the option, indicating if this option s...
Definition option.h:46
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:34 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.