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

Generated by: LCOV version 1.10