2011-07-01 11:19:52 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2011-07-01 11:19:52 +04:00
|
|
|
|
|
|
|
#ifndef MOZILLA_SVGNUMBERPAIRSMILTYPE_H_
|
|
|
|
#define MOZILLA_SVGNUMBERPAIRSMILTYPE_H_
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2011-07-01 11:19:52 +04:00
|
|
|
#include "nsISMILType.h"
|
|
|
|
|
2012-01-26 13:57:21 +04:00
|
|
|
class nsSMILValue;
|
|
|
|
|
2011-07-01 11:19:52 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class SVGNumberPairSMILType : public nsISMILType
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Singleton for nsSMILValue objects to hold onto.
|
|
|
|
static SVGNumberPairSMILType sSingleton;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// nsISMILType Methods
|
|
|
|
// -------------------
|
2013-05-30 00:43:41 +04:00
|
|
|
virtual void Init(nsSMILValue& aValue) const MOZ_OVERRIDE;
|
2015-01-02 09:13:59 +03:00
|
|
|
virtual void Destroy(nsSMILValue&) const MOZ_OVERRIDE;
|
2013-05-30 00:43:41 +04:00
|
|
|
virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const MOZ_OVERRIDE;
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool IsEqual(const nsSMILValue& aLeft,
|
2013-05-30 00:43:41 +04:00
|
|
|
const nsSMILValue& aRight) const MOZ_OVERRIDE;
|
2011-07-01 11:19:52 +04:00
|
|
|
virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
|
2013-05-30 00:43:41 +04:00
|
|
|
uint32_t aCount) const MOZ_OVERRIDE;
|
2011-07-01 11:19:52 +04:00
|
|
|
virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
|
|
|
|
const nsSMILValue& aTo,
|
2013-05-30 00:43:41 +04:00
|
|
|
double& aDistance) const MOZ_OVERRIDE;
|
2011-07-01 11:19:52 +04:00
|
|
|
virtual nsresult Interpolate(const nsSMILValue& aStartVal,
|
|
|
|
const nsSMILValue& aEndVal,
|
|
|
|
double aUnitDistance,
|
2013-05-30 00:43:41 +04:00
|
|
|
nsSMILValue& aResult) const MOZ_OVERRIDE;
|
2011-07-01 11:19:52 +04:00
|
|
|
|
|
|
|
private:
|
2013-08-12 18:13:34 +04:00
|
|
|
// Private constructor: prevent instances beyond my singleton.
|
|
|
|
MOZ_CONSTEXPR SVGNumberPairSMILType() {}
|
2011-07-01 11:19:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // MOZILLA_SVGNUMBERPAIRSMILTYPE_H_
|