Home | History | Annotate | Download | only in svg
      1 /*
      2  * Copyright (C) 2005 Alexander Kellett <lypanov (at) kde.org>
      3  *
      4  * This library is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU Library General Public
      6  * License as published by the Free Software Foundation; either
      7  * version 2 of the License, or (at your option) any later version.
      8  *
      9  * This library is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  * Library General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU Library General Public License
     15  * along with this library; see the file COPYING.LIB.  If not, write to
     16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17  * Boston, MA 02110-1301, USA.
     18  */
     19 
     20 #ifndef SVGMaskElement_h
     21 #define SVGMaskElement_h
     22 
     23 #include "core/SVGNames.h"
     24 #include "core/svg/SVGAnimatedBoolean.h"
     25 #include "core/svg/SVGAnimatedEnumeration.h"
     26 #include "core/svg/SVGAnimatedLength.h"
     27 #include "core/svg/SVGElement.h"
     28 #include "core/svg/SVGTests.h"
     29 #include "core/svg/SVGUnitTypes.h"
     30 
     31 namespace blink {
     32 
     33 class SVGMaskElement FINAL : public SVGElement,
     34                              public SVGTests {
     35     DEFINE_WRAPPERTYPEINFO();
     36 public:
     37     DECLARE_NODE_FACTORY(SVGMaskElement);
     38 
     39     SVGAnimatedLength* x() const { return m_x.get(); }
     40     SVGAnimatedLength* y() const { return m_y.get(); }
     41     SVGAnimatedLength* width() const { return m_width.get(); }
     42     SVGAnimatedLength* height() const { return m_height.get(); }
     43     SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* maskUnits() { return m_maskUnits.get(); }
     44     SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* maskContentUnits() { return m_maskContentUnits.get(); }
     45 
     46 private:
     47     explicit SVGMaskElement(Document&);
     48 
     49     virtual bool isValid() const OVERRIDE { return SVGTests::isValid(); }
     50     virtual bool needsPendingResourceHandling() const OVERRIDE { return false; }
     51 
     52     bool isSupportedAttribute(const QualifiedName&);
     53     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     54     virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
     55     virtual void childrenChanged(const ChildrenChange&) OVERRIDE;
     56 
     57     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
     58 
     59     virtual bool selfHasRelativeLengths() const OVERRIDE;
     60 
     61     RefPtr<SVGAnimatedLength> m_x;
     62     RefPtr<SVGAnimatedLength> m_y;
     63     RefPtr<SVGAnimatedLength> m_width;
     64     RefPtr<SVGAnimatedLength> m_height;
     65     RefPtr<SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType> > m_maskUnits;
     66     RefPtr<SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType> > m_maskContentUnits;
     67 };
     68 
     69 } // namespace blink
     70 
     71 #endif // SVGMaskElement_h
     72