KHTML
LinearGradientAttributes.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 LinearGradientAttributes_h 00023 #define LinearGradientAttributes_h 00024 00025 #include "GradientAttributes.h" 00026 00027 #if ENABLE(SVG) 00028 00029 namespace WebCore 00030 { 00031 struct LinearGradientAttributes : GradientAttributes { 00032 LinearGradientAttributes() 00033 : m_x1(0.0) 00034 , m_y1(0.0) 00035 , m_x2(1.0) 00036 , m_y2(0.0) 00037 , m_x1Set(false) 00038 , m_y1Set(false) 00039 , m_x2Set(false) 00040 , m_y2Set(false) 00041 { 00042 } 00043 00044 double x1() const { return m_x1; } 00045 double y1() const { return m_y1; } 00046 double x2() const { return m_x2; } 00047 double y2() const { return m_y2; } 00048 00049 void setX1(double value) { m_x1 = value; m_x1Set = true; } 00050 void setY1(double value) { m_y1 = value; m_y1Set = true; } 00051 void setX2(double value) { m_x2 = value; m_x2Set = true; } 00052 void setY2(double value) { m_y2 = value; m_y2Set = true; } 00053 00054 bool hasX1() const { return m_x1Set; } 00055 bool hasY1() const { return m_y1Set; } 00056 bool hasX2() const { return m_x2Set; } 00057 bool hasY2() const { return m_y2Set; } 00058 00059 private: 00060 // Properties 00061 double m_x1; 00062 double m_y1; 00063 double m_x2; 00064 double m_y2; 00065 00066 // Property states 00067 bool m_x1Set : 1; 00068 bool m_y1Set : 1; 00069 bool m_x2Set : 1; 00070 bool m_y2Set : 1; 00071 }; 00072 00073 } // namespace WebCore 00074 00075 #endif // ENABLE(SVG) 00076 #endif 00077 00078 // vim:ts=4:noet
KDE 4.6 API Reference