Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_node_dummies_graph.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_NODE_DUMMIES_GRAPH_H
8#define __KIS_NODE_DUMMIES_GRAPH_H
9
10#include <QList>
11#include <QMap>
12
13#include "kritaui_export.h"
14#include "kis_types.h"
15#include "kis_node.h"
16
17class KisNodeShape;
18
35class KRITAUI_EXPORT KisNodeDummy : public QObject
36{
37 Q_OBJECT
38
39public:
49 KisNodeDummy(KisNodeShape *nodeShape, KisNodeSP node);
50 ~KisNodeDummy() override;
51
52 KisNodeDummy* firstChild() const;
53 KisNodeDummy* lastChild() const;
54 KisNodeDummy* nextSibling() const;
55 KisNodeDummy* prevSibling() const;
56 KisNodeDummy* parent() const;
57
58 KisNodeDummy* at(int index) const;
59 int childCount() const;
60 int indexOf(KisNodeDummy *child) const;
61
62 KisNodeSP node() const;
63
64 bool isGUIVisible(bool showGlobalSelection) const;
65
66private:
67 friend class KisNodeShapesGraph; // for ::nodeShape() method
68 friend class KisNodeShapesGraphTest;
69 KisNodeShape* nodeShape() const;
70
71 friend class KisNodeDummiesGraph;
73
76};
77
83class KRITAUI_EXPORT KisNodeDummiesGraph
84{
85public:
87
92 KisNodeDummy* rootDummy() const;
93
94 KisNodeDummy* nodeToDummy(KisNodeSP node);
95 bool containsNode(KisNodeSP node) const;
96 int dummiesCount() const;
97
104 void addNode(KisNodeDummy *node, KisNodeDummy *parent, KisNodeDummy *aboveThis);
105
113 void moveNode(KisNodeDummy *node, KisNodeDummy *parent, KisNodeDummy *aboveThis);
114
127 void removeNode(KisNodeDummy *node);
128
129private:
130 void unmapDummyRecursively(KisNodeDummy *dummy);
131
132private:
133 typedef QMap<KisNodeSP, KisNodeDummy*> NodeMap;
134
135private:
138};
139
140#endif /* __KIS_NODE_DUMMIES_GRAPH_H */
QMap< KisNodeSP, KisNodeDummy * > NodeMap
QList< KisNodeDummy * > m_children
KisNodeShape * m_nodeShape