tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / framework / source / uiconfiguration / imagemanager.cxx
blobd679deccf802f8edd6dd521a2d558f73b251f2a8
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;
36 namespace framework
39 ImageManager::ImageManager( const uno::Reference< uno::XComponentContext >& rxContext, bool bForModule ) :
40 m_pImpl( new ImageManagerImpl(rxContext, this, bForModule) )
44 ImageManager::~ImageManager()
46 m_pImpl->clear();
49 // XComponent
50 void SAL_CALL ImageManager::dispose()
52 m_pImpl->dispose();
55 void SAL_CALL ImageManager::addEventListener( const uno::Reference< XEventListener >& xListener )
57 m_pImpl->addEventListener(xListener);
60 void SAL_CALL ImageManager::removeEventListener( const uno::Reference< XEventListener >& xListener )
62 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
63 m_pImpl->removeEventListener(xListener);
66 // Non-UNO methods
67 void ImageManager::setStorage( const uno::Reference< XStorage >& Storage )
69 SolarMutexGuard g;
71 m_pImpl->m_xUserConfigStorage = Storage;
72 m_pImpl->implts_initialize();
75 // XInitialization
76 void SAL_CALL ImageManager::initialize( const Sequence< Any >& aArguments )
78 m_pImpl->initialize(aArguments);
81 // XImageManager
82 void SAL_CALL ImageManager::reset()
84 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
85 m_pImpl->reset();
88 Sequence< OUString > SAL_CALL ImageManager::getAllImageNames( ::sal_Int16 nImageType )
90 return m_pImpl->getAllImageNames( nImageType );
93 sal_Bool SAL_CALL ImageManager::hasImage( ::sal_Int16 nImageType, const OUString& aCommandURL )
95 return m_pImpl->hasImage(nImageType,aCommandURL);
98 Sequence< uno::Reference< XGraphic > > SAL_CALL ImageManager::getImages(
99 ::sal_Int16 nImageType,
100 const Sequence< OUString >& aCommandURLSequence )
102 return m_pImpl->getImages(nImageType,aCommandURLSequence);
105 void SAL_CALL ImageManager::replaceImages(
106 ::sal_Int16 nImageType,
107 const Sequence< OUString >& aCommandURLSequence,
108 const Sequence< uno::Reference< XGraphic > >& aGraphicsSequence )
110 m_pImpl->replaceImages(nImageType,aCommandURLSequence,aGraphicsSequence);
113 void SAL_CALL ImageManager::removeImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence )
115 m_pImpl->removeImages(nImageType,aCommandURLSequence);
118 void SAL_CALL ImageManager::insertImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
120 m_pImpl->insertImages(nImageType,aCommandURLSequence,aGraphicSequence);
123 // XUIConfiguration
124 void SAL_CALL ImageManager::addConfigurationListener( const uno::Reference< css::ui::XUIConfigurationListener >& xListener )
126 m_pImpl->addConfigurationListener(xListener);
129 void SAL_CALL ImageManager::removeConfigurationListener( const uno::Reference< css::ui::XUIConfigurationListener >& xListener )
131 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
132 m_pImpl->removeConfigurationListener(xListener);
135 // XUIConfigurationPersistence
136 void SAL_CALL ImageManager::reload()
138 m_pImpl->reload();
141 void SAL_CALL ImageManager::store()
143 m_pImpl->store();
146 void SAL_CALL ImageManager::storeToStorage( const uno::Reference< XStorage >& Storage )
148 m_pImpl->storeToStorage(Storage);
151 sal_Bool SAL_CALL ImageManager::isModified()
153 return m_pImpl->isModified();
156 sal_Bool SAL_CALL ImageManager::isReadOnly()
158 return m_pImpl->isReadOnly();
161 } // namespace framework
163 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
164 com_sun_star_comp_framework_ImageManager_get_implementation(
165 css::uno::XComponentContext *context,
166 css::uno::Sequence<css::uno::Any> const &)
168 return cppu::acquire(new framework::ImageManager(context, /*bForModule*/false));
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */