KHtml

PatternAttributes.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 PatternAttributes_h
23 #define PatternAttributes_h
24 
25 #if ENABLE(SVG)
26 
27 namespace WebCore
28 {
29 struct PatternAttributes {
30  PatternAttributes()
31  : m_x()
32  , m_y()
33  , m_width()
34  , m_height()
35  , m_boundingBoxMode(true)
36  , m_boundingBoxModeContent(false)
37  , m_patternContentElement(0)
38  , m_xSet(false)
39  , m_ySet(false)
40  , m_widthSet(false)
41  , m_heightSet(false)
42  , m_boundingBoxModeSet(false)
43  , m_boundingBoxModeContentSet(false)
44  , m_patternTransformSet(false)
45  , m_patternContentElementSet(false)
46  {
47  }
48 
49  SVGLength x() const
50  {
51  return m_x;
52  }
53  SVGLength y() const
54  {
55  return m_y;
56  }
57  SVGLength width() const
58  {
59  return m_width;
60  }
61  SVGLength height() const
62  {
63  return m_height;
64  }
65  bool boundingBoxMode() const
66  {
67  return m_boundingBoxMode;
68  }
69  bool boundingBoxModeContent() const
70  {
71  return m_boundingBoxModeContent;
72  }
73  AffineTransform patternTransform() const
74  {
75  return m_patternTransform;
76  }
77  const SVGPatternElement *patternContentElement() const
78  {
79  return m_patternContentElement;
80  }
81 
82  void setX(const SVGLength &value)
83  {
84  m_x = value;
85  m_xSet = true;
86  }
87  void setY(const SVGLength &value)
88  {
89  m_y = value;
90  m_ySet = true;
91  }
92  void setWidth(const SVGLength &value)
93  {
94  m_width = value;
95  m_widthSet = true;
96  }
97  void setHeight(const SVGLength &value)
98  {
99  m_height = value;
100  m_heightSet = true;
101  }
102  void setBoundingBoxMode(bool value)
103  {
104  m_boundingBoxMode = value;
105  m_boundingBoxModeSet = true;
106  }
107  void setBoundingBoxModeContent(bool value)
108  {
109  m_boundingBoxModeContent = value;
110  m_boundingBoxModeContentSet = true;
111  }
112  void setPatternTransform(const AffineTransform &value)
113  {
114  m_patternTransform = value;
115  m_patternTransformSet = true;
116  }
117  void setPatternContentElement(const SVGPatternElement *value)
118  {
119  m_patternContentElement = value;
120  m_patternContentElementSet = true;
121  }
122 
123  bool hasX() const
124  {
125  return m_xSet;
126  }
127  bool hasY() const
128  {
129  return m_ySet;
130  }
131  bool hasWidth() const
132  {
133  return m_widthSet;
134  }
135  bool hasHeight() const
136  {
137  return m_heightSet;
138  }
139  bool hasBoundingBoxMode() const
140  {
141  return m_boundingBoxModeSet;
142  }
143  bool hasBoundingBoxModeContent() const
144  {
145  return m_boundingBoxModeContentSet;
146  }
147  bool hasPatternTransform() const
148  {
149  return m_patternTransformSet;
150  }
151  bool hasPatternContentElement() const
152  {
153  return m_patternContentElementSet;
154  }
155 
156 private:
157  // Properties
158  SVGLength m_x;
159  SVGLength m_y;
160  SVGLength m_width;
161  SVGLength m_height;
162  bool m_boundingBoxMode;
163  bool m_boundingBoxModeContent;
164  AffineTransform m_patternTransform;
165  const SVGPatternElement *m_patternContentElement;
166 
167  // Property states
168  bool m_xSet : 1;
169  bool m_ySet : 1;
170  bool m_widthSet : 1;
171  bool m_heightSet : 1;
172  bool m_boundingBoxModeSet : 1;
173  bool m_boundingBoxModeContentSet : 1;
174  bool m_patternTransformSet : 1;
175  bool m_patternContentElementSet : 1;
176 };
177 
178 } // namespace WebCore
179 
180 #endif // ENABLE(SVG)
181 #endif
182 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.