vshadowdecorator.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 __VSHADOWDECORATOR_H__
21#define __VSHADOWDECORATOR_H__
22
23
24#include "vobject.h"
25#include <koffice_export.h>
26
29class KARBONBASE_EXPORT VShadowDecorator : public VObject
30{
31public:
32 VShadowDecorator( VObject* object, VObject* parent, int distance = 2, int angle = 0, float opacity = 1.0 );
33 VShadowDecorator( const VShadowDecorator& obj );
34
35 virtual ~VShadowDecorator();
36
37 virtual void draw( VPainter* /*painter*/, const KoRect* /*rect*/ = 0L ) const;
38
39 virtual const KoRect& boundingBox() const { return m_object->boundingBox(); }
40 VStroke* stroke() const { return m_object->stroke(); }
41 virtual void setStroke( const VStroke& stroke );
42 VFill* fill() const { return m_object->fill(); }
43 virtual void setFill( const VFill& fill );
44
45 virtual void accept( VVisitor& /*visitor*/ );
46
47 virtual void save( TQDomElement& ) const;
48 virtual void load( const TQDomElement& ) {}
49
50 virtual VObject* clone() const;
51
52 VState state() const { return m_state; }
53 virtual void setState( const VState state );
54
55 void setShadow( int distance = 2, int angle = 0, float opacity = 1.0 );
56protected:
57 VObject *m_object;
58 int m_distance;
59 int m_angle;
60 float m_opacity;
61};
62
63#endif
64
Manages the fill of shapes.
Definition vfill.h:45
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
VState m_state
the object's state
Definition vobject.h:286
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 VFill * fill() const
Gets the object's actual fill.
Definition vobject.h:177
virtual void load(const TQDomElement &element)
Load this object's state from xml and initialize this object accordingly.
Definition vobject.cpp:157
virtual VStroke * stroke() const
Gets the object's actual stroke.
Definition vobject.h:170
virtual void save(TQDomElement &element) const
Save this object's state to xml.
Definition vobject.cpp:102
virtual void setFill(const VFill &fill)
Sets the fill to a given new fill.
Definition vobject.cpp:93
virtual void draw(VPainter *painter, const KoRect *rect=0L) const
Draw the object to a painting device.
Definition vobject.h:100
VState state() const
Get the state the object is in.
Definition vobject.h:154
Manages stroke properties.
Definition vstroke.h:49
The abstract visitor class.
Definition vvisitor.h:51