19f4ab948SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
39f4ab948SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
49f4ab948SAndrew Rist * or more contributor license agreements. See the NOTICE file
59f4ab948SAndrew Rist * distributed with this work for additional information
69f4ab948SAndrew Rist * regarding copyright ownership. The ASF licenses this file
79f4ab948SAndrew Rist * to you under the Apache License, Version 2.0 (the
89f4ab948SAndrew Rist * "License"); you may not use this file except in compliance
99f4ab948SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
119f4ab948SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
139f4ab948SAndrew Rist * Unless required by applicable law or agreed to in writing,
149f4ab948SAndrew Rist * software distributed under the License is distributed on an
159f4ab948SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
169f4ab948SAndrew Rist * KIND, either express or implied. See the License for the
179f4ab948SAndrew Rist * specific language governing permissions and limitations
189f4ab948SAndrew Rist * under the License.
19cdf0e10cSrcweir *
209f4ab948SAndrew Rist *************************************************************/
219f4ab948SAndrew Rist
229f4ab948SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #include <com/sun/star/util/XCloneable.hpp>
25cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
26cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
27cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
28cdf0e10cSrcweir #include <com/sun/star/animations/XAnimateColor.hpp>
29cdf0e10cSrcweir #include <com/sun/star/animations/XAnimateSet.hpp>
30cdf0e10cSrcweir #include <com/sun/star/animations/XAnimateMotion.hpp>
31cdf0e10cSrcweir #include <com/sun/star/animations/XAnimateTransform.hpp>
32cdf0e10cSrcweir #include <com/sun/star/animations/XTransitionFilter.hpp>
33cdf0e10cSrcweir #include <com/sun/star/animations/XTimeContainer.hpp>
34cdf0e10cSrcweir #include <com/sun/star/animations/XIterateContainer.hpp>
35cdf0e10cSrcweir #include <com/sun/star/animations/XAudio.hpp>
36cdf0e10cSrcweir #include <com/sun/star/animations/XCommand.hpp>
37cdf0e10cSrcweir #include <com/sun/star/animations/AnimationNodeType.hpp>
38cdf0e10cSrcweir #include <com/sun/star/animations/AnimationCalcMode.hpp>
39cdf0e10cSrcweir #include <com/sun/star/animations/AnimationFill.hpp>
40cdf0e10cSrcweir #include <com/sun/star/animations/AnimationRestart.hpp>
41cdf0e10cSrcweir #include <com/sun/star/animations/AnimationColorSpace.hpp>
42cdf0e10cSrcweir #include <com/sun/star/animations/AnimationAdditiveMode.hpp>
43cdf0e10cSrcweir #include <com/sun/star/animations/AnimationTransformType.hpp>
44cdf0e10cSrcweir #include <com/sun/star/animations/TransitionType.hpp>
45cdf0e10cSrcweir #include <com/sun/star/animations/TransitionSubType.hpp>
46cdf0e10cSrcweir #include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
47cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp>
48cdf0e10cSrcweir #include <com/sun/star/beans/NamedValue.hpp>
49cdf0e10cSrcweir #include <com/sun/star/util/XChangesNotifier.hpp>
50cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
51cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
52f59b791fSJian Fang Zhang #include <cppuhelper/weakref.hxx>
53cdf0e10cSrcweir
54cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
55cdf0e10cSrcweir #include <rtl/uuid.h>
56cdf0e10cSrcweir
57cdf0e10cSrcweir #include <osl/mutex.hxx>
58cdf0e10cSrcweir #include <list>
59cdf0e10cSrcweir #include <algorithm>
60cdf0e10cSrcweir
61cdf0e10cSrcweir using ::osl::Mutex;
62cdf0e10cSrcweir using ::osl::Guard;
63cdf0e10cSrcweir using ::rtl::OUString;
64cdf0e10cSrcweir using ::cppu::OInterfaceContainerHelper;
65cdf0e10cSrcweir using ::cppu::OInterfaceIteratorHelper;
66cdf0e10cSrcweir using ::com::sun::star::uno::Any;
67cdf0e10cSrcweir using ::com::sun::star::uno::UNO_QUERY;
68cdf0e10cSrcweir using ::com::sun::star::uno::XInterface;
69cdf0e10cSrcweir using ::com::sun::star::uno::RuntimeException;
70cdf0e10cSrcweir using ::com::sun::star::uno::Sequence;
71cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
72f59b791fSJian Fang Zhang using ::com::sun::star::uno::WeakReference;
73cdf0e10cSrcweir using ::com::sun::star::uno::XComponentContext;
74cdf0e10cSrcweir using ::com::sun::star::uno::Exception;
75cdf0e10cSrcweir using ::com::sun::star::uno::XWeak;
76cdf0e10cSrcweir using ::com::sun::star::uno::Type;
77cdf0e10cSrcweir using ::com::sun::star::uno::makeAny;
78cdf0e10cSrcweir using ::com::sun::star::lang::NoSupportException;
79cdf0e10cSrcweir using ::com::sun::star::lang::IllegalArgumentException;
80cdf0e10cSrcweir using ::com::sun::star::lang::WrappedTargetException;
81cdf0e10cSrcweir using ::com::sun::star::lang::NoSupportException;
82cdf0e10cSrcweir using ::com::sun::star::lang::XServiceInfo;
83cdf0e10cSrcweir using ::com::sun::star::lang::XTypeProvider;
84cdf0e10cSrcweir using ::com::sun::star::container::NoSuchElementException;
85cdf0e10cSrcweir using ::com::sun::star::container::ElementExistException;
86cdf0e10cSrcweir using ::com::sun::star::container::XEnumeration;
87cdf0e10cSrcweir using ::com::sun::star::container::XEnumerationAccess;
88cdf0e10cSrcweir using ::com::sun::star::beans::NamedValue;
89cdf0e10cSrcweir using ::com::sun::star::util::XCloneable;
90cdf0e10cSrcweir using ::com::sun::star::lang::XUnoTunnel;
91cdf0e10cSrcweir using ::com::sun::star::util::XChangesNotifier;
92cdf0e10cSrcweir using ::com::sun::star::util::XChangesListener;
93cdf0e10cSrcweir using ::com::sun::star::util::ElementChange;
94cdf0e10cSrcweir using ::com::sun::star::util::ChangesEvent;
95cdf0e10cSrcweir
96cdf0e10cSrcweir using ::cppu::OWeakObject;
97cdf0e10cSrcweir
98cdf0e10cSrcweir using namespace ::com::sun::star::animations;
99cdf0e10cSrcweir using namespace ::com::sun::star::animations::AnimationNodeType;
100cdf0e10cSrcweir
101cdf0e10cSrcweir namespace animcore
102cdf0e10cSrcweir {
103cdf0e10cSrcweir
104cdf0e10cSrcweir // ====================================================================
105cdf0e10cSrcweir
106cdf0e10cSrcweir typedef ::std::list< Reference< XAnimationNode > > ChildList_t;
107cdf0e10cSrcweir
108cdf0e10cSrcweir // ====================================================================
109cdf0e10cSrcweir
110cdf0e10cSrcweir class AnimationNodeBase : public XAnimateMotion,
111cdf0e10cSrcweir public XAnimateColor,
112cdf0e10cSrcweir public XTransitionFilter,
113cdf0e10cSrcweir public XAnimateSet,
114cdf0e10cSrcweir public XAnimateTransform,
115cdf0e10cSrcweir public XIterateContainer,
116cdf0e10cSrcweir public XEnumerationAccess,
117cdf0e10cSrcweir public XServiceInfo,
118cdf0e10cSrcweir public XTypeProvider,
119cdf0e10cSrcweir public XAudio,
120cdf0e10cSrcweir public XCommand,
121cdf0e10cSrcweir public XCloneable,
122cdf0e10cSrcweir public XChangesNotifier,
123cdf0e10cSrcweir public XUnoTunnel,
124cdf0e10cSrcweir public OWeakObject
125cdf0e10cSrcweir {
126cdf0e10cSrcweir public:
127cdf0e10cSrcweir // our first, last and only protection from mutli-threads!
128cdf0e10cSrcweir Mutex maMutex;
129cdf0e10cSrcweir };
130cdf0e10cSrcweir
131cdf0e10cSrcweir class AnimationNode : public AnimationNodeBase
132cdf0e10cSrcweir {
133cdf0e10cSrcweir public:
134cdf0e10cSrcweir AnimationNode( sal_Int16 nNodeType );
135cdf0e10cSrcweir AnimationNode( const AnimationNode& rNode );
136cdf0e10cSrcweir virtual ~AnimationNode();
137cdf0e10cSrcweir
138cdf0e10cSrcweir // XInterface
139cdf0e10cSrcweir virtual Any SAL_CALL queryInterface( const Type& aType ) throw (RuntimeException);
140cdf0e10cSrcweir virtual void SAL_CALL acquire() throw ();
141cdf0e10cSrcweir virtual void SAL_CALL release() throw ();
142cdf0e10cSrcweir
143cdf0e10cSrcweir // XTypeProvider
144cdf0e10cSrcweir virtual Sequence< Type > SAL_CALL getTypes() throw (RuntimeException);
145cdf0e10cSrcweir virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (RuntimeException);
146cdf0e10cSrcweir
147cdf0e10cSrcweir // XServiceInfo
148cdf0e10cSrcweir OUString SAL_CALL getImplementationName() throw();
149cdf0e10cSrcweir Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw();
150cdf0e10cSrcweir sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw();
151cdf0e10cSrcweir
152cdf0e10cSrcweir // XChild
153cdf0e10cSrcweir virtual Reference< XInterface > SAL_CALL getParent() throw (RuntimeException);
154cdf0e10cSrcweir virtual void SAL_CALL setParent( const Reference< XInterface >& Parent ) throw (NoSupportException, RuntimeException);
155cdf0e10cSrcweir
156cdf0e10cSrcweir // XCloneable
157cdf0e10cSrcweir virtual Reference< XCloneable > SAL_CALL createClone() throw (RuntimeException);
158cdf0e10cSrcweir
159cdf0e10cSrcweir // XAnimationNode
160cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getType() throw (RuntimeException);
161cdf0e10cSrcweir virtual Any SAL_CALL getBegin() throw (RuntimeException);
162cdf0e10cSrcweir virtual void SAL_CALL setBegin( const Any& _begin ) throw (RuntimeException);
163cdf0e10cSrcweir virtual Any SAL_CALL getDuration() throw (RuntimeException);
164cdf0e10cSrcweir virtual void SAL_CALL setDuration( const Any& _duration ) throw (RuntimeException);
165cdf0e10cSrcweir virtual Any SAL_CALL getEnd() throw (RuntimeException);
166cdf0e10cSrcweir virtual void SAL_CALL setEnd( const Any& _end ) throw (RuntimeException);
167cdf0e10cSrcweir virtual Any SAL_CALL getEndSync() throw (RuntimeException);
168cdf0e10cSrcweir virtual void SAL_CALL setEndSync( const Any& _endsync ) throw (RuntimeException);
169cdf0e10cSrcweir virtual Any SAL_CALL getRepeatCount() throw (RuntimeException);
170cdf0e10cSrcweir virtual void SAL_CALL setRepeatCount( const Any& _repeatcount ) throw (RuntimeException);
171cdf0e10cSrcweir virtual Any SAL_CALL getRepeatDuration() throw (RuntimeException);
172cdf0e10cSrcweir virtual void SAL_CALL setRepeatDuration( const Any& _repeatduration ) throw (RuntimeException);
173cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getFill() throw (RuntimeException);
174cdf0e10cSrcweir virtual void SAL_CALL setFill( sal_Int16 _fill ) throw (RuntimeException);
175cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getFillDefault() throw (RuntimeException);
176cdf0e10cSrcweir virtual void SAL_CALL setFillDefault( sal_Int16 _filldefault ) throw (RuntimeException);
177cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getRestart() throw (RuntimeException);
178cdf0e10cSrcweir virtual void SAL_CALL setRestart( sal_Int16 _restart ) throw (RuntimeException);
179cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getRestartDefault() throw (RuntimeException);
180cdf0e10cSrcweir virtual void SAL_CALL setRestartDefault( sal_Int16 _restartdefault ) throw (RuntimeException);
181cdf0e10cSrcweir virtual double SAL_CALL getAcceleration() throw (RuntimeException);
182cdf0e10cSrcweir virtual void SAL_CALL setAcceleration( double _acceleration ) throw (RuntimeException);
183cdf0e10cSrcweir virtual double SAL_CALL getDecelerate() throw (RuntimeException);
184cdf0e10cSrcweir virtual void SAL_CALL setDecelerate( double _decelerate ) throw (RuntimeException);
185cdf0e10cSrcweir virtual sal_Bool SAL_CALL getAutoReverse() throw (RuntimeException);
186cdf0e10cSrcweir virtual void SAL_CALL setAutoReverse( sal_Bool _autoreverse ) throw (RuntimeException);
187cdf0e10cSrcweir virtual Sequence< NamedValue > SAL_CALL getUserData() throw (RuntimeException);
188cdf0e10cSrcweir virtual void SAL_CALL setUserData( const Sequence< NamedValue >& _userdata ) throw (RuntimeException);
189cdf0e10cSrcweir
190cdf0e10cSrcweir // XAnimate
191cdf0e10cSrcweir virtual Any SAL_CALL getTarget() throw (RuntimeException);
192cdf0e10cSrcweir virtual void SAL_CALL setTarget( const Any& _target ) throw (RuntimeException);
193cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getSubItem() throw (RuntimeException);
194cdf0e10cSrcweir virtual void SAL_CALL setSubItem( sal_Int16 _subitem ) throw (RuntimeException);
195cdf0e10cSrcweir virtual OUString SAL_CALL getAttributeName() throw (RuntimeException);
196cdf0e10cSrcweir virtual void SAL_CALL setAttributeName( const OUString& _attribute ) throw (RuntimeException);
197cdf0e10cSrcweir virtual Sequence< Any > SAL_CALL getValues() throw (RuntimeException);
198cdf0e10cSrcweir virtual void SAL_CALL setValues( const Sequence< Any >& _values ) throw (RuntimeException);
199cdf0e10cSrcweir virtual Sequence< double > SAL_CALL getKeyTimes() throw (RuntimeException);
200cdf0e10cSrcweir virtual void SAL_CALL setKeyTimes( const Sequence< double >& _keytimes ) throw (RuntimeException);
201cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getValueType() throw (RuntimeException);
202cdf0e10cSrcweir virtual void SAL_CALL setValueType( sal_Int16 _valuetype ) throw (RuntimeException);
203cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getCalcMode() throw (RuntimeException);
204cdf0e10cSrcweir virtual void SAL_CALL setCalcMode( sal_Int16 _calcmode ) throw (RuntimeException);
205cdf0e10cSrcweir virtual sal_Bool SAL_CALL getAccumulate() throw (RuntimeException);
206cdf0e10cSrcweir virtual void SAL_CALL setAccumulate( sal_Bool _accumulate ) throw (RuntimeException);
207cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getAdditive() throw (RuntimeException);
208cdf0e10cSrcweir virtual void SAL_CALL setAdditive( sal_Int16 _additive ) throw (RuntimeException);
209cdf0e10cSrcweir virtual Any SAL_CALL getFrom() throw (RuntimeException);
210cdf0e10cSrcweir virtual void SAL_CALL setFrom( const Any& _from ) throw (RuntimeException);
211cdf0e10cSrcweir virtual Any SAL_CALL getTo() throw (RuntimeException);
212cdf0e10cSrcweir virtual void SAL_CALL setTo( const Any& _to ) throw (RuntimeException);
213cdf0e10cSrcweir virtual Any SAL_CALL getBy() throw (RuntimeException);
214cdf0e10cSrcweir virtual void SAL_CALL setBy( const Any& _by ) throw (RuntimeException);
215cdf0e10cSrcweir virtual Sequence< TimeFilterPair > SAL_CALL getTimeFilter() throw (RuntimeException);
216cdf0e10cSrcweir virtual void SAL_CALL setTimeFilter( const Sequence< TimeFilterPair >& _timefilter ) throw (RuntimeException);
217cdf0e10cSrcweir virtual OUString SAL_CALL getFormula() throw (RuntimeException);
218cdf0e10cSrcweir virtual void SAL_CALL setFormula( const OUString& _formula ) throw (RuntimeException);
219cdf0e10cSrcweir
220cdf0e10cSrcweir // XAnimateColor
221cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getColorInterpolation() throw (RuntimeException);
222cdf0e10cSrcweir virtual void SAL_CALL setColorInterpolation( sal_Int16 _colorspace ) throw (RuntimeException);
223cdf0e10cSrcweir virtual sal_Bool SAL_CALL getDirection() throw (RuntimeException);
224cdf0e10cSrcweir virtual void SAL_CALL setDirection( sal_Bool _direction ) throw (RuntimeException);
225cdf0e10cSrcweir
226cdf0e10cSrcweir // XAnimateMotion
227cdf0e10cSrcweir virtual Any SAL_CALL getPath() throw (RuntimeException);
228cdf0e10cSrcweir virtual void SAL_CALL setPath( const Any& _path ) throw (RuntimeException);
229cdf0e10cSrcweir virtual Any SAL_CALL getOrigin() throw (RuntimeException);
230cdf0e10cSrcweir virtual void SAL_CALL setOrigin( const Any& _origin ) throw (RuntimeException);
231cdf0e10cSrcweir
232cdf0e10cSrcweir // XAnimateTransform
233cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getTransformType() throw (RuntimeException);
234cdf0e10cSrcweir virtual void SAL_CALL setTransformType( sal_Int16 _transformtype ) throw (RuntimeException);
235cdf0e10cSrcweir
236cdf0e10cSrcweir // XTransitionFilter
237cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getTransition() throw (RuntimeException);
238cdf0e10cSrcweir virtual void SAL_CALL setTransition( sal_Int16 _transition ) throw (RuntimeException);
239cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getSubtype() throw (RuntimeException);
240cdf0e10cSrcweir virtual void SAL_CALL setSubtype( sal_Int16 _subtype ) throw (RuntimeException);
241cdf0e10cSrcweir virtual sal_Bool SAL_CALL getMode() throw (RuntimeException);
242cdf0e10cSrcweir virtual void SAL_CALL setMode( sal_Bool _mode ) throw (RuntimeException);
243cdf0e10cSrcweir // virtual sal_Bool SAL_CALL getDirection() throw (RuntimeException);
244cdf0e10cSrcweir // virtual void SAL_CALL setDirection( sal_Bool _direction ) throw (RuntimeException);
245cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getFadeColor() throw (RuntimeException);
246cdf0e10cSrcweir virtual void SAL_CALL setFadeColor( sal_Int32 _fadecolor ) throw (RuntimeException);
247cdf0e10cSrcweir
248cdf0e10cSrcweir // XAudio
249cdf0e10cSrcweir virtual Any SAL_CALL getSource() throw (RuntimeException);
250cdf0e10cSrcweir virtual void SAL_CALL setSource( const Any& _source ) throw (RuntimeException);
251cdf0e10cSrcweir virtual double SAL_CALL getVolume() throw (RuntimeException);
252cdf0e10cSrcweir virtual void SAL_CALL setVolume( double _volume ) throw (RuntimeException);
253cdf0e10cSrcweir
254cdf0e10cSrcweir
255cdf0e10cSrcweir // XCommand
256cdf0e10cSrcweir // virtual Any SAL_CALL getTarget() throw (RuntimeException);
257cdf0e10cSrcweir // virtual void SAL_CALL setTarget( const Any& _target ) throw (RuntimeException);
258cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getCommand() throw (RuntimeException);
259cdf0e10cSrcweir virtual void SAL_CALL setCommand( sal_Int16 _command ) throw (RuntimeException);
260cdf0e10cSrcweir virtual Any SAL_CALL getParameter() throw (RuntimeException);
261cdf0e10cSrcweir virtual void SAL_CALL setParameter( const Any& _parameter ) throw (RuntimeException);
262cdf0e10cSrcweir
263cdf0e10cSrcweir // XElementAccess
264cdf0e10cSrcweir virtual Type SAL_CALL getElementType() throw (RuntimeException);
265cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() throw (RuntimeException);
266cdf0e10cSrcweir
267cdf0e10cSrcweir // XEnumerationAccess
268cdf0e10cSrcweir virtual Reference< XEnumeration > SAL_CALL createEnumeration() throw (RuntimeException);
269cdf0e10cSrcweir
270cdf0e10cSrcweir // XTimeContainer
271cdf0e10cSrcweir virtual Reference< XAnimationNode > SAL_CALL insertBefore( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& refChild ) throw (IllegalArgumentException, NoSuchElementException, ElementExistException, WrappedTargetException, RuntimeException);
272cdf0e10cSrcweir virtual Reference< XAnimationNode > SAL_CALL insertAfter( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& refChild ) throw (IllegalArgumentException, NoSuchElementException, ElementExistException, WrappedTargetException, RuntimeException);
273cdf0e10cSrcweir virtual Reference< XAnimationNode > SAL_CALL replaceChild( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& oldChild ) throw( IllegalArgumentException, NoSuchElementException, ElementExistException, WrappedTargetException, RuntimeException);
274cdf0e10cSrcweir virtual Reference< XAnimationNode > SAL_CALL removeChild( const Reference< XAnimationNode >& oldChild ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException);
275cdf0e10cSrcweir virtual Reference< XAnimationNode > SAL_CALL appendChild( const Reference< XAnimationNode >& newChild ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException);
276cdf0e10cSrcweir
277cdf0e10cSrcweir // XIterateContainer
278cdf0e10cSrcweir virtual sal_Int16 SAL_CALL getIterateType() throw (RuntimeException);
279cdf0e10cSrcweir virtual void SAL_CALL setIterateType( sal_Int16 _iteratetype ) throw (RuntimeException);
280cdf0e10cSrcweir virtual double SAL_CALL getIterateInterval() throw (RuntimeException);
281cdf0e10cSrcweir virtual void SAL_CALL setIterateInterval( double _iterateinterval ) throw (RuntimeException);
282cdf0e10cSrcweir
283cdf0e10cSrcweir // XChangesNotifier
284cdf0e10cSrcweir virtual void SAL_CALL addChangesListener( const Reference< XChangesListener >& aListener ) throw (RuntimeException);
285cdf0e10cSrcweir virtual void SAL_CALL removeChangesListener( const Reference< XChangesListener >& aListener ) throw (RuntimeException);
286cdf0e10cSrcweir
287cdf0e10cSrcweir // XUnoTunnel
288cdf0e10cSrcweir virtual ::sal_Int64 SAL_CALL getSomething( const Sequence< ::sal_Int8 >& aIdentifier ) throw (RuntimeException);
289cdf0e10cSrcweir
290cdf0e10cSrcweir static const Sequence< sal_Int8 > & getUnoTunnelId();
291cdf0e10cSrcweir void fireChangeListener();
292cdf0e10cSrcweir
293cdf0e10cSrcweir private:
294cdf0e10cSrcweir OInterfaceContainerHelper maChangeListener;
295cdf0e10cSrcweir
296cdf0e10cSrcweir static void initTypeProvider( sal_Int16 nNodeType ) throw();
297cdf0e10cSrcweir
298cdf0e10cSrcweir const sal_Int16 mnNodeType;
299cdf0e10cSrcweir
300cdf0e10cSrcweir // for XTypeProvider
301cdf0e10cSrcweir static Sequence< Type >* mpTypes[12];
302cdf0e10cSrcweir static Sequence< sal_Int8 >* mpId[12];
303cdf0e10cSrcweir
304cdf0e10cSrcweir // attributes for the XAnimationNode interface implementation
305cdf0e10cSrcweir Any maBegin, maDuration, maEnd, maEndSync, maRepeatCount, maRepeatDuration;
306cdf0e10cSrcweir sal_Int16 mnFill, mnFillDefault, mnRestart, mnRestartDefault;
307cdf0e10cSrcweir double mfAcceleration, mfDecelerate;
308cdf0e10cSrcweir sal_Bool mbAutoReverse;
309cdf0e10cSrcweir Sequence< NamedValue > maUserData;
310cdf0e10cSrcweir
311cdf0e10cSrcweir // parent interface for XChild interface implementation
312f59b791fSJian Fang Zhang WeakReference<XInterface> mxParent;
313cdf0e10cSrcweir AnimationNode* mpParent;
314cdf0e10cSrcweir
315cdf0e10cSrcweir // attributes for XAnimate
316cdf0e10cSrcweir Any maTarget;
317cdf0e10cSrcweir OUString maAttributeName, maFormula;
318cdf0e10cSrcweir Sequence< Any > maValues;
319cdf0e10cSrcweir Sequence< double > maKeyTimes;
320cdf0e10cSrcweir sal_Int16 mnValueType, mnSubItem;
321cdf0e10cSrcweir sal_Int16 mnCalcMode, mnAdditive;
322cdf0e10cSrcweir sal_Bool mbAccumulate;
323cdf0e10cSrcweir Any maFrom, maTo, maBy;
324cdf0e10cSrcweir Sequence< TimeFilterPair > maTimeFilter;
325cdf0e10cSrcweir
326cdf0e10cSrcweir // attributes for XAnimateColor
327cdf0e10cSrcweir sal_Int16 mnColorSpace;
328cdf0e10cSrcweir sal_Bool mbDirection;
329cdf0e10cSrcweir
330cdf0e10cSrcweir // atributes for XAnimateMotion
331cdf0e10cSrcweir Any maPath, maOrigin;
332cdf0e10cSrcweir
333cdf0e10cSrcweir // attributes for XAnimateTransform
334cdf0e10cSrcweir sal_Int16 mnTransformType;
335cdf0e10cSrcweir
336cdf0e10cSrcweir // attributes for XTransitionFilter
337cdf0e10cSrcweir sal_Int16 mnTransition;
338cdf0e10cSrcweir sal_Int16 mnSubtype;
339cdf0e10cSrcweir sal_Bool mbMode;
340cdf0e10cSrcweir sal_Int32 mnFadeColor;
341cdf0e10cSrcweir
342cdf0e10cSrcweir // XAudio
343cdf0e10cSrcweir double mfVolume;
344cdf0e10cSrcweir
345cdf0e10cSrcweir // XCommand
346cdf0e10cSrcweir sal_Int16 mnCommand;
347cdf0e10cSrcweir Any maParameter;
348cdf0e10cSrcweir
349cdf0e10cSrcweir // XIterateContainer
350cdf0e10cSrcweir sal_Int16 mnIterateType;
351cdf0e10cSrcweir double mfIterateInterval;
352cdf0e10cSrcweir
353cdf0e10cSrcweir /** sorted list of child nodes for XTimeContainer*/
354cdf0e10cSrcweir ChildList_t maChilds;
355cdf0e10cSrcweir };
356cdf0e10cSrcweir
357cdf0e10cSrcweir // ====================================================================
358cdf0e10cSrcweir
359cdf0e10cSrcweir class TimeContainerEnumeration : public ::cppu::WeakImplHelper1< XEnumeration >
360cdf0e10cSrcweir {
361cdf0e10cSrcweir public:
362cdf0e10cSrcweir TimeContainerEnumeration( const ChildList_t &rChilds );
363cdf0e10cSrcweir virtual ~TimeContainerEnumeration();
364cdf0e10cSrcweir
365cdf0e10cSrcweir // Methods
366cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasMoreElements() throw (RuntimeException);
367cdf0e10cSrcweir virtual Any SAL_CALL nextElement( ) throw (NoSuchElementException, WrappedTargetException, RuntimeException);
368cdf0e10cSrcweir
369cdf0e10cSrcweir private:
370cdf0e10cSrcweir /** sorted list of child nodes */
371cdf0e10cSrcweir ChildList_t maChilds;
372cdf0e10cSrcweir
373cdf0e10cSrcweir /** current iteration position */
374cdf0e10cSrcweir ChildList_t::iterator maIter;
375cdf0e10cSrcweir
376cdf0e10cSrcweir /** our first, last and only protection from mutli-threads! */
377cdf0e10cSrcweir Mutex maMutex;
378cdf0e10cSrcweir };
379cdf0e10cSrcweir
TimeContainerEnumeration(const ChildList_t & rChilds)380cdf0e10cSrcweir TimeContainerEnumeration::TimeContainerEnumeration( const ChildList_t &rChilds )
381cdf0e10cSrcweir : maChilds( rChilds )
382cdf0e10cSrcweir {
383cdf0e10cSrcweir maIter = maChilds.begin();
384cdf0e10cSrcweir }
385cdf0e10cSrcweir
~TimeContainerEnumeration()386cdf0e10cSrcweir TimeContainerEnumeration::~TimeContainerEnumeration()
387cdf0e10cSrcweir {
388cdf0e10cSrcweir }
389cdf0e10cSrcweir
390cdf0e10cSrcweir // Methods
hasMoreElements()391cdf0e10cSrcweir sal_Bool SAL_CALL TimeContainerEnumeration::hasMoreElements() throw (RuntimeException)
392cdf0e10cSrcweir {
393cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
394cdf0e10cSrcweir
395cdf0e10cSrcweir return maIter != maChilds.end();
396cdf0e10cSrcweir }
397cdf0e10cSrcweir
nextElement()398cdf0e10cSrcweir Any SAL_CALL TimeContainerEnumeration::nextElement()
399cdf0e10cSrcweir throw (NoSuchElementException, WrappedTargetException, RuntimeException)
400cdf0e10cSrcweir {
401cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
402cdf0e10cSrcweir
403cdf0e10cSrcweir if( maIter == maChilds.end() )
404cdf0e10cSrcweir throw NoSuchElementException();
405cdf0e10cSrcweir
406cdf0e10cSrcweir return makeAny( (*maIter++) );
407cdf0e10cSrcweir }
408cdf0e10cSrcweir
409cdf0e10cSrcweir // ====================================================================
410cdf0e10cSrcweir
411cdf0e10cSrcweir Sequence< Type >* AnimationNode::mpTypes[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
412cdf0e10cSrcweir Sequence< sal_Int8 >* AnimationNode::mpId[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
413cdf0e10cSrcweir
AnimationNode(sal_Int16 nNodeType)414cdf0e10cSrcweir AnimationNode::AnimationNode( sal_Int16 nNodeType )
415cdf0e10cSrcweir : maChangeListener(maMutex),
416cdf0e10cSrcweir mnNodeType( nNodeType ),
417cdf0e10cSrcweir mnFill( AnimationFill::DEFAULT ),
418cdf0e10cSrcweir mnFillDefault( AnimationFill::INHERIT ),
419cdf0e10cSrcweir mnRestart( AnimationRestart:: DEFAULT ),
420cdf0e10cSrcweir mnRestartDefault( AnimationRestart:: INHERIT ),
421cdf0e10cSrcweir mfAcceleration( 0.0 ),
422cdf0e10cSrcweir mfDecelerate( 0.0 ),
423cdf0e10cSrcweir mbAutoReverse( sal_False ),
424cdf0e10cSrcweir mpParent(0),
425cdf0e10cSrcweir mnValueType( 0 ),
426cdf0e10cSrcweir mnSubItem( 0 ),
427cdf0e10cSrcweir mnCalcMode( (nNodeType == AnimationNodeType::ANIMATEMOTION) ? AnimationCalcMode::PACED : AnimationCalcMode::LINEAR),
428cdf0e10cSrcweir mnAdditive(AnimationAdditiveMode::REPLACE),
429cdf0e10cSrcweir mbAccumulate(sal_False),
430cdf0e10cSrcweir mnColorSpace( AnimationColorSpace::RGB ),
431cdf0e10cSrcweir mbDirection( sal_True ),
432cdf0e10cSrcweir mnTransformType( AnimationTransformType::TRANSLATE ),
433cdf0e10cSrcweir mnTransition(TransitionType::BARWIPE),
434cdf0e10cSrcweir mnSubtype(TransitionSubType::DEFAULT),
435cdf0e10cSrcweir mbMode(true),
436cdf0e10cSrcweir mnFadeColor(0),
437cdf0e10cSrcweir mfVolume(1.0),
438cdf0e10cSrcweir mnCommand(0),
439cdf0e10cSrcweir mnIterateType( ::com::sun::star::presentation::ShapeAnimationSubType::AS_WHOLE ),
440cdf0e10cSrcweir mfIterateInterval(0.0)
441cdf0e10cSrcweir {
442cdf0e10cSrcweir OSL_ENSURE((sal_uInt32)nNodeType < sizeof(mpTypes)/sizeof(Sequence<Type>*), "NodeType out of range");
443cdf0e10cSrcweir }
444cdf0e10cSrcweir
AnimationNode(const AnimationNode & rNode)445cdf0e10cSrcweir AnimationNode::AnimationNode( const AnimationNode& rNode )
446cdf0e10cSrcweir : AnimationNodeBase(),
447cdf0e10cSrcweir maChangeListener(maMutex),
448cdf0e10cSrcweir mnNodeType( rNode.mnNodeType ),
449cdf0e10cSrcweir
450cdf0e10cSrcweir // attributes for the XAnimationNode interface implementation
451cdf0e10cSrcweir maBegin( rNode.maBegin ),
452cdf0e10cSrcweir maDuration( rNode.maDuration ),
453cdf0e10cSrcweir maEnd( rNode.maEnd ),
454cdf0e10cSrcweir maEndSync( rNode.maEndSync ),
455cdf0e10cSrcweir maRepeatCount( rNode.maRepeatCount ),
456cdf0e10cSrcweir maRepeatDuration( rNode.maRepeatDuration ),
457cdf0e10cSrcweir mnFill( rNode.mnFill ),
458cdf0e10cSrcweir mnFillDefault( rNode.mnFillDefault ),
459cdf0e10cSrcweir mnRestart( rNode.mnRestart ),
460cdf0e10cSrcweir mnRestartDefault( rNode.mnRestartDefault ),
461cdf0e10cSrcweir mfAcceleration( rNode.mfAcceleration ),
462cdf0e10cSrcweir mfDecelerate( rNode.mfDecelerate ),
463cdf0e10cSrcweir mbAutoReverse( rNode.mbAutoReverse ),
464cdf0e10cSrcweir maUserData( rNode.maUserData ),
465cdf0e10cSrcweir mpParent(0),
466cdf0e10cSrcweir
467cdf0e10cSrcweir // attributes for XAnimate
468cdf0e10cSrcweir maTarget( rNode.maTarget ),
469cdf0e10cSrcweir maAttributeName( rNode.maAttributeName ),
470cdf0e10cSrcweir maFormula( rNode.maFormula ),
471cdf0e10cSrcweir maValues( rNode.maValues ),
472cdf0e10cSrcweir maKeyTimes( rNode.maKeyTimes ),
473cdf0e10cSrcweir mnValueType( rNode.mnValueType ),
474cdf0e10cSrcweir mnSubItem( rNode.mnSubItem ),
475cdf0e10cSrcweir mnCalcMode( rNode.mnCalcMode ),
476cdf0e10cSrcweir mnAdditive( rNode.mnAdditive ),
477cdf0e10cSrcweir mbAccumulate( rNode.mbAccumulate ),
478cdf0e10cSrcweir maFrom( rNode.maFrom ),
479cdf0e10cSrcweir maTo( rNode.maTo ),
480cdf0e10cSrcweir maBy( rNode.maBy ),
481cdf0e10cSrcweir maTimeFilter( rNode.maTimeFilter ),
482cdf0e10cSrcweir
483cdf0e10cSrcweir // attributes for XAnimateColor
484cdf0e10cSrcweir mnColorSpace( rNode.mnColorSpace ),
485cdf0e10cSrcweir mbDirection( rNode.mbDirection ),
486cdf0e10cSrcweir
487cdf0e10cSrcweir // atributes for XAnimateMotion
488cdf0e10cSrcweir maPath( rNode.maPath ),
489cdf0e10cSrcweir maOrigin( rNode.maOrigin ),
490cdf0e10cSrcweir
491cdf0e10cSrcweir // attributes for XAnimateTransform
492cdf0e10cSrcweir mnTransformType( rNode.mnTransformType ),
493cdf0e10cSrcweir
494cdf0e10cSrcweir // attributes for XTransitionFilter
495cdf0e10cSrcweir mnTransition( rNode.mnTransition ),
496cdf0e10cSrcweir mnSubtype( rNode.mnSubtype ),
497cdf0e10cSrcweir mbMode( rNode.mbMode ),
498cdf0e10cSrcweir mnFadeColor( rNode.mnFadeColor ),
499cdf0e10cSrcweir
500cdf0e10cSrcweir // XAudio
501cdf0e10cSrcweir mfVolume( rNode.mfVolume ),
502cdf0e10cSrcweir
503cdf0e10cSrcweir // XCommand
504cdf0e10cSrcweir mnCommand( rNode.mnCommand ),
505cdf0e10cSrcweir maParameter( rNode.maParameter ),
506cdf0e10cSrcweir
507cdf0e10cSrcweir // XIterateContainer
508cdf0e10cSrcweir mnIterateType( rNode.mnIterateType ),
509cdf0e10cSrcweir mfIterateInterval( rNode.mfIterateInterval )
510cdf0e10cSrcweir {
511cdf0e10cSrcweir }
512cdf0e10cSrcweir
~AnimationNode()513cdf0e10cSrcweir AnimationNode::~AnimationNode()
514cdf0e10cSrcweir {
515cdf0e10cSrcweir }
516cdf0e10cSrcweir
517cdf0e10cSrcweir // --------------------------------------------------------------------
518cdf0e10cSrcweir
519cdf0e10cSrcweir #define IMPL_NODE_FACTORY(N,IN,SN)\
520cdf0e10cSrcweir Reference< XInterface > SAL_CALL createInstance_##N( const Reference< XComponentContext > & ) throw (Exception)\
521cdf0e10cSrcweir {\
522cdf0e10cSrcweir return Reference < XInterface > ( SAL_STATIC_CAST( ::cppu::OWeakObject * , new AnimationNode( N ) ) );\
523cdf0e10cSrcweir }\
524cdf0e10cSrcweir OUString getImplementationName_##N()\
525cdf0e10cSrcweir {\
526cdf0e10cSrcweir return OUString( RTL_CONSTASCII_USTRINGPARAM ( IN ) );\
527cdf0e10cSrcweir }\
528cdf0e10cSrcweir Sequence<OUString> getSupportedServiceNames_##N(void)\
529cdf0e10cSrcweir {\
530cdf0e10cSrcweir Sequence<OUString> aRet(1);\
531cdf0e10cSrcweir aRet.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( SN ));\
532cdf0e10cSrcweir return aRet;\
533cdf0e10cSrcweir }
534cdf0e10cSrcweir
535cdf0e10cSrcweir IMPL_NODE_FACTORY( PAR, "animcore::ParallelTimeContainer", "com.sun.star.animations.ParallelTimeContainer" )
536cdf0e10cSrcweir IMPL_NODE_FACTORY( SEQ, "animcore::SequenceTimeContainer", "com.sun.star.animations.SequenceTimeContainer" )
537cdf0e10cSrcweir IMPL_NODE_FACTORY( ITERATE, "animcore::IterateContainer", "com.sun.star.animations.IterateContainer" )
538cdf0e10cSrcweir IMPL_NODE_FACTORY( ANIMATE, "animcore::Animate", "com.sun.star.animations.Animate" )
539cdf0e10cSrcweir IMPL_NODE_FACTORY( SET, "animcore::AnimateSet", "com.sun.star.animations.AnimateSet" )
540cdf0e10cSrcweir IMPL_NODE_FACTORY( ANIMATECOLOR, "animcore::AnimateColor", "com.sun.star.animations.AnimateColor" )
541cdf0e10cSrcweir IMPL_NODE_FACTORY( ANIMATEMOTION, "animcore::AnimateMotion", "com.sun.star.animations.AnimateMotion" )
542cdf0e10cSrcweir IMPL_NODE_FACTORY( ANIMATETRANSFORM, "animcore::AnimateTransform", "com.sun.star.animations.AnimateTransform" )
543cdf0e10cSrcweir IMPL_NODE_FACTORY( TRANSITIONFILTER, "animcore::TransitionFilter", "com.sun.star.animations.TransitionFilter" )
544cdf0e10cSrcweir IMPL_NODE_FACTORY( AUDIO, "animcore::Audio", "com.sun.star.animations.Audio" );
545cdf0e10cSrcweir IMPL_NODE_FACTORY( COMMAND, "animcore::Command", "com.sun.star.animations.Command" );
546cdf0e10cSrcweir
547cdf0e10cSrcweir // --------------------------------------------------------------------
548cdf0e10cSrcweir
549cdf0e10cSrcweir // XInterface
queryInterface(const Type & aType)550cdf0e10cSrcweir Any SAL_CALL AnimationNode::queryInterface( const Type& aType ) throw (RuntimeException)
551cdf0e10cSrcweir {
552cdf0e10cSrcweir Any aRet( ::cppu::queryInterface(
553cdf0e10cSrcweir aType,
554cdf0e10cSrcweir static_cast< XServiceInfo * >( this ),
555cdf0e10cSrcweir static_cast< XTypeProvider * >( this ),
556cdf0e10cSrcweir static_cast< XChild * >( static_cast< XTimeContainer * >(this) ),
557cdf0e10cSrcweir static_cast< XCloneable* >( this ),
558cdf0e10cSrcweir static_cast< XAnimationNode* >( static_cast< XTimeContainer * >(this) ),
559cdf0e10cSrcweir static_cast< XInterface* >(static_cast< OWeakObject * >(this)),
560cdf0e10cSrcweir static_cast< XWeak* >(static_cast< OWeakObject * >(this)),
561cdf0e10cSrcweir static_cast< XChangesNotifier* >( this ),
562cdf0e10cSrcweir static_cast< XUnoTunnel* >( this ) ) );
563cdf0e10cSrcweir
564cdf0e10cSrcweir if(!aRet.hasValue())
565cdf0e10cSrcweir {
566cdf0e10cSrcweir switch( mnNodeType )
567cdf0e10cSrcweir {
568cdf0e10cSrcweir case AnimationNodeType::PAR:
569cdf0e10cSrcweir case AnimationNodeType::SEQ:
570cdf0e10cSrcweir aRet = ::cppu::queryInterface(
571cdf0e10cSrcweir aType,
572cdf0e10cSrcweir static_cast< XTimeContainer * >( this ),
573cdf0e10cSrcweir static_cast< XEnumerationAccess * >( this ),
574cdf0e10cSrcweir static_cast< XElementAccess * >( this ) );
575cdf0e10cSrcweir break;
576cdf0e10cSrcweir case AnimationNodeType::ITERATE:
577cdf0e10cSrcweir aRet = ::cppu::queryInterface(
578cdf0e10cSrcweir aType,
579cdf0e10cSrcweir static_cast< XTimeContainer * >( this ),
580cdf0e10cSrcweir static_cast< XIterateContainer * >( this ),
581cdf0e10cSrcweir static_cast< XEnumerationAccess * >( this ),
582cdf0e10cSrcweir static_cast< XElementAccess * >( this ) );
583cdf0e10cSrcweir break;
584cdf0e10cSrcweir case AnimationNodeType::ANIMATE:
585cdf0e10cSrcweir aRet = ::cppu::queryInterface(
586cdf0e10cSrcweir aType,
587cdf0e10cSrcweir static_cast< XAnimate * >( static_cast< XAnimateMotion * >(this) ) );
588cdf0e10cSrcweir break;
589cdf0e10cSrcweir case AnimationNodeType::ANIMATEMOTION:
590cdf0e10cSrcweir aRet = ::cppu::queryInterface(
591cdf0e10cSrcweir aType,
592cdf0e10cSrcweir static_cast< XAnimate * >( static_cast< XAnimateMotion * >(this) ),
593cdf0e10cSrcweir static_cast< XAnimateMotion * >( this ) );
594cdf0e10cSrcweir break;
595cdf0e10cSrcweir case AnimationNodeType::ANIMATECOLOR:
596cdf0e10cSrcweir aRet = ::cppu::queryInterface(
597cdf0e10cSrcweir aType,
598cdf0e10cSrcweir static_cast< XAnimate * >( static_cast< XAnimateColor * >(this) ),
599cdf0e10cSrcweir static_cast< XAnimateColor * >( this ) );
600cdf0e10cSrcweir break;
601cdf0e10cSrcweir case AnimationNodeType::SET:
602cdf0e10cSrcweir aRet = ::cppu::queryInterface(
603cdf0e10cSrcweir aType,
604cdf0e10cSrcweir static_cast< XAnimate * >( static_cast< XAnimateSet * >(this) ),
605cdf0e10cSrcweir static_cast< XAnimateSet * >( this ) );
606cdf0e10cSrcweir break;
607cdf0e10cSrcweir case AnimationNodeType::ANIMATETRANSFORM:
608cdf0e10cSrcweir aRet = ::cppu::queryInterface(
609cdf0e10cSrcweir aType,
610cdf0e10cSrcweir static_cast< XAnimate * >( static_cast< XAnimateTransform * >(this) ),
611cdf0e10cSrcweir static_cast< XAnimateTransform * >( this ) );
612cdf0e10cSrcweir break;
613cdf0e10cSrcweir case AnimationNodeType::AUDIO:
614cdf0e10cSrcweir aRet = ::cppu::queryInterface(
615cdf0e10cSrcweir aType,
616cdf0e10cSrcweir static_cast< XAudio * >( static_cast< XAudio * >(this) ) );
617cdf0e10cSrcweir break;
618cdf0e10cSrcweir case AnimationNodeType::COMMAND:
619cdf0e10cSrcweir aRet = ::cppu::queryInterface(
620cdf0e10cSrcweir aType,
621cdf0e10cSrcweir static_cast< XCommand * >( static_cast< XCommand * >(this) ) );
622cdf0e10cSrcweir break;
623cdf0e10cSrcweir case AnimationNodeType::TRANSITIONFILTER:
624cdf0e10cSrcweir aRet = ::cppu::queryInterface(
625cdf0e10cSrcweir aType,
626cdf0e10cSrcweir static_cast< XAnimate * >( static_cast< XTransitionFilter * >(this) ),
627cdf0e10cSrcweir static_cast< XTransitionFilter * >( this ) );
628cdf0e10cSrcweir break;
629cdf0e10cSrcweir }
630cdf0e10cSrcweir }
631cdf0e10cSrcweir
632cdf0e10cSrcweir return aRet.hasValue() ? aRet : OWeakObject::queryInterface( aType );
633cdf0e10cSrcweir }
634cdf0e10cSrcweir
635cdf0e10cSrcweir // --------------------------------------------------------------------
636cdf0e10cSrcweir
initTypeProvider(sal_Int16 nNodeType)637cdf0e10cSrcweir void AnimationNode::initTypeProvider( sal_Int16 nNodeType ) throw()
638cdf0e10cSrcweir {
639cdf0e10cSrcweir ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
640cdf0e10cSrcweir
641cdf0e10cSrcweir if(! mpTypes[nNodeType] )
642cdf0e10cSrcweir {
643cdf0e10cSrcweir // create id
644cdf0e10cSrcweir mpId[nNodeType] = new Sequence< sal_Int8 >( 16 );
645cdf0e10cSrcweir rtl_createUuid( (sal_uInt8 *)mpId[nNodeType]->getArray(), 0, sal_True );
646cdf0e10cSrcweir
647cdf0e10cSrcweir static sal_Int32 type_numbers[] =
648cdf0e10cSrcweir {
649cdf0e10cSrcweir 7, // CUSTOM
650cdf0e10cSrcweir 9, // PAR
651cdf0e10cSrcweir 9, // SEQ
652cdf0e10cSrcweir 9, // ITERATE
653cdf0e10cSrcweir 8, // ANIMATE
654cdf0e10cSrcweir 8, // SET
655cdf0e10cSrcweir 8, // ANIMATEMOTION
656cdf0e10cSrcweir 8, // ANIMATECOLOR
657cdf0e10cSrcweir 8, // ANIMATETRANSFORM
658cdf0e10cSrcweir 8, // TRANSITIONFILTER
659cdf0e10cSrcweir 8, // AUDIO
660cdf0e10cSrcweir 8, // COMMAND
661cdf0e10cSrcweir };
662cdf0e10cSrcweir
663cdf0e10cSrcweir // collect types
664cdf0e10cSrcweir Sequence< Type > * types = new Sequence< Type >( type_numbers[nNodeType] );
665cdf0e10cSrcweir Type * pTypeAr = types->getArray();
666cdf0e10cSrcweir sal_Int32 nPos = 0;
667cdf0e10cSrcweir
668cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XWeak > *)0 );
669cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XChild > *)0 );
670cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XCloneable > *)0 );
671cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XTypeProvider > *)0 );
672cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XServiceInfo > *)0 );
673cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XUnoTunnel > *)0 );
674cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XChangesNotifier> *)0 );
675cdf0e10cSrcweir
676cdf0e10cSrcweir switch( nNodeType )
677cdf0e10cSrcweir {
678cdf0e10cSrcweir case AnimationNodeType::PAR:
679cdf0e10cSrcweir case AnimationNodeType::SEQ:
680cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XTimeContainer > *)0 );
681cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XEnumerationAccess > *)0 );
682cdf0e10cSrcweir break;
683cdf0e10cSrcweir case AnimationNodeType::ITERATE:
684cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XIterateContainer > *)0 );
685cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XEnumerationAccess > *)0 );
686cdf0e10cSrcweir break;
687cdf0e10cSrcweir case AnimationNodeType::ANIMATE:
688cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XAnimate > *)0 );
689cdf0e10cSrcweir break;
690cdf0e10cSrcweir case AnimationNodeType::ANIMATEMOTION:
691cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XAnimateMotion > *)0 );
692cdf0e10cSrcweir break;
693cdf0e10cSrcweir case AnimationNodeType::ANIMATECOLOR:
694cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XAnimateColor > *)0 );
695cdf0e10cSrcweir break;
696cdf0e10cSrcweir case AnimationNodeType::ANIMATETRANSFORM:
697cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XAnimateTransform > *)0 );
698cdf0e10cSrcweir break;
699cdf0e10cSrcweir case AnimationNodeType::SET:
700cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XAnimateSet > *)0 );
701cdf0e10cSrcweir break;
702cdf0e10cSrcweir case AnimationNodeType::TRANSITIONFILTER:
703cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XTransitionFilter > *)0 );
704cdf0e10cSrcweir break;
705cdf0e10cSrcweir case AnimationNodeType::AUDIO:
706cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( (const Reference< XAudio > *)0 );
707cdf0e10cSrcweir break;
708cdf0e10cSrcweir case AnimationNodeType::COMMAND:
709cdf0e10cSrcweir pTypeAr[nPos++] = ::getCppuType( ( const Reference< XCommand > *)0 );
710cdf0e10cSrcweir break;
711cdf0e10cSrcweir }
712cdf0e10cSrcweir mpTypes[nNodeType] = types;
713cdf0e10cSrcweir }
714cdf0e10cSrcweir }
715cdf0e10cSrcweir
716cdf0e10cSrcweir // --------------------------------------------------------------------
717cdf0e10cSrcweir
getTypes()718cdf0e10cSrcweir Sequence< Type > AnimationNode::getTypes() throw (RuntimeException)
719cdf0e10cSrcweir {
720cdf0e10cSrcweir if (! mpTypes[mnNodeType])
721cdf0e10cSrcweir initTypeProvider(mnNodeType);
722cdf0e10cSrcweir return *mpTypes[mnNodeType];
723cdf0e10cSrcweir }
724cdf0e10cSrcweir // --------------------------------------------------------------------
725cdf0e10cSrcweir
getImplementationId()726cdf0e10cSrcweir Sequence< sal_Int8 > AnimationNode::getImplementationId() throw (RuntimeException)
727cdf0e10cSrcweir {
728cdf0e10cSrcweir if (! mpId[mnNodeType])
729cdf0e10cSrcweir initTypeProvider(mnNodeType);
730cdf0e10cSrcweir return *mpId[mnNodeType];
731cdf0e10cSrcweir }
732cdf0e10cSrcweir
733cdf0e10cSrcweir // --------------------------------------------------------------------
734cdf0e10cSrcweir
735cdf0e10cSrcweir // XInterface
acquire()736cdf0e10cSrcweir void SAL_CALL AnimationNode::acquire( ) throw ()
737cdf0e10cSrcweir {
738cdf0e10cSrcweir OWeakObject::acquire();
739cdf0e10cSrcweir }
740cdf0e10cSrcweir
741cdf0e10cSrcweir // --------------------------------------------------------------------
742cdf0e10cSrcweir
743cdf0e10cSrcweir // XInterface
release()744cdf0e10cSrcweir void SAL_CALL AnimationNode::release( ) throw ()
745cdf0e10cSrcweir {
7465cce249fSAndre Fischer OWeakObject::release();
747cdf0e10cSrcweir }
748cdf0e10cSrcweir
749cdf0e10cSrcweir // --------------------------------------------------------------------
750cdf0e10cSrcweir
751cdf0e10cSrcweir // XServiceInfo
getImplementationName()752cdf0e10cSrcweir OUString AnimationNode::getImplementationName() throw()
753cdf0e10cSrcweir {
754cdf0e10cSrcweir switch( mnNodeType )
755cdf0e10cSrcweir {
756cdf0e10cSrcweir case AnimationNodeType::PAR:
757cdf0e10cSrcweir return getImplementationName_PAR();
758cdf0e10cSrcweir case AnimationNodeType::SEQ:
759cdf0e10cSrcweir return getImplementationName_SEQ();
760cdf0e10cSrcweir case AnimationNodeType::ITERATE:
761cdf0e10cSrcweir return getImplementationName_ITERATE();
762cdf0e10cSrcweir case AnimationNodeType::SET:
763cdf0e10cSrcweir return getImplementationName_SET();
764cdf0e10cSrcweir case AnimationNodeType::ANIMATECOLOR:
765cdf0e10cSrcweir return getImplementationName_ANIMATECOLOR();
766cdf0e10cSrcweir case AnimationNodeType::ANIMATEMOTION:
767cdf0e10cSrcweir return getImplementationName_ANIMATEMOTION();
768cdf0e10cSrcweir case AnimationNodeType::TRANSITIONFILTER:
769cdf0e10cSrcweir return getImplementationName_TRANSITIONFILTER();
770cdf0e10cSrcweir case AnimationNodeType::ANIMATETRANSFORM:
771cdf0e10cSrcweir return getImplementationName_ANIMATETRANSFORM();
772cdf0e10cSrcweir case AnimationNodeType::AUDIO:
773cdf0e10cSrcweir return getImplementationName_AUDIO();
774cdf0e10cSrcweir case AnimationNodeType::COMMAND:
775cdf0e10cSrcweir return getImplementationName_COMMAND();
776cdf0e10cSrcweir case AnimationNodeType::ANIMATE:
777cdf0e10cSrcweir default:
778cdf0e10cSrcweir return getImplementationName_ANIMATE();
779cdf0e10cSrcweir }
780cdf0e10cSrcweir }
781cdf0e10cSrcweir
782cdf0e10cSrcweir // --------------------------------------------------------------------
783cdf0e10cSrcweir
784cdf0e10cSrcweir // XServiceInfo
supportsService(const OUString & ServiceName)785cdf0e10cSrcweir sal_Bool AnimationNode::supportsService(const OUString& ServiceName) throw()
786cdf0e10cSrcweir {
787cdf0e10cSrcweir Sequence< OUString > aSNL( getSupportedServiceNames() );
788cdf0e10cSrcweir const OUString * pArray = aSNL.getConstArray();
789cdf0e10cSrcweir
790cdf0e10cSrcweir for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
791cdf0e10cSrcweir if( pArray[i] == ServiceName )
792cdf0e10cSrcweir return sal_True;
793cdf0e10cSrcweir
794cdf0e10cSrcweir return sal_False;
795cdf0e10cSrcweir }
796cdf0e10cSrcweir
797cdf0e10cSrcweir // --------------------------------------------------------------------
798cdf0e10cSrcweir
799cdf0e10cSrcweir // XServiceInfo
getSupportedServiceNames(void)800cdf0e10cSrcweir Sequence< OUString > AnimationNode::getSupportedServiceNames(void) throw()
801cdf0e10cSrcweir {
802cdf0e10cSrcweir switch( mnNodeType )
803cdf0e10cSrcweir {
804cdf0e10cSrcweir case AnimationNodeType::PAR:
805cdf0e10cSrcweir return getSupportedServiceNames_PAR();
806cdf0e10cSrcweir case AnimationNodeType::SEQ:
807cdf0e10cSrcweir return getSupportedServiceNames_SEQ();
808cdf0e10cSrcweir case AnimationNodeType::ITERATE:
809cdf0e10cSrcweir return getSupportedServiceNames_ITERATE();
810cdf0e10cSrcweir case AnimationNodeType::SET:
811cdf0e10cSrcweir return getSupportedServiceNames_SET();
812cdf0e10cSrcweir case AnimationNodeType::ANIMATECOLOR:
813cdf0e10cSrcweir return getSupportedServiceNames_ANIMATECOLOR();
814cdf0e10cSrcweir case AnimationNodeType::ANIMATEMOTION:
815cdf0e10cSrcweir return getSupportedServiceNames_ANIMATEMOTION();
816cdf0e10cSrcweir case AnimationNodeType::TRANSITIONFILTER:
817cdf0e10cSrcweir return getSupportedServiceNames_TRANSITIONFILTER();
818cdf0e10cSrcweir case AnimationNodeType::AUDIO:
819cdf0e10cSrcweir return getSupportedServiceNames_AUDIO();
820cdf0e10cSrcweir case AnimationNodeType::COMMAND:
821cdf0e10cSrcweir return getSupportedServiceNames_COMMAND();
822cdf0e10cSrcweir case AnimationNodeType::ANIMATE:
823cdf0e10cSrcweir default:
824cdf0e10cSrcweir return getSupportedServiceNames_ANIMATE();
825cdf0e10cSrcweir }
826cdf0e10cSrcweir }
827cdf0e10cSrcweir
828cdf0e10cSrcweir // --------------------------------------------------------------------
829cdf0e10cSrcweir
830cdf0e10cSrcweir // XAnimationNode
getType()831cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getType() throw (RuntimeException)
832cdf0e10cSrcweir {
833cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
834cdf0e10cSrcweir return mnNodeType;
835cdf0e10cSrcweir }
836cdf0e10cSrcweir
837cdf0e10cSrcweir // --------------------------------------------------------------------
838cdf0e10cSrcweir
839cdf0e10cSrcweir // XAnimationNode
getBegin()840cdf0e10cSrcweir Any SAL_CALL AnimationNode::getBegin() throw (RuntimeException)
841cdf0e10cSrcweir {
842cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
843cdf0e10cSrcweir return maBegin;
844cdf0e10cSrcweir }
845cdf0e10cSrcweir
846cdf0e10cSrcweir // --------------------------------------------------------------------
847cdf0e10cSrcweir
848cdf0e10cSrcweir // XAnimationNode
setBegin(const Any & _begin)849cdf0e10cSrcweir void SAL_CALL AnimationNode::setBegin( const Any& _begin ) throw (RuntimeException)
850cdf0e10cSrcweir {
851cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
852cdf0e10cSrcweir if( _begin != maBegin )
853cdf0e10cSrcweir {
854cdf0e10cSrcweir maBegin = _begin;
855cdf0e10cSrcweir fireChangeListener();
856cdf0e10cSrcweir }
857cdf0e10cSrcweir }
858cdf0e10cSrcweir
859cdf0e10cSrcweir // --------------------------------------------------------------------
860cdf0e10cSrcweir
861cdf0e10cSrcweir // XAnimationNode
getDuration()862cdf0e10cSrcweir Any SAL_CALL AnimationNode::getDuration() throw (RuntimeException)
863cdf0e10cSrcweir {
864cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
865cdf0e10cSrcweir return maDuration;
866cdf0e10cSrcweir }
867cdf0e10cSrcweir
868cdf0e10cSrcweir // --------------------------------------------------------------------
869cdf0e10cSrcweir
870cdf0e10cSrcweir // XAnimationNode
setDuration(const Any & _duration)871cdf0e10cSrcweir void SAL_CALL AnimationNode::setDuration( const Any& _duration ) throw (RuntimeException)
872cdf0e10cSrcweir {
873cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
874cdf0e10cSrcweir if( _duration != maDuration )
875cdf0e10cSrcweir {
876cdf0e10cSrcweir maDuration = _duration;
877cdf0e10cSrcweir fireChangeListener();
878cdf0e10cSrcweir }
879cdf0e10cSrcweir }
880cdf0e10cSrcweir
881cdf0e10cSrcweir // --------------------------------------------------------------------
882cdf0e10cSrcweir
883cdf0e10cSrcweir // XAnimationNode
getEnd()884cdf0e10cSrcweir Any SAL_CALL AnimationNode::getEnd() throw (RuntimeException)
885cdf0e10cSrcweir {
886cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
887cdf0e10cSrcweir return maEnd;
888cdf0e10cSrcweir }
889cdf0e10cSrcweir
890cdf0e10cSrcweir // --------------------------------------------------------------------
891cdf0e10cSrcweir
892cdf0e10cSrcweir // XAnimationNode
setEnd(const Any & _end)893cdf0e10cSrcweir void SAL_CALL AnimationNode::setEnd( const Any& _end ) throw (RuntimeException)
894cdf0e10cSrcweir {
895cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
896cdf0e10cSrcweir if( _end != maEnd )
897cdf0e10cSrcweir {
898cdf0e10cSrcweir maEnd = _end;
899cdf0e10cSrcweir fireChangeListener();
900cdf0e10cSrcweir }
901cdf0e10cSrcweir }
902cdf0e10cSrcweir
903cdf0e10cSrcweir // --------------------------------------------------------------------
904cdf0e10cSrcweir
905cdf0e10cSrcweir // XAnimationNode
getEndSync()906cdf0e10cSrcweir Any SAL_CALL AnimationNode::getEndSync() throw (RuntimeException)
907cdf0e10cSrcweir {
908cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
909cdf0e10cSrcweir return maEndSync;
910cdf0e10cSrcweir }
911cdf0e10cSrcweir
912cdf0e10cSrcweir // --------------------------------------------------------------------
913cdf0e10cSrcweir
914cdf0e10cSrcweir // XAnimationNode
setEndSync(const Any & _endsync)915cdf0e10cSrcweir void SAL_CALL AnimationNode::setEndSync( const Any& _endsync ) throw (RuntimeException)
916cdf0e10cSrcweir {
917cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
918cdf0e10cSrcweir if( _endsync != maEndSync )
919cdf0e10cSrcweir {
920cdf0e10cSrcweir maEndSync = _endsync;
921cdf0e10cSrcweir fireChangeListener();
922cdf0e10cSrcweir }
923cdf0e10cSrcweir }
924cdf0e10cSrcweir
925cdf0e10cSrcweir // --------------------------------------------------------------------
926cdf0e10cSrcweir
927cdf0e10cSrcweir // XAnimationNode
getRepeatCount()928cdf0e10cSrcweir Any SAL_CALL AnimationNode::getRepeatCount() throw (RuntimeException)
929cdf0e10cSrcweir {
930cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
931cdf0e10cSrcweir return maRepeatCount;
932cdf0e10cSrcweir }
933cdf0e10cSrcweir
934cdf0e10cSrcweir // --------------------------------------------------------------------
935cdf0e10cSrcweir
936cdf0e10cSrcweir // XAnimationNode
setRepeatCount(const Any & _repeatcount)937cdf0e10cSrcweir void SAL_CALL AnimationNode::setRepeatCount( const Any& _repeatcount ) throw (RuntimeException)
938cdf0e10cSrcweir {
939cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
940cdf0e10cSrcweir if( _repeatcount != maRepeatCount )
941cdf0e10cSrcweir {
942cdf0e10cSrcweir maRepeatCount = _repeatcount;
943cdf0e10cSrcweir fireChangeListener();
944cdf0e10cSrcweir }
945cdf0e10cSrcweir }
946cdf0e10cSrcweir
947cdf0e10cSrcweir // --------------------------------------------------------------------
948cdf0e10cSrcweir
949cdf0e10cSrcweir // XAnimationNode
getRepeatDuration()950cdf0e10cSrcweir Any SAL_CALL AnimationNode::getRepeatDuration() throw (RuntimeException)
951cdf0e10cSrcweir {
952cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
953cdf0e10cSrcweir return maRepeatDuration;
954cdf0e10cSrcweir }
955cdf0e10cSrcweir
956cdf0e10cSrcweir // --------------------------------------------------------------------
957cdf0e10cSrcweir
958cdf0e10cSrcweir // XAnimationNode
setRepeatDuration(const Any & _repeatduration)959cdf0e10cSrcweir void SAL_CALL AnimationNode::setRepeatDuration( const Any& _repeatduration ) throw (RuntimeException)
960cdf0e10cSrcweir {
961cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
962cdf0e10cSrcweir if( _repeatduration != maRepeatDuration )
963cdf0e10cSrcweir {
964cdf0e10cSrcweir maRepeatDuration = _repeatduration;
965cdf0e10cSrcweir fireChangeListener();
966cdf0e10cSrcweir }
967cdf0e10cSrcweir }
968cdf0e10cSrcweir
969cdf0e10cSrcweir // --------------------------------------------------------------------
970cdf0e10cSrcweir
971cdf0e10cSrcweir // XAnimationNode
getFill()972cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getFill() throw (RuntimeException)
973cdf0e10cSrcweir {
974cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
975cdf0e10cSrcweir return mnFill;
976cdf0e10cSrcweir }
977cdf0e10cSrcweir
978cdf0e10cSrcweir // --------------------------------------------------------------------
979cdf0e10cSrcweir
980cdf0e10cSrcweir // XAnimationNode
setFill(sal_Int16 _fill)981cdf0e10cSrcweir void SAL_CALL AnimationNode::setFill( sal_Int16 _fill ) throw (RuntimeException)
982cdf0e10cSrcweir {
983cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
984cdf0e10cSrcweir if( _fill != mnFill )
985cdf0e10cSrcweir {
986cdf0e10cSrcweir mnFill = _fill;
987cdf0e10cSrcweir fireChangeListener();
988cdf0e10cSrcweir }
989cdf0e10cSrcweir }
990cdf0e10cSrcweir
991cdf0e10cSrcweir // --------------------------------------------------------------------
992cdf0e10cSrcweir
993cdf0e10cSrcweir // XAnimationNode
getFillDefault()994cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getFillDefault() throw (RuntimeException)
995cdf0e10cSrcweir {
996cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
997cdf0e10cSrcweir return mnFillDefault;
998cdf0e10cSrcweir }
999cdf0e10cSrcweir
1000cdf0e10cSrcweir // --------------------------------------------------------------------
1001cdf0e10cSrcweir
1002cdf0e10cSrcweir // XAnimationNode
setFillDefault(sal_Int16 _filldefault)1003cdf0e10cSrcweir void SAL_CALL AnimationNode::setFillDefault( sal_Int16 _filldefault ) throw (RuntimeException)
1004cdf0e10cSrcweir {
1005cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1006cdf0e10cSrcweir if( _filldefault != mnFillDefault )
1007cdf0e10cSrcweir {
1008cdf0e10cSrcweir mnFillDefault = _filldefault;
1009cdf0e10cSrcweir fireChangeListener();
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir }
1012cdf0e10cSrcweir
1013cdf0e10cSrcweir // --------------------------------------------------------------------
1014cdf0e10cSrcweir
1015cdf0e10cSrcweir // XAnimationNode
getRestart()1016cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getRestart() throw (RuntimeException)
1017cdf0e10cSrcweir {
1018cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1019cdf0e10cSrcweir return mnRestart;
1020cdf0e10cSrcweir }
1021cdf0e10cSrcweir
1022cdf0e10cSrcweir // --------------------------------------------------------------------
1023cdf0e10cSrcweir
1024cdf0e10cSrcweir // XAnimationNode
setRestart(sal_Int16 _restart)1025cdf0e10cSrcweir void SAL_CALL AnimationNode::setRestart( sal_Int16 _restart ) throw (RuntimeException)
1026cdf0e10cSrcweir {
1027cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1028cdf0e10cSrcweir if( _restart != mnRestart )
1029cdf0e10cSrcweir {
1030cdf0e10cSrcweir mnRestart = _restart;
1031cdf0e10cSrcweir fireChangeListener();
1032cdf0e10cSrcweir }
1033cdf0e10cSrcweir }
1034cdf0e10cSrcweir
1035cdf0e10cSrcweir // --------------------------------------------------------------------
1036cdf0e10cSrcweir
1037cdf0e10cSrcweir // XAnimationNode
getRestartDefault()1038cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getRestartDefault() throw (RuntimeException)
1039cdf0e10cSrcweir {
1040cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1041cdf0e10cSrcweir return mnRestartDefault;
1042cdf0e10cSrcweir }
1043cdf0e10cSrcweir
1044cdf0e10cSrcweir // --------------------------------------------------------------------
1045cdf0e10cSrcweir
1046cdf0e10cSrcweir // XAnimationNode
setRestartDefault(sal_Int16 _restartdefault)1047cdf0e10cSrcweir void SAL_CALL AnimationNode::setRestartDefault( sal_Int16 _restartdefault ) throw (RuntimeException)
1048cdf0e10cSrcweir {
1049cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1050cdf0e10cSrcweir if( _restartdefault != mnRestartDefault )
1051cdf0e10cSrcweir {
1052cdf0e10cSrcweir mnRestartDefault = _restartdefault;
1053cdf0e10cSrcweir fireChangeListener();
1054cdf0e10cSrcweir }
1055cdf0e10cSrcweir }
1056cdf0e10cSrcweir
1057cdf0e10cSrcweir // --------------------------------------------------------------------
1058cdf0e10cSrcweir
1059cdf0e10cSrcweir // XAnimationNode
getAcceleration()1060cdf0e10cSrcweir double SAL_CALL AnimationNode::getAcceleration() throw (RuntimeException)
1061cdf0e10cSrcweir {
1062cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1063cdf0e10cSrcweir return mfAcceleration;
1064cdf0e10cSrcweir }
1065cdf0e10cSrcweir
1066cdf0e10cSrcweir // --------------------------------------------------------------------
1067cdf0e10cSrcweir
1068cdf0e10cSrcweir // XAnimationNode
setAcceleration(double _acceleration)1069cdf0e10cSrcweir void SAL_CALL AnimationNode::setAcceleration( double _acceleration ) throw (RuntimeException)
1070cdf0e10cSrcweir {
1071cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1072cdf0e10cSrcweir if( _acceleration != mfAcceleration )
1073cdf0e10cSrcweir {
1074cdf0e10cSrcweir mfAcceleration = _acceleration;
1075cdf0e10cSrcweir fireChangeListener();
1076cdf0e10cSrcweir }
1077cdf0e10cSrcweir }
1078cdf0e10cSrcweir
1079cdf0e10cSrcweir // --------------------------------------------------------------------
1080cdf0e10cSrcweir
1081cdf0e10cSrcweir // XAnimationNode
getDecelerate()1082cdf0e10cSrcweir double SAL_CALL AnimationNode::getDecelerate() throw (RuntimeException)
1083cdf0e10cSrcweir {
1084cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1085cdf0e10cSrcweir return mfDecelerate;
1086cdf0e10cSrcweir }
1087cdf0e10cSrcweir
1088cdf0e10cSrcweir // --------------------------------------------------------------------
1089cdf0e10cSrcweir
1090cdf0e10cSrcweir // XAnimationNode
setDecelerate(double _decelerate)1091cdf0e10cSrcweir void SAL_CALL AnimationNode::setDecelerate( double _decelerate ) throw (RuntimeException)
1092cdf0e10cSrcweir {
1093cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1094cdf0e10cSrcweir if( _decelerate != mfDecelerate )
1095cdf0e10cSrcweir {
1096cdf0e10cSrcweir mfDecelerate = _decelerate;
1097cdf0e10cSrcweir fireChangeListener();
1098cdf0e10cSrcweir }
1099cdf0e10cSrcweir }
1100cdf0e10cSrcweir
1101cdf0e10cSrcweir // --------------------------------------------------------------------
1102cdf0e10cSrcweir
1103cdf0e10cSrcweir // XAnimationNode
getAutoReverse()1104cdf0e10cSrcweir sal_Bool SAL_CALL AnimationNode::getAutoReverse() throw (RuntimeException)
1105cdf0e10cSrcweir {
1106cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1107cdf0e10cSrcweir return mbAutoReverse;
1108cdf0e10cSrcweir }
1109cdf0e10cSrcweir
1110cdf0e10cSrcweir // --------------------------------------------------------------------
1111cdf0e10cSrcweir
1112cdf0e10cSrcweir // XAnimationNode
setAutoReverse(sal_Bool _autoreverse)1113cdf0e10cSrcweir void SAL_CALL AnimationNode::setAutoReverse( sal_Bool _autoreverse ) throw (RuntimeException)
1114cdf0e10cSrcweir {
1115cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1116cdf0e10cSrcweir if( _autoreverse != mbAutoReverse )
1117cdf0e10cSrcweir {
1118cdf0e10cSrcweir mbAutoReverse = _autoreverse;
1119cdf0e10cSrcweir fireChangeListener();
1120cdf0e10cSrcweir }
1121cdf0e10cSrcweir }
1122cdf0e10cSrcweir
1123cdf0e10cSrcweir // --------------------------------------------------------------------
1124cdf0e10cSrcweir
getUserData()1125cdf0e10cSrcweir Sequence< NamedValue > SAL_CALL AnimationNode::getUserData() throw (RuntimeException)
1126cdf0e10cSrcweir {
1127cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1128cdf0e10cSrcweir return maUserData;
1129cdf0e10cSrcweir }
1130cdf0e10cSrcweir
1131cdf0e10cSrcweir // --------------------------------------------------------------------
1132cdf0e10cSrcweir
setUserData(const Sequence<NamedValue> & _userdata)1133cdf0e10cSrcweir void SAL_CALL AnimationNode::setUserData( const Sequence< NamedValue >& _userdata ) throw (RuntimeException)
1134cdf0e10cSrcweir {
1135cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1136cdf0e10cSrcweir maUserData = _userdata;
1137cdf0e10cSrcweir fireChangeListener();
1138cdf0e10cSrcweir }
1139cdf0e10cSrcweir
1140cdf0e10cSrcweir // --------------------------------------------------------------------
1141cdf0e10cSrcweir
1142cdf0e10cSrcweir // XChild
getParent()1143cdf0e10cSrcweir Reference< XInterface > SAL_CALL AnimationNode::getParent() throw (RuntimeException)
1144cdf0e10cSrcweir {
1145cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1146f59b791fSJian Fang Zhang return mxParent.get();
1147cdf0e10cSrcweir }
1148cdf0e10cSrcweir
1149cdf0e10cSrcweir // --------------------------------------------------------------------
1150cdf0e10cSrcweir
1151cdf0e10cSrcweir // XChild
setParent(const Reference<XInterface> & Parent)1152cdf0e10cSrcweir void SAL_CALL AnimationNode::setParent( const Reference< XInterface >& Parent ) throw (NoSupportException, RuntimeException)
1153cdf0e10cSrcweir {
1154cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1155f59b791fSJian Fang Zhang if( Parent != mxParent.get() )
1156cdf0e10cSrcweir {
1157cdf0e10cSrcweir mxParent = Parent;
1158cdf0e10cSrcweir
1159cdf0e10cSrcweir mpParent = 0;
1160f59b791fSJian Fang Zhang Reference< XUnoTunnel > xTunnel( mxParent.get(), UNO_QUERY );
1161cdf0e10cSrcweir if( xTunnel.is() )
1162cdf0e10cSrcweir mpParent = reinterpret_cast< AnimationNode* >( sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething( getUnoTunnelId() )));
1163cdf0e10cSrcweir
1164cdf0e10cSrcweir fireChangeListener();
1165cdf0e10cSrcweir }
1166cdf0e10cSrcweir }
1167cdf0e10cSrcweir
1168cdf0e10cSrcweir // --------------------------------------------------------------------
1169cdf0e10cSrcweir
1170cdf0e10cSrcweir // XCloneable
createClone()1171cdf0e10cSrcweir Reference< XCloneable > SAL_CALL AnimationNode::createClone() throw (RuntimeException)
1172cdf0e10cSrcweir {
1173cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1174cdf0e10cSrcweir
1175cdf0e10cSrcweir Reference< XCloneable > xNewNode;
1176cdf0e10cSrcweir try
1177cdf0e10cSrcweir {
1178cdf0e10cSrcweir xNewNode = new AnimationNode( *this );
1179cdf0e10cSrcweir
1180cdf0e10cSrcweir if( maChilds.size() )
1181cdf0e10cSrcweir {
1182cdf0e10cSrcweir Reference< XTimeContainer > xContainer( xNewNode, UNO_QUERY );
1183cdf0e10cSrcweir if( xContainer.is() )
1184cdf0e10cSrcweir {
1185cdf0e10cSrcweir ChildList_t::iterator aIter( maChilds.begin() );
1186cdf0e10cSrcweir ChildList_t::iterator aEnd( maChilds.end() );
1187cdf0e10cSrcweir while( aIter != aEnd )
1188cdf0e10cSrcweir {
1189cdf0e10cSrcweir Reference< XCloneable > xCloneable((*aIter++), UNO_QUERY );
1190cdf0e10cSrcweir if( xCloneable.is() ) try
1191cdf0e10cSrcweir {
1192cdf0e10cSrcweir Reference< XAnimationNode > xNewChildNode( xCloneable->createClone(), UNO_QUERY );
1193cdf0e10cSrcweir if( xNewChildNode.is() )
1194cdf0e10cSrcweir xContainer->appendChild( xNewChildNode );
1195cdf0e10cSrcweir }
1196cdf0e10cSrcweir catch( Exception& e )
1197cdf0e10cSrcweir {
1198cdf0e10cSrcweir (void)e;
1199cdf0e10cSrcweir OSL_TRACE( "animations::AnimationNode::createClone(), exception caught!" );
1200cdf0e10cSrcweir }
1201cdf0e10cSrcweir }
1202cdf0e10cSrcweir }
1203cdf0e10cSrcweir }
1204cdf0e10cSrcweir }
1205cdf0e10cSrcweir catch( Exception& e )
1206cdf0e10cSrcweir {
1207cdf0e10cSrcweir (void)e;
1208cdf0e10cSrcweir OSL_TRACE( "animations::AnimationNode::createClone(), exception caught!" );
1209cdf0e10cSrcweir }
1210cdf0e10cSrcweir
1211cdf0e10cSrcweir return xNewNode;
1212cdf0e10cSrcweir }
1213cdf0e10cSrcweir
1214cdf0e10cSrcweir // --------------------------------------------------------------------
1215cdf0e10cSrcweir
1216cdf0e10cSrcweir // XAnimate
getTarget()1217cdf0e10cSrcweir Any SAL_CALL AnimationNode::getTarget()
1218cdf0e10cSrcweir throw (RuntimeException)
1219cdf0e10cSrcweir {
1220cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1221cdf0e10cSrcweir return maTarget;
1222cdf0e10cSrcweir }
1223cdf0e10cSrcweir
1224cdf0e10cSrcweir // --------------------------------------------------------------------
1225cdf0e10cSrcweir
1226cdf0e10cSrcweir // XAnimate
setTarget(const Any & _target)1227cdf0e10cSrcweir void SAL_CALL AnimationNode::setTarget( const Any& _target )
1228cdf0e10cSrcweir throw (RuntimeException)
1229cdf0e10cSrcweir {
1230cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1231cdf0e10cSrcweir if( _target != maTarget )
1232cdf0e10cSrcweir {
1233cdf0e10cSrcweir maTarget= _target;
1234cdf0e10cSrcweir fireChangeListener();
1235cdf0e10cSrcweir }
1236cdf0e10cSrcweir }
1237cdf0e10cSrcweir
1238cdf0e10cSrcweir // --------------------------------------------------------------------
1239cdf0e10cSrcweir
1240cdf0e10cSrcweir // XAnimate
getAttributeName()1241cdf0e10cSrcweir OUString SAL_CALL AnimationNode::getAttributeName() throw (RuntimeException)
1242cdf0e10cSrcweir {
1243cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1244cdf0e10cSrcweir return maAttributeName;
1245cdf0e10cSrcweir }
1246cdf0e10cSrcweir
1247cdf0e10cSrcweir // --------------------------------------------------------------------
1248cdf0e10cSrcweir
1249cdf0e10cSrcweir // XAnimate
setAttributeName(const OUString & _attribute)1250cdf0e10cSrcweir void SAL_CALL AnimationNode::setAttributeName( const OUString& _attribute )
1251cdf0e10cSrcweir throw (RuntimeException)
1252cdf0e10cSrcweir {
1253cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1254cdf0e10cSrcweir if( _attribute != maAttributeName )
1255cdf0e10cSrcweir {
1256cdf0e10cSrcweir maAttributeName = _attribute;
1257cdf0e10cSrcweir fireChangeListener();
1258cdf0e10cSrcweir }
1259cdf0e10cSrcweir }
1260cdf0e10cSrcweir
1261cdf0e10cSrcweir // --------------------------------------------------------------------
1262cdf0e10cSrcweir
1263cdf0e10cSrcweir // XAnimate
getValues()1264cdf0e10cSrcweir Sequence< Any > SAL_CALL AnimationNode::getValues()
1265cdf0e10cSrcweir throw (RuntimeException)
1266cdf0e10cSrcweir {
1267cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1268cdf0e10cSrcweir return maValues;
1269cdf0e10cSrcweir }
1270cdf0e10cSrcweir
1271cdf0e10cSrcweir // --------------------------------------------------------------------
1272cdf0e10cSrcweir
1273cdf0e10cSrcweir // XAnimate
setValues(const Sequence<Any> & _values)1274cdf0e10cSrcweir void SAL_CALL AnimationNode::setValues( const Sequence< Any >& _values )
1275cdf0e10cSrcweir throw (RuntimeException)
1276cdf0e10cSrcweir {
1277cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1278cdf0e10cSrcweir maValues = _values;
1279cdf0e10cSrcweir fireChangeListener();
1280cdf0e10cSrcweir }
1281cdf0e10cSrcweir
1282cdf0e10cSrcweir // --------------------------------------------------------------------
1283cdf0e10cSrcweir
1284cdf0e10cSrcweir // XAnimate
getSubItem()1285cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getSubItem() throw (RuntimeException)
1286cdf0e10cSrcweir {
1287cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1288cdf0e10cSrcweir return mnSubItem;
1289cdf0e10cSrcweir }
1290cdf0e10cSrcweir
1291cdf0e10cSrcweir // --------------------------------------------------------------------
1292cdf0e10cSrcweir
1293cdf0e10cSrcweir // XAnimate
setSubItem(sal_Int16 _subitem)1294cdf0e10cSrcweir void SAL_CALL AnimationNode::setSubItem( sal_Int16 _subitem ) throw (RuntimeException)
1295cdf0e10cSrcweir {
1296cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1297cdf0e10cSrcweir if( _subitem != mnSubItem )
1298cdf0e10cSrcweir {
1299cdf0e10cSrcweir mnSubItem = _subitem;
1300cdf0e10cSrcweir fireChangeListener();
1301cdf0e10cSrcweir }
1302cdf0e10cSrcweir }
1303cdf0e10cSrcweir
1304cdf0e10cSrcweir // --------------------------------------------------------------------
1305cdf0e10cSrcweir
1306cdf0e10cSrcweir // XAnimate
getKeyTimes()1307cdf0e10cSrcweir Sequence< double > SAL_CALL AnimationNode::getKeyTimes() throw (RuntimeException)
1308cdf0e10cSrcweir {
1309cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1310cdf0e10cSrcweir return maKeyTimes;
1311cdf0e10cSrcweir }
1312cdf0e10cSrcweir
1313cdf0e10cSrcweir // --------------------------------------------------------------------
1314cdf0e10cSrcweir
1315cdf0e10cSrcweir // XAnimate
setKeyTimes(const Sequence<double> & _keytimes)1316cdf0e10cSrcweir void SAL_CALL AnimationNode::setKeyTimes( const Sequence< double >& _keytimes ) throw (RuntimeException)
1317cdf0e10cSrcweir {
1318cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1319cdf0e10cSrcweir maKeyTimes = _keytimes;
1320cdf0e10cSrcweir fireChangeListener();
1321cdf0e10cSrcweir }
1322cdf0e10cSrcweir
1323cdf0e10cSrcweir // --------------------------------------------------------------------
1324cdf0e10cSrcweir
1325cdf0e10cSrcweir // XAnimate
getValueType()1326cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getValueType() throw (RuntimeException)
1327cdf0e10cSrcweir {
1328cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1329cdf0e10cSrcweir return mnValueType;
1330cdf0e10cSrcweir }
1331cdf0e10cSrcweir
1332cdf0e10cSrcweir // --------------------------------------------------------------------
1333cdf0e10cSrcweir
setValueType(sal_Int16 _valuetype)1334cdf0e10cSrcweir void SAL_CALL AnimationNode::setValueType( sal_Int16 _valuetype ) throw (RuntimeException)
1335cdf0e10cSrcweir {
1336cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1337cdf0e10cSrcweir if( _valuetype != mnValueType )
1338cdf0e10cSrcweir {
1339cdf0e10cSrcweir mnValueType = _valuetype;
1340cdf0e10cSrcweir fireChangeListener();
1341cdf0e10cSrcweir }
1342cdf0e10cSrcweir }
1343cdf0e10cSrcweir
1344cdf0e10cSrcweir // --------------------------------------------------------------------
1345cdf0e10cSrcweir
1346cdf0e10cSrcweir // XAnimate
getCalcMode()1347cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getCalcMode()
1348cdf0e10cSrcweir throw (RuntimeException)
1349cdf0e10cSrcweir {
1350cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1351cdf0e10cSrcweir return mnCalcMode;
1352cdf0e10cSrcweir }
1353cdf0e10cSrcweir
1354cdf0e10cSrcweir // --------------------------------------------------------------------
1355cdf0e10cSrcweir
1356cdf0e10cSrcweir // XAnimate
setCalcMode(sal_Int16 _calcmode)1357cdf0e10cSrcweir void SAL_CALL AnimationNode::setCalcMode( sal_Int16 _calcmode )
1358cdf0e10cSrcweir throw (RuntimeException)
1359cdf0e10cSrcweir {
1360cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1361cdf0e10cSrcweir if( _calcmode != mnCalcMode )
1362cdf0e10cSrcweir {
1363cdf0e10cSrcweir mnCalcMode = _calcmode;
1364cdf0e10cSrcweir fireChangeListener();
1365cdf0e10cSrcweir }
1366cdf0e10cSrcweir }
1367cdf0e10cSrcweir
1368cdf0e10cSrcweir // --------------------------------------------------------------------
1369cdf0e10cSrcweir
1370cdf0e10cSrcweir // XAnimate
getAccumulate()1371cdf0e10cSrcweir sal_Bool SAL_CALL AnimationNode::getAccumulate()
1372cdf0e10cSrcweir throw (RuntimeException)
1373cdf0e10cSrcweir {
1374cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1375cdf0e10cSrcweir return mbAccumulate;
1376cdf0e10cSrcweir }
1377cdf0e10cSrcweir
1378cdf0e10cSrcweir // --------------------------------------------------------------------
1379cdf0e10cSrcweir
1380cdf0e10cSrcweir // XAnimate
setAccumulate(sal_Bool _accumulate)1381cdf0e10cSrcweir void SAL_CALL AnimationNode::setAccumulate( sal_Bool _accumulate )
1382cdf0e10cSrcweir throw (RuntimeException)
1383cdf0e10cSrcweir {
1384cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1385cdf0e10cSrcweir if( _accumulate != mbAccumulate )
1386cdf0e10cSrcweir {
1387cdf0e10cSrcweir mbAccumulate = _accumulate;
1388cdf0e10cSrcweir fireChangeListener();
1389cdf0e10cSrcweir }
1390cdf0e10cSrcweir }
1391cdf0e10cSrcweir
1392cdf0e10cSrcweir // --------------------------------------------------------------------
1393cdf0e10cSrcweir
1394cdf0e10cSrcweir // XAnimate
getAdditive()1395cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getAdditive()
1396cdf0e10cSrcweir throw (RuntimeException)
1397cdf0e10cSrcweir {
1398cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1399cdf0e10cSrcweir return mnAdditive;
1400cdf0e10cSrcweir }
1401cdf0e10cSrcweir
1402cdf0e10cSrcweir // --------------------------------------------------------------------
1403cdf0e10cSrcweir
1404cdf0e10cSrcweir // XAnimate
setAdditive(sal_Int16 _additive)1405cdf0e10cSrcweir void SAL_CALL AnimationNode::setAdditive( sal_Int16 _additive )
1406cdf0e10cSrcweir throw (RuntimeException)
1407cdf0e10cSrcweir {
1408cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1409cdf0e10cSrcweir if( _additive != mnAdditive )
1410cdf0e10cSrcweir {
1411cdf0e10cSrcweir mnAdditive = _additive;
1412cdf0e10cSrcweir fireChangeListener();
1413cdf0e10cSrcweir }
1414cdf0e10cSrcweir }
1415cdf0e10cSrcweir
1416cdf0e10cSrcweir // --------------------------------------------------------------------
1417cdf0e10cSrcweir
1418cdf0e10cSrcweir // XAnimate
getFrom()1419cdf0e10cSrcweir Any SAL_CALL AnimationNode::getFrom()
1420cdf0e10cSrcweir throw (RuntimeException)
1421cdf0e10cSrcweir {
1422cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1423cdf0e10cSrcweir return maFrom;
1424cdf0e10cSrcweir }
1425cdf0e10cSrcweir
1426cdf0e10cSrcweir // --------------------------------------------------------------------
1427cdf0e10cSrcweir
1428cdf0e10cSrcweir // XAnimate
setFrom(const Any & _from)1429cdf0e10cSrcweir void SAL_CALL AnimationNode::setFrom( const Any& _from )
1430cdf0e10cSrcweir throw (RuntimeException)
1431cdf0e10cSrcweir {
1432cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1433cdf0e10cSrcweir if( _from != maFrom )
1434cdf0e10cSrcweir {
1435cdf0e10cSrcweir maFrom = _from;
1436cdf0e10cSrcweir fireChangeListener();
1437cdf0e10cSrcweir }
1438cdf0e10cSrcweir }
1439cdf0e10cSrcweir
1440cdf0e10cSrcweir // --------------------------------------------------------------------
1441cdf0e10cSrcweir
1442cdf0e10cSrcweir // XAnimate
getTo()1443cdf0e10cSrcweir Any SAL_CALL AnimationNode::getTo()
1444cdf0e10cSrcweir throw (RuntimeException)
1445cdf0e10cSrcweir {
1446cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1447cdf0e10cSrcweir return maTo;
1448cdf0e10cSrcweir }
1449cdf0e10cSrcweir
1450cdf0e10cSrcweir // --------------------------------------------------------------------
1451cdf0e10cSrcweir
1452cdf0e10cSrcweir // XAnimate
setTo(const Any & _to)1453cdf0e10cSrcweir void SAL_CALL AnimationNode::setTo( const Any& _to )
1454cdf0e10cSrcweir throw (RuntimeException)
1455cdf0e10cSrcweir {
1456cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1457cdf0e10cSrcweir if( _to != maTo )
1458cdf0e10cSrcweir {
1459cdf0e10cSrcweir maTo = _to;
1460cdf0e10cSrcweir fireChangeListener();
1461cdf0e10cSrcweir }
1462cdf0e10cSrcweir }
1463cdf0e10cSrcweir
1464cdf0e10cSrcweir // --------------------------------------------------------------------
1465cdf0e10cSrcweir
1466cdf0e10cSrcweir // XAnimate
getBy()1467cdf0e10cSrcweir Any SAL_CALL AnimationNode::getBy()
1468cdf0e10cSrcweir throw (RuntimeException)
1469cdf0e10cSrcweir {
1470cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1471cdf0e10cSrcweir return maBy;
1472cdf0e10cSrcweir }
1473cdf0e10cSrcweir
1474cdf0e10cSrcweir // --------------------------------------------------------------------
1475cdf0e10cSrcweir
1476cdf0e10cSrcweir // XAnimate
setBy(const Any & _by)1477cdf0e10cSrcweir void SAL_CALL AnimationNode::setBy( const Any& _by )
1478cdf0e10cSrcweir throw (RuntimeException)
1479cdf0e10cSrcweir {
1480cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1481cdf0e10cSrcweir if( _by != maBy )
1482cdf0e10cSrcweir {
1483cdf0e10cSrcweir maBy = _by;
1484cdf0e10cSrcweir fireChangeListener();
1485cdf0e10cSrcweir }
1486cdf0e10cSrcweir }
1487cdf0e10cSrcweir
1488cdf0e10cSrcweir // --------------------------------------------------------------------
1489cdf0e10cSrcweir
1490cdf0e10cSrcweir // XAnimate
getTimeFilter()1491cdf0e10cSrcweir Sequence< TimeFilterPair > SAL_CALL AnimationNode::getTimeFilter()
1492cdf0e10cSrcweir throw (RuntimeException)
1493cdf0e10cSrcweir {
1494cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1495cdf0e10cSrcweir return maTimeFilter;
1496cdf0e10cSrcweir }
1497cdf0e10cSrcweir
1498cdf0e10cSrcweir // --------------------------------------------------------------------
1499cdf0e10cSrcweir
1500cdf0e10cSrcweir // XAnimate
setTimeFilter(const Sequence<TimeFilterPair> & _timefilter)1501cdf0e10cSrcweir void SAL_CALL AnimationNode::setTimeFilter( const Sequence< TimeFilterPair >& _timefilter )
1502cdf0e10cSrcweir throw (RuntimeException)
1503cdf0e10cSrcweir {
1504cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1505cdf0e10cSrcweir maTimeFilter = _timefilter;
1506cdf0e10cSrcweir fireChangeListener();
1507cdf0e10cSrcweir }
1508cdf0e10cSrcweir
1509cdf0e10cSrcweir // --------------------------------------------------------------------
1510cdf0e10cSrcweir
getFormula()1511cdf0e10cSrcweir OUString SAL_CALL AnimationNode::getFormula() throw (RuntimeException)
1512cdf0e10cSrcweir {
1513cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1514cdf0e10cSrcweir return maFormula;
1515cdf0e10cSrcweir }
1516cdf0e10cSrcweir
1517cdf0e10cSrcweir // --------------------------------------------------------------------
1518cdf0e10cSrcweir
setFormula(const OUString & _formula)1519cdf0e10cSrcweir void SAL_CALL AnimationNode::setFormula( const OUString& _formula ) throw (RuntimeException)
1520cdf0e10cSrcweir {
1521cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1522cdf0e10cSrcweir if( _formula != maFormula )
1523cdf0e10cSrcweir {
1524cdf0e10cSrcweir maFormula = _formula;
1525cdf0e10cSrcweir fireChangeListener();
1526cdf0e10cSrcweir }
1527cdf0e10cSrcweir }
1528cdf0e10cSrcweir
1529cdf0e10cSrcweir // --------------------------------------------------------------------
1530cdf0e10cSrcweir
1531cdf0e10cSrcweir // XAnimateColor
getColorInterpolation()1532cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getColorInterpolation() throw (RuntimeException)
1533cdf0e10cSrcweir {
1534cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1535cdf0e10cSrcweir return mnColorSpace;
1536cdf0e10cSrcweir }
1537cdf0e10cSrcweir
1538cdf0e10cSrcweir // --------------------------------------------------------------------
1539cdf0e10cSrcweir
1540cdf0e10cSrcweir // XAnimateColor
setColorInterpolation(sal_Int16 _colorspace)1541cdf0e10cSrcweir void SAL_CALL AnimationNode::setColorInterpolation( sal_Int16 _colorspace ) throw (RuntimeException)
1542cdf0e10cSrcweir {
1543cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1544cdf0e10cSrcweir if( _colorspace != mnColorSpace )
1545cdf0e10cSrcweir {
1546cdf0e10cSrcweir mnColorSpace = _colorspace;
1547cdf0e10cSrcweir fireChangeListener();
1548cdf0e10cSrcweir }
1549cdf0e10cSrcweir }
1550cdf0e10cSrcweir
1551cdf0e10cSrcweir // --------------------------------------------------------------------
1552cdf0e10cSrcweir
1553cdf0e10cSrcweir // XAnimateColor
getDirection()1554cdf0e10cSrcweir sal_Bool SAL_CALL AnimationNode::getDirection() throw (RuntimeException)
1555cdf0e10cSrcweir {
1556cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1557cdf0e10cSrcweir return mbDirection;
1558cdf0e10cSrcweir }
1559cdf0e10cSrcweir
1560cdf0e10cSrcweir // --------------------------------------------------------------------
1561cdf0e10cSrcweir
1562cdf0e10cSrcweir // XAnimateColor
setDirection(sal_Bool _direction)1563cdf0e10cSrcweir void SAL_CALL AnimationNode::setDirection( sal_Bool _direction ) throw (RuntimeException)
1564cdf0e10cSrcweir {
1565cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1566cdf0e10cSrcweir if( _direction != mbDirection )
1567cdf0e10cSrcweir {
1568cdf0e10cSrcweir mbDirection = _direction;
1569cdf0e10cSrcweir fireChangeListener();
1570cdf0e10cSrcweir }
1571cdf0e10cSrcweir }
1572cdf0e10cSrcweir
1573cdf0e10cSrcweir // --------------------------------------------------------------------
1574cdf0e10cSrcweir
1575cdf0e10cSrcweir // XAnimateMotion
getPath()1576cdf0e10cSrcweir Any SAL_CALL AnimationNode::getPath() throw (RuntimeException)
1577cdf0e10cSrcweir {
1578cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1579cdf0e10cSrcweir return maPath;
1580cdf0e10cSrcweir }
1581cdf0e10cSrcweir
1582cdf0e10cSrcweir // --------------------------------------------------------------------
1583cdf0e10cSrcweir
1584cdf0e10cSrcweir // XAnimateMotion
setPath(const Any & _path)1585cdf0e10cSrcweir void SAL_CALL AnimationNode::setPath( const Any& _path ) throw (RuntimeException)
1586cdf0e10cSrcweir {
1587cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1588cdf0e10cSrcweir maPath = _path;
1589cdf0e10cSrcweir fireChangeListener();
1590cdf0e10cSrcweir }
1591cdf0e10cSrcweir
1592cdf0e10cSrcweir // --------------------------------------------------------------------
1593cdf0e10cSrcweir
1594cdf0e10cSrcweir // XAnimateMotion
getOrigin()1595cdf0e10cSrcweir Any SAL_CALL AnimationNode::getOrigin() throw (RuntimeException)
1596cdf0e10cSrcweir {
1597cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1598cdf0e10cSrcweir return maOrigin;
1599cdf0e10cSrcweir }
1600cdf0e10cSrcweir
1601cdf0e10cSrcweir // --------------------------------------------------------------------
1602cdf0e10cSrcweir
1603cdf0e10cSrcweir // XAnimateMotion
setOrigin(const Any & _origin)1604cdf0e10cSrcweir void SAL_CALL AnimationNode::setOrigin( const Any& _origin ) throw (RuntimeException)
1605cdf0e10cSrcweir {
1606cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1607cdf0e10cSrcweir maOrigin = _origin;
1608cdf0e10cSrcweir fireChangeListener();
1609cdf0e10cSrcweir }
1610cdf0e10cSrcweir
1611cdf0e10cSrcweir // --------------------------------------------------------------------
1612cdf0e10cSrcweir
1613cdf0e10cSrcweir // XAnimateTransform
getTransformType()1614cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getTransformType() throw (RuntimeException)
1615cdf0e10cSrcweir {
1616cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1617cdf0e10cSrcweir return mnTransformType;
1618cdf0e10cSrcweir }
1619cdf0e10cSrcweir
1620cdf0e10cSrcweir // --------------------------------------------------------------------
1621cdf0e10cSrcweir
1622cdf0e10cSrcweir // XAnimateTransform
setTransformType(sal_Int16 _transformtype)1623cdf0e10cSrcweir void SAL_CALL AnimationNode::setTransformType( sal_Int16 _transformtype ) throw (RuntimeException)
1624cdf0e10cSrcweir {
1625cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1626cdf0e10cSrcweir if( _transformtype != mnTransformType )
1627cdf0e10cSrcweir {
1628cdf0e10cSrcweir mnTransformType = _transformtype;
1629cdf0e10cSrcweir fireChangeListener();
1630cdf0e10cSrcweir }
1631cdf0e10cSrcweir }
1632cdf0e10cSrcweir
1633cdf0e10cSrcweir // --------------------------------------------------------------------
1634cdf0e10cSrcweir
1635cdf0e10cSrcweir // XTransitionFilter
getTransition()1636cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getTransition() throw (RuntimeException)
1637cdf0e10cSrcweir {
1638cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1639cdf0e10cSrcweir return mnTransition;
1640cdf0e10cSrcweir }
1641cdf0e10cSrcweir
1642cdf0e10cSrcweir // --------------------------------------------------------------------
1643cdf0e10cSrcweir
1644cdf0e10cSrcweir // XTransitionFilter
setTransition(sal_Int16 _transition)1645cdf0e10cSrcweir void SAL_CALL AnimationNode::setTransition( sal_Int16 _transition ) throw (RuntimeException)
1646cdf0e10cSrcweir {
1647cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1648cdf0e10cSrcweir if( _transition != mnTransition )
1649cdf0e10cSrcweir {
1650cdf0e10cSrcweir mnTransition = _transition;
1651cdf0e10cSrcweir fireChangeListener();
1652cdf0e10cSrcweir }
1653cdf0e10cSrcweir }
1654cdf0e10cSrcweir
1655cdf0e10cSrcweir // --------------------------------------------------------------------
1656cdf0e10cSrcweir
1657cdf0e10cSrcweir // XTransitionFilter
getSubtype()1658cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getSubtype() throw (RuntimeException)
1659cdf0e10cSrcweir {
1660cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1661cdf0e10cSrcweir return mnSubtype;
1662cdf0e10cSrcweir }
1663cdf0e10cSrcweir
1664cdf0e10cSrcweir // --------------------------------------------------------------------
1665cdf0e10cSrcweir
1666cdf0e10cSrcweir // XTransitionFilter
setSubtype(sal_Int16 _subtype)1667cdf0e10cSrcweir void SAL_CALL AnimationNode::setSubtype( sal_Int16 _subtype ) throw (RuntimeException)
1668cdf0e10cSrcweir {
1669cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1670cdf0e10cSrcweir if( _subtype != mnSubtype )
1671cdf0e10cSrcweir {
1672cdf0e10cSrcweir mnSubtype = _subtype;
1673cdf0e10cSrcweir fireChangeListener();
1674cdf0e10cSrcweir }
1675cdf0e10cSrcweir }
1676cdf0e10cSrcweir
1677cdf0e10cSrcweir // --------------------------------------------------------------------
1678cdf0e10cSrcweir
1679cdf0e10cSrcweir // XTransitionFilter
getMode()1680cdf0e10cSrcweir sal_Bool SAL_CALL AnimationNode::getMode() throw (RuntimeException)
1681cdf0e10cSrcweir {
1682cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1683cdf0e10cSrcweir return mbMode;
1684cdf0e10cSrcweir }
1685cdf0e10cSrcweir
1686cdf0e10cSrcweir // --------------------------------------------------------------------
1687cdf0e10cSrcweir
1688cdf0e10cSrcweir // XTransitionFilter
setMode(sal_Bool _mode)1689cdf0e10cSrcweir void SAL_CALL AnimationNode::setMode( sal_Bool _mode ) throw (RuntimeException)
1690cdf0e10cSrcweir {
1691cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1692cdf0e10cSrcweir if( _mode != mbMode )
1693cdf0e10cSrcweir {
1694cdf0e10cSrcweir mbMode = _mode;
1695cdf0e10cSrcweir fireChangeListener();
1696cdf0e10cSrcweir }
1697cdf0e10cSrcweir }
1698cdf0e10cSrcweir
1699cdf0e10cSrcweir // --------------------------------------------------------------------
1700cdf0e10cSrcweir
1701cdf0e10cSrcweir // XTransitionFilter
getFadeColor()1702cdf0e10cSrcweir sal_Int32 SAL_CALL AnimationNode::getFadeColor() throw (RuntimeException)
1703cdf0e10cSrcweir {
1704cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1705cdf0e10cSrcweir return mnFadeColor;
1706cdf0e10cSrcweir }
1707cdf0e10cSrcweir
1708cdf0e10cSrcweir // --------------------------------------------------------------------
1709cdf0e10cSrcweir
1710cdf0e10cSrcweir // XTransitionFilter
setFadeColor(sal_Int32 _fadecolor)1711cdf0e10cSrcweir void SAL_CALL AnimationNode::setFadeColor( sal_Int32 _fadecolor ) throw (RuntimeException)
1712cdf0e10cSrcweir {
1713cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1714cdf0e10cSrcweir if( _fadecolor != mnFadeColor )
1715cdf0e10cSrcweir {
1716cdf0e10cSrcweir mnFadeColor = _fadecolor;
1717cdf0e10cSrcweir fireChangeListener();
1718cdf0e10cSrcweir }
1719cdf0e10cSrcweir }
1720cdf0e10cSrcweir
1721cdf0e10cSrcweir // --------------------------------------------------------------------
1722cdf0e10cSrcweir
1723cdf0e10cSrcweir // XAudio
getSource()1724cdf0e10cSrcweir Any SAL_CALL AnimationNode::getSource() throw (RuntimeException)
1725cdf0e10cSrcweir {
1726cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1727cdf0e10cSrcweir return maTarget;
1728cdf0e10cSrcweir }
1729cdf0e10cSrcweir
1730cdf0e10cSrcweir // --------------------------------------------------------------------
1731cdf0e10cSrcweir
1732cdf0e10cSrcweir // XAudio
setSource(const Any & _source)1733cdf0e10cSrcweir void SAL_CALL AnimationNode::setSource( const Any& _source ) throw (RuntimeException)
1734cdf0e10cSrcweir {
1735cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1736cdf0e10cSrcweir maTarget = _source;
1737cdf0e10cSrcweir fireChangeListener();
1738cdf0e10cSrcweir }
1739cdf0e10cSrcweir
1740cdf0e10cSrcweir // --------------------------------------------------------------------
1741cdf0e10cSrcweir
1742cdf0e10cSrcweir // XAudio
getVolume()1743cdf0e10cSrcweir double SAL_CALL AnimationNode::getVolume() throw (RuntimeException)
1744cdf0e10cSrcweir {
1745cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1746cdf0e10cSrcweir return mfVolume;
1747cdf0e10cSrcweir }
1748cdf0e10cSrcweir
1749cdf0e10cSrcweir // --------------------------------------------------------------------
1750cdf0e10cSrcweir
1751cdf0e10cSrcweir // XAudio
setVolume(double _volume)1752cdf0e10cSrcweir void SAL_CALL AnimationNode::setVolume( double _volume ) throw (RuntimeException)
1753cdf0e10cSrcweir {
1754cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1755cdf0e10cSrcweir if( _volume != mfVolume )
1756cdf0e10cSrcweir {
1757cdf0e10cSrcweir mfVolume = _volume;
1758cdf0e10cSrcweir fireChangeListener();
1759cdf0e10cSrcweir }
1760cdf0e10cSrcweir }
1761cdf0e10cSrcweir
1762cdf0e10cSrcweir // --------------------------------------------------------------------
1763cdf0e10cSrcweir
1764cdf0e10cSrcweir // XCommand
getCommand()1765cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getCommand() throw (RuntimeException)
1766cdf0e10cSrcweir {
1767cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1768cdf0e10cSrcweir return mnCommand;
1769cdf0e10cSrcweir }
1770cdf0e10cSrcweir
1771cdf0e10cSrcweir // --------------------------------------------------------------------
1772cdf0e10cSrcweir
1773cdf0e10cSrcweir // XCommand
setCommand(sal_Int16 _command)1774cdf0e10cSrcweir void SAL_CALL AnimationNode::setCommand( sal_Int16 _command ) throw (RuntimeException)
1775cdf0e10cSrcweir {
1776cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1777cdf0e10cSrcweir if( _command != mnCommand )
1778cdf0e10cSrcweir {
1779cdf0e10cSrcweir mnCommand = _command;
1780cdf0e10cSrcweir fireChangeListener();
1781cdf0e10cSrcweir }
1782cdf0e10cSrcweir }
1783cdf0e10cSrcweir
1784cdf0e10cSrcweir // --------------------------------------------------------------------
1785cdf0e10cSrcweir
1786cdf0e10cSrcweir // XCommand
getParameter()1787cdf0e10cSrcweir Any SAL_CALL AnimationNode::getParameter() throw (RuntimeException)
1788cdf0e10cSrcweir {
1789cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1790cdf0e10cSrcweir return maParameter;
1791cdf0e10cSrcweir }
1792cdf0e10cSrcweir
1793cdf0e10cSrcweir // --------------------------------------------------------------------
1794cdf0e10cSrcweir
1795cdf0e10cSrcweir // XCommand
setParameter(const Any & _parameter)1796cdf0e10cSrcweir void SAL_CALL AnimationNode::setParameter( const Any& _parameter ) throw (RuntimeException)
1797cdf0e10cSrcweir {
1798cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1799cdf0e10cSrcweir maParameter = _parameter;
1800cdf0e10cSrcweir fireChangeListener();
1801cdf0e10cSrcweir }
1802cdf0e10cSrcweir
1803cdf0e10cSrcweir // --------------------------------------------------------------------
1804cdf0e10cSrcweir
1805cdf0e10cSrcweir // XElementAccess
getElementType()1806cdf0e10cSrcweir Type SAL_CALL AnimationNode::getElementType() throw (RuntimeException)
1807cdf0e10cSrcweir {
1808cdf0e10cSrcweir return ::getCppuType((const Reference< XAnimationNode >*)0);
1809cdf0e10cSrcweir }
1810cdf0e10cSrcweir
1811cdf0e10cSrcweir // --------------------------------------------------------------------
1812cdf0e10cSrcweir
1813cdf0e10cSrcweir // XElementAccess
hasElements()1814cdf0e10cSrcweir sal_Bool SAL_CALL AnimationNode::hasElements() throw (RuntimeException)
1815cdf0e10cSrcweir {
1816cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1817cdf0e10cSrcweir return !maChilds.empty();
1818cdf0e10cSrcweir }
1819cdf0e10cSrcweir
1820cdf0e10cSrcweir // --------------------------------------------------------------------
1821cdf0e10cSrcweir
1822cdf0e10cSrcweir // XEnumerationAccess
createEnumeration()1823cdf0e10cSrcweir Reference< XEnumeration > SAL_CALL AnimationNode::createEnumeration()
1824cdf0e10cSrcweir throw (RuntimeException)
1825cdf0e10cSrcweir {
1826cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1827cdf0e10cSrcweir
1828cdf0e10cSrcweir return new TimeContainerEnumeration( maChilds);
1829cdf0e10cSrcweir }
1830cdf0e10cSrcweir
1831cdf0e10cSrcweir // --------------------------------------------------------------------
1832cdf0e10cSrcweir
1833cdf0e10cSrcweir
1834cdf0e10cSrcweir // XTimeContainer
insertBefore(const Reference<XAnimationNode> & newChild,const Reference<XAnimationNode> & refChild)1835cdf0e10cSrcweir Reference< XAnimationNode > SAL_CALL AnimationNode::insertBefore( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& refChild )
1836cdf0e10cSrcweir throw (IllegalArgumentException, NoSuchElementException, ElementExistException, WrappedTargetException, RuntimeException)
1837cdf0e10cSrcweir {
1838cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1839cdf0e10cSrcweir
1840cdf0e10cSrcweir if( !newChild.is() || !refChild.is() )
1841cdf0e10cSrcweir throw IllegalArgumentException();
1842cdf0e10cSrcweir
1843cdf0e10cSrcweir ChildList_t::iterator before = ::std::find(maChilds.begin(), maChilds.end(), refChild);
1844cdf0e10cSrcweir if( before == maChilds.end() )
1845cdf0e10cSrcweir throw NoSuchElementException();
1846cdf0e10cSrcweir
1847cdf0e10cSrcweir if( ::std::find(maChilds.begin(), maChilds.end(), newChild) != maChilds.end() )
1848cdf0e10cSrcweir throw ElementExistException();
1849cdf0e10cSrcweir
1850cdf0e10cSrcweir maChilds.insert( before, newChild );
1851cdf0e10cSrcweir
1852cdf0e10cSrcweir Reference< XInterface > xThis( static_cast< OWeakObject * >(this) );
1853cdf0e10cSrcweir newChild->setParent( xThis );
1854cdf0e10cSrcweir
1855cdf0e10cSrcweir return newChild;
1856cdf0e10cSrcweir }
1857cdf0e10cSrcweir
1858cdf0e10cSrcweir // --------------------------------------------------------------------
1859cdf0e10cSrcweir
1860cdf0e10cSrcweir // XTimeContainer
insertAfter(const Reference<XAnimationNode> & newChild,const Reference<XAnimationNode> & refChild)1861cdf0e10cSrcweir Reference< XAnimationNode > SAL_CALL AnimationNode::insertAfter( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& refChild )
1862cdf0e10cSrcweir throw (IllegalArgumentException, NoSuchElementException, ElementExistException, WrappedTargetException, RuntimeException)
1863cdf0e10cSrcweir {
1864cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1865cdf0e10cSrcweir
1866cdf0e10cSrcweir if( !newChild.is() || !refChild.is() )
1867cdf0e10cSrcweir throw IllegalArgumentException();
1868cdf0e10cSrcweir
1869cdf0e10cSrcweir ChildList_t::iterator before = ::std::find(maChilds.begin(), maChilds.end(), refChild);
1870cdf0e10cSrcweir if( before == maChilds.end() )
1871cdf0e10cSrcweir throw NoSuchElementException();
1872cdf0e10cSrcweir
1873cdf0e10cSrcweir if( ::std::find(maChilds.begin(), maChilds.end(), newChild) != maChilds.end() )
1874cdf0e10cSrcweir throw ElementExistException();
1875cdf0e10cSrcweir
1876cdf0e10cSrcweir before++;
1877cdf0e10cSrcweir if( before != maChilds.end() )
1878cdf0e10cSrcweir maChilds.insert( before, newChild );
1879cdf0e10cSrcweir else
1880cdf0e10cSrcweir maChilds.push_back( newChild );
1881cdf0e10cSrcweir
1882cdf0e10cSrcweir Reference< XInterface > xThis( static_cast< OWeakObject * >(this) );
1883cdf0e10cSrcweir newChild->setParent( xThis );
1884cdf0e10cSrcweir
1885cdf0e10cSrcweir return newChild;
1886cdf0e10cSrcweir }
1887cdf0e10cSrcweir
1888cdf0e10cSrcweir // --------------------------------------------------------------------
1889cdf0e10cSrcweir
1890cdf0e10cSrcweir // XTimeContainer
replaceChild(const Reference<XAnimationNode> & newChild,const Reference<XAnimationNode> & oldChild)1891cdf0e10cSrcweir Reference< XAnimationNode > SAL_CALL AnimationNode::replaceChild( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& oldChild )
1892cdf0e10cSrcweir throw( IllegalArgumentException, NoSuchElementException, ElementExistException, WrappedTargetException, RuntimeException)
1893cdf0e10cSrcweir {
1894cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1895cdf0e10cSrcweir
1896cdf0e10cSrcweir if( !newChild.is() || !oldChild.is() )
1897cdf0e10cSrcweir throw IllegalArgumentException();
1898cdf0e10cSrcweir
1899cdf0e10cSrcweir ChildList_t::iterator replace = ::std::find(maChilds.begin(), maChilds.end(), oldChild);
1900cdf0e10cSrcweir if( replace == maChilds.end() )
1901cdf0e10cSrcweir throw NoSuchElementException();
1902cdf0e10cSrcweir
1903cdf0e10cSrcweir if( ::std::find(maChilds.begin(), maChilds.end(), newChild) != maChilds.end() )
1904cdf0e10cSrcweir throw ElementExistException();
1905cdf0e10cSrcweir
1906cdf0e10cSrcweir Reference< XInterface > xNull( 0 );
1907cdf0e10cSrcweir oldChild->setParent( xNull );
1908cdf0e10cSrcweir
1909cdf0e10cSrcweir (*replace) = newChild;
1910cdf0e10cSrcweir
1911cdf0e10cSrcweir Reference< XInterface > xThis( static_cast< OWeakObject * >(this) );
1912cdf0e10cSrcweir newChild->setParent( xThis );
1913cdf0e10cSrcweir
1914cdf0e10cSrcweir return newChild;
1915cdf0e10cSrcweir }
1916cdf0e10cSrcweir
1917cdf0e10cSrcweir // --------------------------------------------------------------------
1918cdf0e10cSrcweir
1919cdf0e10cSrcweir // XTimeContainer
removeChild(const Reference<XAnimationNode> & oldChild)1920cdf0e10cSrcweir Reference< XAnimationNode > SAL_CALL AnimationNode::removeChild( const Reference< XAnimationNode >& oldChild )
1921cdf0e10cSrcweir throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
1922cdf0e10cSrcweir {
1923cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1924cdf0e10cSrcweir
1925cdf0e10cSrcweir if( !oldChild.is() )
1926cdf0e10cSrcweir throw IllegalArgumentException();
1927cdf0e10cSrcweir
1928cdf0e10cSrcweir ChildList_t::iterator old = ::std::find(maChilds.begin(), maChilds.end(), oldChild);
1929cdf0e10cSrcweir if( old == maChilds.end() )
1930cdf0e10cSrcweir throw NoSuchElementException();
1931cdf0e10cSrcweir
1932cdf0e10cSrcweir Reference< XInterface > xNull( 0 );
1933cdf0e10cSrcweir oldChild->setParent( xNull );
1934cdf0e10cSrcweir
1935cdf0e10cSrcweir maChilds.erase( old );
1936cdf0e10cSrcweir
1937cdf0e10cSrcweir return oldChild;
1938cdf0e10cSrcweir }
1939cdf0e10cSrcweir
1940cdf0e10cSrcweir // --------------------------------------------------------------------
1941cdf0e10cSrcweir
1942cdf0e10cSrcweir // XTimeContainer
appendChild(const Reference<XAnimationNode> & newChild)1943cdf0e10cSrcweir Reference< XAnimationNode > SAL_CALL AnimationNode::appendChild( const Reference< XAnimationNode >& newChild )
1944cdf0e10cSrcweir throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
1945cdf0e10cSrcweir {
1946cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1947cdf0e10cSrcweir
1948cdf0e10cSrcweir if( !newChild.is() )
1949cdf0e10cSrcweir throw IllegalArgumentException();
1950cdf0e10cSrcweir
1951cdf0e10cSrcweir if( ::std::find(maChilds.begin(), maChilds.end(), newChild) != maChilds.end() )
1952cdf0e10cSrcweir throw ElementExistException();
1953cdf0e10cSrcweir
1954cdf0e10cSrcweir Reference< XInterface > xThis( static_cast< OWeakObject * >(this) );
1955cdf0e10cSrcweir Reference< XInterface > xChild( newChild );
1956cdf0e10cSrcweir
1957cdf0e10cSrcweir if( xThis == xChild )
1958cdf0e10cSrcweir throw IllegalArgumentException();
1959cdf0e10cSrcweir
1960cdf0e10cSrcweir maChilds.push_back( newChild );
1961cdf0e10cSrcweir
1962cdf0e10cSrcweir newChild->setParent( xThis );
1963cdf0e10cSrcweir
1964cdf0e10cSrcweir return newChild;
1965cdf0e10cSrcweir }
1966cdf0e10cSrcweir
1967cdf0e10cSrcweir // --------------------------------------------------------------------
1968cdf0e10cSrcweir
1969cdf0e10cSrcweir // XIterateContainer
getIterateType()1970cdf0e10cSrcweir sal_Int16 SAL_CALL AnimationNode::getIterateType() throw (RuntimeException)
1971cdf0e10cSrcweir {
1972cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1973cdf0e10cSrcweir return mnIterateType;
1974cdf0e10cSrcweir }
1975cdf0e10cSrcweir
1976cdf0e10cSrcweir // --------------------------------------------------------------------
1977cdf0e10cSrcweir
1978cdf0e10cSrcweir // XIterateContainer
setIterateType(sal_Int16 _iteratetype)1979cdf0e10cSrcweir void SAL_CALL AnimationNode::setIterateType( sal_Int16 _iteratetype ) throw (RuntimeException)
1980cdf0e10cSrcweir {
1981cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1982cdf0e10cSrcweir if( _iteratetype != mnIterateType )
1983cdf0e10cSrcweir {
1984cdf0e10cSrcweir mnIterateType = _iteratetype;
1985cdf0e10cSrcweir fireChangeListener();
1986cdf0e10cSrcweir }
1987cdf0e10cSrcweir }
1988cdf0e10cSrcweir
1989cdf0e10cSrcweir // --------------------------------------------------------------------
1990cdf0e10cSrcweir
1991cdf0e10cSrcweir // XIterateContainer
getIterateInterval()1992cdf0e10cSrcweir double SAL_CALL AnimationNode::getIterateInterval() throw (RuntimeException)
1993cdf0e10cSrcweir {
1994cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
1995cdf0e10cSrcweir return mfIterateInterval;
1996cdf0e10cSrcweir }
1997cdf0e10cSrcweir
1998cdf0e10cSrcweir // --------------------------------------------------------------------
1999cdf0e10cSrcweir
2000cdf0e10cSrcweir // XIterateContainer
setIterateInterval(double _iterateinterval)2001cdf0e10cSrcweir void SAL_CALL AnimationNode::setIterateInterval( double _iterateinterval ) throw (RuntimeException)
2002cdf0e10cSrcweir {
2003cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
2004cdf0e10cSrcweir if( _iterateinterval != mfIterateInterval )
2005cdf0e10cSrcweir {
2006cdf0e10cSrcweir mfIterateInterval = _iterateinterval;
2007cdf0e10cSrcweir fireChangeListener();
2008cdf0e10cSrcweir }
2009cdf0e10cSrcweir }
2010cdf0e10cSrcweir
2011cdf0e10cSrcweir // --------------------------------------------------------------------
2012cdf0e10cSrcweir
2013cdf0e10cSrcweir // XChangesNotifier
addChangesListener(const Reference<XChangesListener> & aListener)2014cdf0e10cSrcweir void SAL_CALL AnimationNode::addChangesListener( const Reference< XChangesListener >& aListener ) throw (RuntimeException)
2015cdf0e10cSrcweir {
2016cdf0e10cSrcweir maChangeListener.addInterface( aListener );
2017cdf0e10cSrcweir }
2018cdf0e10cSrcweir
2019cdf0e10cSrcweir // --------------------------------------------------------------------
2020cdf0e10cSrcweir
2021cdf0e10cSrcweir // XChangesNotifier
removeChangesListener(const Reference<XChangesListener> & aListener)2022cdf0e10cSrcweir void SAL_CALL AnimationNode::removeChangesListener( const Reference< XChangesListener >& aListener ) throw (RuntimeException)
2023cdf0e10cSrcweir {
2024cdf0e10cSrcweir maChangeListener.removeInterface(aListener);
2025cdf0e10cSrcweir }
2026cdf0e10cSrcweir
2027cdf0e10cSrcweir // --------------------------------------------------------------------
2028cdf0e10cSrcweir
2029cdf0e10cSrcweir // XUnoTunnel
getSomething(const Sequence<::sal_Int8> & rId)2030cdf0e10cSrcweir ::sal_Int64 SAL_CALL AnimationNode::getSomething( const Sequence< ::sal_Int8 >& rId ) throw (RuntimeException)
2031cdf0e10cSrcweir {
2032cdf0e10cSrcweir if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
2033cdf0e10cSrcweir {
2034cdf0e10cSrcweir return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr >(this));
2035cdf0e10cSrcweir
2036cdf0e10cSrcweir }
2037cdf0e10cSrcweir else
2038cdf0e10cSrcweir {
2039cdf0e10cSrcweir return 0;
2040cdf0e10cSrcweir }
2041cdf0e10cSrcweir }
2042cdf0e10cSrcweir
2043cdf0e10cSrcweir // --------------------------------------------------------------------
2044cdf0e10cSrcweir
getUnoTunnelId()2045cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< sal_Int8 > & AnimationNode::getUnoTunnelId()
2046cdf0e10cSrcweir {
2047cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< sal_Int8 > * pSeq = 0;
2048cdf0e10cSrcweir if( !pSeq )
2049cdf0e10cSrcweir {
2050cdf0e10cSrcweir ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() );
2051cdf0e10cSrcweir if( !pSeq )
2052cdf0e10cSrcweir {
2053cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 );
2054cdf0e10cSrcweir rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
2055cdf0e10cSrcweir pSeq = &aSeq;
2056cdf0e10cSrcweir }
2057cdf0e10cSrcweir }
2058cdf0e10cSrcweir return *pSeq;
2059cdf0e10cSrcweir }
2060cdf0e10cSrcweir
2061cdf0e10cSrcweir // --------------------------------------------------------------------
2062cdf0e10cSrcweir
fireChangeListener()2063cdf0e10cSrcweir void AnimationNode::fireChangeListener()
2064cdf0e10cSrcweir {
2065cdf0e10cSrcweir Guard< Mutex > aGuard( maMutex );
2066cdf0e10cSrcweir
2067cdf0e10cSrcweir OInterfaceIteratorHelper aIterator( maChangeListener );
2068cdf0e10cSrcweir if( aIterator.hasMoreElements() )
2069cdf0e10cSrcweir {
2070cdf0e10cSrcweir Reference< XInterface > xSource( static_cast<OWeakObject*>(this), UNO_QUERY );
2071cdf0e10cSrcweir Sequence< ElementChange > aChanges;
2072f59b791fSJian Fang Zhang const ChangesEvent aEvent( xSource, makeAny( mxParent.get() ), aChanges );
2073cdf0e10cSrcweir while( aIterator.hasMoreElements() )
2074cdf0e10cSrcweir {
2075cdf0e10cSrcweir Reference< XChangesListener > xListener( aIterator.next(), UNO_QUERY );
2076cdf0e10cSrcweir if( xListener.is() )
2077cdf0e10cSrcweir xListener->changesOccurred( aEvent );
2078cdf0e10cSrcweir }
2079cdf0e10cSrcweir }
2080cdf0e10cSrcweir
2081*0f681397SArmin Le Grand // #i123585# check mpParent, it is extracted from mxParent (see AnimationNode::setParent)
2082*0f681397SArmin Le Grand // and may be invalid when mxParent got deleted in the meantime
2083*0f681397SArmin Le Grand if(mpParent)
2084*0f681397SArmin Le Grand {
2085*0f681397SArmin Le Grand Reference< XInterface > xCheckReference(mxParent);
2086*0f681397SArmin Le Grand
2087*0f681397SArmin Le Grand if(!xCheckReference.is())
2088*0f681397SArmin Le Grand {
2089*0f681397SArmin Le Grand mpParent = 0;
2090*0f681397SArmin Le Grand }
2091*0f681397SArmin Le Grand }
2092*0f681397SArmin Le Grand
2093cdf0e10cSrcweir if( mpParent )
2094cdf0e10cSrcweir mpParent->fireChangeListener();
2095cdf0e10cSrcweir }
2096cdf0e10cSrcweir
2097cdf0e10cSrcweir // --------------------------------------------------------------------
2098cdf0e10cSrcweir
2099cdf0e10cSrcweir } // namespace animcore
2100