1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/smil/nsSMILNullType.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 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_SMILNULLTYPE_H_ 1.10 +#define NS_SMILNULLTYPE_H_ 1.11 + 1.12 +#include "mozilla/Attributes.h" 1.13 +#include "nsISMILType.h" 1.14 + 1.15 +class nsSMILNullType : public nsISMILType 1.16 +{ 1.17 +public: 1.18 + // Singleton for nsSMILValue objects to hold onto. 1.19 + static nsSMILNullType* 1.20 + Singleton() 1.21 + { 1.22 + static nsSMILNullType 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& aValue) const MOZ_OVERRIDE {} 1.31 + virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE; 1.32 + 1.33 + // The remaining methods should never be called, so although they're very 1.34 + // simple they don't need to be inline. 1.35 + virtual bool IsEqual(const nsSMILValue& aLeft, 1.36 + const nsSMILValue& aRight) const MOZ_OVERRIDE; 1.37 + virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, 1.38 + uint32_t aCount) const MOZ_OVERRIDE; 1.39 + virtual nsresult ComputeDistance(const nsSMILValue& aFrom, 1.40 + const nsSMILValue& aTo, 1.41 + double& aDistance) const MOZ_OVERRIDE; 1.42 + virtual nsresult Interpolate(const nsSMILValue& aStartVal, 1.43 + const nsSMILValue& aEndVal, 1.44 + double aUnitDistance, 1.45 + nsSMILValue& aResult) const MOZ_OVERRIDE; 1.46 + 1.47 +private: 1.48 + // Private constructor: prevent instances beyond my singleton. 1.49 + MOZ_CONSTEXPR nsSMILNullType() {} 1.50 +}; 1.51 + 1.52 +#endif // NS_SMILNULLTYPE_H_