Backed out changeset 58dbd2146e24 (bug 944961) for bustage.
[gecko.git] / content / smil / nsSMILNullType.h
blob2e6a4ef3a2f5cddfe4826c487c9598467a20069a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef NS_SMILNULLTYPE_H_
7 #define NS_SMILNULLTYPE_H_
9 #include "mozilla/Attributes.h"
10 #include "nsISMILType.h"
12 class nsSMILNullType : public nsISMILType
14 public:
15 // Singleton for nsSMILValue objects to hold onto.
16 static nsSMILNullType*
17 Singleton()
19 static nsSMILNullType sSingleton;
20 return &sSingleton;
23 protected:
24 // nsISMILType Methods
25 // -------------------
26 virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE {}
27 virtual void Destroy(nsSMILValue& aValue) const MOZ_OVERRIDE {}
28 virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE;
30 // The remaining methods should never be called, so although they're very
31 // simple they don't need to be inline.
32 virtual bool IsEqual(const nsSMILValue& aLeft,
33 const nsSMILValue& aRight) const MOZ_OVERRIDE;
34 virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
35 uint32_t aCount) const MOZ_OVERRIDE;
36 virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
37 const nsSMILValue& aTo,
38 double& aDistance) const MOZ_OVERRIDE;
39 virtual nsresult Interpolate(const nsSMILValue& aStartVal,
40 const nsSMILValue& aEndVal,
41 double aUnitDistance,
42 nsSMILValue& aResult) const MOZ_OVERRIDE;
44 private:
45 // Private constructor: prevent instances beyond my singleton.
46 MOZ_CONSTEXPR nsSMILNullType() {}
49 #endif // NS_SMILNULLTYPE_H_