7#ifndef KSANE_PAGESIZE_OPTION_H
8#define KSANE_PAGESIZE_OPTION_H
13#include "baseoption.h"
18static const QString PageSizeOptionName = QStringLiteral(
"KSane::PageSize");
20class PageSizeOption :
public BaseOption
25 PageSizeOption(BaseOption *optionTopLeftX,
26 BaseOption *optionTopLeftY,
27 BaseOption *optionBottomRightX,
28 BaseOption *optionBottomRightY,
29 BaseOption *optionResolution,
30 BaseOption *optionPageWidth,
31 BaseOption *optionPageHeight);
33 QVariant value()
const override;
34 QString valueAsString()
const override;
37 QString name()
const override;
38 QString title()
const override;
39 QString description()
const override;
40 QVariantList valueList()
const override;
41 QVariantList internalValueList()
const override;
44 bool setValue(
const QVariant &value)
override;
46 void restoreOptions();
47 void computePageSizes();
50 void optionTopLeftXUpdated();
51 void optionTopLeftYUpdated();
52 void optionBottomRightXUpdated();
53 void optionBottomRightYUpdated();
56 struct PageSizeProperties {
62 double ensureMilliMeter(BaseOption *option,
double value);
64 BaseOption *m_optionTopLeftX;
65 BaseOption *m_optionTopLeftY;
66 BaseOption *m_optionBottomRightX;
67 BaseOption *m_optionBottomRightY;
68 BaseOption *m_optionResolution;
69 BaseOption *m_optionPageWidth;
70 BaseOption *m_optionPageHeight;
71 int m_currentIndex = -1;
73 QList<PageSizeProperties> m_availableSizes;
74 double m_previousCoordinates[4];
OptionState
This enumeration describes the current statue of the value of the option, indicating if this option s...