1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* ***** BEGIN LICENSE BLOCK *****
3 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Original Code is the Mozilla SMIL module.
16 : *
17 : * The Initial Developer of the Original Code is Brian Birtles.
18 : * Portions created by the Initial Developer are Copyright (C) 2006
19 : * the Initial Developer. All Rights Reserved.
20 : *
21 : * Contributor(s):
22 : * Robert O'Callahan <roc+moz@cs.cmu.edu>
23 : * Brian Birtles <birtles@gmail.com>
24 : *
25 : * Alternatively, the contents of this file may be used under the terms of
26 : * either of the GNU General Public License Version 2 or later (the "GPL"),
27 : * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 : * in which case the provisions of the GPL or the LGPL are applicable instead
29 : * of those above. If you wish to allow use of your version of this file only
30 : * under the terms of either the GPL or the LGPL, and not to allow others to
31 : * use your version of this file under the terms of the MPL, indicate your
32 : * decision by deleting the provisions above and replace them with the notice
33 : * and other provisions required by the GPL or the LGPL. If you do not delete
34 : * the provisions above, a recipient may use your version of this file under
35 : * the terms of any one of the MPL, the GPL or the LGPL.
36 : *
37 : * ***** END LICENSE BLOCK ***** */
38 :
39 : #ifndef NS_SMILNULLTYPE_H_
40 : #define NS_SMILNULLTYPE_H_
41 :
42 : #include "nsISMILType.h"
43 :
44 : class nsSMILNullType : public nsISMILType
45 : {
46 : public:
47 : // Singleton for nsSMILValue objects to hold onto.
48 : static nsSMILNullType sSingleton;
49 :
50 : protected:
51 : // nsISMILType Methods
52 : // -------------------
53 0 : virtual void Init(nsSMILValue& aValue) const {}
54 0 : virtual void Destroy(nsSMILValue& aValue) const {}
55 : virtual nsresult Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const;
56 :
57 : // The remaining methods should never be called, so although they're very
58 : // simple they don't need to be inline.
59 : virtual bool IsEqual(const nsSMILValue& aLeft,
60 : const nsSMILValue& aRight) const;
61 : virtual nsresult Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
62 : PRUint32 aCount) const;
63 : virtual nsresult ComputeDistance(const nsSMILValue& aFrom,
64 : const nsSMILValue& aTo,
65 : double& aDistance) const;
66 : virtual nsresult Interpolate(const nsSMILValue& aStartVal,
67 : const nsSMILValue& aEndVal,
68 : double aUnitDistance,
69 : nsSMILValue& aResult) const;
70 :
71 : private:
72 : // Private constructor & destructor: prevent instances beyond my singleton,
73 : // and prevent others from deleting my singleton.
74 1464 : nsSMILNullType() {}
75 1487 : ~nsSMILNullType() {}
76 : };
77 :
78 : #endif // NS_SMILNULLTYPE_H_
|