1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/smil/nsSMILFloatType.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef NS_SMILFLOATTYPE_H_ 1.10 +#define NS_SMILFLOATTYPE_H_ 1.11 + 1.12 +#include "mozilla/Attributes.h" 1.13 +#include "nsISMILType.h" 1.14 + 1.15 +class nsSMILFloatType : public nsISMILType 1.16 +{ 1.17 +public: 1.18 + // Singleton for nsSMILValue objects to hold onto. 1.19 + static nsSMILFloatType* 1.20 + Singleton() 1.21 + { 1.22 + static nsSMILFloatType sSingleton; 1.23 + return &sSingleton; 1.24 + } 1.25 + 1.26 +protected: 1.27 + // nsISMILType Methods 1.28 + // ------------------- 1.29 + virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE; 1.30 + virtual void Destroy(nsSMILValue&) const; 1.31 + virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE; 1.32 + virtual bool IsEqual(const nsSMILValue& aLeft, 1.33 + const nsSMILValue& aRight) const MOZ_OVERRIDE; 1.34 + virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, 1.35 + uint32_t aCount) const MOZ_OVERRIDE; 1.36 + virtual nsresult ComputeDistance(const nsSMILValue& aFrom, 1.37 + const nsSMILValue& aTo, 1.38 + double& aDistance) const MOZ_OVERRIDE; 1.39 + virtual nsresult Interpolate(const nsSMILValue& aStartVal, 1.40 + const nsSMILValue& aEndVal, 1.41 + double aUnitDistance, 1.42 + nsSMILValue& aResult) const MOZ_OVERRIDE; 1.43 + 1.44 +private: 1.45 + // Private constructor: prevent instances beyond my singleton. 1.46 + MOZ_CONSTEXPR nsSMILFloatType() {} 1.47 +}; 1.48 + 1.49 +#endif // NS_SMILFLOATTYPE_H_