Krita

GuidesConfig.h
1/*
2 * SPDX-FileCopyrightText: 2024 Grum999 <grum999@grum.fr>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_GUIDESCONFIG_H
7#define LIBKIS_GUIDESCONFIG_H
8
9#include <QObject>
10#include "kis_guides_config.h"
11
12#include "kritalibkis_export.h"
13#include "libkis.h"
14
15/**
16 * The GuidesConfig class encapsulates a Krita Guides configuration.
17 *
18 */
19class KRITALIBKIS_EXPORT GuidesConfig : public QObject
20{
21 Q_OBJECT
22
23public:
24 GuidesConfig(KisGuidesConfig *guidesConfig);
25
26 /**
27 * Create a new, empty GuidesConfig.
28 */
29 explicit GuidesConfig(QObject *parent = 0);
30 ~GuidesConfig() override;
31
32 bool operator==(const GuidesConfig &other) const;
33 bool operator!=(const GuidesConfig &other) const;
34
35public Q_SLOTS:
36
37 /**
38 * @brief Guides color
39 * @return color applied for all guides
40 */
41 QColor color() const;
42
43 /**
44 * @brief Define guides color
45 * @param color color to apply
46 */
47 void setColor(const QColor &color) const;
48
49 /**
50 * @brief Guides line type
51 * @return line type applied for all guides
52 * Can be:
53 * - "solid"
54 * - "dashed"
55 * - "dot"
56 */
57 QString lineType() const;
58
59 /**
60 * @brief Define guides lines type
61 * @param lineType line type to use for guides:
62 * Can be:
63 * - "solid"
64 * - "dashed"
65 * - "dot"
66 */
67 void setLineType(const QString &lineType);
68
69 /**
70 * @brief indicate if there's guides defined
71 * @return True if at least one guide is defined, otherwise False
72 */
73 bool hasGuides() const;
74
75 /**
76 * @brief indicate if position from current guides configuration match positions from another guides configuration
77 * @return True if positions are the same
78 */
79 bool hasSamePositionAs(const GuidesConfig &guideConfig) const;
80
81 /**
82 * @brief The horizontal guides.
83 * @return a list of the horizontal positions of guides.
84 */
85 QList<qreal> horizontalGuides() const;
86
87 /**
88 * @brief Set the horizontal guides.
89 * @param lines a list of the horizontal positions of guides to set
90 */
91 void setHorizontalGuides(const QList<qreal> &lines);
92
93 /**
94 * @brief The vertical guides.
95 * @return a list of vertical positions of guides.
96 */
97 QList<qreal> verticalGuides() const;
98
99 /**
100 * @brief Set the vertical guides.
101 * @param lines a list of the vertical positions of guides to set
102 */
103 void setVerticalGuides(const QList<qreal> &lines);
104
105 /**
106 * @brief Load guides definition from an XML document
107 * @param xmlContent xml content provided as a string
108 * @return True if xml content is valid and guides has been loaded, otherwise False
109 */
110 bool fromXml(const QString &xmlContent) const;
111
112 /**
113 * @brief Save guides definition as an XML document
114 * @return A string with xml content
115 */
116 QString toXml() const;
117
118 /**
119 * @brief Remove all guides
120 */
121 void removeAllGuides();
122
123 /**
124 * @brief Returns guides visibility status.
125 * @return True if guides are visibles, otherwise False
126 */
127 bool visible() const;
128
129 /**
130 * @brief Set guides visibility status
131 * @param value True to set guides visible, otherwise False
132 */
133 void setVisible(const bool value);
134
135 /**
136 * @brief Returns guide lock status
137 * @return True if guides are locked, otherwise False
138 */
139 bool locked() const;
140
141 /**
142 * @brief Set guides lock status
143 * @param value True to set guides locked, otherwise False
144 */
145 void setLocked(const bool value);
146
147 /**
148 * @brief Returns guide snap status
149 * @return True if snap to guides is active, otherwise False
150 */
151 bool snap() const;
152
153 /**
154 * @brief Set guides snap status
155 * @param value True to set snap to guides active, otherwise False
156 */
157 void setSnap(const bool value);
158
159private:
160 friend class Document;
161
162 KisGuidesConfig guidesConfig() const;
163
164private:
165 struct Private;
166 Private *d;
167
168};
169
170#endif // LIBKIS_GUIDESCONFIG_H
The Document class encapsulates a Krita Document/Image.
Definition Document.h:37
The GuidesConfig class encapsulates a Krita Guides configuration.
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.