dom/smil/SMILBoolType.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial