diff --git a/libs/ui/utils/kis_document_aware_spin_box_unit_manager.h b/libs/ui/utils/kis_document_aware_spin_box_unit_manager.h index da01dadc6f..377c3bdfab 100644 --- a/libs/ui/utils/kis_document_aware_spin_box_unit_manager.h +++ b/libs/ui/utils/kis_document_aware_spin_box_unit_manager.h @@ -1,58 +1,61 @@ /* * Copyright (c) 2016 Laurent Valentin Jospin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KISDOCUMENTAWARESPINBOXUNITMANAGER_H #define KISDOCUMENTAWARESPINBOXUNITMANAGER_H #include "kis_spin_box_unit_manager.h" #include "kis_double_parse_unit_spin_box.h" #include "kritaui_export.h" class KisDocumentAwareSpinBoxUnitManagerBuilder : public KisSpinBoxUnitManagerBuilder { + +public: + KisSpinBoxUnitManager* buildUnitManager(QObject* parent); }; class KRITAUI_EXPORT KisDocumentAwareSpinBoxUnitManager : public KisSpinBoxUnitManager { Q_OBJECT public: enum PixDir { PIX_DIR_X, PIX_DIR_Y }; //in case the image has not the same x and y resolution, indicate on which direction get the resolution. //! \brief configure a KisDocumentAwareSpinBoxUnitManager for the given spinbox (make the manager a child of the spinbox and attach it to the spinbox). static void setDocumentAwarnessToExistingUnitSpinBox(KisDoubleParseUnitSpinBox* spinBox, bool setUnitFromOutsideToggle = false); //! \brief create a unitSpinBox that is already document aware. static KisDoubleParseUnitSpinBox* createUnitSpinBoxWithDocumentAwarness(QWidget* parent = 0); KisDocumentAwareSpinBoxUnitManager(QObject *parent = 0, int pPixDir = PIX_DIR_X); virtual qreal getConversionFactor(UnitDimension dim, QString symbol) const; virtual qreal getConversionConstant(UnitDimension dim, QString symbol) const; private: PixDir pixDir; }; #endif // KISDOCUMENTAWARESPINBOXUNITMANAGER_H diff --git a/libs/widgets/kis_double_parse_spin_box.h b/libs/widgets/kis_double_parse_spin_box.h index ad28214856..5c2a4fc46c 100644 --- a/libs/widgets/kis_double_parse_spin_box.h +++ b/libs/widgets/kis_double_parse_spin_box.h @@ -1,85 +1,85 @@ /* * Copyright (c) 2016 Laurent Valentin Jospin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KISDOUBLEPARSESPINBOX_H #define KISDOUBLEPARSESPINBOX_H #include #include "kritawidgets_export.h" class QLabel; /*! * \brief The KisDoubleParseSpinBox class is a cleverer doubleSpinBox, able to parse arithmetic expressions. * * Use this spinbox instead of the basic one from Qt if you want it to be able to parse arithmetic expressions. */ class KRITAWIDGETS_EXPORT KisDoubleParseSpinBox : public QDoubleSpinBox { Q_OBJECT public: KisDoubleParseSpinBox(QWidget* parent = 0); - ~KisDoubleParseSpinBox(); + virtual ~KisDoubleParseSpinBox(); //KisDoubleParseSpinBox may be used polymorphycally as a QDoubleSpinBox. virtual double valueFromText(const QString & text) const; virtual QString textFromValue(double val) const; virtual QValidator::State validate ( QString & input, int & pos ) const; virtual void stepBy(int steps); void setValue(double value); //polymorphism won't work directly, we use a signal/slot hack to do so but if signals are disabled this function will still be useful. bool isLastValid() const{ return boolLastValid; } //! \brief this virtual function is similar to cleanText(); for KisDoubleParseSpinBox. But child class may remove additionnal artifacts. virtual QString veryCleanText() const; Q_SIGNALS: //! \brief signal emmitted when the last parsed expression create an error. void errorWhileParsing(QString expr) const; //! \brief signal emmitted when the last parsed expression is valid. void noMoreParsingError() const; public Q_SLOTS: //! \brief useful to let the widget change it's stylesheet when an error occured in the last expression. void setErrorStyle(); //! \brief useful to let the widget reset it's stylesheet when there's no more error. void clearErrorStyle(); //! \brief say the widget to return to an error free state. void clearError(); protected: mutable bool boolLastValid; mutable double oldValue; mutable QString lastExprParsed; QLabel* warningIcon; QPalette oldPalette; bool isOldPaletteSaved; QMargins oldMargins; bool areOldMarginsSaved; }; #endif // KISDOUBLEPARSESPINBOX_H diff --git a/libs/widgets/kis_double_parse_unit_spin_box.h b/libs/widgets/kis_double_parse_unit_spin_box.h index 19c9006777..91b437f2f3 100644 --- a/libs/widgets/kis_double_parse_unit_spin_box.h +++ b/libs/widgets/kis_double_parse_unit_spin_box.h @@ -1,124 +1,124 @@ /* * Copyright (c) 2016 Laurent Valentin Jospin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KIS_DOUBLEPARSEUNITSPINBOX_H #define KIS_DOUBLEPARSEUNITSPINBOX_H #include #include "kis_double_parse_spin_box.h" #include "kritawidgets_export.h" class KisSpinBoxUnitManager; /*! * \brief The KisDoubleParseUnitSpinBox class is an evolution of the \see KoUnitDoubleSpinBox, but inherit from \see KisDoubleParseSpinBox to be able to parse math expressions. * * This class store the */ class KRITAWIDGETS_EXPORT KisDoubleParseUnitSpinBox : public KisDoubleParseSpinBox { Q_OBJECT public: KisDoubleParseUnitSpinBox(QWidget* parent = 0); - ~KisDoubleParseUnitSpinBox(); + virtual ~KisDoubleParseUnitSpinBox(); void setUnitManager(KisSpinBoxUnitManager* unitManager); /** * Set the new value in points which will then be converted to the current unit for display * @param newValue the new value * @see value() */ virtual void changeValue( double newValue ); /** * This spinbox shows the internal value after a conversion to the unit set here. */ virtual void setUnit(const KoUnit &unit); virtual void setUnit(const QString & symbol); /** * @brief setDimensionType set the dimension (for example length or angle) of the units the spinbox manage * @param dim the dimension id. (if not an id in KisSpinBoxUnitManager::UnitDimension, then the function does nothing). */ virtual void setDimensionType(int dim); /// @return the current value, converted in points double value( ) const; /// Set minimum value in points. void setMinimum(double min); /// Set maximum value in points. void setMaximum(double max); /// Set step size in the current unit. void setLineStep(double step); /// Set step size in points. void setLineStepPt(double step); /// Set minimum, maximum value and the step size (all in points) void setMinMaxStep( double min, double max, double step ); /// reimplemented from superclass, will forward to KoUnitDoubleValidator virtual QValidator::State validate(QString &input, int &pos) const; /** * Transform the double in a nice text, using locale symbols * @param value the number as double * @return the resulting string */ virtual QString textFromValue( double value ) const; //! \brief get the text in the spinbox without prefix or suffix, and remove unit symbol if present. virtual QString veryCleanText() const; /** * Transfrom a string into a double, while taking care of locale specific symbols. * @param str the string to transform into a number * @return the value as double */ virtual double valueFromText( const QString& str ) const; void setUnitChangeFromOutsideBehavior(bool toggle); //if set to false, setting the unit using KoUnit won't have any effect. Q_SIGNALS: /// emitted like valueChanged in the parent, but this one emits the point value void valueChangedPt( qreal ); private: class Private; Private * const d; QString detectUnit(); QString makeTextClean(QString const& txt) const; private Q_SLOTS: // exists to do emits for valueChangedPt void privateValueChanged(); void detectUnitChanges(); void disconnectExternalUnitManager(); }; #endif // KIS_DOUBLEPARSEUNITSPINBOX_H diff --git a/libs/widgetutils/kis_spin_box_unit_manager.cpp b/libs/widgetutils/kis_spin_box_unit_manager.cpp index 207f0f4ee6..679fb2d9ca 100644 --- a/libs/widgetutils/kis_spin_box_unit_manager.cpp +++ b/libs/widgetutils/kis_spin_box_unit_manager.cpp @@ -1,451 +1,458 @@ /* * Copyright (c) 2016 Laurent Valentin Jospin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kis_spin_box_unit_manager.h" #include "KoUnit.h" #include #include KisSpinBoxUnitManagerBuilder* KisSpinBoxUnitManagerFactory::builder = nullptr; KisSpinBoxUnitManager* KisSpinBoxUnitManagerFactory::buildDefaultUnitManager(QObject* parent) { if (builder == nullptr) { return new KisSpinBoxUnitManager(parent); } return builder->buildUnitManager(parent); } void KisSpinBoxUnitManagerFactory::setDefaultUnitManagerBuilder(KisSpinBoxUnitManagerBuilder* pBuilder) { if (builder != nullptr) { delete builder; //The factory took over the lifecycle of the builder, so it delete it when replaced. } builder = pBuilder; } void KisSpinBoxUnitManagerFactory::clearUnitManagerBuilder() { if (builder != nullptr) { delete builder; //The factory took over the lifecycle of the builder, so it delete it when replaced. } builder = nullptr; } const QStringList KisSpinBoxUnitManager::referenceUnitSymbols = {"pt", "°", "frame"}; const QStringList KisSpinBoxUnitManager::documentRelativeLengthUnitSymbols = {"px", "vw", "vh"}; //px are relative to the resolution, vw and vh to the width and height. const QStringList KisSpinBoxUnitManager::documentRelativeTimeUnitSymbols = {"s", "%"}; //secondes are relative to the framerate, % to the sequence length. class Q_DECL_HIDDEN KisSpinBoxUnitManager::Private { public: Private(KisSpinBoxUnitManager::UnitDimension pDim = KisSpinBoxUnitManager::LENGTH, QString pUnitSymbol = "pt", double pConv = 1.0): dim(pDim), unitSymbol(pUnitSymbol), conversionFactor(pConv), conversionFactorIsFixed(true), conversionConstant(0), conversionConstantIsFixed(true), constrains(0), unitListCached(false), hasHundredPercent(false), canAccessDocument(false) { } KisSpinBoxUnitManager::UnitDimension dim; QString unitSymbol; mutable double conversionFactor; bool conversionFactorIsFixed; //tell if it's possible to trust the conversion factor stored or if it's needed to recompute it. mutable double conversionConstant; bool conversionConstantIsFixed; //tell if it's possible to trust the conversion constant stored or if it's needed to recompute it. KisSpinBoxUnitManager::Constrains constrains; mutable QStringList unitList; mutable bool unitListCached; mutable QStringList unitListWithName; mutable bool unitListWithNameCached; //it's possible to store a reference for the % unit, for lenght. bool hasHundredPercent; qreal hundredPercent; bool canAccessDocument; }; KisSpinBoxUnitManager::KisSpinBoxUnitManager(QObject *parent) : QObject(parent) { d = new Private(); } KisSpinBoxUnitManager::~KisSpinBoxUnitManager() { delete d; } int KisSpinBoxUnitManager::getUnitDimensionType() const { return d->dim; } QString KisSpinBoxUnitManager::getReferenceUnitSymbol() const { return referenceUnitSymbols[d->dim]; } QString KisSpinBoxUnitManager::getApparentUnitSymbol() const { return d->unitSymbol; } int KisSpinBoxUnitManager::getApparentUnitId() const { QStringList list = getsUnitSymbolList(); return list.indexOf(d->unitSymbol); } QStringList KisSpinBoxUnitManager::getsUnitSymbolList(bool withName) const{ QStringList list; //TODO: cache if (withName) { if (d->unitListWithNameCached) { return d->unitListWithName; } } else { if (d->unitListCached) { return d->unitList; } } switch (d->dim) { case LENGTH: for (int i = 0; i < KoUnit::TypeCount; i++) { if (KoUnit::Type(i) == KoUnit::Pixel) { continue; //skip pixel, which is a document relative unit, in the base classe. } if (withName) { list << KoUnit::unitDescription(KoUnit::Type(i)); } else { list << KoUnit(KoUnit::Type(i)).symbol(); } } if (d->canAccessDocument) { // ad document relative units if (withName) { list << KoUnit::unitDescription(KoUnit::Pixel) << i18n("view width (vw)") << i18n("view height (vh)"); } else { list << documentRelativeLengthUnitSymbols; } } break; case ANGLE: if (withName) { list << i18n("degrees (°)") << i18n("radians (rad)") << i18n("gons (gon)") << i18n("percent of circle (%)"); } else { list << "°" << "rad" << "gon" << "%"; } break; case TIME: if (withName) { list << i18n("frames (f)"); } else { list << "f"; } if (d->canAccessDocument) { if (withName) { list << i18n("seconds (s)") << i18n("percent of animation (%)"); } else { list << documentRelativeTimeUnitSymbols; } } break; } if (withName) { d->unitListWithName = list; d->unitListWithNameCached = true; } else { d->unitList = list; d->unitListCached = true; } return list; } qreal KisSpinBoxUnitManager::getConversionConstant(UnitDimension dim, QString symbol) const { + Q_UNUSED(dim); + Q_UNUSED(symbol); + return 0; // all units managed here are transform via a linear function, so this wll alway be 0 in this class. } qreal KisSpinBoxUnitManager::getReferenceValue(double apparentValue) const { if (!d->conversionFactorIsFixed) { recomputeConversionFactor(); } if(!d->conversionConstantIsFixed) { recomputeConvesrionConstant(); } qreal v = (apparentValue - d->conversionConstant)/d->conversionFactor; if (d->constrains &= REFISINT) { v = qFloor(v); } return v; } qreal KisSpinBoxUnitManager::getApparentValue(double refValue) const { if (!d->conversionFactorIsFixed) { recomputeConversionFactor(); } if(!d->conversionConstantIsFixed) { recomputeConvesrionConstant(); } qreal v = refValue*d->conversionFactor + d->conversionConstant; if (d->constrains &= VALISINT) { v = qFloor(v); } return v; } qreal KisSpinBoxUnitManager::getConversionFactor(UnitDimension dim, QString symbol) const { qreal factor = -1; switch (dim) { case LENGTH: do { if (symbol == "px") { break; } bool ok; KoUnit unit = KoUnit::fromSymbol(symbol, &ok); if (! ok) { break; } factor = unit.toUserValue(1.0); } while (0) ; break; case ANGLE: if (symbol == "°") { factor = 1.0; break; } if (symbol == "rad") { factor = acos(-1)/90.0; break; } if (symbol == "gon") { factor = 10.0/9.0; break; } if (symbol == "%") { factor = 2.5/9.0; //(25% of circle is 90°) break; } break; case TIME: if (symbol != "f") { //we have only frames for the moment. break; } factor = 1.0; break; } return factor; } void KisSpinBoxUnitManager::setUnitDim(UnitDimension dim) { if (dim == d->dim) { return; } d->dim = dim; d->unitSymbol = referenceUnitSymbols[d->dim]; //Active dim is reference dim when just changed. d->conversionFactor = 1.0; emit unitDimensionChanged(d->dim); } void KisSpinBoxUnitManager::setApparentUnitFromSymbol(QString pSymbol) { QString symbol = pSymbol.trimmed(); if (symbol == d->unitSymbol) { return; } QString newSymb = ""; switch (d->dim) { case ANGLE: if (symbol.toLower() == "deg") { newSymb = "°"; break; } goto default_indentifier; //alway do default after handling possible special cases. default_indentifier: default: QStringList list = getsUnitSymbolList(); if (list.contains(symbol, Qt::CaseInsensitive)) { for (QString str : list) { if (str.toLower() == symbol.toLower()) { newSymb = str; //official symbol may contain capitals letters, so better take the official version. break; } } break; } } if(newSymb.isEmpty()) { return; //abort if it was impossible to locate the correct symbol. } if (d->canAccessDocument) { //manage document relative units. QStringList speUnits; switch (d->dim) { case LENGTH: speUnits = documentRelativeLengthUnitSymbols; goto default_identifier_conv_fact; case TIME: speUnits = documentRelativeTimeUnitSymbols; goto default_identifier_conv_fact; default_identifier_conv_fact: default: if (speUnits.isEmpty()) { d->conversionFactorIsFixed = true; break; } if (speUnits.contains(newSymb)) { d->conversionFactorIsFixed = false; break; } d->conversionFactorIsFixed = true; break; } if (d->dim == TIME) { if (newSymb == "%") { d->conversionConstantIsFixed = false; } } else { d->conversionConstantIsFixed = true; } } qreal conversFact = getConversionFactor(d->dim, newSymb); qreal oldConversFact = d->conversionFactor; d->conversionFactor = conversFact; emit conversionFactorChanged(d->conversionFactor, oldConversFact); d->unitSymbol = newSymb; emit unitChanged(newSymb); } void KisSpinBoxUnitManager::recomputeConversionFactor() const { if (d->conversionFactorIsFixed) { return; } qreal oldConversionFactor = d->conversionFactor; d->conversionFactor = getConversionFactor(d->dim, d->unitSymbol); if (oldConversionFactor != d->conversionFactor) { emit conversionFactorChanged(d->conversionFactor, oldConversionFactor); } } void KisSpinBoxUnitManager::recomputeConvesrionConstant() const { if (d->conversionConstantIsFixed) { return; } qreal oldConversionConstant = d->conversionConstant; d->conversionConstant = getConversionConstant(d->dim, d->unitSymbol); + + if (oldConversionConstant != d->conversionConstant) { + emit conversionConstantChanged(d->conversionConstant, oldConversionConstant); + } } void KisSpinBoxUnitManager::grantDocumentRelativeUnits() { d->canAccessDocument = true; } diff --git a/libs/widgetutils/kis_spin_box_unit_manager.h b/libs/widgetutils/kis_spin_box_unit_manager.h index 65c75d8330..ea2403daf9 100644 --- a/libs/widgetutils/kis_spin_box_unit_manager.h +++ b/libs/widgetutils/kis_spin_box_unit_manager.h @@ -1,140 +1,143 @@ /* * Copyright (c) 2016 Laurent Valentin Jospin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KISSPINBOXUNITMANAGER_H #define KISSPINBOXUNITMANAGER_H #include #include #include "kritawidgetutils_export.h" class KisSpinBoxUnitManager; class KisSpinBoxUnitManagerBuilder; class KisSpinBoxUnitManagerFactory; class KRITAWIDGETUTILS_EXPORT KisSpinBoxUnitManagerFactory { public: static KisSpinBoxUnitManager* buildDefaultUnitManager(QObject* parent); //! \brief set a builder the factory can use. The factory should take on the lifecycle of the builder, so to delete it call clearUnitManagerBuilder(); static void setDefaultUnitManagerBuilder(KisSpinBoxUnitManagerBuilder* pBuilder); static void clearUnitManagerBuilder(); private: static KisSpinBoxUnitManagerBuilder* builder; }; class KRITAWIDGETUTILS_EXPORT KisSpinBoxUnitManagerBuilder { public: + virtual ~KisSpinBoxUnitManagerBuilder() {} + virtual KisSpinBoxUnitManager* buildUnitManager(QObject* parent) = 0; //this pure virtual function is used to build a unitmanager, it will be used by the unitManagerFactory. }; /** * @brief The KisSpinBoxUnitManager class is an abstract interface for the unitspinboxes classes to manage different type of units. * * The class make a difference between unit dimension (distance, angle, time). * * The class allow to converte values between reference unit and apparent unit, but also to get other information like possible units symbols. * * This class don't allow to use relative units (units which conversion factor is dependant of the context), even if it's private data are prepared to manage it. * The reason for this is that from the library of this class it's very hard to acess easily the informations needed. So all will be managed by subclasses in other libs. * */ class KRITAWIDGETUTILS_EXPORT KisSpinBoxUnitManager : public QObject { Q_OBJECT public: enum UnitDimension{ LENGTH = 0, ANGLE = 1, TIME = 2 }; static inline bool isUnitId(int code) { return (code == LENGTH || code == ANGLE || code == TIME); } //! \brief this list hold the symbols of the referenc unit per dimension. The index is equal to the value in UnitDimension so that the dimension name can be used to index the list. static const QStringList referenceUnitSymbols; enum Constrain{ NOCONSTR = 0, REFISINT = 1, VALISINT = 2 }; Q_DECLARE_FLAGS(Constrains, Constrain) explicit KisSpinBoxUnitManager(QObject *parent = 0); - ~KisSpinBoxUnitManager(); + virtual ~KisSpinBoxUnitManager(); int getUnitDimensionType() const; QString getReferenceUnitSymbol() const; QString getApparentUnitSymbol() const; //! \brief get the position of the apparent unit in the list of units. It is usefull if we want to build a model for combo-box based unit management. int getApparentUnitId() const; virtual QStringList getsUnitSymbolList(bool withName = false) const; qreal getReferenceValue(double apparentValue) const; qreal getApparentValue(double refValue) const; //! \brief gets the conversion factor of a managed unit, or -1 in case of error. This method is the one that need to be overridden to extend the ability of the KisSpinBoxUnitManager. virtual qreal getConversionFactor(UnitDimension dim, QString symbol) const; //! \brief some units conversions are done via an affine transform, not just a linear transform. This function gives the constant of this affine transform (usually 0). virtual qreal getConversionConstant(UnitDimension dim, QString symbol) const; Q_SIGNALS: void unitDimensionChanged(int dimCode); void unitChanged(QString symbol); void conversionFactorChanged(qreal newConversionFactor, qreal oldConversionFactor) const; + void conversionConstantChanged(qreal newConversionFactor, qreal oldConversionFactor) const; void unitListChanged(); public Q_SLOTS: void setUnitDim(UnitDimension dim); void setApparentUnitFromSymbol(QString pSymbol); protected: class Private; Private * d; //unit's that may be used only if acess to the document informations exists. static const QStringList documentRelativeLengthUnitSymbols; static const QStringList documentRelativeTimeUnitSymbols; void recomputeConversionFactor() const; void recomputeConvesrionConstant() const; //! \brief calling this method give acess to document relative units. Only subclasses that manage thoses units should call it. void grantDocumentRelativeUnits(); }; #endif // KISSPINBOXUNITMANAGER_H