LCOV - code coverage report
Current view: top level - framework/source/uiconfiguration - imagemanager.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 24 62 38.7 %
Date: 2014-04-11 Functions: 9 23 39.1 %
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             : #include <uiconfiguration/imagemanager.hxx>
      21             : #include <xml/imagesconfiguration.hxx>
      22             : #include <uiconfiguration/graphicnameaccess.hxx>
      23             : #include "imagemanagerimpl.hxx"
      24             : 
      25             : #include "properties.h"
      26             : 
      27             : #include <com/sun/star/lang/DisposedException.hpp>
      28             : #include <com/sun/star/beans/XPropertySet.hpp>
      29             : #include <com/sun/star/beans/PropertyValue.hpp>
      30             : #include <com/sun/star/embed/ElementModes.hpp>
      31             : #include <com/sun/star/io/XStream.hpp>
      32             : 
      33             : #include <vcl/svapp.hxx>
      34             : #include <rtl/ref.hxx>
      35             : #include <rtl/ustrbuf.hxx>
      36             : #include <osl/mutex.hxx>
      37             : #include <comphelper/sequence.hxx>
      38             : #include <unotools/ucbstreamhelper.hxx>
      39             : #include <vcl/pngread.hxx>
      40             : #include <vcl/pngwrite.hxx>
      41             : 
      42             : using ::com::sun::star::uno::Sequence;
      43             : using ::com::sun::star::uno::XInterface;
      44             : using ::com::sun::star::uno::Exception;
      45             : using ::com::sun::star::uno::RuntimeException;
      46             : using ::com::sun::star::uno::UNO_QUERY;
      47             : using ::com::sun::star::uno::Any;
      48             : using ::com::sun::star::uno::makeAny;
      49             : using ::com::sun::star::graphic::XGraphic;
      50             : using namespace ::com::sun::star;
      51             : using namespace ::com::sun::star::io;
      52             : using namespace ::com::sun::star::embed;
      53             : using namespace ::com::sun::star::lang;
      54             : using namespace ::com::sun::star::container;
      55             : using namespace ::com::sun::star::beans;
      56             : 
      57             : namespace framework
      58             : {
      59             : 
      60        2031 : ImageManager::ImageManager( const uno::Reference< uno::XComponentContext >& rxContext ) :
      61        2031 :     m_pImpl( new ImageManagerImpl(rxContext, this, false) )
      62             : {
      63        2031 : }
      64             : 
      65        6003 : ImageManager::~ImageManager()
      66             : {
      67        2001 :     m_pImpl->clear();
      68        4002 : }
      69             : 
      70             : // XComponent
      71           0 : void SAL_CALL ImageManager::dispose() throw (::com::sun::star::uno::RuntimeException, std::exception)
      72             : {
      73           0 :     m_pImpl->dispose();
      74           0 : }
      75             : 
      76           0 : void SAL_CALL ImageManager::addEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
      77             : {
      78           0 :     m_pImpl->addEventListener(xListener);
      79           0 : }
      80             : 
      81           0 : void SAL_CALL ImageManager::removeEventListener( const uno::Reference< XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception)
      82             : {
      83             :     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
      84           0 :     m_pImpl->removeEventListener(xListener);
      85           0 : }
      86             : 
      87             : // Non-UNO methods
      88           4 : void ImageManager::setStorage( const uno::Reference< XStorage >& Storage )
      89             : throw (::com::sun::star::uno::RuntimeException)
      90             : {
      91           4 :     SolarMutexGuard g;
      92             : 
      93           4 :     m_pImpl->m_xUserConfigStorage = Storage;
      94           4 :     m_pImpl->implts_initialize();
      95           4 : }
      96             : 
      97             : // XInitialization
      98        2030 : void SAL_CALL ImageManager::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException, std::exception )
      99             : {
     100        2030 :     m_pImpl->initialize(aArguments);
     101        2030 : }
     102             : 
     103             : // XImageManager
     104           0 : void SAL_CALL ImageManager::reset()
     105             : throw (::com::sun::star::uno::RuntimeException, std::exception)
     106             : {
     107             : 
     108             :     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     109           0 :     m_pImpl->reset();
     110           0 : }
     111             : 
     112           0 : Sequence< OUString > SAL_CALL ImageManager::getAllImageNames( ::sal_Int16 nImageType )
     113             : throw (::com::sun::star::uno::RuntimeException, std::exception)
     114             : {
     115           0 :     return m_pImpl->getAllImageNames( nImageType );
     116             : }
     117             : 
     118           0 : sal_Bool SAL_CALL ImageManager::hasImage( ::sal_Int16 nImageType, const OUString& aCommandURL )
     119             : throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception)
     120             : {
     121           0 :     return m_pImpl->hasImage(nImageType,aCommandURL);
     122             : }
     123             : 
     124       18923 : Sequence< uno::Reference< XGraphic > > SAL_CALL ImageManager::getImages(
     125             :     ::sal_Int16 nImageType,
     126             :     const Sequence< OUString >& aCommandURLSequence )
     127             : throw ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception )
     128             : {
     129       18923 :     return m_pImpl->getImages(nImageType,aCommandURLSequence);
     130             : }
     131             : 
     132           0 : void SAL_CALL ImageManager::replaceImages(
     133             :     ::sal_Int16 nImageType,
     134             :     const Sequence< OUString >& aCommandURLSequence,
     135             :     const Sequence< uno::Reference< XGraphic > >& aGraphicsSequence )
     136             : throw ( ::com::sun::star::lang::IllegalArgumentException,
     137             :         ::com::sun::star::lang::IllegalAccessException,
     138             :         ::com::sun::star::uno::RuntimeException, std::exception)
     139             : {
     140           0 :     m_pImpl->replaceImages(nImageType,aCommandURLSequence,aGraphicsSequence);
     141           0 : }
     142             : 
     143           0 : void SAL_CALL ImageManager::removeImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence )
     144             : throw ( ::com::sun::star::lang::IllegalArgumentException,
     145             :         ::com::sun::star::lang::IllegalAccessException,
     146             :         ::com::sun::star::uno::RuntimeException, std::exception)
     147             : {
     148           0 :     m_pImpl->removeImages(nImageType,aCommandURLSequence);
     149           0 : }
     150             : 
     151           0 : void SAL_CALL ImageManager::insertImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
     152             : throw ( ::com::sun::star::container::ElementExistException,
     153             :         ::com::sun::star::lang::IllegalArgumentException,
     154             :         ::com::sun::star::lang::IllegalAccessException,
     155             :         ::com::sun::star::uno::RuntimeException, std::exception)
     156             : {
     157           0 :     m_pImpl->insertImages(nImageType,aCommandURLSequence,aGraphicSequence);
     158           0 : }
     159             : 
     160             : // XUIConfiguration
     161       28248 : void SAL_CALL ImageManager::addConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
     162             : throw (::com::sun::star::uno::RuntimeException, std::exception)
     163             : {
     164       28248 :     m_pImpl->addConfigurationListener(xListener);
     165       28248 : }
     166             : 
     167       28240 : void SAL_CALL ImageManager::removeConfigurationListener( const uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& xListener )
     168             : throw (::com::sun::star::uno::RuntimeException, std::exception)
     169             : {
     170             :     /* SAFE AREA ----------------------------------------------------------------------------------------------- */
     171       28240 :     m_pImpl->removeConfigurationListener(xListener);
     172       28240 : }
     173             : 
     174             : // XUIConfigurationPersistence
     175           0 : void SAL_CALL ImageManager::reload()
     176             : throw ( ::com::sun::star::uno::Exception,
     177             :         ::com::sun::star::uno::RuntimeException, std::exception )
     178             : {
     179           0 :     m_pImpl->reload();
     180           0 : }
     181             : 
     182           0 : void SAL_CALL ImageManager::store()
     183             : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
     184             : {
     185           0 :     m_pImpl->store();
     186           0 : }
     187             : 
     188           0 : void SAL_CALL ImageManager::storeToStorage( const uno::Reference< XStorage >& Storage )
     189             : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception)
     190             : {
     191           0 :     m_pImpl->storeToStorage(Storage);
     192           0 : }
     193             : 
     194           0 : sal_Bool SAL_CALL ImageManager::isModified()
     195             : throw (::com::sun::star::uno::RuntimeException, std::exception)
     196             : {
     197           0 :     return m_pImpl->isModified();
     198             : }
     199             : 
     200           0 : sal_Bool SAL_CALL ImageManager::isReadOnly() throw (::com::sun::star::uno::RuntimeException, std::exception)
     201             : {
     202           0 :     return m_pImpl->isReadOnly();
     203             : }
     204             : 
     205             : } // namespace framework
     206             : 
     207             : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
     208           1 : com_sun_star_comp_framework_ImageManager_get_implementation(
     209             :     css::uno::XComponentContext *context,
     210             :     css::uno::Sequence<css::uno::Any> const &)
     211             : {
     212           1 :     return cppu::acquire(new framework::ImageManager(context));
     213             : }
     214             : 
     215             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10