karbon

vgroup.h
1/* This file is part of the KDE project
2 Copyright (C) 2002, 2003 The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VGROUP_H__
21#define __VGROUP_H__
22
23#include <tqptrlist.h>
24
25#include "vobject.h"
26#include <koffice_export.h>
27typedef TQPtrList<VObject> VObjectList;
28typedef TQPtrListIterator<VObject> VObjectListIterator;
29
34class KARBONBASE_EXPORT VGroup : public VObject
35{
36public:
45 VGroup( VObject* parent, VState state = normal );
46
52 VGroup( const VGroup& group );
53
57 virtual ~VGroup();
58
59 virtual void draw( VPainter* painter, const KoRect* rect = 0L ) const;
60
61 virtual const KoRect& boundingBox() const;
62
63 virtual void setStroke( const VStroke& stroke );
64 virtual void setFill( const VFill& fill );
65
66 virtual void setState( const VState state );
67
68 virtual void save( TQDomElement& element ) const;
69 virtual void saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index ) const;
70 virtual void load( const TQDomElement& element );
71 virtual bool loadOasis( const TQDomElement &element, KoOasisLoadingContext &context );
72
73 virtual VGroup* clone() const;
74
75 virtual void accept( VVisitor& visitor );
76
82 void take( const VObject& object );
83
89 void append( VObject* object );
90
98 virtual void insertInfrontOf( VObject* newObject, VObject* oldObject );
99
103 void clear();
104
110 const VObjectList& objects() const { return m_objects; }
111
112protected:
113 VObjectList m_objects;
114};
115
116#endif
117
Manages the fill of shapes.
Definition vfill.h:45
Base class for all sort of VObject conglomerats.
Definition vgroup.h:35
const VObjectList & objects() const
Read only access to the grouped objects.
Definition vgroup.h:110
VObjectList m_objects
the list of grouped objects
Definition vgroup.h:113
The base class for all karbon objects.
Definition vobject.h:50
virtual VObject * clone() const =0
Create an exact copy of this object.
virtual void setState(const VState state)
Sets the state to a specified new state.
Definition vobject.h:163
virtual void accept(VVisitor &)
Accept a VVisitor.
Definition vobject.h:236
virtual void saveOasis(KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index) const
Save this object's state to OpenDocument.
Definition vobject.cpp:116
virtual void setStroke(const VStroke &stroke)
Sets the stroke to a given new stroke.
Definition vobject.cpp:84
virtual const KoRect & boundingBox() const
Calculates the tightest bounding box around the object.
Definition vobject.h:111
virtual void load(const TQDomElement &element)
Load this object's state from xml and initialize this object accordingly.
Definition vobject.cpp:157
virtual void save(TQDomElement &element) const
Save this object's state to xml.
Definition vobject.cpp:102
virtual void insertInfrontOf(VObject *newObject, VObject *oldObject)
This function is important for undo/redo.
Definition vobject.h:246
virtual void setFill(const VFill &fill)
Sets the fill to a given new fill.
Definition vobject.cpp:93
virtual bool loadOasis(const TQDomElement &element, KoOasisLoadingContext &context)
Load this object's state from OpenDocument and initialize this object accordingly.
Definition vobject.cpp:181
virtual void draw(VPainter *painter, const KoRect *rect=0L) const
Draw the object to a painting device.
Definition vobject.h:100
Manages stroke properties.
Definition vstroke.h:49
The abstract visitor class.
Definition vvisitor.h:51