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 QVariantList internalValueList() const override;
41
42public Q_SLOTS:
43 bool setValue(const QVariant &value) override;
44 void storeOptions();
45 void restoreOptions();
46 void computePageSizes();
47
48private Q_SLOTS:
49 void optionTopLeftXUpdated();
50 void optionTopLeftYUpdated();
51 void optionBottomRightXUpdated();
52 void optionBottomRightYUpdated();
53
54private:
55 double ensureMilliMeter(BaseOption *option, double value);
56
57 BaseOption *m_optionTopLeftX;
58 BaseOption *m_optionTopLeftY;
59 BaseOption *m_optionBottomRightX;
60 BaseOption *m_optionBottomRightY;
61 BaseOption *m_optionResolution;
62 BaseOption *m_optionPageWidth;
63 BaseOption *m_optionPageHeight;
64 int m_currentIndex = -1;
65 Option::OptionState m_state = Option::StateDisabled;
66 QVariantList m_availableSizesListNames;
67 QList<QSizeF> m_availableSizesList;
68 double m_previousCoordinates[4];
69};
70
71} // namespace KSaneCore
72
73#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-2025 The KDE developers.
Generated on Fri Feb 28 2025 12:01:16 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.