KHtml

LinearGradientAttributes.h
1 /*
2  Copyright (C) 2006 Nikolas Zimmermann <[email protected]>
3 
4  This file is part of the KDE project
5 
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.
10 
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.
15 
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.
20 */
21 
22 #ifndef LinearGradientAttributes_h
23 #define LinearGradientAttributes_h
24 
25 #include "GradientAttributes.h"
26 
27 #if ENABLE(SVG)
28 
29 namespace WebCore
30 {
31 struct LinearGradientAttributes : GradientAttributes {
32  LinearGradientAttributes()
33  : m_x1(0.0)
34  , m_y1(0.0)
35  , m_x2(1.0)
36  , m_y2(0.0)
37  , m_x1Set(false)
38  , m_y1Set(false)
39  , m_x2Set(false)
40  , m_y2Set(false)
41  {
42  }
43 
44  double x1() const
45  {
46  return m_x1;
47  }
48  double y1() const
49  {
50  return m_y1;
51  }
52  double x2() const
53  {
54  return m_x2;
55  }
56  double y2() const
57  {
58  return m_y2;
59  }
60 
61  void setX1(double value)
62  {
63  m_x1 = value;
64  m_x1Set = true;
65  }
66  void setY1(double value)
67  {
68  m_y1 = value;
69  m_y1Set = true;
70  }
71  void setX2(double value)
72  {
73  m_x2 = value;
74  m_x2Set = true;
75  }
76  void setY2(double value)
77  {
78  m_y2 = value;
79  m_y2Set = true;
80  }
81 
82  bool hasX1() const
83  {
84  return m_x1Set;
85  }
86  bool hasY1() const
87  {
88  return m_y1Set;
89  }
90  bool hasX2() const
91  {
92  return m_x2Set;
93  }
94  bool hasY2() const
95  {
96  return m_y2Set;
97  }
98 
99 private:
100  // Properties
101  double m_x1;
102  double m_y1;
103  double m_x2;
104  double m_y2;
105 
106  // Property states
107  bool m_x1Set : 1;
108  bool m_y1Set : 1;
109  bool m_x2Set : 1;
110  bool m_y2Set : 1;
111 };
112 
113 } // namespace WebCore
114 
115 #endif // ENABLE(SVG)
116 #endif
117 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.