Krita Source Code Documentation
Loading...
Searching...
No Matches
GridConfig.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Grum999 <grum999@grum.fr>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_GRIDCONFIG_H
7#define LIBKIS_GRIDCONFIG_H
8
9#include <QObject>
10#include "kis_grid_config.h"
11
12#include "kritalibkis_export.h"
13#include "libkis.h"
14
19class KRITALIBKIS_EXPORT GridConfig : public QObject
20{
21 Q_OBJECT
22
23public:
24 GridConfig(KisGridConfig *guidesConfig);
25
29 explicit GridConfig(QObject *parent = 0);
30 ~GridConfig() override;
31
32 bool operator==(const GridConfig &other) const;
33 bool operator!=(const GridConfig &other) const;
34
35public Q_SLOTS:
36
41 bool visible() const;
42
47 void setVisible(bool visible);
48
53 bool snap() const;
54
59 void setSnap(bool snap);
60
65 QPoint offset() const;
66
71 void setOffset(QPoint offset);
72
78 QPoint spacing() const;
79
85 void setSpacing(QPoint spacing);
86
93 bool spacingActiveHorizontal() const;
94
101 void setSpacingActiveHorizontal(bool active);
102
109 bool spacingActiveVertical() const;
110
117 void setSpacingActiveVertical(bool active);
118
124 int subdivision() const;
125
131 void setSubdivision(int subdivision);
132
138 qreal angleLeft() const;
139
145 void setAngleLeft(qreal angleLeft);
146
152 qreal angleRight() const;
153
159 void setAngleRight(qreal angleRight);
160
167 bool angleLeftActive() const;
168
175 void setAngleLeftActive(bool active);
176
183 bool angleRightActive() const;
184
191 void setAngleRightActive(bool active);
192
198 int cellSpacing() const;
199
205 void setCellSpacing(int cellSpacing);
206
212 int cellSize() const;
213
219 void setCellSize(int cellSize);
220
228 QString type() const;
229
237 void setType(const QString &gridType);
238
244 bool offsetAspectLocked() const;
245
251 void setOffsetAspectLocked(bool offsetAspectLocked);
252
259 bool spacingAspectLocked() const;
260
267 void setSpacingAspectLocked(bool spacingAspectLocked);
268
275 bool angleAspectLocked() const;
276
283 void setAngleAspectLocked(bool angleAspectLocked);
284
293 QString lineTypeMain() const;
294
303 void setLineTypeMain(const QString &lineType);
304
315 QString lineTypeSubdivision() const;
316
327 void setLineTypeSubdivision(const QString &lineType);
328
340 QString lineTypeVertical() const;
341
353 void setLineTypeVertical(const QString &lineType);
354
359 QColor colorMain() const;
360
365 void setColorMain(QColor colorMain);
366
372 QColor colorSubdivision() const;
373
379 void setColorSubdivision(QColor colorSubdivision);
380
386 QColor colorVertical() const;
387
393 void setColorVertical(QColor colorVertical);
394
400 bool fromXml(const QString &xmlContent) const;
401
406 QString toXml() const;
407
408
409private:
410 friend class Document;
411
412 KisGridConfig gridConfig() const;
413
414private:
415 struct Private;
417
418};
419
420#endif // LIBKIS_GRIDCONFIG_H
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
bool operator!=(const KoID &v1, const KoID &v2)
Definition KoID.h:103
Private * d
Definition GridConfig.h:416