don't discard iframe children.
[kdelibs.git] / khtml / svg / GradientAttributes.h
blobc16e9612388587ad53554da689a3f6d4f4c14983
1 /*
2 Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 This file is part of the KDE project
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #ifndef GradientAttributes_h
23 #define GradientAttributes_h
25 #if ENABLE(SVG)
27 namespace WebCore
29 struct GradientAttributes {
30 GradientAttributes()
31 : m_spreadMethod(SPREADMETHOD_PAD)
32 , m_boundingBoxMode(true)
33 , m_spreadMethodSet(false)
34 , m_boundingBoxModeSet(false)
35 , m_gradientTransformSet(false)
36 , m_stopsSet(false)
40 SVGGradientSpreadMethod spreadMethod() const { return m_spreadMethod; }
41 bool boundingBoxMode() const { return m_boundingBoxMode; }
42 AffineTransform gradientTransform() const { return m_gradientTransform; }
43 const Vector<SVGGradientStop>& stops() const { return m_stops; }
45 void setSpreadMethod(SVGGradientSpreadMethod value) { m_spreadMethod = value; m_spreadMethodSet = true; }
46 void setBoundingBoxMode(bool value) { m_boundingBoxMode = value; m_boundingBoxModeSet = true; }
47 void setGradientTransform(const AffineTransform& value) { m_gradientTransform = value; m_gradientTransformSet = true; }
48 void setStops(const Vector<SVGGradientStop>& value) { m_stops = value; m_stopsSet = true; }
50 bool hasSpreadMethod() const { return m_spreadMethodSet; }
51 bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; }
52 bool hasGradientTransform() const { return m_gradientTransformSet; }
53 bool hasStops() const { return m_stopsSet; }
55 private:
56 // Properties
57 SVGGradientSpreadMethod m_spreadMethod;
58 bool m_boundingBoxMode;
59 AffineTransform m_gradientTransform;
60 Vector<SVGGradientStop> m_stops;
62 // Property states
63 bool m_spreadMethodSet : 1;
64 bool m_boundingBoxModeSet : 1;
65 bool m_gradientTransformSet : 1;
66 bool m_stopsSet : 1;
69 } // namespace WebCore
71 #endif // ENABLE(SVG)
72 #endif
74 // vim:ts=4:noet