michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef NS_SMILNULLTYPE_H_ michael@0: #define NS_SMILNULLTYPE_H_ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsISMILType.h" michael@0: michael@0: class nsSMILNullType : public nsISMILType michael@0: { michael@0: public: michael@0: // Singleton for nsSMILValue objects to hold onto. michael@0: static nsSMILNullType* michael@0: Singleton() michael@0: { michael@0: static nsSMILNullType sSingleton; michael@0: return &sSingleton; michael@0: } michael@0: michael@0: protected: michael@0: // nsISMILType Methods michael@0: // ------------------- michael@0: virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE {} michael@0: virtual void Destroy(nsSMILValue& aValue) const MOZ_OVERRIDE {} michael@0: virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE; michael@0: michael@0: // The remaining methods should never be called, so although they're very michael@0: // simple they don't need to be inline. michael@0: virtual bool IsEqual(const nsSMILValue& aLeft, michael@0: const nsSMILValue& aRight) const MOZ_OVERRIDE; michael@0: virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, michael@0: uint32_t aCount) const MOZ_OVERRIDE; michael@0: virtual nsresult ComputeDistance(const nsSMILValue& aFrom, michael@0: const nsSMILValue& aTo, michael@0: double& aDistance) const MOZ_OVERRIDE; michael@0: virtual nsresult Interpolate(const nsSMILValue& aStartVal, michael@0: const nsSMILValue& aEndVal, michael@0: double aUnitDistance, michael@0: nsSMILValue& aResult) const MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: // Private constructor: prevent instances beyond my singleton. michael@0: MOZ_CONSTEXPR nsSMILNullType() {} michael@0: }; michael@0: michael@0: #endif // NS_SMILNULLTYPE_H_