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