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;
48 class RenderSVGContainer : public RenderContainer
51 RenderSVGContainer(SVGStyledElement*);
52 ~RenderSVGContainer();
54 // Some containers do not want it's children
55 // to be drawn, because they may be 'referenced'
56 // Example: <marker> children in SVG
57 void setDrawsContents(bool);
58 bool drawsContents() const;
60 virtual bool isKCanvasContainer() const { return true; }
61 virtual const char* renderName() const { return "KCanvasContainer"; }
63 virtual bool canHaveChildren() const;
65 virtual bool requiresLayer();
66 virtual short lineHeight(bool b, bool isRootLineBox = false) const;
67 virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
69 virtual void calcMinMaxWidth();
70 virtual void layout();
71 virtual void paint(PaintInfo &paintInfo, int parentX, int parentY);
73 virtual IntRect getAbsoluteRepaintRect();
75 virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
77 virtual AffineTransform absoluteTransform() const;
79 bool fillContains(const FloatPoint&) const;
80 bool strokeContains(const FloatPoint&) const;
81 FloatRect relativeBBox(bool includeStroke = true) const;
83 virtual AffineTransform localTransform() const;
84 void setLocalTransform(const AffineTransform&);
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;
101 AffineTransform getAspectRatio(const FloatRect& logical, const FloatRect& physical) const;
103 bool m_drawsContents : 1;
105 AffineTransform m_matrix;
107 FloatRect m_viewport;
110 IntRect m_absoluteBounds;
115 #endif // SVG_SUPPORT