1
/* This file is part of the KDE project
3
Copyright (c) 2010 Cyril Oblikov <munknex@gmail.com>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
24
#include "KoShapeContainer.h"
25
#include "KoResourceManager.h"
26
#include <KoConnectionShape.h>
28
#define TREESHAPEID "TreeShape"
30
class KoViewConverter;
31
class KoShapeSavingContext;
32
class KoShapeLoadingContext;
34
class KoConnectionShape;
38
class TreeShape : public KoShapeContainer
43
OrgDown, OrgUp, OrgLeft, OrgRight,
45
MapClockwise, MapAntiClockwise,
49
// ConnectionType is defined in KoConnectionShape
57
TreeShape(KoResourceManager *documentResources=0);
58
TreeShape(KoShape *root, KoResourceManager *documentResources=0);
60
virtual void setZIndex(int zIndex);
61
virtual void paintComponent(QPainter &painter, const KoViewConverter &converter);
62
virtual bool hitTest(const QPointF &position) const;
63
virtual void saveOdf(KoShapeSavingContext &context) const;
64
virtual bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context);
66
virtual void addChild(KoShape *tree, KoShape *connector);
67
virtual KoShape* connector(KoShape *shape);
68
virtual void setRoot(KoShape *shape, RootType type);
69
virtual KoShape* root() const;
70
virtual RootType rootType() const;
71
virtual void setStructure(TreeShape::TreeType structure);
72
virtual TreeShape::TreeType structure() const;
73
virtual void setConnectionType(KoConnectionShape::Type type);
74
virtual KoConnectionShape::Type connectionType() const;
75
virtual QList<KoShape*> addNewChild();
76
virtual void setNextShape(KoShape *shape);
77
virtual KoShape* nextShape();
78
virtual KoShape* proposePosition(KoShape* shape);
79
virtual TreeType proposeStructure();
82
// virtual void shapeChanged(ChangeType type, KoShape *shape = 0);
83
virtual Layout *layout() const;
85
KoResourceManager *m_documentResources;
89
#endif // KOTREESHAPE_H