1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/smil/SMILEnumType.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 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 MOZILLA_SMILENUMTYPE_H_ 1.10 +#define MOZILLA_SMILENUMTYPE_H_ 1.11 + 1.12 +#include "mozilla/Attributes.h" 1.13 +#include "nsISMILType.h" 1.14 + 1.15 +namespace mozilla { 1.16 + 1.17 +class SMILEnumType : public nsISMILType 1.18 +{ 1.19 +public: 1.20 + // Singleton for nsSMILValue objects to hold onto. 1.21 + static SMILEnumType* 1.22 + Singleton() 1.23 + { 1.24 + static SMILEnumType sSingleton; 1.25 + return &sSingleton; 1.26 + } 1.27 + 1.28 +protected: 1.29 + // nsISMILType Methods 1.30 + // ------------------- 1.31 + virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE; 1.32 + virtual void Destroy(nsSMILValue&) const; 1.33 + virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE; 1.34 + virtual bool IsEqual(const nsSMILValue& aLeft, 1.35 + const nsSMILValue& aRight) const MOZ_OVERRIDE; 1.36 + virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, 1.37 + uint32_t aCount) const MOZ_OVERRIDE; 1.38 + virtual nsresult ComputeDistance(const nsSMILValue& aFrom, 1.39 + const nsSMILValue& aTo, 1.40 + double& aDistance) const MOZ_OVERRIDE; 1.41 + virtual nsresult Interpolate(const nsSMILValue& aStartVal, 1.42 + const nsSMILValue& aEndVal, 1.43 + double aUnitDistance, 1.44 + nsSMILValue& aResult) const MOZ_OVERRIDE; 1.45 + 1.46 +private: 1.47 + // Private constructor: prevent instances beyond my singleton. 1.48 + MOZ_CONSTEXPR SMILEnumType() {} 1.49 +}; 1.50 + 1.51 +} // namespace mozilla 1.52 + 1.53 +#endif // MOZILLA_SMILENUMTYPE_H_