LibreOffice Module sd (master) 1
Configuration.hxx
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
20#pragma once
21
22#include <com/sun/star/drawing/framework/XConfiguration.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/container/XNamed.hpp>
26
27#include <memory>
28
29namespace com::sun::star::util { class XCloneable; }
30namespace com::sun::star::drawing::framework { class XConfigurationControllerBroadcaster; }
31
32namespace sd::framework {
33
35 css::drawing::framework::XConfiguration,
36 css::container::XNamed
38
58class Configuration final
60{
61public:
74 Configuration (const css::uno::Reference<css::drawing::framework::XConfigurationControllerBroadcaster>& rxBroadcaster,
75 bool bBroadcastRequestEvents);
76 virtual ~Configuration() override;
77
78 virtual void disposing(std::unique_lock<std::mutex>&) override;
79
80 // XConfiguration
81
82 virtual void SAL_CALL addResource (
83 const css::uno::Reference<css::drawing::framework::XResourceId>&
84 rxResourceId) override;
85
86 virtual void SAL_CALL removeResource(
87 const css::uno::Reference<css::drawing::framework::XResourceId>&
88 rxResourceId) override;
89
90 virtual css::uno::Sequence< css::uno::Reference<
91 css::drawing::framework::XResourceId> > SAL_CALL getResources (
92 const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId,
93 const OUString& rsResourceURLPrefix,
94 css::drawing::framework::AnchorBindingMode eMode) override;
95
96 virtual sal_Bool SAL_CALL hasResource (
97 const css::uno::Reference<css::drawing::framework::XResourceId>&
98 rxResourceId) override;
99
100 // XCloneable
101
102 virtual css::uno::Reference<css::util::XCloneable>
103 SAL_CALL createClone() override;
104
105 // XNamed
106
110 virtual OUString SAL_CALL getName() override;
111
115 virtual void SAL_CALL setName (const OUString& rName) override;
116
117private:
118 class ResourceContainer;
122 std::unique_ptr<ResourceContainer> mpResourceContainer;
123
127 css::uno::Reference<css::drawing::framework::XConfigurationControllerBroadcaster>
129
131
138 Configuration (const css::uno::Reference<css::drawing::framework::XConfigurationControllerBroadcaster>& rxBroadcaster,
139 bool bBroadcastRequestEvents,
140 const ResourceContainer& rResourceContainer);
141
152 void PostEvent (
153 const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId,
154 const bool bActivation);
155
161 void ThrowIfDisposed() const;
162};
163
169 const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration1,
170 const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration2);
171
172} // end of namespace sd::framework
173
174/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A configuration describes the resources of an application like panes, views, and tool bars and their ...
virtual css::uno::Sequence< css::uno::Reference< css::drawing::framework::XResourceId > > SAL_CALL getResources(const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId, const OUString &rsResourceURLPrefix, css::drawing::framework::AnchorBindingMode eMode) override
virtual OUString SAL_CALL getName() override
Return a human readable string representation.
std::unique_ptr< ResourceContainer > mpResourceContainer
The resource container holds the URLs of unique resource and of resource linked to unique resources.
Configuration(const css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > &rxBroadcaster, bool bBroadcastRequestEvents, const ResourceContainer &rResourceContainer)
This private variant of the constructor is used for cloning a Configuration object.
virtual void SAL_CALL removeResource(const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) override
virtual void SAL_CALL addResource(const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) override
void ThrowIfDisposed() const
When the called object has already been disposed this method throws an exception and does not return.
virtual ~Configuration() override
void PostEvent(const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId, const bool bActivation)
Send an event to all interested listeners that a resource has been added or removed.
css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > mxBroadcaster
The broadcaster used for notifying listeners of requests for configuration changes.
Configuration(const css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > &rxBroadcaster, bool bBroadcastRequestEvents)
Create a new configuration with a broadcaster that is used to send events about requested configurati...
virtual sal_Bool SAL_CALL hasResource(const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual void disposing(std::unique_lock< std::mutex > &) override
virtual void SAL_CALL setName(const OUString &rName) override
This call is ignored because the XNamed interface is (mis)used to give access to a human readable nam...
comphelper::WeakComponentImplHelper< css::drawing::framework::XConfiguration, css::container::XNamed > ConfigurationInterfaceBase
bool AreConfigurationsEquivalent(const Reference< XConfiguration > &rxConfiguration1, const Reference< XConfiguration > &rxConfiguration2)
unsigned char sal_Bool