LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sd/source/ui/unoidl - randomnode.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 204 1.0 %
Date: 2013-07-09 Functions: 1 54 1.9 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10