Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / svg / SVGPathSegListSMILType.h
blob172701caca965099fb377d36134b65375f122f9c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_SVG_SVGPATHSEGLISTSMILTYPE_H_
8 #define DOM_SVG_SVGPATHSEGLISTSMILTYPE_H_
10 #include "mozilla/Attributes.h"
11 #include "mozilla/SMILType.h"
13 namespace mozilla {
15 class SMILValue;
17 ////////////////////////////////////////////////////////////////////////
18 // SVGPathSegListSMILType
20 // Operations for animating an SVGPathData.
22 class SVGPathSegListSMILType : public SMILType {
23 public:
24 // Singleton for SMILValue objects to hold onto.
25 static SVGPathSegListSMILType* Singleton() {
26 static SVGPathSegListSMILType sSingleton;
27 return &sSingleton;
30 protected:
31 // SMILType Methods
32 // -------------------
34 void Init(SMILValue& aValue) const override;
36 void Destroy(SMILValue& aValue) const override;
37 nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const override;
38 bool IsEqual(const SMILValue& aLeft, const SMILValue& aRight) const override;
39 nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
40 uint32_t aCount) const override;
41 nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
42 double& aDistance) const override;
43 nsresult Interpolate(const SMILValue& aStartVal, const SMILValue& aEndVal,
44 double aUnitDistance, SMILValue& aResult) const override;
46 private:
47 // Private constructor: prevent instances beyond my singleton.
48 constexpr SVGPathSegListSMILType() = default;
51 } // namespace mozilla
53 #endif // DOM_SVG_SVGPATHSEGLISTSMILTYPE_H_