Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/canvas/KisMirrorAxisConfig.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2019 Anna Medonosova <anna.medonosova@gmail.com> | ||||
3 | * | ||||
4 | * This library is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Lesser General Public License as published by | ||||
6 | * the Free Software Foundation; version 2.1 of the License. | ||||
7 | * | ||||
8 | * This library is distributed in the hope that it will be useful, | ||||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
11 | * GNU Lesser General Public License for more details. | ||||
12 | * | ||||
13 | * You should have received a copy of the GNU Lesser General Public License | ||||
14 | * along with this program; if not, write to the Free Software | ||||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
16 | */ | ||||
17 | | ||||
18 | | ||||
19 | #ifndef KISMIRRORAXISCONFIG_H | ||||
20 | #define KISMIRRORAXISCONFIG_H | ||||
21 | | ||||
22 | #include <QScopedPointer> | ||||
23 | | ||||
24 | #include "kritaui_export.h" | ||||
25 | #include <boost/operators.hpp> | ||||
26 | | ||||
27 | class QDomElement; | ||||
28 | class QDomDocument; | ||||
29 | | ||||
30 | /** | ||||
31 | * @brief The KisMirrorAxisConfig class stores configuration for the KisMirrorAxis | ||||
32 | * canvas decoration. Contents are saved to/loaded from KRA documents. | ||||
33 | */ | ||||
34 | | ||||
35 | class KRITAUI_EXPORT KisMirrorAxisConfig : public QObject, boost::equality_comparable<KisMirrorAxisConfig> | ||||
36 | { | ||||
37 | Q_OBJECT | ||||
38 | | ||||
39 | public: | ||||
40 | KisMirrorAxisConfig(); | ||||
41 | ~KisMirrorAxisConfig(); | ||||
42 | | ||||
43 | KisMirrorAxisConfig(const KisMirrorAxisConfig &rhs); | ||||
44 | KisMirrorAxisConfig& operator=(const KisMirrorAxisConfig& rhs); | ||||
45 | bool operator==(const KisMirrorAxisConfig& rhs) const; | ||||
46 | | ||||
47 | bool mirrorHorizontal(); | ||||
48 | void setMirrorHorizontal(bool state); | ||||
49 | | ||||
50 | bool mirrorVertical(); | ||||
51 | void setMirrorVertical(bool state); | ||||
52 | | ||||
53 | bool lockHorizontal(); | ||||
54 | void setLockHorizontal(bool state); | ||||
55 | | ||||
56 | bool lockVertical(); | ||||
57 | void setLockVertical(bool state); | ||||
58 | | ||||
59 | bool hideVerticalDecoration(); | ||||
60 | void setHideVerticalDecoration(bool state); | ||||
61 | | ||||
62 | bool hideHorizontalDecoration(); | ||||
63 | void setHideHorizontalDecoration(bool state); | ||||
64 | | ||||
65 | float handleSize(); | ||||
66 | void setHandleSize(float size); | ||||
67 | | ||||
68 | float horizontalHandlePosition(); | ||||
69 | void setHorizontalHandlePosition(float position); | ||||
70 | | ||||
71 | float verticalHandlePosition(); | ||||
72 | void setVerticalHandlePosition(float position); | ||||
73 | | ||||
74 | QPointF axisPosition(); | ||||
75 | void setAxisPosition(QPointF position); | ||||
76 | | ||||
77 | /** | ||||
78 | * @brief saveToXml() function for KisKraSaver | ||||
79 | * @param doc | ||||
80 | * @param tag | ||||
81 | * @return | ||||
82 | */ | ||||
83 | QDomElement saveToXml(QDomDocument& doc, const QString &tag) const; | ||||
84 | | ||||
85 | /** | ||||
86 | * @brief loadFromXml() function for KisKraLoader | ||||
87 | * @param parent element | ||||
88 | * @return | ||||
89 | */ | ||||
90 | bool loadFromXml(const QDomElement &parent); | ||||
91 | | ||||
92 | /** | ||||
93 | * @brief Check whether the config object was changed, or is the class default. | ||||
94 | * @return true, if the object is default; false, if the config was changed | ||||
95 | */ | ||||
96 | bool isDefault() const; | ||||
97 | | ||||
98 | private: | ||||
99 | class Private; | ||||
100 | const QScopedPointer<Private> d; | ||||
101 | }; | ||||
102 | | ||||
103 | #endif // KISMIRRORAXISCONFIG_H |