SVGIntegerPairSMILType.h (1629B)
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/. */ 6 7 #ifndef DOM_SVG_SVGINTEGERPAIRSMILTYPE_H_ 8 #define DOM_SVG_SVGINTEGERPAIRSMILTYPE_H_ 9 10 #include "mozilla/SMILType.h" 11 12 namespace mozilla { 13 14 class SMILValue; 15 16 class SVGIntegerPairSMILType : public SMILType { 17 public: 18 // Singleton for SMILValue objects to hold onto. 19 static SVGIntegerPairSMILType* Singleton() { 20 static SVGIntegerPairSMILType sSingleton; 21 return &sSingleton; 22 } 23 24 protected: 25 // SMILType Methods 26 // ------------------- 27 void InitValue(SMILValue& aValue) const override; 28 void DestroyValue(SMILValue&) const override; 29 nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const override; 30 bool IsEqual(const SMILValue& aLeft, const SMILValue& aRight) const override; 31 nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd, 32 uint32_t aCount) const override; 33 nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo, 34 double& aDistance) const override; 35 nsresult Interpolate(const SMILValue& aStartVal, const SMILValue& aEndVal, 36 double aUnitDistance, SMILValue& aResult) const override; 37 38 private: 39 // Private constructor: prevent instances beyond my singleton. 40 constexpr SVGIntegerPairSMILType() = default; 41 }; 42 43 } // namespace mozilla 44 45 #endif // DOM_SVG_SVGINTEGERPAIRSMILTYPE_H_