xref: /trunk/main/sd/source/ui/unoidl/randomnode.cxx (revision 45c5a00162811bd03b87fcb4fe9996782f2b59ec)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 // MARKER(update_precomp.py): autogen include statement, do not remove
26 #include "precompiled_sd.hxx"
27 #include <com/sun/star/animations/XTimeContainer.hpp>
28 #include <com/sun/star/presentation/ParagraphTarget.hpp>
29 #include <com/sun/star/animations/AnimationFill.hpp>
30 #include <com/sun/star/animations/XAnimate.hpp>
31 #include <com/sun/star/animations/AnimationRestart.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/container/XEnumerationAccess.hpp>
35 #include <com/sun/star/util/XCloneable.hpp>
36 #include <comphelper/processfactory.hxx>
37 
38 #include <cppuhelper/implbase5.hxx>
39 #include <osl/mutex.hxx>
40 #include "CustomAnimationPreset.hxx"
41 
42 using ::osl::Mutex;
43 using ::osl::Guard;
44 using ::rtl::OUString;
45 
46 using ::com::sun::star::uno::Reference;
47 using ::com::sun::star::uno::RuntimeException;
48 using ::com::sun::star::uno::Exception;
49 using ::com::sun::star::uno::Sequence;
50 using ::com::sun::star::uno::Any;
51 using ::com::sun::star::uno::UNO_QUERY;
52 using ::com::sun::star::uno::XInterface;
53 using ::com::sun::star::lang::NoSupportException;
54 using ::com::sun::star::beans::NamedValue;
55 using ::com::sun::star::lang::IllegalArgumentException;
56 using ::com::sun::star::container::NoSuchElementException;
57 using ::com::sun::star::container::ElementExistException;
58 using ::com::sun::star::lang::WrappedTargetException;
59 using ::com::sun::star::container::XEnumeration;
60 using ::com::sun::star::container::XEnumerationAccess;
61 using ::com::sun::star::util::XCloneable;
62 using ::com::sun::star::lang::XServiceInfo;
63 using ::com::sun::star::lang::XInitialization;
64 using ::com::sun::star::uno::Type;
65 using ::com::sun::star::uno::XWeak;
66 using ::com::sun::star::lang::XMultiServiceFactory;
67 using ::com::sun::star::presentation::ParagraphTarget;
68 using ::com::sun::star::drawing::XShape;
69 
70 using namespace ::com::sun::star::animations;
71 namespace sd
72 {
73 
74 typedef ::cppu::WeakImplHelper5< XTimeContainer, XEnumerationAccess, XCloneable, XServiceInfo, XInitialization > RandomAnimationNodeBase;
75 class RandomAnimationNode : public RandomAnimationNodeBase
76 {
77 public:
78     RandomAnimationNode( const RandomAnimationNode& rNode );
79     RandomAnimationNode( sal_Int16 nPresetClass );
80     RandomAnimationNode();
81 
82     void init( sal_Int16 nPresetClass );
83 
84     // XInitialization
85     void SAL_CALL initialize( const Sequence< Any >& aArguments );
86 
87     // XChild
88     Reference< XInterface > SAL_CALL getParent(  );
89     void SAL_CALL setParent( const Reference< XInterface >& Parent );
90 
91     // XCloneable
92     virtual Reference< XCloneable > SAL_CALL createClone();
93 
94     // XServiceInfo
95     OUString SAL_CALL getImplementationName() throw();
96     Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw();
97     sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw();
98 
99     // XAnimationNode
100     ::sal_Int16 SAL_CALL getType();
101     Any SAL_CALL getBegin();
102     void SAL_CALL setBegin( const Any& _begin );
103     Any SAL_CALL getDuration();
104     void SAL_CALL setDuration( const Any& _duration );
105     Any SAL_CALL getEnd();
106     void SAL_CALL setEnd( const Any& _end );
107     Any SAL_CALL getEndSync();
108     void SAL_CALL setEndSync( const Any& _endsync );
109     Any SAL_CALL getRepeatCount();
110     void SAL_CALL setRepeatCount( const Any& _repeatcount );
111     Any SAL_CALL getRepeatDuration();
112     void SAL_CALL setRepeatDuration( const Any& _repeatduration );
113     ::sal_Int16 SAL_CALL getFill();
114     void SAL_CALL setFill( ::sal_Int16 _fill );
115     ::sal_Int16 SAL_CALL getFillDefault();
116     void SAL_CALL setFillDefault( ::sal_Int16 _filldefault );
117     ::sal_Int16 SAL_CALL getRestart();
118     void SAL_CALL setRestart( ::sal_Int16 _restart );
119     ::sal_Int16 SAL_CALL getRestartDefault();
120     void SAL_CALL setRestartDefault( ::sal_Int16 _restartdefault );
121     double SAL_CALL getAcceleration();
122     void SAL_CALL setAcceleration( double _acceleration );
123     double SAL_CALL getDecelerate();
124     void SAL_CALL setDecelerate( double _decelerate );
125     ::sal_Bool SAL_CALL getAutoReverse();
126     void SAL_CALL setAutoReverse( ::sal_Bool _autoreverse );
127     Sequence< NamedValue > SAL_CALL getUserData();
128     void SAL_CALL setUserData( const Sequence< NamedValue >& _userdata );
129 
130     // XElementAccess
131     virtual Type SAL_CALL getElementType();
132     virtual sal_Bool SAL_CALL hasElements();
133 
134     // XEnumerationAccess
135     virtual Reference< XEnumeration > SAL_CALL createEnumeration();
136 
137     // XTimeContainer
138     Reference< XAnimationNode > SAL_CALL insertBefore( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& refChild );
139     Reference< XAnimationNode > SAL_CALL insertAfter( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& refChild );
140     Reference< XAnimationNode > SAL_CALL replaceChild( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >& oldChild );
141     Reference< XAnimationNode > SAL_CALL removeChild( const Reference< XAnimationNode >& oldChild );
142     Reference< XAnimationNode > SAL_CALL appendChild( const Reference< XAnimationNode >& newChild );
143 
144 private:
145     // our first, last and only protection from mutli-threads!
146     Mutex maMutex;
147 
148     sal_Int16 mnPresetClass;
149     Reference< XInterface > mxParent;
150 
151     Any maBegin, maDuration, maEnd, maEndSync, maRepeatCount, maRepeatDuration, maTarget;
152     sal_Int16 mnFill, mnFillDefault, mnRestart, mnRestartDefault;
153     double mfAcceleration, mfDecelerate;
154     sal_Bool mbAutoReverse;
155     Sequence< NamedValue > maUserData;
156 
157     Reference< XAnimate > mxFirstNode;
158 };
159 
160 // --------------------------------------------------------------------
161 
162 static const sal_Char* pSN1 = "com.sun.star.animations.ParallelTimeContainer";
163 static const sal_Char* pSN2 = "com.sun.star.comp.sd.RandomAnimationNode";
164 
165 // --------------------------------------------------------------------
166 
167 SD_DLLPUBLIC Reference< XInterface > RandomAnimationNode_createInstance( sal_Int16 nPresetClass )
168 {
169     Reference< XInterface > xInt( static_cast<XWeak*>( new RandomAnimationNode( nPresetClass ) ) );
170     return xInt;
171 }
172 
173 // --------------------------------------------------------------------
174 
175 Reference< XInterface > SAL_CALL RandomNode_createInstance( const Reference< XMultiServiceFactory > &  )
176 {
177     Reference< XInterface > xInt( static_cast<XWeak*>( new RandomAnimationNode() ) );
178     return xInt;
179 }
180 
181 // --------------------------------------------------------------------
182 
183 OUString RandomNode__getImplementationName()
184 {
185     return OUString( RTL_CONSTASCII_USTRINGPARAM( "sd::RandomAnimationNode" ) );
186 }
187 
188 // --------------------------------------------------------------------
189 
190 Sequence< OUString > SAL_CALL RandomNode_getSupportedServiceNames()
191 {
192 //  static const OUString aSN1( OUString::createFromAscii( pSN1 ) );
193     static const OUString aSN2( OUString::createFromAscii( pSN2 ) );
194     Sequence< OUString > aSeq( &aSN2, 1 );
195 //  aSeq[0] = aSN1;
196 /// aSeq[1] = aSN2;
197     return aSeq;
198 }
199 
200 // --------------------------------------------------------------------
201 
202 RandomAnimationNode::RandomAnimationNode( const RandomAnimationNode& rNode )
203 :   RandomAnimationNodeBase(),
204     mnPresetClass( rNode.mnPresetClass ),
205     maBegin( rNode.maBegin ),
206     maDuration( rNode.maDuration ),
207     maEnd( rNode.maEnd ),
208     maEndSync( rNode.maEndSync ),
209     maRepeatCount( rNode.maRepeatCount ),
210     maRepeatDuration( rNode.maRepeatDuration ),
211     maTarget( rNode.maTarget ),
212     mnFill( rNode.mnFill ),
213     mnFillDefault( rNode.mnFillDefault ),
214     mnRestart( rNode.mnRestart ),
215     mnRestartDefault( rNode.mnRestartDefault ),
216     mfAcceleration( rNode.mfAcceleration ),
217     mfDecelerate( rNode.mfDecelerate ),
218     mbAutoReverse( rNode.mbAutoReverse ),
219     maUserData( rNode.maUserData )
220 {
221 }
222 
223 // --------------------------------------------------------------------
224 
225 RandomAnimationNode::RandomAnimationNode( sal_Int16 nPresetClass )
226 {
227     init( nPresetClass );
228 }
229 
230 RandomAnimationNode::RandomAnimationNode()
231 {
232     init( 1 );
233 }
234 
235 void RandomAnimationNode::init( sal_Int16 nPresetClass )
236 {
237     mnPresetClass = nPresetClass;
238     mnFill = AnimationFill::DEFAULT;
239     mnFillDefault = AnimationFill::INHERIT;
240     mnRestart = AnimationRestart::DEFAULT;
241     mnRestartDefault = AnimationRestart::INHERIT;
242     mfAcceleration = 0.0;
243     mfDecelerate = 0.0;
244     mbAutoReverse = sal_False;
245 }
246 
247 // --------------------------------------------------------------------
248 
249 // XInitialization
250 void SAL_CALL RandomAnimationNode::initialize( const Sequence< Any >& aArguments )
251 {
252     if( aArguments.getLength() != 1 )
253         throw IllegalArgumentException();
254 
255     if( aArguments[0].getValueType() == ::getCppuType((const sal_Int16*)0) )
256     {
257         aArguments[0] >>= mnPresetClass;
258     }
259     else if( aArguments[0].getValueType() != ::getCppuType((const ParagraphTarget*)0) )
260     {
261         Reference< XShape > xShape;
262         aArguments[0] >>= xShape;
263         if( !xShape.is() )
264             throw IllegalArgumentException();
265     }
266     maTarget = aArguments[0];
267 }
268 
269 // --------------------------------------------------------------------
270 
271 // XAnimationNode
272 sal_Int16 SAL_CALL RandomAnimationNode::getType()
273 {
274     Guard< Mutex > aGuard( maMutex );
275     return ::com::sun::star::animations::AnimationNodeType::PAR;
276 }
277 
278 // --------------------------------------------------------------------
279 
280 // XAnimationNode
281 Any SAL_CALL RandomAnimationNode::getBegin()
282 {
283     Guard< Mutex > aGuard( maMutex );
284     return maBegin;
285 }
286 
287 // --------------------------------------------------------------------
288 
289 // XAnimationNode
290 void SAL_CALL RandomAnimationNode::setBegin( const Any& _begin )
291 {
292     Guard< Mutex > aGuard( maMutex );
293     maBegin = _begin;
294 }
295 
296 // --------------------------------------------------------------------
297 
298 // XAnimationNode
299 Any SAL_CALL RandomAnimationNode::getDuration()
300 {
301     Guard< Mutex > aGuard( maMutex );
302     return maDuration;
303 }
304 
305 // --------------------------------------------------------------------
306 
307 // XAnimationNode
308 void SAL_CALL RandomAnimationNode::setDuration( const Any& _duration )
309 {
310     Guard< Mutex > aGuard( maMutex );
311     maDuration = _duration;
312 }
313 
314 // --------------------------------------------------------------------
315 
316 // XAnimationNode
317 Any SAL_CALL RandomAnimationNode::getEnd()
318 {
319     Guard< Mutex > aGuard( maMutex );
320     return maEnd;
321 }
322 
323 // --------------------------------------------------------------------
324 
325 // XAnimationNode
326 void SAL_CALL RandomAnimationNode::setEnd( const Any& _end )
327 {
328     Guard< Mutex > aGuard( maMutex );
329     maEnd = _end;
330 }
331 
332 // --------------------------------------------------------------------
333 
334 // XAnimationNode
335 Any SAL_CALL RandomAnimationNode::getEndSync()
336 {
337     Guard< Mutex > aGuard( maMutex );
338     return maEndSync;
339 }
340 
341 // --------------------------------------------------------------------
342 
343 // XAnimationNode
344 void SAL_CALL RandomAnimationNode::setEndSync( const Any& _endsync )
345 {
346     Guard< Mutex > aGuard( maMutex );
347     maEndSync = _endsync;
348 }
349 
350 // --------------------------------------------------------------------
351 
352 // XAnimationNode
353 Any SAL_CALL RandomAnimationNode::getRepeatCount()
354 {
355     Guard< Mutex > aGuard( maMutex );
356     return maRepeatCount;
357 }
358 
359 // --------------------------------------------------------------------
360 
361 // XAnimationNode
362 void SAL_CALL RandomAnimationNode::setRepeatCount( const Any& _repeatcount )
363 {
364     Guard< Mutex > aGuard( maMutex );
365     maRepeatCount = _repeatcount;
366 }
367 
368 // --------------------------------------------------------------------
369 
370 // XAnimationNode
371 Any SAL_CALL RandomAnimationNode::getRepeatDuration()
372 {
373     Guard< Mutex > aGuard( maMutex );
374     return maRepeatDuration;
375 }
376 
377 // --------------------------------------------------------------------
378 
379 // XAnimationNode
380 void SAL_CALL RandomAnimationNode::setRepeatDuration( const Any& _repeatduration )
381 {
382     Guard< Mutex > aGuard( maMutex );
383     maRepeatDuration = _repeatduration;
384 }
385 
386 // --------------------------------------------------------------------
387 
388 // XAnimationNode
389 sal_Int16 SAL_CALL RandomAnimationNode::getFill()
390 {
391     Guard< Mutex > aGuard( maMutex );
392     return mnFill;
393 }
394 
395 // --------------------------------------------------------------------
396 
397 // XAnimationNode
398 void SAL_CALL RandomAnimationNode::setFill( sal_Int16 _fill )
399 {
400     Guard< Mutex > aGuard( maMutex );
401     mnFill = _fill;
402 }
403 
404 // --------------------------------------------------------------------
405 
406 // XAnimationNode
407 sal_Int16 SAL_CALL RandomAnimationNode::getFillDefault()
408 {
409     Guard< Mutex > aGuard( maMutex );
410     return mnFillDefault;
411 }
412 
413 // --------------------------------------------------------------------
414 
415 // XAnimationNode
416 void SAL_CALL RandomAnimationNode::setFillDefault( sal_Int16 _filldefault )
417 {
418     Guard< Mutex > aGuard( maMutex );
419     mnFillDefault = _filldefault;
420 }
421 
422 // --------------------------------------------------------------------
423 
424 // XAnimationNode
425 sal_Int16 SAL_CALL RandomAnimationNode::getRestart()
426 {
427     Guard< Mutex > aGuard( maMutex );
428     return mnRestart;
429 }
430 
431 // --------------------------------------------------------------------
432 
433 // XAnimationNode
434 void SAL_CALL RandomAnimationNode::setRestart( sal_Int16 _restart )
435 {
436     Guard< Mutex > aGuard( maMutex );
437     mnRestart = _restart;
438 }
439 
440 // --------------------------------------------------------------------
441 
442 // XAnimationNode
443 sal_Int16 SAL_CALL RandomAnimationNode::getRestartDefault()
444 {
445     Guard< Mutex > aGuard( maMutex );
446     return mnRestartDefault;
447 }
448 
449 // --------------------------------------------------------------------
450 
451 // XAnimationNode
452 void SAL_CALL RandomAnimationNode::setRestartDefault( sal_Int16 _restartdefault )
453 {
454     Guard< Mutex > aGuard( maMutex );
455     mnRestartDefault = _restartdefault;
456 }
457 
458 // --------------------------------------------------------------------
459 
460 // XAnimationNode
461 double SAL_CALL RandomAnimationNode::getAcceleration()
462 {
463     Guard< Mutex > aGuard( maMutex );
464     return mfAcceleration;
465 }
466 
467 // --------------------------------------------------------------------
468 
469 // XAnimationNode
470 void SAL_CALL RandomAnimationNode::setAcceleration( double _acceleration )
471 {
472     Guard< Mutex > aGuard( maMutex );
473     mfAcceleration = _acceleration;
474 }
475 
476 // --------------------------------------------------------------------
477 
478 // XAnimationNode
479 double SAL_CALL RandomAnimationNode::getDecelerate()
480 {
481     Guard< Mutex > aGuard( maMutex );
482     return mfDecelerate;
483 }
484 
485 // --------------------------------------------------------------------
486 
487 // XAnimationNode
488 void SAL_CALL RandomAnimationNode::setDecelerate( double _decelerate )
489 {
490     Guard< Mutex > aGuard( maMutex );
491     mfDecelerate = _decelerate;
492 }
493 
494 // --------------------------------------------------------------------
495 
496 // XAnimationNode
497 sal_Bool SAL_CALL RandomAnimationNode::getAutoReverse()
498 {
499     Guard< Mutex > aGuard( maMutex );
500     return mbAutoReverse;
501 }
502 
503 // --------------------------------------------------------------------
504 
505 // XAnimationNode
506 void SAL_CALL RandomAnimationNode::setAutoReverse( sal_Bool _autoreverse )
507 {
508     Guard< Mutex > aGuard( maMutex );
509     mbAutoReverse = _autoreverse;
510 }
511 
512 // --------------------------------------------------------------------
513 
514 Sequence< NamedValue > SAL_CALL RandomAnimationNode::getUserData()
515 {
516     Guard< Mutex > aGuard( maMutex );
517     return maUserData;
518 }
519 
520 // --------------------------------------------------------------------
521 
522 void SAL_CALL RandomAnimationNode::setUserData( const Sequence< NamedValue >& _userdata )
523 {
524     Guard< Mutex > aGuard( maMutex );
525     maUserData = _userdata;
526 }
527 
528 // --------------------------------------------------------------------
529 
530 // XChild
531 Reference< XInterface > SAL_CALL RandomAnimationNode::getParent()
532 {
533     Guard< Mutex > aGuard( maMutex );
534     return mxParent;
535 }
536 
537 // --------------------------------------------------------------------
538 
539 // XChild
540 void SAL_CALL RandomAnimationNode::setParent( const Reference< XInterface >& Parent )
541 {
542     Guard< Mutex > aGuard( maMutex );
543     mxParent = Parent;
544 }
545 
546 // --------------------------------------------------------------------
547 
548 // XCloneable
549 Reference< XCloneable > SAL_CALL RandomAnimationNode::createClone()
550 {
551     Reference< XCloneable > xNewNode( new RandomAnimationNode( *this ) );
552     return xNewNode;
553 }
554 
555 // --------------------------------------------------------------------
556 
557 // XElementAccess
558 Type SAL_CALL RandomAnimationNode::getElementType()
559 {
560     return ::getCppuType((const Reference< XAnimationNode >*)0);
561 }
562 
563 // --------------------------------------------------------------------
564 
565 // XElementAccess
566 sal_Bool SAL_CALL RandomAnimationNode::hasElements()
567 {
568     return sal_True;
569 }
570 
571 // --------------------------------------------------------------------
572 
573 // XEnumerationAccess
574 Reference< XEnumeration > SAL_CALL RandomAnimationNode::createEnumeration()
575 {
576     Guard< Mutex > aGuard( maMutex );
577 
578     if( !maTarget.hasValue() && mxFirstNode.is() )
579     {
580         Any aTarget( mxFirstNode->getTarget() );
581         if( aTarget.hasValue() )
582         {
583             maTarget = aTarget;
584             mxFirstNode.clear();
585         }
586     }
587 
588     Reference< XEnumeration > xEnum;
589 
590     Reference< XEnumerationAccess > aEnumAccess( CustomAnimationPresets::getCustomAnimationPresets().getRandomPreset( mnPresetClass ), UNO_QUERY );
591 
592     if( aEnumAccess.is() )
593     {
594         Reference< XEnumeration > xEnumeration( aEnumAccess->createEnumeration(), UNO_QUERY );
595         if( xEnumeration.is() )
596         {
597             while( xEnumeration->hasMoreElements() )
598             {
599                 Reference< XAnimate > xAnimate( xEnumeration->nextElement(), UNO_QUERY );
600                 if( xAnimate.is() )
601                     xAnimate->setTarget( maTarget );
602             }
603         }
604         xEnum = aEnumAccess->createEnumeration();
605     }
606     else
607     {
608         // no presets? give empty node!
609         Reference< XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
610         Reference< XEnumerationAccess > aEmptyEnumAccess(
611             xServiceFactory->createInstance(
612                 OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.animations.ParallelTimeContainer" ))),
613             UNO_QUERY );
614 
615         if( aEmptyEnumAccess.is() )
616             xEnum = aEmptyEnumAccess->createEnumeration();
617     }
618 
619     return xEnum;
620 }
621 
622 // --------------------------------------------------------------------
623 
624 
625 // XTimeContainer
626 Reference< XAnimationNode > SAL_CALL RandomAnimationNode::insertBefore( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >&  )
627 {
628     return appendChild( newChild );
629 }
630 
631 // --------------------------------------------------------------------
632 
633 // XTimeContainer
634 Reference< XAnimationNode > SAL_CALL RandomAnimationNode::insertAfter( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >&  )
635 {
636     return appendChild( newChild );
637 }
638 
639 // --------------------------------------------------------------------
640 
641 // XTimeContainer
642 Reference< XAnimationNode > SAL_CALL RandomAnimationNode::replaceChild( const Reference< XAnimationNode >& newChild, const Reference< XAnimationNode >&  )
643 {
644     return appendChild( newChild );
645 }
646 
647 // --------------------------------------------------------------------
648 
649 // XTimeContainer
650 Reference< XAnimationNode > SAL_CALL RandomAnimationNode::removeChild( const Reference< XAnimationNode >& oldChild )
651 {
652     return oldChild;
653 }
654 
655 // --------------------------------------------------------------------
656 
657 // XTimeContainer
658 Reference< XAnimationNode > SAL_CALL RandomAnimationNode::appendChild( const Reference< XAnimationNode >& newChild )
659 {
660     Reference< XAnimate > xAnimate( newChild, UNO_QUERY );
661     if( xAnimate.is() )
662     {
663         Any aTarget( xAnimate->getTarget() );
664         if( aTarget.hasValue() )
665             maTarget = aTarget;
666     }
667 
668     if( !maTarget.hasValue() && !mxFirstNode.is() )
669         mxFirstNode = xAnimate;
670 
671     return newChild;
672 }
673 
674 // XServiceInfo
675 OUString RandomAnimationNode::getImplementationName() throw()
676 {
677     return RandomNode__getImplementationName();
678 }
679 
680 // XServiceInfo
681 sal_Bool RandomAnimationNode::supportsService(const OUString& ServiceName) throw()
682 {
683     return ServiceName.equalsAscii( pSN1 ) || ServiceName.equalsAscii( pSN2 );
684 }
685 
686 // XServiceInfo
687 Sequence< OUString > RandomAnimationNode::getSupportedServiceNames(void) throw()
688 {
689     return RandomNode_getSupportedServiceNames();
690 }
691 
692 }
693