dom/smil/SMILIntegerType.h
author Connor Brewster <connor.brewster@eagles.oc.edu>
Wed, 21 Jun 2017 01:04:18 -0700
changeset 365153 2278abe603678cd4bb47ca088fe6774a1d46aa2c
parent 304308 96875d7ae6f2f4cb0f56cd872eaae90345933563
child 448947 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
servo: Merge #17421 - Fix crash when id attribute is set via SetAttributeNode (from cbrewster:set_attribute_node_fix); r=emilio fixes #17366 Source-Repo: https://github.com/servo/servo Source-Revision: 82884050be02c0a72d2e2e2fa5645ecad2b9c668

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SMILINTEGERTYPE_H_
#define MOZILLA_SMILINTEGERTYPE_H_

#include "mozilla/Attributes.h"
#include "nsISMILType.h"

namespace mozilla {

class SMILIntegerType : public nsISMILType
{
public:
  virtual void Init(nsSMILValue& aValue) const override;
  virtual void Destroy(nsSMILValue& aValue) const override;
  virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const override;
  virtual bool IsEqual(const nsSMILValue& aLeft,
                       const nsSMILValue& aRight) const override;
  virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
                       uint32_t aCount) const override;
  virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
                                   const nsSMILValue& aTo,
                                   double& aDistance) const override;
  virtual nsresult Interpolate(const nsSMILValue& aStartVal,
                               const nsSMILValue& aEndVal,
                               double aUnitDistance,
                               nsSMILValue& aResult) const override;

  static SMILIntegerType*
  Singleton()
  {
    static SMILIntegerType sSingleton;
    return &sSingleton;
  }

private:
  constexpr SMILIntegerType() {}
};

} // namespace mozilla

#endif // MOZILLA_SMILINTEGERTYPE_H_