• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 SVGAnimatedPathSegListPropertyTearOff_h
21 #define SVGAnimatedPathSegListPropertyTearOff_h
22 
23 #if ENABLE(SVG)
24 #include "SVGAnimatedListPropertyTearOff.h"
25 #include "SVGPathSegList.h"
26 #include "SVGPathSegListPropertyTearOff.h"
27 
28 namespace WebCore {
29 
30 class SVGPathSegListPropertyTearOff;
31 
32 class SVGAnimatedPathSegListPropertyTearOff : public SVGAnimatedListPropertyTearOff<SVGPathSegList> {
33 public:
baseVal(SVGPathSegRole role)34     SVGProperty* baseVal(SVGPathSegRole role)
35     {
36         if (!m_baseVal)
37             m_baseVal = SVGPathSegListPropertyTearOff::create(this, BaseValRole, role);
38         return m_baseVal.get();
39     }
40 
animVal(SVGPathSegRole role)41     SVGProperty* animVal(SVGPathSegRole role)
42     {
43         if (!m_animVal)
44             m_animVal = SVGPathSegListPropertyTearOff::create(this, AnimValRole, role);
45         return m_animVal.get();
46     }
47 
removeItemFromList(const RefPtr<SVGPathSeg> & segment,bool shouldSynchronizeWrappers)48     int removeItemFromList(const RefPtr<SVGPathSeg>& segment, bool shouldSynchronizeWrappers)
49     {
50         // This should ever be called for our baseVal, as animVal can't modify the list.
51         return static_pointer_cast<SVGPathSegListPropertyTearOff>(m_baseVal)->removeItemFromList(segment, shouldSynchronizeWrappers);
52     }
53 
54 private:
55     friend class SVGAnimatedProperty;
56 
create(SVGElement * contextElement,const QualifiedName & attributeName,SVGPathSegList & values)57     static PassRefPtr<SVGAnimatedPathSegListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, SVGPathSegList& values)
58     {
59         ASSERT(contextElement);
60         return adoptRef(new SVGAnimatedPathSegListPropertyTearOff(contextElement, attributeName, values));
61     }
62 
SVGAnimatedPathSegListPropertyTearOff(SVGElement * contextElement,const QualifiedName & attributeName,SVGPathSegList & values)63     SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, SVGPathSegList& values)
64         : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attributeName, values)
65     {
66     }
67 };
68 
69 }
70 
71 #endif // ENABLE(SVG)
72 #endif // SVGAnimatedPathSegListPropertyTearOff_h
73