Krita Source Code Documentation
Loading...
Searching...
No Matches
KoDocumentResourceManager.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2006 Boudewijn Rempt (boud@valdyas.org)
3 SPDX-FileCopyrightText: 2007, 2009, 2010 Thomas Zander <zander@kde.org>
4 SPDX-FileCopyrightText: 2008 Carlos Licea <carlos.licea@kdemail.net>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8#ifndef KO_DOCUMENTRESOURCEMANAGER_H
9#define KO_DOCUMENTRESOURCEMANAGER_H
10
11#include <QObject>
12
13#include "kritaflake_export.h"
14
15class KoShape;
16class KUndo2Stack;
18class KoColor;
19class KoUnit;
20
21class QVariant;
22class QSizeF;
23
48class KRITAFLAKE_EXPORT KoDocumentResourceManager : public QObject
49{
50 Q_OBJECT
51
52public:
53
64
65 KarbonStart = 1000,
66 KexiStart = 2000,
67 FlowStart = 3000,
68 PlanStart = 4000,
69 StageStart = 5000,
70 KritaStart = 6000,
71 SheetsStart = 7000,
72 WordsStart = 8000,
73 KoPageAppStart = 9000,
74 KoTextStart = 10000
75};
76
77
82 explicit KoDocumentResourceManager(QObject *parent = 0);
84
91 void setResource(int key, const QVariant &value);
92
99 void setResource(int key, const KoColor &color);
100
107 void setResource(int key, KoShape *shape);
108
115 void setResource(int key, const KoUnit &unit);
116
123 QVariant resource(int key) const;
124
130 bool boolResource(int key) const;
131
137 int intResource(int key) const;
138
144 KoColor koColorResource(int key) const;
145
151 KoShape *koShapeResource(int key) const;
152
158 QString stringResource(int key) const;
159
165 QSizeF sizeResource(int key) const;
166
172 KoUnit unitResource(int key) const;
173
179 bool hasResource(int key) const;
180
187 void clearResource(int key);
188
189
190
196 void setGrabSensitivity(int grabSensitivity);
198 int grabSensitivity() const;
199
200 KUndo2Stack *undoStack() const;
201 void setUndoStack(KUndo2Stack *undoStack);
202
203 qreal documentResolution() const;
204 QRectF documentRectInPixels() const;
205
206Q_SIGNALS:
214 void resourceChanged(int key, const QVariant &value);
215
216private:
219
220 class Private;
221 Private *const d;
222};
223
224#endif
float value(const T *src, size_t ch)
KoShape * koShapeResource(int key) const
KoUnit unitResource(int key) const
KoDocumentResourceManager & operator=(const KoDocumentResourceManager &)
KoDocumentResourceManager(const KoDocumentResourceManager &)
void resourceChanged(int key, const QVariant &value)
@ OdfDocument
OBSOLETE The document this canvas shows.
@ UndoStack
The document-wide undo stack (KUndo2Stack)
@ DocumentRectInPixels
Bounds of the document in pixels.
@ DocumentResolution
Pixels-per-inch resolution of the document.
@ GrabSensitivity
The grab sensitivity used for grabbing handles of any kind.
@ MarkerCollection
The collection holding all markers.