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 *optionTopLeftX,
25 BaseOption *optionTopLeftY,
26 BaseOption *optionBottomRightX,
27 BaseOption *optionBottomRightY,
28 BaseOption *optionResolution,
29 BaseOption *optionPageWidth,
30 BaseOption *optionPageHeight);
31
32 QVariant value() const override;
33 QString valueAsString() const override;
34
35 Option::OptionState state() const override;
36 QString name() const override;
37 QString title() const override;
38 QString description() const override;
39 QVariantList valueList() const override;
40
41public Q_SLOTS:
42 bool setValue(const QVariant &value) override;
43
44private Q_SLOTS:
45 void optionTopLeftXUpdated();
46 void optionTopLeftYUpdated();
47 void optionBottomRightXUpdated();
48 void optionBottomRightYUpdated();
49
50private:
51 double ensureMilliMeter(BaseOption *option, double value);
52
53 BaseOption *m_optionTopLeftX;
54 BaseOption *m_optionTopLeftY;
55 BaseOption *m_optionBottomRightX;
56 BaseOption *m_optionBottomRightY;
57 BaseOption *m_optionResolution;
58 BaseOption *m_optionPageWidth;
59 BaseOption *m_optionPageHeight;
60 int m_currentIndex = -1;
61 Option::OptionState m_state = Option::StateDisabled;
62 QVariantList m_availableSizesListNames;
63 QList<QSizeF> m_availableSizesList;
64};
65
66} // namespace KSaneCore
67
68#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 Fri Oct 11 2024 12:18:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.