1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <xml/imagesconfiguration.hxx>
22 #include <uiconfiguration/graphicnameaccess.hxx>
23 #include "imagemanagerimpl.hxx"
25 #include <properties.h>
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>
33 #include <vcl/svapp.hxx>
34 #include <rtl/ref.hxx>
35 #include <rtl/ustrbuf.hxx>
37 using ::com::sun::star::uno::Sequence
;
38 using ::com::sun::star::uno::XInterface
;
39 using ::com::sun::star::uno::Any
;
40 using ::com::sun::star::graphic::XGraphic
;
41 using namespace ::com::sun::star
;
42 using namespace ::com::sun::star::io
;
43 using namespace ::com::sun::star::embed
;
44 using namespace ::com::sun::star::lang
;
45 using namespace ::com::sun::star::container
;
46 using namespace ::com::sun::star::beans
;
51 ImageManager::ImageManager( const uno::Reference
< uno::XComponentContext
>& rxContext
) :
52 m_pImpl( new ImageManagerImpl(rxContext
, this, false) )
56 ImageManager::~ImageManager()
62 void SAL_CALL
ImageManager::dispose()
67 void SAL_CALL
ImageManager::addEventListener( const uno::Reference
< XEventListener
>& xListener
)
69 m_pImpl
->addEventListener(xListener
);
72 void SAL_CALL
ImageManager::removeEventListener( const uno::Reference
< XEventListener
>& xListener
)
74 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
75 m_pImpl
->removeEventListener(xListener
);
79 void ImageManager::setStorage( const uno::Reference
< XStorage
>& Storage
)
83 m_pImpl
->m_xUserConfigStorage
= Storage
;
84 m_pImpl
->implts_initialize();
88 void SAL_CALL
ImageManager::initialize( const Sequence
< Any
>& aArguments
)
90 m_pImpl
->initialize(aArguments
);
94 void SAL_CALL
ImageManager::reset()
96 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
100 Sequence
< OUString
> SAL_CALL
ImageManager::getAllImageNames( ::sal_Int16 nImageType
)
102 return m_pImpl
->getAllImageNames( nImageType
);
105 sal_Bool SAL_CALL
ImageManager::hasImage( ::sal_Int16 nImageType
, const OUString
& aCommandURL
)
107 return m_pImpl
->hasImage(nImageType
,aCommandURL
);
110 Sequence
< uno::Reference
< XGraphic
> > SAL_CALL
ImageManager::getImages(
111 ::sal_Int16 nImageType
,
112 const Sequence
< OUString
>& aCommandURLSequence
)
114 return m_pImpl
->getImages(nImageType
,aCommandURLSequence
);
117 void SAL_CALL
ImageManager::replaceImages(
118 ::sal_Int16 nImageType
,
119 const Sequence
< OUString
>& aCommandURLSequence
,
120 const Sequence
< uno::Reference
< XGraphic
> >& aGraphicsSequence
)
122 m_pImpl
->replaceImages(nImageType
,aCommandURLSequence
,aGraphicsSequence
);
125 void SAL_CALL
ImageManager::removeImages( ::sal_Int16 nImageType
, const Sequence
< OUString
>& aCommandURLSequence
)
127 m_pImpl
->removeImages(nImageType
,aCommandURLSequence
);
130 void SAL_CALL
ImageManager::insertImages( ::sal_Int16 nImageType
, const Sequence
< OUString
>& aCommandURLSequence
, const Sequence
< uno::Reference
< XGraphic
> >& aGraphicSequence
)
132 m_pImpl
->insertImages(nImageType
,aCommandURLSequence
,aGraphicSequence
);
136 void SAL_CALL
ImageManager::addConfigurationListener( const uno::Reference
< css::ui::XUIConfigurationListener
>& xListener
)
138 m_pImpl
->addConfigurationListener(xListener
);
141 void SAL_CALL
ImageManager::removeConfigurationListener( const uno::Reference
< css::ui::XUIConfigurationListener
>& xListener
)
143 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
144 m_pImpl
->removeConfigurationListener(xListener
);
147 // XUIConfigurationPersistence
148 void SAL_CALL
ImageManager::reload()
153 void SAL_CALL
ImageManager::store()
158 void SAL_CALL
ImageManager::storeToStorage( const uno::Reference
< XStorage
>& Storage
)
160 m_pImpl
->storeToStorage(Storage
);
163 sal_Bool SAL_CALL
ImageManager::isModified()
165 return m_pImpl
->isModified();
168 sal_Bool SAL_CALL
ImageManager::isReadOnly()
170 return m_pImpl
->isReadOnly();
173 } // namespace framework
175 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
176 com_sun_star_comp_framework_ImageManager_get_implementation(
177 css::uno::XComponentContext
*context
,
178 css::uno::Sequence
<css::uno::Any
> const &)
180 return cppu::acquire(new framework::ImageManager(context
));
183 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */