|
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/. */ |
|
5 |
|
6 #ifndef NS_SMILFLOATTYPE_H_ |
|
7 #define NS_SMILFLOATTYPE_H_ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "nsISMILType.h" |
|
11 |
|
12 class nsSMILFloatType : public nsISMILType |
|
13 { |
|
14 public: |
|
15 // Singleton for nsSMILValue objects to hold onto. |
|
16 static nsSMILFloatType* |
|
17 Singleton() |
|
18 { |
|
19 static nsSMILFloatType sSingleton; |
|
20 return &sSingleton; |
|
21 } |
|
22 |
|
23 protected: |
|
24 // nsISMILType Methods |
|
25 // ------------------- |
|
26 virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE; |
|
27 virtual void Destroy(nsSMILValue&) const; |
|
28 virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE; |
|
29 virtual bool IsEqual(const nsSMILValue& aLeft, |
|
30 const nsSMILValue& aRight) const MOZ_OVERRIDE; |
|
31 virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, |
|
32 uint32_t aCount) const MOZ_OVERRIDE; |
|
33 virtual nsresult ComputeDistance(const nsSMILValue& aFrom, |
|
34 const nsSMILValue& aTo, |
|
35 double& aDistance) const MOZ_OVERRIDE; |
|
36 virtual nsresult Interpolate(const nsSMILValue& aStartVal, |
|
37 const nsSMILValue& aEndVal, |
|
38 double aUnitDistance, |
|
39 nsSMILValue& aResult) const MOZ_OVERRIDE; |
|
40 |
|
41 private: |
|
42 // Private constructor: prevent instances beyond my singleton. |
|
43 MOZ_CONSTEXPR nsSMILFloatType() {} |
|
44 }; |
|
45 |
|
46 #endif // NS_SMILFLOATTYPE_H_ |