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/moduleimagemanager.hxx>
21 #include <xml/imagesconfiguration.hxx>
22 #include <uiconfiguration/graphicnameaccess.hxx>
24 #include "imagemanagerimpl.hxx"
26 #include <properties.h>
28 #include <com/sun/star/ui/UIElementType.hpp>
29 #include <com/sun/star/ui/ConfigurationEvent.hpp>
30 #include <com/sun/star/lang/DisposedException.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/beans/PropertyValue.hpp>
33 #include <com/sun/star/embed/ElementModes.hpp>
34 #include <com/sun/star/io/XStream.hpp>
35 #include <com/sun/star/ui/ImageType.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <vcl/svapp.hxx>
39 #include <rtl/ustrbuf.hxx>
40 #include <sal/log.hxx>
41 #include <osl/file.hxx>
45 using ::com::sun::star::uno::Sequence
;
46 using ::com::sun::star::uno::Any
;
47 using ::com::sun::star::graphic::XGraphic
;
48 using namespace ::com::sun::star
;
49 using namespace ::com::sun::star::io
;
50 using namespace ::com::sun::star::embed
;
51 using namespace ::com::sun::star::lang
;
52 using namespace ::com::sun::star::container
;
53 using namespace ::com::sun::star::beans
;
54 using namespace ::com::sun::star::ui
;
58 ModuleImageManager::ModuleImageManager( const uno::Reference
< uno::XComponentContext
>& xContext
) :
59 m_pImpl( new ImageManagerImpl(xContext
,static_cast< OWeakObject
* >(this),true) )
63 ModuleImageManager::~ModuleImageManager()
68 void SAL_CALL
ModuleImageManager::dispose()
73 void SAL_CALL
ModuleImageManager::addEventListener( const uno::Reference
< XEventListener
>& xListener
)
75 m_pImpl
->addEventListener(xListener
);
78 void SAL_CALL
ModuleImageManager::removeEventListener( const uno::Reference
< XEventListener
>& xListener
)
80 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
81 m_pImpl
->removeEventListener(xListener
);
85 void SAL_CALL
ModuleImageManager::initialize( const Sequence
< Any
>& aArguments
)
87 m_pImpl
->initialize(aArguments
);
91 void SAL_CALL
ModuleImageManager::reset()
96 Sequence
< OUString
> SAL_CALL
ModuleImageManager::getAllImageNames( ::sal_Int16 nImageType
)
98 return m_pImpl
->getAllImageNames( nImageType
);
101 sal_Bool SAL_CALL
ModuleImageManager::hasImage( ::sal_Int16 nImageType
, const OUString
& aCommandURL
)
103 return m_pImpl
->hasImage(nImageType
,aCommandURL
);
106 Sequence
< uno::Reference
< XGraphic
> > SAL_CALL
ModuleImageManager::getImages(
107 ::sal_Int16 nImageType
,
108 const Sequence
< OUString
>& aCommandURLSequence
)
110 SAL_INFO( "fwk", "framework: ModuleImageManager::getImages" );
111 return m_pImpl
->getImages(nImageType
,aCommandURLSequence
);
114 void SAL_CALL
ModuleImageManager::replaceImages(
115 ::sal_Int16 nImageType
,
116 const Sequence
< OUString
>& aCommandURLSequence
,
117 const Sequence
< uno::Reference
< XGraphic
> >& aGraphicsSequence
)
119 m_pImpl
->replaceImages(nImageType
,aCommandURLSequence
,aGraphicsSequence
);
122 void SAL_CALL
ModuleImageManager::removeImages( ::sal_Int16 nImageType
, const Sequence
< OUString
>& aCommandURLSequence
)
124 m_pImpl
->removeImages(nImageType
,aCommandURLSequence
);
127 void SAL_CALL
ModuleImageManager::insertImages( ::sal_Int16 nImageType
, const Sequence
< OUString
>& aCommandURLSequence
, const Sequence
< uno::Reference
< XGraphic
> >& aGraphicSequence
)
129 m_pImpl
->insertImages(nImageType
,aCommandURLSequence
,aGraphicSequence
);
133 void SAL_CALL
ModuleImageManager::addConfigurationListener( const uno::Reference
< css::ui::XUIConfigurationListener
>& xListener
)
135 m_pImpl
->addConfigurationListener(xListener
);
138 void SAL_CALL
ModuleImageManager::removeConfigurationListener( const uno::Reference
< css::ui::XUIConfigurationListener
>& xListener
)
140 m_pImpl
->removeConfigurationListener(xListener
);
143 // XUIConfigurationPersistence
144 void SAL_CALL
ModuleImageManager::reload()
149 void SAL_CALL
ModuleImageManager::store()
154 void SAL_CALL
ModuleImageManager::storeToStorage( const uno::Reference
< XStorage
>& Storage
)
156 m_pImpl
->storeToStorage(Storage
);
159 sal_Bool SAL_CALL
ModuleImageManager::isModified()
161 return m_pImpl
->isModified();
164 sal_Bool SAL_CALL
ModuleImageManager::isReadOnly()
166 return m_pImpl
->isReadOnly();
169 } // namespace framework
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */