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 SVG project.
16 : *
17 : * The Initial Developer of the Original Code is
18 : * the Mozilla Corporation.
19 : * Portions created by the Initial Developer are Copyright (C) 2008
20 : * the Initial Developer. All Rights Reserved.
21 : *
22 : * Contributor(s):
23 : * Daniel Holbert <dholbert@mozilla.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_ISMILANIMATIONELEMENT_H_
40 : #define NS_ISMILANIMATIONELEMENT_H_
41 :
42 : #include "nsISupports.h"
43 :
44 : //////////////////////////////////////////////////////////////////////////////
45 : // nsISMILAnimationElement: Interface for elements that control the animation of
46 : // some property of another element, e.g. <animate>, <set>.
47 :
48 : #define NS_ISMILANIMATIONELEMENT_IID \
49 : { 0x29792cd9, 0x0f96, 0x4ba6, \
50 : { 0xad, 0xea, 0x03, 0x0e, 0x0b, 0xfe, 0x1e, 0xb7 } }
51 :
52 : class nsISMILAttr;
53 : class nsSMILAnimationFunction;
54 : class nsSMILTimeContainer;
55 : class nsSMILTimedElement;
56 : class nsIAtom;
57 : class nsAttrValue;
58 :
59 : namespace mozilla {
60 : namespace dom {
61 : class Element;
62 : } // namespace dom
63 : } // namespace mozilla
64 :
65 : enum nsSMILTargetAttrType {
66 : eSMILTargetAttrType_auto,
67 : eSMILTargetAttrType_CSS,
68 : eSMILTargetAttrType_XML
69 : };
70 :
71 : class nsISMILAnimationElement : public nsISupports
72 0 : {
73 : public:
74 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISMILANIMATIONELEMENT_IID)
75 :
76 : /*
77 : * Returns this element as a mozilla::dom::Element.
78 : */
79 : virtual const mozilla::dom::Element& AsElement() const = 0;
80 :
81 : /*
82 : * Non-const version of Element()
83 : */
84 : virtual mozilla::dom::Element& AsElement() = 0;
85 :
86 : /*
87 : * Returns true if the element passes conditional processing
88 : */
89 : virtual bool PassesConditionalProcessingTests() = 0;
90 :
91 : /*
92 : * Returns the source attribute as an nsAttrValue. The global namespace will
93 : * be used.
94 : *
95 : * (The 'Anim' here and below is largely to avoid conflicts for subclasses
96 : * that derive from nsGenericElement)
97 : *
98 : * @param aName the name of the attr
99 : * @returns true if the attribute was set (even when set to empty string)
100 : * false when not set.
101 : */
102 : virtual const nsAttrValue* GetAnimAttr(nsIAtom* aName) const = 0;
103 :
104 : /*
105 : * Get the current value of an attribute as a string. The global namespace
106 : * will be used.
107 : *
108 : * @param aName the name of the attr
109 : * @param aResult the value (may legitimately be the empty string) [OUT]
110 : * @returns true if the attribute was set (even when set to empty string)
111 : * false when not set.
112 : */
113 : virtual bool GetAnimAttr(nsIAtom* aAttName, nsAString& aResult) const = 0;
114 :
115 : /*
116 : * Check for the presence of an attribute in the global namespace.
117 : */
118 : virtual bool HasAnimAttr(nsIAtom* aAttName) const = 0;
119 :
120 : /*
121 : * Returns the target (animated) element.
122 : */
123 : virtual mozilla::dom::Element* GetTargetElementContent() = 0;
124 :
125 : /*
126 : * Returns the name of the target (animated) attribute or property.
127 : */
128 : virtual bool GetTargetAttributeName(PRInt32* aNamespaceID,
129 : nsIAtom** aLocalName) const = 0;
130 :
131 : /*
132 : * Returns the type of the target (animated) attribute or property.
133 : */
134 : virtual nsSMILTargetAttrType GetTargetAttributeType() const = 0;
135 :
136 : /*
137 : * Returns the SMIL animation function associated with this animation element.
138 : *
139 : * The animation function is owned by the animation element.
140 : */
141 : virtual nsSMILAnimationFunction& AnimationFunction() = 0;
142 :
143 : /*
144 : * Returns the SMIL timed element associated with this animation element.
145 : *
146 : * The timed element is owned by the animation element.
147 : */
148 : virtual nsSMILTimedElement& TimedElement() = 0;
149 :
150 : /*
151 : * Returns the SMIL timed container root with which this animation element is
152 : * associated (if any).
153 : */
154 : virtual nsSMILTimeContainer* GetTimeContainer() = 0;
155 : };
156 :
157 : NS_DEFINE_STATIC_IID_ACCESSOR(nsISMILAnimationElement,
158 : NS_ISMILANIMATIONELEMENT_IID)
159 :
160 : #endif // NS_ISMILANIMATIONELEMENT_H_
|