KHTML
GradientAttributes.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 00003 00004 This file is part of the KDE project 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef GradientAttributes_h 00023 #define GradientAttributes_h 00024 00025 #if ENABLE(SVG) 00026 00027 namespace WebCore 00028 { 00029 struct GradientAttributes { 00030 GradientAttributes() 00031 : m_spreadMethod(SPREADMETHOD_PAD) 00032 , m_boundingBoxMode(true) 00033 , m_spreadMethodSet(false) 00034 , m_boundingBoxModeSet(false) 00035 , m_gradientTransformSet(false) 00036 , m_stopsSet(false) 00037 { 00038 } 00039 00040 SVGGradientSpreadMethod spreadMethod() const { return m_spreadMethod; } 00041 bool boundingBoxMode() const { return m_boundingBoxMode; } 00042 AffineTransform gradientTransform() const { return m_gradientTransform; } 00043 const Vector<SVGGradientStop>& stops() const { return m_stops; } 00044 00045 void setSpreadMethod(SVGGradientSpreadMethod value) { m_spreadMethod = value; m_spreadMethodSet = true; } 00046 void setBoundingBoxMode(bool value) { m_boundingBoxMode = value; m_boundingBoxModeSet = true; } 00047 void setGradientTransform(const AffineTransform& value) { m_gradientTransform = value; m_gradientTransformSet = true; } 00048 void setStops(const Vector<SVGGradientStop>& value) { m_stops = value; m_stopsSet = true; } 00049 00050 bool hasSpreadMethod() const { return m_spreadMethodSet; } 00051 bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; } 00052 bool hasGradientTransform() const { return m_gradientTransformSet; } 00053 bool hasStops() const { return m_stopsSet; } 00054 00055 private: 00056 // Properties 00057 SVGGradientSpreadMethod m_spreadMethod; 00058 bool m_boundingBoxMode; 00059 AffineTransform m_gradientTransform; 00060 Vector<SVGGradientStop> m_stops; 00061 00062 // Property states 00063 bool m_spreadMethodSet : 1; 00064 bool m_boundingBoxModeSet : 1; 00065 bool m_gradientTransformSet : 1; 00066 bool m_stopsSet : 1; 00067 }; 00068 00069 } // namespace WebCore 00070 00071 #endif // ENABLE(SVG) 00072 #endif 00073 00074 // vim:ts=4:noet
KDE 4.6 API Reference