Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef NS_SMILFLOATTYPE_H_
8 : #define NS_SMILFLOATTYPE_H_
9 :
10 : #include "mozilla/Attributes.h"
11 : #include "nsISMILType.h"
12 :
13 : class nsSMILFloatType : public nsISMILType
14 : {
15 : public:
16 : // Singleton for nsSMILValue objects to hold onto.
17 : static nsSMILFloatType*
18 0 : Singleton()
19 : {
20 0 : static nsSMILFloatType sSingleton;
21 0 : return &sSingleton;
22 : }
23 :
24 : protected:
25 : // nsISMILType Methods
26 : // -------------------
27 : virtual void Init(nsSMILValue& aValue) const override;
28 : virtual void Destroy(nsSMILValue& aValue) const override;
29 : virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const override;
30 : virtual bool IsEqual(const nsSMILValue& aLeft,
31 : const nsSMILValue& aRight) const override;
32 : virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
33 : uint32_t aCount) const override;
34 : virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
35 : const nsSMILValue& aTo,
36 : double& aDistance) const override;
37 : virtual nsresult Interpolate(const nsSMILValue& aStartVal,
38 : const nsSMILValue& aEndVal,
39 : double aUnitDistance,
40 : nsSMILValue& aResult) const override;
41 :
42 : private:
43 : // Private constructor: prevent instances beyond my singleton.
44 0 : constexpr nsSMILFloatType() {}
45 : };
46 :
47 : #endif // NS_SMILFLOATTYPE_H_
|