Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_document_aware_spin_box_unit_manager.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Laurent Valentin Jospin <laurent.valentin@famillejospin.ch>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISDOCUMENTAWARESPINBOXUNITMANAGER_H
8#define KISDOCUMENTAWARESPINBOXUNITMANAGER_H
9
12
13#include "kritaui_export.h"
15{
16
17public:
18
19 KisSpinBoxUnitManager* buildUnitManager(QObject* parent) override;
20};
21
27{
28 Q_OBJECT
29
30public:
31
32 enum PixDir {
34 PIX_DIR_Y
35 }; //in case the image has not the same x and y resolution, indicate on which direction get the resolution.
36
38 static void setDocumentAwarenessToExistingUnitSpinBox(KisDoubleParseUnitSpinBox* spinBox, bool setUnitFromOutsideToggle = false);
39
41 static KisDoubleParseUnitSpinBox* createUnitSpinBoxWithDocumentAwareness(QWidget* parent = 0);
42
43 KisDocumentAwareSpinBoxUnitManager(QObject *parent = 0, int pPixDir = PIX_DIR_X);
44
46 qreal getConversionFactor(int dim, QString psymbol) const override;
48 qreal getConversionConstant(int dim, QString symbol) const override;
49
50protected:
51
53 virtual bool hasPercent(int unitDim) const override;
54
56};
57
58#endif // KISDOCUMENTAWARESPINBOXUNITMANAGER_H
KisSpinBoxUnitManager * buildUnitManager(QObject *parent) override
The KisDocumentAwareSpinBoxUnitManager class is a KisSpinBoxUnitManager that is able to connect to th...
The KisDoubleParseUnitSpinBox class is an evolution of the.
The KisSpinBoxUnitManagerBuilder class is the base class, used in the strategy pattern of KisSpinBoxU...
The KisSpinBoxUnitManager class is an abstract interface for the unitspinboxes classes to manage diff...
virtual qreal getConversionConstant(int dim, QString symbol) const
some units conversions are done via an affine transform, not just a linear transform....
virtual qreal getConversionFactor(int dim, QString symbol) const
gets the conversion factor of a managed unit, or -1 in case of error. This method is the one that nee...
virtual bool hasPercent(int unitDim) const
indicate if the unit manager has some kind of way of using a percent unit, used by the main class to ...