kpresenter

KPrRectObject.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
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 kprectobject_h
22#define kprectobject_h
23
24#include <KoBrush.h>
25
26#include "KPrObject.h"
27
28class KPrGradient;
29class DCOPObject;
30
31class KPrRectObject : public KPr2DObject
32{
33public:
34 KPrRectObject();
35 KPrRectObject( const KoPen &_pen, const TQBrush &_brush, FillType _fillType,
36 const TQColor &_gColor1, const TQColor &_gColor2,
37 BCType _gType, int _xRnd, int _yRnd,
38 bool _unbalanced, int _xfactor, int _yfactor );
39 virtual ~KPrRectObject() {}
40 virtual DCOPObject* dcopObject();
41
42 KPrRectObject &operator=( const KPrRectObject & );
43
44 virtual void setRnds( int _xRnd, int _yRnd )
45 { xRnd = _xRnd; yRnd = _yRnd; m_redrawGradientPix = true; }
46
47 virtual ObjType getType() const
48 { return OT_RECT; }
49 virtual TQString getTypeString() const
50 { return i18n("Rectangle"); }
51 virtual void getRnds( int &_xRnd, int &_yRnd ) const
52 { _xRnd = xRnd; _yRnd = yRnd; }
53
54 virtual TQDomDocumentFragment save( TQDomDocument& doc, double offset );
55 virtual double load(const TQDomElement &element);
56 virtual void loadOasis(const TQDomElement &element, KoOasisContext &context, KPrLoadingInfo *info);
57
58protected:
59 virtual const char * getOasisElementName() const;
60 virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
61
62 virtual void paint( TQPainter *_painter,KoTextZoomHandler*_zoomHandler,
63 int /* pageNum */, bool drawingShadow, bool drawContour );
64
65 int xRnd, yRnd;
66private:
71 TQPointArray boundingRegion( int x, int y, int w, int h, int _xRnd, int _yRnd) const;
72};
73
74#endif
Class: KPrGradient.
Definition KPrGradient.h:40
Temporary information used only during loading.