Bug 1795723 - Unified extensions UI should support High Contrast Mode. r=ayeddi,deskt...
[gecko.git] / dom / smil / SMILEnumType.h
blob039d32f0bbe31fe4ffdf9b0b9f013f9cc7e3170d
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/. */
7 #ifndef DOM_SMIL_SMILENUMTYPE_H_
8 #define DOM_SMIL_SMILENUMTYPE_H_
10 #include "mozilla/Attributes.h"
11 #include "mozilla/SMILType.h"
13 namespace mozilla {
15 class SMILEnumType : public SMILType {
16 public:
17 // Singleton for SMILValue objects to hold onto.
18 static SMILEnumType* Singleton() {
19 static SMILEnumType sSingleton;
20 return &sSingleton;
23 protected:
24 // SMILType Methods
25 // -------------------
26 virtual void Init(SMILValue& aValue) const override;
27 virtual void Destroy(SMILValue& aValue) const override;
28 virtual nsresult Assign(SMILValue& aDest,
29 const SMILValue& aSrc) const override;
30 virtual bool IsEqual(const SMILValue& aLeft,
31 const SMILValue& aRight) const override;
32 virtual nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
33 uint32_t aCount) const override;
34 virtual nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
35 double& aDistance) const override;
36 virtual nsresult Interpolate(const SMILValue& aStartVal,
37 const SMILValue& aEndVal, double aUnitDistance,
38 SMILValue& aResult) const override;
40 private:
41 // Private constructor: prevent instances beyond my singleton.
42 constexpr SMILEnumType() = default;
45 } // namespace mozilla
47 #endif // DOM_SMIL_SMILENUMTYPE_H_