LibreOffice Module framework (master) 1
imagemanager.cxx
Go to the documentation of this file.
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
21#include "imagemanagerimpl.hxx"
22
23#include <com/sun/star/beans/XPropertySet.hpp>
24
25#include <vcl/svapp.hxx>
26
27using ::com::sun::star::uno::Sequence;
28using ::com::sun::star::uno::XInterface;
29using ::com::sun::star::uno::Any;
30using ::com::sun::star::graphic::XGraphic;
31using namespace ::com::sun::star;
32using namespace ::com::sun::star::io;
33using namespace ::com::sun::star::embed;
34using namespace ::com::sun::star::lang;
35using namespace ::com::sun::star::container;
36using namespace ::com::sun::star::beans;
37
38namespace framework
39{
40
41ImageManager::ImageManager( const uno::Reference< uno::XComponentContext >& rxContext, bool bForModule ) :
42 m_pImpl( new ImageManagerImpl(rxContext, this, bForModule) )
43{
44}
45
47{
48 m_pImpl->clear();
49}
50
51// XComponent
52void SAL_CALL ImageManager::dispose()
53{
54 m_pImpl->dispose();
55}
56
57void SAL_CALL ImageManager::addEventListener( const uno::Reference< XEventListener >& xListener )
58{
59 m_pImpl->addEventListener(xListener);
60}
61
62void SAL_CALL ImageManager::removeEventListener( const uno::Reference< XEventListener >& xListener )
63{
64 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
65 m_pImpl->removeEventListener(xListener);
66}
67
68// Non-UNO methods
69void ImageManager::setStorage( const uno::Reference< XStorage >& Storage )
70{
72
73 m_pImpl->m_xUserConfigStorage = Storage;
74 m_pImpl->implts_initialize();
75}
76
77// XInitialization
78void SAL_CALL ImageManager::initialize( const Sequence< Any >& aArguments )
79{
80 m_pImpl->initialize(aArguments);
81}
82
83// XImageManager
84void SAL_CALL ImageManager::reset()
85{
86 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
87 m_pImpl->reset();
88}
89
90Sequence< OUString > SAL_CALL ImageManager::getAllImageNames( ::sal_Int16 nImageType )
91{
92 return m_pImpl->getAllImageNames( nImageType );
93}
94
95sal_Bool SAL_CALL ImageManager::hasImage( ::sal_Int16 nImageType, const OUString& aCommandURL )
96{
97 return m_pImpl->hasImage(nImageType,aCommandURL);
98}
99
100Sequence< uno::Reference< XGraphic > > SAL_CALL ImageManager::getImages(
101 ::sal_Int16 nImageType,
102 const Sequence< OUString >& aCommandURLSequence )
103{
104 return m_pImpl->getImages(nImageType,aCommandURLSequence);
105}
106
108 ::sal_Int16 nImageType,
109 const Sequence< OUString >& aCommandURLSequence,
110 const Sequence< uno::Reference< XGraphic > >& aGraphicsSequence )
111{
112 m_pImpl->replaceImages(nImageType,aCommandURLSequence,aGraphicsSequence);
113}
114
115void SAL_CALL ImageManager::removeImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence )
116{
117 m_pImpl->removeImages(nImageType,aCommandURLSequence);
118}
119
120void SAL_CALL ImageManager::insertImages( ::sal_Int16 nImageType, const Sequence< OUString >& aCommandURLSequence, const Sequence< uno::Reference< XGraphic > >& aGraphicSequence )
121{
122 m_pImpl->insertImages(nImageType,aCommandURLSequence,aGraphicSequence);
123}
124
125// XUIConfiguration
126void SAL_CALL ImageManager::addConfigurationListener( const uno::Reference< css::ui::XUIConfigurationListener >& xListener )
127{
128 m_pImpl->addConfigurationListener(xListener);
129}
130
131void SAL_CALL ImageManager::removeConfigurationListener( const uno::Reference< css::ui::XUIConfigurationListener >& xListener )
132{
133 /* SAFE AREA ----------------------------------------------------------------------------------------------- */
134 m_pImpl->removeConfigurationListener(xListener);
135}
136
137// XUIConfigurationPersistence
138void SAL_CALL ImageManager::reload()
139{
140 m_pImpl->reload();
141}
142
143void SAL_CALL ImageManager::store()
144{
145 m_pImpl->store();
146}
147
148void SAL_CALL ImageManager::storeToStorage( const uno::Reference< XStorage >& Storage )
149{
150 m_pImpl->storeToStorage(Storage);
151}
152
154{
155 return m_pImpl->isModified();
156}
157
159{
160 return m_pImpl->isReadOnly();
161}
162
163} // namespace framework
164
165extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
167 css::uno::XComponentContext *context,
168 css::uno::Sequence<css::uno::Any> const &)
169{
170 return cppu::acquire(new framework::ImageManager(context, /*bForModule*/false));
171}
172
173/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
virtual css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > SAL_CALL getImages(::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aCommandURLSequence) override
virtual void SAL_CALL store() override
virtual void SAL_CALL insertImages(::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aCommandURLSequence, const css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > &aGraphicSequence) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL removeImages(::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aResourceURLSequence) override
virtual void SAL_CALL reset() override
virtual void SAL_CALL removeConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener > &Listener) override
virtual void SAL_CALL storeToStorage(const css::uno::Reference< css::embed::XStorage > &Storage) override
virtual void SAL_CALL dispose() override
virtual sal_Bool SAL_CALL isModified() override
virtual void SAL_CALL reload() override
virtual void SAL_CALL replaceImages(::sal_Int16 nImageType, const css::uno::Sequence< OUString > &aCommandURLSequence, const css::uno::Sequence< css::uno::Reference< css::graphic::XGraphic > > &aGraphicsSequence) override
virtual css::uno::Sequence< OUString > SAL_CALL getAllImageNames(::sal_Int16 nImageType) override
virtual ~ImageManager() override
virtual void SAL_CALL addConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener > &Listener) override
virtual sal_Bool SAL_CALL hasImage(::sal_Int16 nImageType, const OUString &aCommandURL) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
ImageManager(const css::uno::Reference< css::uno::XComponentContext > &rxContext, bool bForModule)
::std::unique_ptr< ImageManagerImpl > m_pImpl
virtual sal_Bool SAL_CALL isReadOnly() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
void setStorage(const css::uno::Reference< css::embed::XStorage > &Storage)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_framework_ImageManager_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Sequence< PropertyValue > aArguments
unsigned char sal_Bool