Bump version to 24.04.3.4
[LibreOffice.git] / framework / source / uiconfiguration / imagemanager.cxx
blob1e104b6df6a14fb96446faa04f2f3b095db541fe
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <uiconfiguration/imagemanager.hxx>
21 #include "imagemanagerimpl.hxx"
23 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <vcl/svapp.hxx>
27 using ::com::sun::star::uno::Sequence;
28 using ::com::sun::star::uno::XInterface;
29 using ::com::sun::star::uno::Any;
30 using ::com::sun::star::graphic::XGraphic;
31 using namespace ::com::sun::star;
32 using namespace ::com::sun::star::io;
33 using namespace ::com::sun::star::embed;
34 using namespace ::com::sun::star::lang;
35 using namespace ::com::sun::star::container;
36 using namespace ::com::sun::star::beans;
38 namespace framework
41 ImageManager::ImageManager( const uno::Reference< uno::XComponentContext >& rxContext, bool bForModule ) :
42 m_pImpl( new ImageManagerImpl(rxContext, this, bForModule) )
46 ImageManager::~ImageManager()
48 m_pImpl->clear();
51 // XComponent
52 void SAL_CALL ImageManager::dispose()
54 m_pImpl->dispose();
57 void SAL_CALL ImageManager::addEventListener( const uno::Reference< XEventListener >& xListener )
59 m_pImpl->addEventListener(xListener);
62 void SAL_CALL ImageManager::removeEventListener( const uno::Reference< XEventListener >& xListener )
64 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
65 m_pImpl->removeEventListener(xListener);
68 // Non-UNO methods
69 void ImageManager::setStorage( const uno::Reference< XStorage >& Storage )
71 SolarMutexGuard g;
73 m_pImpl->m_xUserConfigStorage = Storage;
74 m_pImpl->implts_initialize();
77 // XInitialization
78 void SAL_CALL ImageManager::initialize( const Sequence< Any >& aArguments )
80 m_pImpl->initialize(aArguments);
83 // XImageManager
84 void SAL_CALL ImageManager::reset()
86 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
87 m_pImpl->reset();
90 Sequence< OUString > SAL_CALL ImageManager::getAllImageNames( ::sal_Int16 nImageType )
92 return m_pImpl->getAllImageNames( nImageType );
95 sal_Bool SAL_CALL ImageManager::hasImage( ::sal_Int16 nImageType, const OUString& aCommandURL )
97 return m_pImpl->hasImage(nImageType,aCommandURL);
100 Sequence< uno::Reference< XGraphic > > SAL_CALL ImageManager::getImages(
101 ::sal_Int16 nImageType,
102 const Sequence< OUString >& aCommandURLSequence )
104 return m_pImpl->getImages(nImageType,aCommandURLSequence);
107 void SAL_CALL ImageManager::replaceImages(
108 ::sal_Int16 nImageType,
109 const Sequence< OUString >& aCommandURLSequence,
110 const Sequence< uno::Reference< XGraphic > >& aGraphicsSequence )
112 m_pImpl->replaceImages(nImageType,aCommandURLSequence,aGraphicsSequence);
115 void SAL_CALL ImageManager::removeImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence )
117 m_pImpl->removeImages(nImageType,aCommandURLSequence);
120 void SAL_CALL ImageManager::insertImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
122 m_pImpl->insertImages(nImageType,aCommandURLSequence,aGraphicSequence);
125 // XUIConfiguration
126 void SAL_CALL ImageManager::addConfigurationListener( const uno::Reference< css::ui::XUIConfigurationListener >& xListener )
128 m_pImpl->addConfigurationListener(xListener);
131 void SAL_CALL ImageManager::removeConfigurationListener( const uno::Reference< css::ui::XUIConfigurationListener >& xListener )
133 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
134 m_pImpl->removeConfigurationListener(xListener);
137 // XUIConfigurationPersistence
138 void SAL_CALL ImageManager::reload()
140 m_pImpl->reload();
143 void SAL_CALL ImageManager::store()
145 m_pImpl->store();
148 void SAL_CALL ImageManager::storeToStorage( const uno::Reference< XStorage >& Storage )
150 m_pImpl->storeToStorage(Storage);
153 sal_Bool SAL_CALL ImageManager::isModified()
155 return m_pImpl->isModified();
158 sal_Bool SAL_CALL ImageManager::isReadOnly()
160 return m_pImpl->isReadOnly();
163 } // namespace framework
165 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
166 com_sun_star_comp_framework_ImageManager_get_implementation(
167 css::uno::XComponentContext *context,
168 css::uno::Sequence<css::uno::Any> const &)
170 return cppu::acquire(new framework::ImageManager(context, /*bForModule*/false));
173 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */