karbon

vlayer.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, 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 __VLAYER_H__
21#define __VLAYER_H__
22
23#include "vgroup.h"
24#include <koffice_export.h>
25class TQDomElement;
26class DCOPObject;
27
28
35
36class KARBONBASE_EXPORT VLayer : public VGroup
37{
38public:
46
52 VLayer( const VLayer& layer );
53
54 virtual ~VLayer();
55 virtual DCOPObject* dcopObject();
56
57 virtual void draw( VPainter *painter, const KoRect* rect = 0L ) const;
58
59 virtual void save( TQDomElement& element ) const;
60 virtual void saveOasis( KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index ) const;
61 virtual void load( const TQDomElement& element );
62
63 virtual VLayer* clone() const;
64
65 virtual void accept( VVisitor& visitor );
66
74 void bringToFront( const VObject& object );
75
83 void upwards( const VObject& object );
84
92 void downwards( const VObject& object );
93
101 void sendToBack( const VObject& object );
102
109
115 bool selected() { return state() == VObject::selected; }
116};
117
118#endif
119
virtual void setState(const VState state)
Sets the state to a specified new state.
Definition vgroup.cpp:148
virtual VGroup * clone() const
Create an exact copy of this object.
Definition vgroup.cpp:120
virtual void accept(VVisitor &visitor)
Accept a VVisitor.
Definition vgroup.cpp:357
virtual void saveOasis(KoStore *store, KoXmlWriter *docWriter, KoGenStyles &mainStyles, int &index) const
Save this object's state to OpenDocument.
Definition vgroup.cpp:178
VGroup(VObject *parent, VState state=normal)
Constructs a new group object that is child of parent and has the given state.
Definition vgroup.cpp:54
virtual void draw(VPainter *painter, const KoRect *rect=0L) const
Draw the object to a painting device.
Definition vgroup.cpp:83
virtual void load(const TQDomElement &element)
Load this object's state from xml and initialize this object accordingly.
Definition vgroup.cpp:263
virtual void save(TQDomElement &element) const
Save this object's state to xml.
Definition vgroup.cpp:160
void setSelected(bool state)
Selects or unselects the layer.
Definition vlayer.h:108
VLayer(VObject *parent, VState state=normal)
Constructs a new layer object that is child of parent and has the given state.
Definition vlayer.cpp:38
void upwards(const VObject &object)
Moves the object one step up the list.
Definition vlayer.cpp:94
void downwards(const VObject &object)
Moves the object one step down the list.
Definition vlayer.cpp:110
void bringToFront(const VObject &object)
Moves the object to the top of the list.
Definition vlayer.cpp:84
void sendToBack(const VObject &object)
Moves the object to the end of the list.
Definition vlayer.cpp:124
bool selected()
Returns the selection state of the layer.
Definition vlayer.h:115
VObject(VObject *parent, VState state=edit)
Constructs a new object that is child of parent and has the given state.
Definition vobject.cpp:36
VObject * parent() const
Returns pointer to current parent object.
Definition vobject.h:147
@ selected
visible, active and can be manipulated by tools
Definition vobject.h:61
@ normal
visible, not active
Definition vobject.h:54
virtual DCOPObject * dcopObject()
Returns pointer to internal DCOP object.
Definition vobject.cpp:75
VState state() const
Get the state the object is in.
Definition vobject.h:154
The abstract visitor class.
Definition vvisitor.h:51