2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
5 This file is part of the KDE project
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public License
18 aint with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
23 #ifndef KCanvasContainer_H
24 #define KCanvasContainer_H
27 #include "kcanvas/RenderPath.h"
28 #include "RenderContainer.h"
45 class KCanvasRenderingStyle;
47 class RenderSVGContainer : public RenderContainer
50 RenderSVGContainer(SVGStyledElement*);
51 ~RenderSVGContainer();
53 // Some containers do not want it's children
54 // to be drawn, because they may be 'referenced'
55 // Example: <marker> children in SVG
56 void setDrawsContents(bool);
57 bool drawsContents() const;
59 virtual bool isKCanvasContainer() const { return true; }
60 virtual const char* renderName() const { return "KCanvasContainer"; }
62 virtual bool canHaveChildren() const;
64 virtual bool requiresLayer();
65 virtual short lineHeight(bool b, bool isRootLineBox = false) const;
66 virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
68 virtual void calcMinMaxWidth();
69 virtual void layout();
70 virtual void paint(PaintInfo &paintInfo, int parentX, int parentY);
72 virtual IntRect getAbsoluteRepaintRect();
74 virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
76 virtual AffineTransform absoluteTransform() const;
78 bool fillContains(const FloatPoint&) const;
79 bool strokeContains(const FloatPoint&) const;
80 FloatRect relativeBBox(bool includeStroke = true) const;
82 virtual AffineTransform localTransform() const;
83 void setLocalTransform(const AffineTransform&);
85 void setViewport(const FloatRect&);
86 FloatRect viewport() const;
88 void setViewBox(const FloatRect&);
89 FloatRect viewBox() const;
91 void setAlign(KCAlign);
92 KCAlign align() const;
97 AffineTransform viewportTransform() const;
100 AffineTransform getAspectRatio(const FloatRect& logical, const FloatRect& physical) const;
102 bool m_drawsContents : 1;
104 AffineTransform m_matrix;
106 FloatRect m_viewport;
109 IntRect m_absoluteBounds;
114 #endif // SVG_SUPPORT