1 /* 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann (at) kde.org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public License 15 * along with this library; see the file COPYING.LIB. If not, write to 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef RadialGradientAttributes_h 21 #define RadialGradientAttributes_h 22 23 #include "core/svg/GradientAttributes.h" 24 25 namespace WebCore { 26 struct RadialGradientAttributes : GradientAttributes { 27 RadialGradientAttributes() 28 : m_cx(LengthModeWidth, "50%") 29 , m_cy(LengthModeWidth, "50%") 30 , m_r(LengthModeWidth, "50%") 31 , m_cxSet(false) 32 , m_cySet(false) 33 , m_rSet(false) 34 , m_fxSet(false) 35 , m_fySet(false) 36 , m_frSet(false) 37 { 38 } 39 40 SVGLength cx() const { return m_cx; } 41 SVGLength cy() const { return m_cy; } 42 SVGLength r() const { return m_r; } 43 SVGLength fx() const { return m_fx; } 44 SVGLength fy() const { return m_fy; } 45 SVGLength fr() const { return m_fr; } 46 47 void setCx(const SVGLength& value) { m_cx = value; m_cxSet = true; } 48 void setCy(const SVGLength& value) { m_cy = value; m_cySet = true; } 49 void setR(const SVGLength& value) { m_r = value; m_rSet = true; } 50 void setFx(const SVGLength& value) { m_fx = value; m_fxSet = true; } 51 void setFy(const SVGLength& value) { m_fy = value; m_fySet = true; } 52 void setFr(const SVGLength& value) { m_fr = value; m_frSet = true; } 53 54 bool hasCx() const { return m_cxSet; } 55 bool hasCy() const { return m_cySet; } 56 bool hasR() const { return m_rSet; } 57 bool hasFx() const { return m_fxSet; } 58 bool hasFy() const { return m_fySet; } 59 bool hasFr() const { return m_frSet; } 60 61 private: 62 // Properties 63 SVGLength m_cx; 64 SVGLength m_cy; 65 SVGLength m_r; 66 SVGLength m_fx; 67 SVGLength m_fy; 68 SVGLength m_fr; 69 70 // Property states 71 bool m_cxSet : 1; 72 bool m_cySet : 1; 73 bool m_rSet : 1; 74 bool m_fxSet : 1; 75 bool m_fySet : 1; 76 bool m_frSet : 1; 77 }; 78 79 } // namespace WebCore 80 81 #endif 82