KHtml

SVGStyledElement.h
1 /*
2  Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <[email protected]>
3  2004, 2005, 2007 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 SVGStyledElement_h
24 #define SVGStyledElement_h
25 
26 #if ENABLE(SVG)
27 #include "AffineTransform.h"
28 #include "Path.h"
29 #include "SVGElement.h"
30 #include "SVGLength.h"
31 #include "SVGResource.h"
32 #include "SVGStylable.h"
33 
34 //khtml compat
35 #include "RenderStyle.h"
36 
37 namespace WebCore
38 {
39 
40 class SVGStyledElement : public SVGElement,
41  public SVGStylable
42 {
43 public:
44  SVGStyledElement(const QualifiedName &, Document *);
45  virtual ~SVGStyledElement();
46 
47  bool isStyled() const override
48  {
49  return true;
50  }
51  virtual bool supportsMarkers() const
52  {
53  return false;
54  }
55 
56  PassRefPtr<DOM::CSSValueImpl> getPresentationAttribute(const DOMString &name) override;
57  DOM::CSSStyleDeclarationImpl *style() override
58  {
59  return StyledElement::style();
60  }
61 
62  bool isKnownAttribute(const QualifiedName &);
63 
64  bool rendererIsNeeded(RenderStyle *) override;
65  virtual SVGResource *canvasResource()
66  {
67  return nullptr;
68  }
69 
70  /*virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;*/
71  void parseMappedAttribute(MappedAttribute *) override;
72 
73  void svgAttributeChanged(const QualifiedName &) override;
74 
75  using DOM::NodeImpl::childrenChanged;
76  virtual void childrenChanged(bool changedByParser = false, Node *beforeChange = nullptr, Node *afterChange = nullptr, int childCountDelta = 0);
77 
78  // Centralized place to force a manual style resolution. Hacky but needed for now.
79  RenderStyle *resolveStyle(RenderStyle *parentStyle);
80 
81  void invalidateResourcesInAncestorChain() const;
82  void detach() override;
83 
84  void setInstanceUpdatesBlocked(bool);
85 
86 protected:
87  virtual bool hasRelativeValues() const
88  {
89  return true;
90  }
91 
92  static int cssPropertyIdForSVGAttributeName(const QualifiedName &);
93 
94 private:
95  ANIMATED_PROPERTY_DECLARATIONS(SVGStyledElement, String, String, ClassName, className)
96 
97  void updateElementInstance(SVGDocumentExtensions *) const;
98 };
99 
100 } // namespace WebCore
101 
102 #endif // ENABLE(SVG)
103 #endif // SVGStyledElement
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.