LCOV - code coverage report
Current view: top level - toolkit/source/controls - animatedimages.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 208 0.0 %
Date: 2014-04-14 Functions: 0 48 0.0 %
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 <toolkit/controls/animatedimages.hxx>
      22             : #include <toolkit/helper/property.hxx>
      23             : #include <toolkit/helper/unopropertyarrayhelper.hxx>
      24             : 
      25             : #include <com/sun/star/lang/DisposedException.hpp>
      26             : #include <com/sun/star/awt/VisualEffect.hpp>
      27             : #include <com/sun/star/awt/ImageScaleMode.hpp>
      28             : #include <com/sun/star/awt/XAnimation.hpp>
      29             : #include <com/sun/star/awt/XAnimatedImages.hpp>
      30             : #include <com/sun/star/beans/XPropertySetInfo.hpp>
      31             : #include <com/sun/star/container/XContainerListener.hpp>
      32             : #include <com/sun/star/uno/XComponentContext.hpp>
      33             : #include <com/sun/star/util/XModifyListener.hpp>
      34             : 
      35             : #include <toolkit/controls/unocontrolbase.hxx>
      36             : #include <toolkit/controls/unocontrolmodel.hxx>
      37             : 
      38             : #include <cppuhelper/implbase1.hxx>
      39             : #include <cppuhelper/implbase2.hxx>
      40             : 
      41             : #include <boost/scoped_ptr.hpp>
      42             : 
      43             : using namespace css::awt;
      44             : using namespace css::container;
      45             : using namespace css::lang;
      46             : using namespace css::uno;
      47             : 
      48             : namespace {
      49             : 
      50             : typedef ::cppu::AggImplInheritanceHelper2   <   UnoControlBase
      51             :                                             ,   css::awt::XAnimation
      52             :                                             ,   css::container::XContainerListener
      53             :                                             >   AnimatedImagesControl_Base;
      54             : 
      55           0 : class AnimatedImagesControl : public AnimatedImagesControl_Base
      56             : {
      57             : public:
      58             :     AnimatedImagesControl();
      59             :     OUString GetComponentServiceName() SAL_OVERRIDE;
      60             : 
      61             :     // XAnimation
      62             :     virtual void SAL_CALL startAnimation(  ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      63             :     virtual void SAL_CALL stopAnimation(  ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      64             :     virtual sal_Bool SAL_CALL isAnimationRunning(  ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      65             : 
      66             :     // XServiceInfo
      67             :     OUString SAL_CALL getImplementationName(  ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      68             :     css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      69             : 
      70             :     // XControl
      71             :     sal_Bool SAL_CALL setModel( const css::uno::Reference< css::awt::XControlModel >& i_rModel ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
      72             :     void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& i_toolkit, const css::uno::Reference< css::awt::XWindowPeer >& i_parentPeer ) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      73             : 
      74             : 
      75             :     // XContainerListener
      76             :     virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      77             :     virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      78             :     virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      79             : 
      80             :     // XEventListener
      81             :     virtual void SAL_CALL disposing( const css::lang::EventObject& i_event ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      82             : };
      83             : 
      84           0 :     AnimatedImagesControl::AnimatedImagesControl()
      85           0 :         :AnimatedImagesControl_Base()
      86             :     {
      87           0 :     }
      88             : 
      89             : 
      90           0 :     OUString AnimatedImagesControl::GetComponentServiceName()
      91             :     {
      92           0 :         return OUString( "AnimatedImages" );
      93             :     }
      94             : 
      95             : 
      96           0 :     void SAL_CALL AnimatedImagesControl::startAnimation(  ) throw (RuntimeException, std::exception)
      97             :     {
      98           0 :         Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
      99           0 :         if ( xAnimation.is() )
     100           0 :             xAnimation->startAnimation();
     101           0 :     }
     102             : 
     103             : 
     104           0 :     void SAL_CALL AnimatedImagesControl::stopAnimation(  ) throw (RuntimeException, std::exception)
     105             :     {
     106           0 :         Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
     107           0 :         if ( xAnimation.is() )
     108           0 :             xAnimation->stopAnimation();
     109           0 :     }
     110             : 
     111             : 
     112           0 :     sal_Bool SAL_CALL AnimatedImagesControl::isAnimationRunning(  ) throw (RuntimeException, std::exception)
     113             :     {
     114           0 :         Reference< XAnimation > xAnimation( getPeer(), UNO_QUERY );
     115           0 :         if ( xAnimation.is() )
     116           0 :             return xAnimation->isAnimationRunning();
     117           0 :         return sal_False;
     118             :     }
     119             : 
     120             : 
     121           0 :     OUString SAL_CALL AnimatedImagesControl::getImplementationName(  ) throw(RuntimeException, std::exception)
     122             :     {
     123           0 :         return OUString( "org.openoffice.comp.toolkit.AnimatedImagesControl" );
     124             :     }
     125             : 
     126             : 
     127           0 :     Sequence< OUString > SAL_CALL AnimatedImagesControl::getSupportedServiceNames() throw(RuntimeException, std::exception)
     128             :     {
     129           0 :         Sequence< OUString > aServices( AnimatedImagesControl_Base::getSupportedServiceNames() );
     130           0 :         aServices.realloc( aServices.getLength() + 1 );
     131           0 :         aServices[ aServices.getLength() - 1 ] = OUString("com.sun.star.awt.AnimatedImagesControl");
     132           0 :         return aServices;
     133             :     }
     134             : 
     135             : 
     136             :     namespace
     137             :     {
     138           0 :         void lcl_updatePeer( Reference< XWindowPeer > const& i_peer, Reference< XControlModel > const& i_model )
     139             :         {
     140           0 :             const Reference< css::util::XModifyListener > xPeerModify( i_peer, UNO_QUERY );
     141           0 :             if ( xPeerModify.is() )
     142             :             {
     143           0 :                 EventObject aEvent;
     144           0 :                 aEvent.Source = i_model;
     145           0 :                 xPeerModify->modified( aEvent );
     146           0 :             }
     147           0 :         }
     148             :     }
     149             : 
     150             : 
     151           0 :     sal_Bool SAL_CALL AnimatedImagesControl::setModel( const Reference< XControlModel >& i_rModel ) throw ( RuntimeException, std::exception )
     152             :     {
     153           0 :         const Reference< XAnimatedImages > xOldContainer( getModel(), UNO_QUERY );
     154           0 :         const Reference< XAnimatedImages > xNewContainer( i_rModel, UNO_QUERY );
     155             : 
     156           0 :         if ( !AnimatedImagesControl_Base::setModel( i_rModel ) )
     157           0 :             return sal_False;
     158             : 
     159           0 :         if ( xOldContainer.is() )
     160           0 :             xOldContainer->removeContainerListener( this );
     161             : 
     162           0 :         if ( xNewContainer.is() )
     163           0 :             xNewContainer->addContainerListener( this );
     164             : 
     165           0 :         lcl_updatePeer( getPeer(), getModel() );
     166             : 
     167           0 :         return sal_True;
     168             :     }
     169             : 
     170             : 
     171           0 :     void SAL_CALL AnimatedImagesControl::createPeer( const Reference< XToolkit >& i_toolkit, const Reference< XWindowPeer >& i_parentPeer ) throw(RuntimeException, std::exception)
     172             :     {
     173           0 :         AnimatedImagesControl_Base::createPeer( i_toolkit, i_parentPeer );
     174             : 
     175           0 :         lcl_updatePeer( getPeer(), getModel() );
     176           0 :     }
     177             : 
     178             : 
     179           0 :     void SAL_CALL AnimatedImagesControl::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException, std::exception)
     180             :     {
     181           0 :         const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
     182           0 :         if ( xPeerListener.is() )
     183           0 :             xPeerListener->elementInserted( i_event );
     184           0 :     }
     185             : 
     186             : 
     187           0 :     void SAL_CALL AnimatedImagesControl::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException, std::exception)
     188             :     {
     189           0 :         const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
     190           0 :         if ( xPeerListener.is() )
     191           0 :             xPeerListener->elementRemoved( i_event );
     192           0 :     }
     193             : 
     194             : 
     195           0 :     void SAL_CALL AnimatedImagesControl::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException, std::exception)
     196             :     {
     197           0 :         const Reference< XContainerListener > xPeerListener( getPeer(), UNO_QUERY );
     198           0 :         if ( xPeerListener.is() )
     199           0 :             xPeerListener->elementReplaced( i_event );
     200           0 :     }
     201             : 
     202             : 
     203           0 :     void SAL_CALL AnimatedImagesControl::disposing( const EventObject& i_event ) throw (RuntimeException, std::exception)
     204             :     {
     205           0 :         UnoControlBase::disposing( i_event );
     206           0 :     }
     207             : 
     208             : }
     209             : 
     210             : namespace toolkit {
     211             : 
     212           0 :     struct AnimatedImagesControlModel_Data
     213             :     {
     214             :         ::std::vector< Sequence< OUString > >    aImageSets;
     215             :     };
     216             : 
     217             :     namespace
     218             :     {
     219           0 :         void lcl_checkIndex( const AnimatedImagesControlModel_Data& i_data, const sal_Int32 i_index, const Reference< XInterface >& i_context,
     220             :             const bool i_forInsert = false )
     221             :         {
     222           0 :             if ( ( i_index < 0 ) || ( size_t( i_index ) > i_data.aImageSets.size() + ( i_forInsert ? 1 : 0 ) ) )
     223           0 :                 throw IndexOutOfBoundsException( OUString(), i_context );
     224           0 :         }
     225             : 
     226           0 :         void lcl_notify( ::osl::ClearableMutexGuard& i_guard, ::cppu::OBroadcastHelper& i_broadcaseHelper,
     227             :             void ( SAL_CALL XContainerListener::*i_notificationMethod )( const ContainerEvent& ),
     228             :             const sal_Int32 i_accessor, const Sequence< OUString >& i_imageURLs, const Reference< XInterface >& i_context )
     229             :         {
     230           0 :             ::cppu::OInterfaceContainerHelper* pContainerListeners = i_broadcaseHelper.getContainer( cppu::UnoType<XContainerListener>::get() );
     231           0 :             if ( pContainerListeners == NULL )
     232           0 :                 return;
     233             : 
     234           0 :             ContainerEvent aEvent;
     235           0 :             aEvent.Source = i_context;
     236           0 :             aEvent.Accessor <<= i_accessor;
     237           0 :             aEvent.Element <<= i_imageURLs;
     238             : 
     239           0 :             i_guard.clear();
     240           0 :             pContainerListeners->notifyEach( i_notificationMethod, aEvent );
     241             :         }
     242             :     }
     243             : 
     244             : 
     245           0 :     AnimatedImagesControlModel::AnimatedImagesControlModel( Reference< com::sun::star::uno::XComponentContext > const & i_factory )
     246             :         :AnimatedImagesControlModel_Base( i_factory )
     247           0 :         ,m_pData( new AnimatedImagesControlModel_Data )
     248             :     {
     249           0 :         ImplRegisterProperty( BASEPROPERTY_AUTO_REPEAT );
     250           0 :         ImplRegisterProperty( BASEPROPERTY_BORDER );
     251           0 :         ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
     252           0 :         ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
     253           0 :         ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
     254           0 :         ImplRegisterProperty( BASEPROPERTY_ENABLEVISIBLE );
     255           0 :         ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
     256           0 :         ImplRegisterProperty( BASEPROPERTY_HELPURL );
     257           0 :         ImplRegisterProperty( BASEPROPERTY_IMAGE_SCALE_MODE );
     258           0 :         ImplRegisterProperty( BASEPROPERTY_STEP_TIME );
     259           0 :     }
     260             : 
     261             : 
     262           0 :     AnimatedImagesControlModel::AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource )
     263             :         :AnimatedImagesControlModel_Base( i_copySource )
     264           0 :         ,m_pData( new AnimatedImagesControlModel_Data( *i_copySource.m_pData ) )
     265             :     {
     266           0 :     }
     267             : 
     268             : 
     269           0 :     AnimatedImagesControlModel::~AnimatedImagesControlModel()
     270             :     {
     271           0 :     }
     272             : 
     273             : 
     274           0 :     UnoControlModel* AnimatedImagesControlModel::Clone() const
     275             :     {
     276           0 :         return new AnimatedImagesControlModel( *this );
     277             :     }
     278             : 
     279             : 
     280           0 :     Reference< css::beans::XPropertySetInfo > SAL_CALL AnimatedImagesControlModel::getPropertySetInfo(  ) throw(RuntimeException, std::exception)
     281             :     {
     282           0 :         static Reference< css::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
     283           0 :         return xInfo;
     284             :     }
     285             : 
     286             : 
     287           0 :     OUString SAL_CALL AnimatedImagesControlModel::getServiceName() throw(RuntimeException, std::exception)
     288             :     {
     289           0 :         return OUString("com.sun.star.awt.AnimatedImagesControlModel");
     290             :     }
     291             : 
     292             : 
     293           0 :     OUString SAL_CALL AnimatedImagesControlModel::getImplementationName(  ) throw(RuntimeException, std::exception)
     294             :     {
     295           0 :         return OUString("org.openoffice.comp.toolkit.AnimatedImagesControlModel");
     296             :     }
     297             : 
     298             : 
     299           0 :     Sequence< OUString > SAL_CALL AnimatedImagesControlModel::getSupportedServiceNames() throw(RuntimeException, std::exception)
     300             :     {
     301           0 :         Sequence< OUString > aServiceNames(2);
     302           0 :         aServiceNames[0] = "com.sun.star.awt.AnimatedImagesControlModel";
     303           0 :         aServiceNames[1] = "com.sun.star.awt.UnoControlModel";
     304           0 :         return aServiceNames;
     305             :     }
     306             : 
     307             : 
     308           0 :     void SAL_CALL AnimatedImagesControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 i_handle, const Any& i_value ) throw (Exception, std::exception)
     309             :     {
     310           0 :         switch ( i_handle )
     311             :         {
     312             :         case BASEPROPERTY_IMAGE_SCALE_MODE:
     313             :         {
     314           0 :             sal_Int16 nImageScaleMode( ImageScaleMode::ANISOTROPIC );
     315           0 :             OSL_VERIFY( i_value >>= nImageScaleMode );  // convertFastPropertyValue ensures that this has the proper type
     316           0 :             if  (   ( nImageScaleMode != ImageScaleMode::NONE )
     317           0 :                 &&  ( nImageScaleMode != ImageScaleMode::ISOTROPIC )
     318           0 :                 &&  ( nImageScaleMode != ImageScaleMode::ANISOTROPIC )
     319             :                 )
     320           0 :                 throw IllegalArgumentException( OUString(), *this, 1 );
     321             :         }
     322           0 :         break;
     323             :         }
     324             : 
     325           0 :         AnimatedImagesControlModel_Base::setFastPropertyValue_NoBroadcast( i_handle, i_value );
     326           0 :     }
     327             : 
     328             : 
     329           0 :     Any AnimatedImagesControlModel::ImplGetDefaultValue( sal_uInt16 i_propertyId ) const
     330             :     {
     331           0 :         switch ( i_propertyId )
     332             :         {
     333             :         case BASEPROPERTY_DEFAULTCONTROL:
     334           0 :             return makeAny( OUString("com.sun.star.awt.AnimatedImagesControl") );
     335             : 
     336             :         case BASEPROPERTY_BORDER:
     337           0 :             return makeAny( css::awt::VisualEffect::NONE );
     338             : 
     339             :         case BASEPROPERTY_STEP_TIME:
     340           0 :             return makeAny( (sal_Int32) 100 );
     341             : 
     342             :         case BASEPROPERTY_AUTO_REPEAT:
     343           0 :             return makeAny( true );
     344             : 
     345             :         case BASEPROPERTY_IMAGE_SCALE_MODE:
     346           0 :             return makeAny( ImageScaleMode::NONE );
     347             : 
     348             :         default:
     349           0 :             return UnoControlModel::ImplGetDefaultValue( i_propertyId );
     350             :         }
     351             :     }
     352             : 
     353             : 
     354           0 :     ::cppu::IPropertyArrayHelper& SAL_CALL AnimatedImagesControlModel::getInfoHelper()
     355             :     {
     356             :         static UnoPropertyArrayHelper* pHelper = NULL;
     357           0 :         if ( !pHelper )
     358             :         {
     359           0 :             Sequence< sal_Int32 > aIDs = ImplGetPropertyIds();
     360           0 :             pHelper = new UnoPropertyArrayHelper( aIDs );
     361             :         }
     362           0 :         return *pHelper;
     363             :     }
     364             : 
     365             : 
     366           0 :     ::sal_Int32 SAL_CALL AnimatedImagesControlModel::getStepTime() throw (RuntimeException, std::exception)
     367             :     {
     368           0 :         sal_Int32 nStepTime( 100 );
     369           0 :         OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ) ) >>= nStepTime );
     370           0 :         return nStepTime;
     371             :     }
     372             : 
     373             : 
     374           0 :     void SAL_CALL AnimatedImagesControlModel::setStepTime( ::sal_Int32 i_stepTime ) throw (RuntimeException, std::exception)
     375             :     {
     376           0 :         setPropertyValue( GetPropertyName( BASEPROPERTY_STEP_TIME ), makeAny( i_stepTime ) );
     377           0 :     }
     378             : 
     379             : 
     380           0 :     sal_Bool SAL_CALL AnimatedImagesControlModel::getAutoRepeat() throw (RuntimeException, std::exception)
     381             :     {
     382           0 :         bool bAutoRepeat( true );
     383           0 :         OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_AUTO_REPEAT ) ) >>= bAutoRepeat );
     384           0 :         return bAutoRepeat;
     385             :     }
     386             : 
     387             : 
     388           0 :     void SAL_CALL AnimatedImagesControlModel::setAutoRepeat( sal_Bool i_autoRepeat ) throw (RuntimeException, std::exception)
     389             :     {
     390           0 :         setPropertyValue( GetPropertyName( BASEPROPERTY_AUTO_REPEAT ), makeAny( i_autoRepeat ) );
     391           0 :     }
     392             : 
     393             : 
     394           0 :     ::sal_Int16 SAL_CALL AnimatedImagesControlModel::getScaleMode() throw (RuntimeException, std::exception)
     395             :     {
     396           0 :         sal_Int16 nImageScaleMode( ImageScaleMode::ANISOTROPIC );
     397           0 :         OSL_VERIFY( getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ) ) >>= nImageScaleMode );
     398           0 :         return nImageScaleMode;
     399             :     }
     400             : 
     401             : 
     402           0 :     void SAL_CALL AnimatedImagesControlModel::setScaleMode( ::sal_Int16 i_scaleMode ) throw (IllegalArgumentException, RuntimeException, std::exception)
     403             :     {
     404           0 :         setPropertyValue( GetPropertyName( BASEPROPERTY_IMAGE_SCALE_MODE ), makeAny( i_scaleMode ) );
     405           0 :     }
     406             : 
     407             : 
     408           0 :     ::sal_Int32 SAL_CALL AnimatedImagesControlModel::getImageSetCount(  ) throw (RuntimeException, std::exception)
     409             :     {
     410           0 :         ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
     411           0 :         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
     412           0 :             throw DisposedException();
     413             : 
     414           0 :         return m_pData->aImageSets.size();
     415             :     }
     416             : 
     417             : 
     418           0 :     Sequence< OUString > SAL_CALL AnimatedImagesControlModel::getImageSet( ::sal_Int32 i_index ) throw (IndexOutOfBoundsException, RuntimeException, std::exception)
     419             :     {
     420           0 :         ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
     421           0 :         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
     422           0 :             throw DisposedException();
     423             : 
     424           0 :         lcl_checkIndex( *m_pData, i_index, *this );
     425             : 
     426           0 :         return m_pData->aImageSets[ i_index ];
     427             :     }
     428             : 
     429             : 
     430           0 :     void SAL_CALL AnimatedImagesControlModel::insertImageSet( ::sal_Int32 i_index, const Sequence< OUString >& i_imageURLs ) throw (IndexOutOfBoundsException, RuntimeException, std::exception)
     431             :     {
     432           0 :         ::osl::ClearableMutexGuard aGuard( GetMutex() );
     433             :         // sanity checks
     434           0 :         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
     435           0 :             throw DisposedException();
     436             : 
     437           0 :         lcl_checkIndex( *m_pData, i_index, *this, true );
     438             : 
     439             :         // actaul insertion
     440           0 :         m_pData->aImageSets.insert( m_pData->aImageSets.begin() + i_index, i_imageURLs );
     441             : 
     442             :         // listener notification
     443           0 :         lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementInserted, i_index, i_imageURLs, *this );
     444           0 :     }
     445             : 
     446             : 
     447           0 :     void SAL_CALL AnimatedImagesControlModel::replaceImageSet( ::sal_Int32 i_index, const Sequence< OUString >& i_imageURLs ) throw (IndexOutOfBoundsException, RuntimeException, std::exception)
     448             :     {
     449           0 :         ::osl::ClearableMutexGuard aGuard( GetMutex() );
     450             :         // sanity checks
     451           0 :         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
     452           0 :             throw DisposedException();
     453             : 
     454           0 :         lcl_checkIndex( *m_pData, i_index, *this );
     455             : 
     456             :         // actaul insertion
     457           0 :         m_pData->aImageSets[ i_index ] = i_imageURLs;
     458             : 
     459             :         // listener notification
     460           0 :         lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementReplaced, i_index, i_imageURLs, *this );
     461           0 :     }
     462             : 
     463             : 
     464           0 :     void SAL_CALL AnimatedImagesControlModel::removeImageSet( ::sal_Int32 i_index ) throw (IndexOutOfBoundsException, RuntimeException, std::exception)
     465             :     {
     466           0 :         ::osl::ClearableMutexGuard aGuard( GetMutex() );
     467             :         // sanity checks
     468           0 :         if ( GetBroadcastHelper().bDisposed || GetBroadcastHelper().bInDispose )
     469           0 :             throw DisposedException();
     470             : 
     471           0 :         lcl_checkIndex( *m_pData, i_index, *this );
     472             : 
     473             :         // actual removal
     474           0 :         ::std::vector< Sequence< OUString > >::iterator removalPos = m_pData->aImageSets.begin() + i_index;
     475           0 :         Sequence< OUString > aRemovedElement( *removalPos );
     476           0 :         m_pData->aImageSets.erase( removalPos );
     477             : 
     478             :         // listener notification
     479           0 :         lcl_notify( aGuard, BrdcstHelper, &XContainerListener::elementRemoved, i_index, aRemovedElement, *this );
     480           0 :     }
     481             : 
     482             : 
     483           0 :     void SAL_CALL AnimatedImagesControlModel::addContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException, std::exception)
     484             :     {
     485           0 :         BrdcstHelper.addListener( cppu::UnoType<XContainerListener>::get(), i_listener );
     486           0 :     }
     487             : 
     488             : 
     489           0 :     void SAL_CALL AnimatedImagesControlModel::removeContainerListener( const Reference< XContainerListener >& i_listener ) throw (RuntimeException, std::exception)
     490             :     {
     491           0 :         BrdcstHelper.removeListener( cppu::UnoType<XContainerListener>::get(), i_listener );
     492           0 :     }
     493             : 
     494             : }
     495             : 
     496             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     497           0 : org_openoffice_comp_toolkit_AnimatedImagesControl_get_implementation(
     498             :     css::uno::XComponentContext *,
     499             :     css::uno::Sequence<css::uno::Any> const &)
     500             : {
     501           0 :     return cppu::acquire(new AnimatedImagesControl());
     502             : }
     503             : 
     504             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     505           0 : org_openoffice_comp_toolkit_AnimatedImagesControlModel_get_implementation(
     506             :     css::uno::XComponentContext *context,
     507             :     css::uno::Sequence<css::uno::Any> const &)
     508             : {
     509           0 :     return cppu::acquire(new toolkit::AnimatedImagesControlModel(context));
     510             : }
     511             : 
     512             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10