~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to plugins/treeshape/TreeShape.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
 
 
3
   Copyright (c) 2010 Cyril Oblikov <munknex@gmail.com>
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
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.
 
19
*/
 
20
 
 
21
#ifndef TREESHAPE_H
 
22
#define TREESHAPE_H
 
23
 
 
24
#include "KoShapeContainer.h"
 
25
#include "KoResourceManager.h"
 
26
#include <KoConnectionShape.h>
 
27
 
 
28
#define TREESHAPEID "TreeShape"
 
29
 
 
30
class KoViewConverter;
 
31
class KoShapeSavingContext;
 
32
class KoShapeLoadingContext;
 
33
class KoShape;
 
34
class KoConnectionShape;
 
35
class Layout;
 
36
class QPainter;
 
37
 
 
38
class TreeShape : public KoShapeContainer
 
39
{
 
40
public:
 
41
 
 
42
    enum TreeType {
 
43
        OrgDown, OrgUp, OrgLeft, OrgRight,
 
44
        TreeLeft, TreeRight,
 
45
        MapClockwise, MapAntiClockwise,
 
46
        FollowParent
 
47
    };
 
48
 
 
49
    // ConnectionType is defined in KoConnectionShape
 
50
 
 
51
    enum RootType {
 
52
        Rectangle, Ellipse,
 
53
        None
 
54
    };
 
55
 
 
56
 
 
57
    TreeShape(KoResourceManager *documentResources=0);
 
58
    TreeShape(KoShape *root, KoResourceManager *documentResources=0);
 
59
    virtual ~TreeShape();
 
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);
 
65
 
 
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();
 
80
 
 
81
private:
 
82
//     virtual void shapeChanged(ChangeType type, KoShape *shape = 0);
 
83
    virtual Layout *layout() const;
 
84
 
 
85
    KoResourceManager *m_documentResources;
 
86
    KoShape *m_nextShape;
 
87
};
 
88
 
 
89
#endif // KOTREESHAPE_H