KHtml

SVGPathSegCurvetoCubic.h
1 /*
2  Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <[email protected]>
3  2004, 2005, 2006 Rob Buis <[email protected]>
4 
5  This file is part of the KDE project
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef SVGPathSegCurvetoCubic_h
24 #define SVGPathSegCurvetoCubic_h
25 
26 #if ENABLE(SVG)
27 
28 #include "SVGPathSeg.h"
29 
30 namespace WebCore
31 {
32 class SVGPathSegCurvetoCubicAbs : public SVGPathSeg
33 {
34 public:
35  static PassRefPtr<SVGPathSegCurvetoCubicAbs> create(float x, float y, float x1, float y1, float x2, float y2)
36  {
37  return adoptRef(new SVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2));
38  }
39 
40  virtual ~SVGPathSegCurvetoCubicAbs();
41 
42  unsigned short pathSegType() const override
43  {
44  return PATHSEG_CURVETO_CUBIC_ABS;
45  }
46  String pathSegTypeAsLetter() const override
47  {
48  return "C";
49  }
50  String toString() const override
51  {
52  return String::format("C %.6lg %.6lg %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x2, m_y2, m_x, m_y);
53  }
54 
55  void setX(float);
56  float x() const;
57 
58  void setY(float);
59  float y() const;
60 
61  void setX1(float);
62  float x1() const;
63 
64  void setY1(float);
65  float y1() const;
66 
67  void setX2(float);
68  float x2() const;
69 
70  void setY2(float);
71  float y2() const;
72 
73 private:
74  SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
75 
76  float m_x;
77  float m_y;
78  float m_x1;
79  float m_y1;
80  float m_x2;
81  float m_y2;
82 };
83 
84 class SVGPathSegCurvetoCubicRel : public SVGPathSeg
85 {
86 public:
87  static PassRefPtr<SVGPathSegCurvetoCubicRel> create(float x, float y, float x1, float y1, float x2, float y2)
88  {
89  return adoptRef(new SVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2));
90  }
91  virtual ~SVGPathSegCurvetoCubicRel();
92 
93  unsigned short pathSegType() const override
94  {
95  return PATHSEG_CURVETO_CUBIC_REL;
96  }
97  String pathSegTypeAsLetter() const override
98  {
99  return "c";
100  }
101  String toString() const override
102  {
103  return String::format("c %.6lg %.6lg %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x2, m_y2, m_x, m_y);
104  }
105 
106  void setX(float);
107  float x() const;
108 
109  void setY(float);
110  float y() const;
111 
112  void setX1(float);
113  float x1() const;
114 
115  void setY1(float);
116  float y1() const;
117 
118  void setX2(float);
119  float x2() const;
120 
121  void setY2(float);
122  float y2() const;
123 
124 private:
125  SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
126 
127  float m_x;
128  float m_y;
129  float m_x1;
130  float m_y1;
131  float m_x2;
132  float m_y2;
133 };
134 
135 } // namespace WebCore
136 
137 #endif // ENABLE(SVG)
138 #endif
139 
QAction * create(StandardAction id, const QObject *recvr, Func slot, QObject *parent)
char * toString(const T &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 25 2021 22:48:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.