File indexing completed on 2024-04-28 15:24:27

0001 /*
0002     Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
0003                   2004, 2005 Rob Buis <buis@kde.org>
0004                   2007 Eric Seidel <eric@webkit.org>
0005 
0006     This file is part of the KDE project
0007 
0008     This library is free software; you can redistribute it and/or
0009     modify it under the terms of the GNU Library General Public
0010     License as published by the Free Software Foundation; either
0011     version 2 of the License, or (at your option) any later version.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Library General Public License for more details.
0017 
0018     You should have received a copy of the GNU Library General Public License
0019     along with this library; see the file COPYING.LIB.  If not, write to
0020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0021     Boston, MA 02110-1301, USA.
0022 */
0023 
0024 #ifndef SVGAElement_h
0025 #define SVGAElement_h
0026 
0027 #if ENABLE(SVG)
0028 #include "SVGExternalResourcesRequired.h"
0029 #include "SVGLangSpace.h"
0030 #include "SVGStyledTransformableElement.h"
0031 #include "SVGTests.h"
0032 #include "SVGURIReference.h"
0033 
0034 namespace WebCore
0035 {
0036 
0037 class SVGAElement : public SVGStyledTransformableElement,
0038     public SVGURIReference,
0039     public SVGTests,
0040     public SVGLangSpace,
0041     public SVGExternalResourcesRequired
0042 {
0043 public:
0044     SVGAElement(const QualifiedName &, Document *);
0045     virtual ~SVGAElement();
0046 
0047     bool isValid() const override
0048     {
0049         return SVGTests::isValid();
0050     }
0051 
0052     virtual String title() const;
0053 
0054     void parseMappedAttribute(MappedAttribute *) override;
0055     void svgAttributeChanged(const QualifiedName &) override;
0056 
0057     RenderObject *createRenderer(RenderArena *, RenderStyle *) override;
0058 
0059     void defaultEventHandler(Event *) override;
0060 
0061     virtual bool supportsFocus() const;
0062     bool isFocusableImpl(FocusType ft) const override;
0063 
0064     bool childShouldCreateRenderer(Node *) const override;
0065 
0066     // KHTML ElementImpl pure virtual method
0067     quint32 id() const override
0068     {
0069         return SVGNames::aTag.id();
0070     }
0071 
0072 protected:
0073     const SVGElement *contextElement() const override
0074     {
0075         return this;
0076     }
0077 
0078 private:
0079     ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
0080     ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
0081 
0082     ANIMATED_PROPERTY_DECLARATIONS(SVGAElement, String, String, Target, target)
0083 };
0084 
0085 } // namespace WebCore
0086 
0087 #endif // ENABLE(SVG)
0088 #endif // SVGAElement_h