filter/source/svg/svgfilter.cxx | 1 offapi/UnoApi_offapi.mk | 4 offapi/com/sun/star/drawing/framework/XConfiguration.idl | 117 ---------- sd/IwyuFilter_sd.yaml | 11 sd/inc/pch/precompiled_sd.hxx | 1 sd/source/console/PresenterController.cxx | 18 - sd/source/console/PresenterController.hxx | 17 - sd/source/console/PresenterFrameworkObserver.cxx | 9 sd/source/console/PresenterFrameworkObserver.hxx | 15 - sd/source/console/PresenterScreen.hxx | 4 sd/source/ui/framework/configuration/ChangeRequestQueue.hxx | 11 sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx | 10 sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx | 18 - sd/source/ui/framework/configuration/Configuration.cxx | 33 +- sd/source/ui/framework/configuration/ConfigurationClassifier.cxx | 18 - sd/source/ui/framework/configuration/ConfigurationClassifier.hxx | 22 - sd/source/ui/framework/configuration/ConfigurationController.cxx | 33 +- sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx | 11 sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx | 20 - sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx | 10 sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.hxx | 12 - sd/source/ui/framework/configuration/ConfigurationTracer.cxx | 8 sd/source/ui/framework/configuration/ConfigurationTracer.hxx | 13 - sd/source/ui/framework/configuration/ConfigurationUpdater.cxx | 11 sd/source/ui/framework/configuration/ConfigurationUpdater.hxx | 22 - sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx | 4 sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.hxx | 12 - sd/source/ui/framework/configuration/UpdateRequest.cxx | 2 sd/source/ui/framework/configuration/UpdateRequest.hxx | 10 sd/source/ui/framework/factories/BasicPaneFactory.cxx | 4 sd/source/ui/framework/factories/PresentationFactory.cxx | 4 sd/source/ui/framework/module/CenterViewFocusModule.cxx | 5 sd/source/ui/framework/module/CenterViewFocusModule.hxx | 17 - sd/source/ui/framework/module/NotesPaneModule.cxx | 6 sd/source/ui/framework/module/NotesPaneModule.hxx | 18 - sd/source/ui/framework/module/ShellStackGuard.cxx | 3 sd/source/ui/framework/module/ShellStackGuard.hxx | 13 - sd/source/ui/framework/module/SlideSorterModule.cxx | 5 sd/source/ui/framework/module/SlideSorterModule.hxx | 17 - sd/source/ui/framework/module/ToolBarModule.cxx | 3 sd/source/ui/framework/module/ToolBarModule.hxx | 14 - sd/source/ui/framework/module/ViewTabBarModule.cxx | 3 sd/source/ui/framework/module/ViewTabBarModule.hxx | 15 - sd/source/ui/framework/tools/FrameworkHelper.cxx | 22 - sd/source/ui/inc/ViewTabBar.hxx | 14 - sd/source/ui/inc/framework/Configuration.hxx | 104 +++++++- sd/source/ui/inc/framework/ConfigurationChangeEvent.hxx | 29 +- sd/source/ui/inc/framework/ConfigurationChangeListener.hxx | 26 +- sd/source/ui/inc/framework/ConfigurationChangeRequest.hxx | 17 + sd/source/ui/inc/framework/ConfigurationController.hxx | 26 +- sd/source/ui/inc/framework/FrameworkHelper.hxx | 4 sd/source/ui/inc/framework/PresentationFactory.hxx | 14 - sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx | 14 - sd/source/ui/slideshow/PaneHider.cxx | 2 sd/source/ui/slideshow/PaneHider.hxx | 6 sd/source/ui/tools/EventMultiplexer.cxx | 21 - sd/source/ui/unoidl/DrawController.cxx | 2 sd/source/ui/view/ViewShellBase.cxx | 4 sd/source/ui/view/ViewTabBar.cxx | 7 sd/source/ui/view/drviews3.cxx | 6 sd/source/ui/view/viewshel.cxx | 6 61 files changed, 423 insertions(+), 505 deletions(-)
New commits: commit f86536104ff45d21d38dab8c59662ab5215d3576 Author: Noel Grandin <[email protected]> AuthorDate: Sat Jun 21 16:37:04 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sun Jun 22 13:56:03 2025 +0200 [API CHANGE] remove drawing::framework::XConfiguration* these are internal to sd and do not need to be exposed as API Change-Id: Ifeebd510a56ecd82b7c86d4b5365dd2fb7d3e734 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186784 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index ef7a1a1e2953..d1b1a4552fe4 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/drawing/XSlideSorterSelectionSupplier.hpp> -#include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/drawing/framework/AnchorBindingMode.hpp> #include <com/sun/star/drawing/framework/XResourceId.hpp> #include <com/sun/star/drawing/framework/XResource.hpp> diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 6eb94a272cb4..ddeedeca27b7 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -2389,10 +2389,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing,\ )) $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing/framework,\ AnchorBindingMode \ - ConfigurationChangeEvent \ - XConfiguration \ - XConfigurationChangeListener \ - XConfigurationChangeRequest \ XPane \ XResource \ XResourceFactory \ diff --git a/offapi/com/sun/star/drawing/framework/XConfiguration.idl b/offapi/com/sun/star/drawing/framework/XConfiguration.idl deleted file mode 100644 index 3aa4b5e70a92..000000000000 --- a/offapi/com/sun/star/drawing/framework/XConfiguration.idl +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -module com { module sun { module star { module drawing { module framework { - -interface XResourceId; - -/** A configuration describes the resources of an application like panes, - views, and tool bars and their relationships that are currently active - or are requested to be activated. Resources are specified by ResourceId - structures rather than references so that not only the current - configuration but also a requested configuration can be represented. - - <p>Direct manipulation of a configuration object is not advised with the - exception of the ConfigurationController and objects that - implement the XConfigurationChangeRequest interface.</p> - - @see XConfigurationController -*/ -interface XConfiguration - : ::com::sun::star::util::XCloneable -{ - /** Returns the list of resources that are bound directly and/or - indirectly to the given anchor. A URL filter can reduce the set of - returned resource ids. - @param xAnchorId - This anchor typically is either a pane or an empty - XResourceId object. An - empty reference is treated like an XResourceId object. - @param sTargetURLPrefix - When a non-empty string is given then resource ids are returned - only when their resource URL matches this prefix, i.e. when it - begins with this prefix or is equal to it. Characters with - special meaning to URLs are not interpreted. In the typical - usage the prefix specifies the type of a resource. A typical - value is "private:resource/floater/", which is the prefix for - pane URLs. In a recursive search, only resource ids at the top - level are matched against this prefix. - <p>Use an empty string to prevent filtering out resource ids.</p> - @param eSearchMode - This flag defines whether to return only resources that are - directly bound to the given anchor or a recursive search is to - be made. Note that for the recursive search and an empty anchor - all resource ids are returned that belong to the configuration. - @return - The set of returned resource ids may be empty when there are no - resource ids that match all conditions. The resources in the - sequence are ordered with respect to the - XResourceId::compareTo() method. - */ - sequence<XResourceId> getResources ( - [in] XResourceId xAnchorId, - [in] string sTargetURLPrefix, - [in] AnchorBindingMode eSearchMode); - - /** <p>Returns whether the specified resource is part of the - configuration.</p> - This is independent of whether the resource does really exist and is - active, i.e. has a visible representation in the GUI. - @param xResourceId - The id of a resource. May be empty (empty reference or empty - XResourceId object) in which case `FALSE` is - returned. - @return - Returns `TRUE` when the resource is part of the configuration - and `FALSE` when it is not. - */ - boolean hasResource ([in] XResourceId xResourceId); - - /** Add a resource to the configuration. - <p>This method should be used only by objects that implement the - XConfigurationRequest interface or by the configuration - controller.</p> - @param xResourceId - The resource to add to the configuration. When the specified - resource is already part of the configuration then this call is - silently ignored. - @throws IllegalArgumentException - When an empty resource id is given then an - IllegalArgumentException is thrown. - */ - void addResource ([in] XResourceId xResourceId); - - /** Remove a resource from the configuration. - <p>This method should be used only by objects that implement the - XConfigurationRequest interface or by the configuration - controller.</p> - @param xResourceId - The resource to remove from the configuration. When the - specified resource is not part of the configuration then this - call is silently ignored. - @throws IllegalArgumentException - When an empty resource id is given then an - IllegalArgumentException is thrown. - */ - void removeResource ([in] XResourceId xResourceId); -}; - -}; }; }; }; }; // ::com::sun::star::drawing::framework - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/IwyuFilter_sd.yaml b/sd/IwyuFilter_sd.yaml index 88d06412fed5..fb46be784587 100644 --- a/sd/IwyuFilter_sd.yaml +++ b/sd/IwyuFilter_sd.yaml @@ -117,18 +117,15 @@ excludelist: sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.hxx: # base class has to be a complete type - com/sun/star/container/XNamed.hpp - - com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp sd/source/ui/framework/configuration/UpdateRequest.hxx: # base class has to be a complete type - com/sun/star/container/XNamed.hpp - - com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp sd/source/ui/inc/framework/factories/BasicToolBarFactory.hxx: # base class has to be a complete type - com/sun/star/drawing/framework/XResourceFactory.hpp - com/sun/star/lang/XInitialization.hpp sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp - com/sun/star/drawing/framework/XResourceFactory.hpp - com/sun/star/lang/XInitialization.hpp sd/source/ui/inc/framework/factories/BasicViewFactory.hxx: @@ -141,19 +138,14 @@ excludelist: - framework/Pane.hxx sd/source/ui/framework/module/CenterViewFocusModule.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp sd/source/ui/framework/module/ShellStackGuard.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp sd/source/ui/framework/module/ToolBarModule.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp sd/source/ui/framework/module/SlideSorterModule.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp sd/source/ui/framework/module/ViewTabBarModule.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp sd/source/ui/inc/AccessibleDocumentViewBase.hxx: # base class has to be a complete type - com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp @@ -211,13 +203,11 @@ excludelist: - com/sun/star/util/XReplaceDescriptor.hpp sd/source/ui/inc/ViewTabBar.hxx: # base class has to be a complete type - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp - com/sun/star/drawing/framework/XToolBar.hpp - com/sun/star/lang/XUnoTunnel.hpp sd/source/ui/inc/framework/Configuration.hxx: # base class has to be a complete type - com/sun/star/container/XNamed.hpp - - com/sun/star/drawing/framework/XConfiguration.hpp - com/sun/star/lang/XServiceInfo.hpp sd/source/ui/inc/framework/ConfigurationController.hxx: # base class has to be a complete type @@ -241,7 +231,6 @@ excludelist: sd/source/ui/inc/framework/PresentationFactory.hxx: # base class has to be a complete type - com/sun/star/drawing/framework/XResourceFactory.hpp - - com/sun/star/drawing/framework/XConfigurationChangeListener.hpp sd/source/ui/inc/framework/ResourceId.hxx: # base class has to be a complete type - com/sun/star/drawing/framework/XResourceId.hpp diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 2756044d2073..2f0bf93db015 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -205,7 +205,6 @@ #include <com/sun/star/drawing/XDrawView.hpp> #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> #include <com/sun/star/drawing/framework/ResourceId.hpp> -#include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/embed/Aspects.hpp> #include <com/sun/star/embed/ElementModes.hpp> diff --git a/sd/source/console/PresenterController.cxx b/sd/source/console/PresenterController.cxx index 096527cd46af..a023083689c1 100644 --- a/sd/source/console/PresenterController.cxx +++ b/sd/source/console/PresenterController.cxx @@ -34,6 +34,7 @@ #include "PresenterWindowManager.hxx" #include <DrawController.hxx> #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/Pane.hxx> #include <com/sun/star/awt/Key.hpp> @@ -91,8 +92,7 @@ PresenterController::PresenterController ( const Reference<presentation::XSlideShowController>& rxSlideShowController, rtl::Reference<PresenterPaneContainer> xPaneContainer, const Reference<XResourceId>& rxMainPaneId) - : PresenterControllerInterfaceBase(m_aMutex), - mxScreen(std::move(xScreen)), + : mxScreen(std::move(xScreen)), mxComponentContext(rxContext), mxController(rxController), mxSlideShowController(rxSlideShowController), @@ -162,7 +162,7 @@ PresenterController::~PresenterController() { } -void PresenterController::disposing() +void PresenterController::disposing(std::unique_lock<std::mutex>&) { maInstances.erase(mxController->getFrame()); @@ -657,16 +657,14 @@ IPresentationTime* PresenterController::GetPresentationTime() return mpPresentationTime; } -//----- XConfigurationChangeListener ------------------------------------------ +//----- ConfigurationChangeListener ------------------------------------------ -void SAL_CALL PresenterController::notifyConfigurationChange ( - const ConfigurationChangeEvent& rEvent) +void PresenterController::notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) { - if (rBHelper.bDisposed || rBHelper.bInDispose) { - throw lang::DisposedException ( - u"PresenterController object has already been disposed"_ustr, - static_cast<uno::XWeak*>(this)); + std::unique_lock l(m_aMutex); + throwIfDisposed(l); } sal_Int32 nType (0); diff --git a/sd/source/console/PresenterController.hxx b/sd/source/console/PresenterController.hxx index 45f66eec9dbd..54bda3338e2a 100644 --- a/sd/source/console/PresenterController.hxx +++ b/sd/source/console/PresenterController.hxx @@ -32,7 +32,7 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/presentation/XSlideShowController.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp> -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XURLTransformer.hpp> @@ -54,8 +54,8 @@ class PresenterPaneBorderPainter; class PresenterScreen; class PresenterWindowManager; -typedef ::cppu::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeListener, +typedef ::cppu::ImplInheritanceHelper < + sd::framework::ConfigurationChangeListener, css::frame::XFrameActionListener, css::awt::XKeyListener, css::awt::XMouseListener @@ -76,8 +76,7 @@ public: to frequently used values of the current theme. */ class PresenterController - : protected ::cppu::BaseMutex, - public PresenterControllerInterfaceBase + : public PresenterControllerInterfaceBase { public: static ::rtl::Reference<PresenterController> Instance ( @@ -92,7 +91,7 @@ public: const css::uno::Reference<css::drawing::framework::XResourceId>& rxMainPaneId); virtual ~PresenterController() override; - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; void UpdateCurrentSlide (const sal_Int32 nOffset); @@ -139,10 +138,10 @@ public: void SetPresentationTime(IPresentationTime* pPresentationTime); IPresentationTime* GetPresentationTime(); - // XConfigurationChangeListener + // ConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener diff --git a/sd/source/console/PresenterFrameworkObserver.cxx b/sd/source/console/PresenterFrameworkObserver.cxx index 55e1c2548427..9821e1f0f078 100644 --- a/sd/source/console/PresenterFrameworkObserver.cxx +++ b/sd/source/console/PresenterFrameworkObserver.cxx @@ -32,8 +32,7 @@ namespace sdext::presenter { PresenterFrameworkObserver::PresenterFrameworkObserver ( rtl::Reference<sd::framework::ConfigurationController> xController, const Action& rAction) - : PresenterFrameworkObserverInterfaceBase(m_aMutex), - mxConfigurationController(std::move(xController)), + : mxConfigurationController(std::move(xController)), maAction(rAction) { if ( ! mxConfigurationController.is()) @@ -65,7 +64,7 @@ void PresenterFrameworkObserver::RunOnUpdateEnd ( rAction); } -void SAL_CALL PresenterFrameworkObserver::disposing() +void PresenterFrameworkObserver::disposing(std::unique_lock<std::mutex>&) { if (maAction) maAction(false); @@ -95,8 +94,8 @@ void SAL_CALL PresenterFrameworkObserver::disposing (const lang::EventObject& rE } } -void SAL_CALL PresenterFrameworkObserver::notifyConfigurationChange ( - const ConfigurationChangeEvent& /*rEvent*/) +void PresenterFrameworkObserver::notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& /*rEvent*/) { Action aAction(maAction); Shutdown(); diff --git a/sd/source/console/PresenterFrameworkObserver.hxx b/sd/source/console/PresenterFrameworkObserver.hxx index 2e3baa4286cc..0ee30abeca46 100644 --- a/sd/source/console/PresenterFrameworkObserver.hxx +++ b/sd/source/console/PresenterFrameworkObserver.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERFRAMEWORKOBSERVER_HXX #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERFRAMEWORKOBSERVER_HXX -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> #include <rtl/ref.hxx> @@ -31,16 +31,11 @@ namespace sd::framework { class ConfigurationController; } namespace sdext::presenter { -typedef ::cppu::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeListener - > PresenterFrameworkObserverInterfaceBase; - /** Watch the drawing framework for changes and run callbacks when a certain change takes place. */ class PresenterFrameworkObserver - : private ::cppu::BaseMutex, - public PresenterFrameworkObserverInterfaceBase + : public sd::framework::ConfigurationChangeListener { public: typedef ::std::function<void (bool)> Action; @@ -52,10 +47,10 @@ public: const rtl::Reference<::sd::framework::ConfigurationController>& rxController, const Action& rAction); - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) override; - virtual void SAL_CALL notifyConfigurationChange ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) override; private: rtl::Reference<sd::framework::ConfigurationController> mxConfigurationController; diff --git a/sd/source/console/PresenterScreen.hxx b/sd/source/console/PresenterScreen.hxx index 13a1e04442ca..4ecf2c79aa3e 100644 --- a/sd/source/console/PresenterScreen.hxx +++ b/sd/source/console/PresenterScreen.hxx @@ -29,7 +29,7 @@ #include <com/sun/star/task/XJob.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/presentation/XPresentation2.hpp> -#include <com/sun/star/drawing/framework/XConfiguration.hpp> +#include <framework/Configuration.hxx> #include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <rtl/ref.hxx> #include <unotools/weakref.hxx> @@ -139,7 +139,7 @@ private: mxConfigurationControllerWeak; css::uno::WeakReference<css::uno::XComponentContext> mxContextWeak; ::rtl::Reference<PresenterController> mpPresenterController; - css::uno::Reference<css::drawing::framework::XConfiguration> mxSavedConfiguration; + rtl::Reference<sd::framework::Configuration> mxSavedConfiguration; ::rtl::Reference<PresenterPaneContainer> mpPaneContainer; css::uno::Reference<css::drawing::framework::XResourceFactory> mxPaneFactory; css::uno::Reference<css::drawing::framework::XResourceFactory> mxViewFactory; diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueue.hxx b/sd/source/ui/framework/configuration/ChangeRequestQueue.hxx index e60b5b527eec..982bf07d66fc 100644 --- a/sd/source/ui/framework/configuration/ChangeRequestQueue.hxx +++ b/sd/source/ui/framework/configuration/ChangeRequestQueue.hxx @@ -19,15 +19,10 @@ #pragma once -#include <com/sun/star/uno/Reference.hxx> - +#include <rtl/ref.hxx> +#include <framework/ConfigurationChangeRequest.hxx> #include <queue> -namespace com::sun::star::drawing::framework -{ -class XConfigurationChangeRequest; -} - namespace sd::framework { /** The ChangeRequestQueue stores the pending requests for changes to the @@ -35,7 +30,7 @@ namespace sd::framework ChangeRequestQueueProcessor to process these requests. */ class ChangeRequestQueue - : public ::std::queue<css::uno::Reference<css::drawing::framework::XConfigurationChangeRequest>> + : public ::std::queue<rtl::Reference<sd::framework::ConfigurationChangeRequest>> { public: /** Create an empty queue. diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx index c67ecbb77a22..dbdd837e3a21 100644 --- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx +++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx @@ -27,7 +27,7 @@ #include <vcl/svapp.hxx> #include <sal/log.hxx> #include <com/sun/star/container/XNamed.hpp> -#include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp> +#include <framework/ConfigurationChangeRequest.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -37,7 +37,7 @@ namespace { #if DEBUG_SD_CONFIGURATION_TRACE -void TraceRequest (const Reference<XConfigurationChangeRequest>& rxRequest) +void TraceRequest (const rtl::Reference<ConfigurationChangeRequest>& rxRequest) { Reference<container::XNamed> xNamed (rxRequest, UNO_QUERY); if (xNamed.is()) @@ -64,7 +64,7 @@ ChangeRequestQueueProcessor::~ChangeRequestQueueProcessor() } void ChangeRequestQueueProcessor::SetConfiguration ( - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { ::osl::MutexGuard aGuard (maMutex); @@ -73,7 +73,7 @@ void ChangeRequestQueueProcessor::SetConfiguration ( } void ChangeRequestQueueProcessor::AddRequest ( - const Reference<XConfigurationChangeRequest>& rxRequest) + const rtl::Reference<ConfigurationChangeRequest>& rxRequest) { ::osl::MutexGuard aGuard (maMutex); @@ -131,7 +131,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent() return; // Get and remove the first entry from the queue. - Reference<XConfigurationChangeRequest> xRequest (maQueue.front()); + rtl::Reference<ConfigurationChangeRequest> xRequest (maQueue.front()); maQueue.pop(); // Execute the change request. diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx index 7becd63a3aba..4ed377dc9359 100644 --- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx +++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx @@ -26,13 +26,13 @@ #include <memory> -namespace com::sun::star::drawing::framework +namespace sd::framework { -class XConfiguration; +class Configuration; } -namespace com::sun::star::drawing::framework +namespace sd::framework { -class XConfigurationChangeRequest; +class ConfigurationChangeRequest; } struct ImplSVEvent; @@ -46,7 +46,7 @@ class ConfigurationUpdater; When after processing one entry the queue is empty then the ConfigurationController::update() method is called so that the changes - made to the local XConfiguration reference are reflected by the UI. + made to the local Configuration reference are reflected by the UI. Queue entries are processed asynchronously by calling PostUserEvent(). */ @@ -64,15 +64,13 @@ public: requests. This method should be called only by the configuration controller who owns the configuration. */ - void SetConfiguration( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + void SetConfiguration(const rtl::Reference<sd::framework::Configuration>& rxConfiguration); /** The given request is appended to the end of the queue and will eventually be processed when all other entries in front of it have been processed. */ - void AddRequest( - const css::uno::Reference<css::drawing::framework::XConfigurationChangeRequest>& rxRequest); + void AddRequest(const rtl::Reference<sd::framework::ConfigurationChangeRequest>& rxRequest); /** Returns </sal_True> when the queue is empty. */ @@ -107,7 +105,7 @@ private: */ ImplSVEvent* mnUserEventId; - css::uno::Reference<css::drawing::framework::XConfiguration> mxConfiguration; + rtl::Reference<sd::framework::Configuration> mxConfiguration; std::shared_ptr<ConfigurationUpdater> mpConfigurationUpdater; diff --git a/sd/source/ui/framework/configuration/Configuration.cxx b/sd/source/ui/framework/configuration/Configuration.cxx index d69b883d1cd8..e833649dd39b 100644 --- a/sd/source/ui/framework/configuration/Configuration.cxx +++ b/sd/source/ui/framework/configuration/Configuration.cxx @@ -18,11 +18,10 @@ */ #include <framework/Configuration.hxx> - +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/FrameworkHelper.hxx> #include <framework/ConfigurationController.hxx> -#include <com/sun/star/drawing/framework/ConfigurationChangeEvent.hpp> #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <rtl/ustrbuf.hxx> @@ -88,9 +87,9 @@ void Configuration::disposing(std::unique_lock<std::mutex>&) mxBroadcaster = nullptr; } -//----- XConfiguration -------------------------------------------------------- +//----- Configuration -------------------------------------------------------- -void SAL_CALL Configuration::addResource (const Reference<XResourceId>& rxResourceId) +void Configuration::addResource (const Reference<XResourceId>& rxResourceId) { ThrowIfDisposed(); @@ -105,7 +104,7 @@ void SAL_CALL Configuration::addResource (const Reference<XResourceId>& rxResour } } -void SAL_CALL Configuration::removeResource (const Reference<XResourceId>& rxResourceId) +void Configuration::removeResource (const Reference<XResourceId>& rxResourceId) { ThrowIfDisposed(); @@ -122,15 +121,15 @@ void SAL_CALL Configuration::removeResource (const Reference<XResourceId>& rxRes } } -Sequence<Reference<XResourceId> > SAL_CALL Configuration::getResources ( +Sequence<Reference<XResourceId> > Configuration::getResources ( const Reference<XResourceId>& rxAnchorId, - const OUString& rsResourceURLPrefix, + std::u16string_view rsResourceURLPrefix, AnchorBindingMode eMode) { std::unique_lock aGuard (m_aMutex); ThrowIfDisposed(); - const bool bFilterResources (!rsResourceURLPrefix.isEmpty()); + const bool bFilterResources (!rsResourceURLPrefix.empty()); // Collect the matching resources in a vector. ::std::vector<Reference<XResourceId> > aResources; @@ -163,7 +162,7 @@ Sequence<Reference<XResourceId> > SAL_CALL Configuration::getResources ( return comphelper::containerToSequence(aResources); } -sal_Bool SAL_CALL Configuration::hasResource (const Reference<XResourceId>& rxResourceId) +bool Configuration::hasResource (const Reference<XResourceId>& rxResourceId) { std::unique_lock aGuard (m_aMutex); ThrowIfDisposed(); @@ -172,9 +171,7 @@ sal_Bool SAL_CALL Configuration::hasResource (const Reference<XResourceId>& rxRe && mpResourceContainer->find(rxResourceId) != mpResourceContainer->end(); } -//----- XCloneable ------------------------------------------------------------ - -Reference<util::XCloneable> SAL_CALL Configuration::createClone() +rtl::Reference<Configuration> Configuration::createClone() { std::unique_lock aGuard (m_aMutex); ThrowIfDisposed(); @@ -251,8 +248,8 @@ void Configuration::ThrowIfDisposed() const } bool AreConfigurationsEquivalent ( - const Reference<XConfiguration>& rxConfiguration1, - const Reference<XConfiguration>& rxConfiguration2) + const rtl::Reference<Configuration>& rxConfiguration1, + const rtl::Reference<Configuration>& rxConfiguration2) { if (rxConfiguration1.is() != rxConfiguration2.is()) return false; @@ -262,10 +259,10 @@ bool AreConfigurationsEquivalent ( // Get the lists of resources from the two given configurations. const Sequence<Reference<XResourceId> > aResources1( rxConfiguration1->getResources( - nullptr, OUString(), AnchorBindingMode_INDIRECT)); + nullptr, u"", AnchorBindingMode_INDIRECT)); const Sequence<Reference<XResourceId> > aResources2( rxConfiguration2->getResources( - nullptr, OUString(), AnchorBindingMode_INDIRECT)); + nullptr, u"", AnchorBindingMode_INDIRECT)); // When the number of resources differ then the configurations can not // be equivalent. @@ -279,6 +276,10 @@ bool AreConfigurationsEquivalent ( }); } +ConfigurationChangeListener::~ConfigurationChangeListener() {} + +ConfigurationChangeRequest::~ConfigurationChangeRequest() {} + } // end of namespace sd::framework diff --git a/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx b/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx index 99fc1297d7f4..6b2a4766915d 100644 --- a/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx @@ -20,7 +20,7 @@ #include "ConfigurationClassifier.hxx" #include <framework/FrameworkHelper.hxx> -#include <com/sun/star/drawing/framework/XConfiguration.hpp> +#include <framework/Configuration.hxx> #include <sal/log.hxx> using namespace ::com::sun::star; @@ -30,8 +30,8 @@ using namespace ::com::sun::star::drawing::framework; namespace sd::framework { ConfigurationClassifier::ConfigurationClassifier ( - const Reference<XConfiguration>& rxConfiguration1, - const Reference<XConfiguration>& rxConfiguration2) + const rtl::Reference<Configuration>& rxConfiguration1, + const rtl::Reference<Configuration>& rxConfiguration2) : mxConfiguration1(rxConfiguration1), mxConfiguration2(rxConfiguration2) { @@ -43,8 +43,8 @@ bool ConfigurationClassifier::Partition() maC2minusC1.clear(); PartitionResources( - mxConfiguration1->getResources(nullptr, OUString(), AnchorBindingMode_DIRECT), - mxConfiguration2->getResources(nullptr, OUString(), AnchorBindingMode_DIRECT)); + mxConfiguration1->getResources(nullptr, u"", AnchorBindingMode_DIRECT), + mxConfiguration2->getResources(nullptr, u"", AnchorBindingMode_DIRECT)); return !maC1minusC2.empty() || !maC2minusC1.empty(); } @@ -75,8 +75,8 @@ void ConfigurationClassifier::PartitionResources ( for (const auto& rxResource : aC1andC2) { PartitionResources( - mxConfiguration1->getResources(rxResource, OUString(), AnchorBindingMode_DIRECT), - mxConfiguration2->getResources(rxResource, OUString(), AnchorBindingMode_DIRECT)); + mxConfiguration1->getResources(rxResource, u"", AnchorBindingMode_DIRECT), + mxConfiguration2->getResources(rxResource, u"", AnchorBindingMode_DIRECT)); } } @@ -117,7 +117,7 @@ void ConfigurationClassifier::ClassifyResources ( void ConfigurationClassifier::CopyResources ( const ResourceIdVector& rSource, - const Reference<XConfiguration>& rxConfiguration, + const rtl::Reference<Configuration>& rxConfiguration, ResourceIdVector& rTarget) { // Copy all resources bound to the ones in aC1minusC2Unique to rC1minusC2. @@ -126,7 +126,7 @@ void ConfigurationClassifier::CopyResources ( const Sequence<Reference<XResourceId> > aBoundResources ( rxConfiguration->getResources( rxResource, - OUString(), + u"", AnchorBindingMode_INDIRECT)); const sal_Int32 nL (aBoundResources.getLength()); diff --git a/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx b/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx index e9384713be59..e6ceee5e651c 100644 --- a/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationClassifier.hxx @@ -21,12 +21,12 @@ #include "debugtrace.hxx" #include <com/sun/star/uno/Reference.hxx> - +#include <rtl/ref.hxx> #include <vector> -namespace com::sun::star::drawing::framework +namespace sd::framework { -class XConfiguration; +class Configuration; } namespace com::sun::star::drawing::framework { @@ -47,9 +47,8 @@ public: /** Create a new ConfigurationClassifier object that will compare the two given configurations. */ - ConfigurationClassifier( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration1, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration2); + ConfigurationClassifier(const rtl::Reference<sd::framework::Configuration>& rxConfiguration1, + const rtl::Reference<sd::framework::Configuration>& rxConfiguration2); /** Calculate three lists of resource ids. These contain the resources that belong to one configuration but not the other, or that belong @@ -99,8 +98,8 @@ public: #endif private: - css::uno::Reference<css::drawing::framework::XConfiguration> mxConfiguration1; - css::uno::Reference<css::drawing::framework::XConfiguration> mxConfiguration2; + rtl::Reference<sd::framework::Configuration> mxConfiguration1; + rtl::Reference<sd::framework::Configuration> mxConfiguration2; /** After the call to Classify() this vector holds all elements from mxConfiguration1 that are not in mxConfiguration2. @@ -154,10 +153,9 @@ private: This list is filled with resources from rSource and the ones bound to them. */ - static void CopyResources( - const ResourceIdVector& rSource, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration, - ResourceIdVector& rTarget); + static void CopyResources(const ResourceIdVector& rSource, + const rtl::Reference<sd::framework::Configuration>& rxConfiguration, + ResourceIdVector& rTarget); }; } // end of namespace sd::framework diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx b/sd/source/ui/framework/configuration/ConfigurationController.cxx index f5db8cac94dc..c111565fa00d 100644 --- a/sd/source/ui/framework/configuration/ConfigurationController.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx @@ -62,7 +62,7 @@ public: requestResourceDeactivation(). The mpConfigurationUpdater makes the current configuration reflect the content of this one. */ - css::uno::Reference<css::drawing::framework::XConfiguration> mxRequestedConfiguration; + rtl::Reference<sd::framework::Configuration> mxRequestedConfiguration; std::shared_ptr<ResourceFactoryManager> mpResourceFactoryContainer; @@ -166,7 +166,7 @@ void ConfigurationController::RequestSynchronousUpdate() } void ConfigurationController::addConfigurationChangeListener ( - const Reference<XConfigurationChangeListener>& rxListener, + const rtl::Reference<ConfigurationChangeListener>& rxListener, const OUString& rsEventType, const Any& rUserData) { @@ -178,7 +178,7 @@ void ConfigurationController::addConfigurationChangeListener ( } void ConfigurationController::removeConfigurationChangeListener ( - const Reference<XConfigurationChangeListener>& rxListener) + const rtl::Reference<ConfigurationChangeListener>& rxListener) { ::osl::MutexGuard aGuard (m_aMutex); @@ -271,7 +271,7 @@ void ConfigurationController::requestResourceActivation ( } } - Reference<XConfigurationChangeRequest> xRequest( + rtl::Reference<ConfigurationChangeRequest> xRequest( new GenericConfigurationChangeRequest( rxResourceId, GenericConfigurationChangeRequest::Activation)); @@ -295,7 +295,7 @@ void ConfigurationController::requestResourceDeactivation ( const Sequence<Reference<XResourceId> > aLinkedResources ( mpImplementation->mxRequestedConfiguration->getResources( rxResourceId, - OUString(), + u"", AnchorBindingMode_DIRECT)); for (const auto& rLinkedResource : aLinkedResources) { @@ -306,7 +306,7 @@ void ConfigurationController::requestResourceDeactivation ( } // Add a deactivation request for the specified resource. - Reference<XConfigurationChangeRequest> xRequest( + rtl::Reference<ConfigurationChangeRequest> xRequest( new GenericConfigurationChangeRequest( rxResourceId, GenericConfigurationChangeRequest::Deactivation)); @@ -351,7 +351,7 @@ bool ConfigurationController::hasPendingRequests() } void ConfigurationController::postChangeRequest ( - const Reference<XConfigurationChangeRequest>& rxRequest) + const rtl::Reference<ConfigurationChangeRequest>& rxRequest) { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); @@ -359,36 +359,35 @@ void ConfigurationController::postChangeRequest ( mpImplementation->mpQueueProcessor->AddRequest(rxRequest); } -Reference<XConfiguration> ConfigurationController::getRequestedConfiguration() +rtl::Reference<Configuration> ConfigurationController::getRequestedConfiguration() { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); if (mpImplementation->mxRequestedConfiguration.is()) - return Reference<XConfiguration>( - mpImplementation->mxRequestedConfiguration->createClone(), UNO_QUERY); + return mpImplementation->mxRequestedConfiguration->createClone(); else - return Reference<XConfiguration>(); + return rtl::Reference<Configuration>(); } -Reference<XConfiguration> ConfigurationController::getCurrentConfiguration() +rtl::Reference<Configuration> ConfigurationController::getCurrentConfiguration() { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); - Reference<XConfiguration> xCurrentConfiguration( + rtl::Reference<Configuration> xCurrentConfiguration( mpImplementation->mpConfigurationUpdater->GetCurrentConfiguration()); if (xCurrentConfiguration.is()) - return Reference<XConfiguration>(xCurrentConfiguration->createClone(), UNO_QUERY); + return xCurrentConfiguration->createClone(); else - return Reference<XConfiguration>(); + return rtl::Reference<Configuration>(); } /** The given configuration is restored by generating the appropriate set of activation and deactivation requests. */ void ConfigurationController::restoreConfiguration ( - const Reference<XConfiguration>& rxNewConfiguration) + const rtl::Reference<Configuration>& rxNewConfiguration) { ::osl::MutexGuard aGuard (m_aMutex); ThrowIfDisposed(); @@ -400,7 +399,7 @@ void ConfigurationController::restoreConfiguration ( mpImplementation->mpConfigurationUpdater->GetLock()); // Get lists of resources that are to be activated or deactivated. - Reference<XConfiguration> xCurrentConfiguration (mpImplementation->mxRequestedConfiguration); + rtl::Reference<Configuration> xCurrentConfiguration (mpImplementation->mxRequestedConfiguration); #if OSL_DEBUG_LEVEL >=1 SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::restoreConfiguration("); ConfigurationTracer::TraceConfiguration(rxNewConfiguration, "requested configuration"); diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx index c0288cb2bdb3..79b0acdd1a3d 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx @@ -18,7 +18,8 @@ */ #include "ConfigurationControllerBroadcaster.hxx" -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <framework/ConfigurationChangeListener.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <com/sun/star/drawing/framework/XResource.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/DisposedException.hpp> @@ -38,7 +39,7 @@ ConfigurationControllerBroadcaster::ConfigurationControllerBroadcaster ( } void ConfigurationControllerBroadcaster::AddListener( - const Reference<XConfigurationChangeListener>& rxListener, + const rtl::Reference<ConfigurationChangeListener>& rxListener, const OUString& rsEventType, const Any& rUserData) { @@ -56,7 +57,7 @@ void ConfigurationControllerBroadcaster::AddListener( } void ConfigurationControllerBroadcaster::RemoveListener( - const Reference<XConfigurationChangeListener>& rxListener) + const rtl::Reference<ConfigurationChangeListener>& rxListener) { if ( ! rxListener.is()) throw lang::IllegalArgumentException(u"invalid listener"_ustr, @@ -92,7 +93,7 @@ void ConfigurationControllerBroadcaster::NotifyListeners ( { // When the exception comes from the listener itself then // unregister it. - if (rException.Context == rListener.mxListener) + if (rException.Context == cppu::getXWeak(rListener.mxListener.get())) RemoveListener(rListener.mxListener); } catch (const RuntimeException&) @@ -161,7 +162,7 @@ void ConfigurationControllerBroadcaster::DisposeAndClear() } else { - Reference<XConfigurationChangeListener> xListener ( + rtl::Reference<ConfigurationChangeListener> xListener ( iMap->second.front().mxListener ); if (xListener.is()) { diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx index 4d72a45b3f6a..370460e19d22 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.hxx @@ -24,15 +24,15 @@ #include <unordered_map> #include <vector> -namespace com::sun::star::drawing::framework { class XConfigurationChangeListener; } +namespace sd::framework { class ConfigurationChangeListener; } namespace com::sun::star::drawing::framework { class XResource; } namespace com::sun::star::drawing::framework { class XResourceId; } -namespace com::sun::star::drawing::framework { struct ConfigurationChangeEvent; } +namespace sd::framework { struct ConfigurationChangeEvent; } namespace sd::framework { class ConfigurationController; -/** This class manages the set of XConfigurationChangeListeners and +/** This class manages the set of ConfigurationChangeListeners and calls them when the ConfigurationController wants to broadcast an event. @@ -67,8 +67,8 @@ public: when an empty listener reference is given. */ void AddListener( - const css::uno::Reference< - css::drawing::framework::XConfigurationChangeListener>& rxListener, + const rtl::Reference< + sd::framework::ConfigurationChangeListener>& rxListener, const OUString& rsEventType, const css::uno::Any& rUserData); @@ -81,8 +81,8 @@ public: when an empty listener reference is given. */ void RemoveListener( - const css::uno::Reference< - css::drawing::framework::XConfigurationChangeListener>& rxListener); + const rtl::Reference< + sd::framework::ConfigurationChangeListener>& rxListener); /** Broadcast the given event to all listeners that have been registered for its type of event as well as all universal listeners. @@ -91,7 +91,7 @@ public: the listener is unregistered automatically. */ void NotifyListeners ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent); + const sd::framework::ConfigurationChangeEvent& rEvent); /** This convenience variant of NotifyListeners create the event from the given arguments. @@ -113,7 +113,7 @@ private: class ListenerDescriptor { public: - css::uno::Reference<css::drawing::framework::XConfigurationChangeListener> mxListener; + rtl::Reference<sd::framework::ConfigurationChangeListener> mxListener; css::uno::Any maUserData; }; typedef std::vector<ListenerDescriptor> ListenerList; @@ -129,7 +129,7 @@ private: */ void NotifyListeners ( const ListenerList& rList, - const css::drawing::framework::ConfigurationChangeEvent& rEvent); + const sd::framework::ConfigurationChangeEvent& rEvent); }; } // end of namespace sd::framework diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx index 70b308691957..1754701cf923 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx @@ -22,7 +22,7 @@ #include "ResourceFactoryManager.hxx" #include <framework/FrameworkHelper.hxx> #include <com/sun/star/lang/DisposedException.hpp> -#include <com/sun/star/drawing/framework/XConfiguration.hpp> +#include <framework/Configuration.hxx> #include <com/sun/star/drawing/framework/XResourceFactory.hpp> #include <comphelper/diagnose_ex.hxx> #include <sal/log.hxx> @@ -64,7 +64,7 @@ ConfigurationControllerResourceManager::ResourceDescriptor void ConfigurationControllerResourceManager::ActivateResources ( const ::std::vector<Reference<XResourceId> >& rResources, - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { ::osl::MutexGuard aGuard (maMutex); // Iterate in normal order over the resources that are to be @@ -76,7 +76,7 @@ void ConfigurationControllerResourceManager::ActivateResources ( void ConfigurationControllerResourceManager::DeactivateResources ( const ::std::vector<Reference<XResourceId> >& rResources, - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { ::osl::MutexGuard aGuard (maMutex); // Iterate in reverse order over the resources that are to be @@ -100,7 +100,7 @@ void ConfigurationControllerResourceManager::DeactivateResources ( */ void ConfigurationControllerResourceManager::ActivateResource ( const Reference<XResourceId>& rxResourceId, - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { if ( ! rxResourceId.is()) { @@ -172,7 +172,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( */ void ConfigurationControllerResourceManager::DeactivateResource ( const Reference<XResourceId>& rxResourceId, - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { if ( ! rxResourceId.is()) return; diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.hxx b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.hxx index b57674e1425c..23da093d0690 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.hxx @@ -22,12 +22,12 @@ #include <osl/mutex.hxx> #include <com/sun/star/uno/Reference.hxx> - +#include <rtl/ref.hxx> #include <map> #include <memory> #include <vector> -namespace com::sun::star::drawing::framework { class XConfiguration; } +namespace sd::framework { class Configuration; } namespace com::sun::star::drawing::framework { class XResourceFactory; } namespace com::sun::star::drawing::framework { class XResource; } namespace com::sun::star::drawing::framework { class XResourceId; } @@ -75,7 +75,7 @@ public: void ActivateResources ( const ::std::vector< css::uno::Reference<css::drawing::framework::XResourceId> >& rResources, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + const rtl::Reference<sd::framework::Configuration>& rxConfiguration); /** Deactivate all the resources that are specified by resource ids in rResources. The resource ids of deactivated resources are removed @@ -85,7 +85,7 @@ public: void DeactivateResources ( const ::std::vector< css::uno::Reference<css::drawing::framework::XResourceId> >& rResources, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + const rtl::Reference<sd::framework::Configuration>& rxConfiguration); /** Return the descriptor for the specified resource. @return @@ -121,11 +121,11 @@ private: void ActivateResource ( const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + const rtl::Reference<sd::framework::Configuration>& rxConfiguration); void DeactivateResource ( const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + const rtl::Reference<sd::framework::Configuration>& rxConfiguration); void AddResource ( const css::uno::Reference<css::drawing::framework::XResource>& rxResource, diff --git a/sd/source/ui/framework/configuration/ConfigurationTracer.cxx b/sd/source/ui/framework/configuration/ConfigurationTracer.cxx index 68cc9fe9a10b..30d687dff8c7 100644 --- a/sd/source/ui/framework/configuration/ConfigurationTracer.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationTracer.cxx @@ -19,7 +19,7 @@ #include "ConfigurationTracer.hxx" -#include <com/sun/star/drawing/framework/XConfiguration.hpp> +#include <framework/Configuration.hxx> #include <sal/log.hxx> using namespace ::com::sun::star::uno; @@ -28,7 +28,7 @@ using namespace ::com::sun::star::drawing::framework; namespace sd::framework { void ConfigurationTracer::TraceConfiguration ( - const Reference<XConfiguration>& rxConfiguration, + const rtl::Reference<Configuration>& rxConfiguration, const char* pMessage) { #if OSL_DEBUG_LEVEL >=1 @@ -50,12 +50,12 @@ void ConfigurationTracer::TraceConfiguration ( #if OSL_DEBUG_LEVEL >=1 void ConfigurationTracer::TraceBoundResources ( - const Reference<XConfiguration>& rxConfiguration, + const rtl::Reference<Configuration>& rxConfiguration, const Reference<XResourceId>& rxResourceId, const int nIndentation) { const Sequence<Reference<XResourceId> > aResourceList ( - rxConfiguration->getResources(rxResourceId, OUString(), AnchorBindingMode_DIRECT)); + rxConfiguration->getResources(rxResourceId, u"", AnchorBindingMode_DIRECT)); static constexpr OUStringLiteral sIndentation (u" "); for (Reference<XResourceId> const & resourceId : aResourceList) { diff --git a/sd/source/ui/framework/configuration/ConfigurationTracer.hxx b/sd/source/ui/framework/configuration/ConfigurationTracer.hxx index 337fae5696a7..96733675df13 100644 --- a/sd/source/ui/framework/configuration/ConfigurationTracer.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationTracer.hxx @@ -20,10 +20,11 @@ #pragma once #include <sal/types.h> +#include <rtl/ref.hxx> -namespace com::sun::star::drawing::framework +namespace sd::framework { -class XConfiguration; +class Configuration; } namespace com::sun::star::drawing::framework { @@ -42,12 +43,12 @@ namespace sd::framework class ConfigurationTracer { public: - static void TraceConfiguration( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration, - const char* pMessage); + static void + TraceConfiguration(const rtl::Reference<sd::framework::Configuration>& rxConfiguration, + const char* pMessage); #if OSL_DEBUG_LEVEL >= 1 static void TraceBoundResources( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration, + const rtl::Reference<sd::framework::Configuration>& rxConfiguration, const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId, const int nIndentation); #endif diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx index 756dd8936e2b..9ccc1cae6bca 100644 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx @@ -23,10 +23,11 @@ #include "ConfigurationControllerBroadcaster.hxx" #include "ConfigurationControllerResourceManager.hxx" #include <framework/Configuration.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/ConfigurationController.hxx> #include <framework/FrameworkHelper.hxx> #include <DrawController.hxx> -#include <com/sun/star/drawing/framework/ConfigurationChangeEvent.hpp> +#include <framework/ConfigurationChangeEvent.hxx> #include <comphelper/scopeguard.hxx> #include <comphelper/diagnose_ex.hxx> @@ -69,7 +70,7 @@ ConfigurationUpdater::ConfigurationUpdater ( std::shared_ptr<ConfigurationControllerResourceManager> pResourceManager, const rtl::Reference<::sd::DrawController>& rxControllerManager) : mpBroadcaster(std::move(pBroadcaster)), - mxCurrentConfiguration(Reference<XConfiguration>(new Configuration(nullptr, false))), + mxCurrentConfiguration(new Configuration(nullptr, false)), mbUpdatePending(false), mbUpdateBeingProcessed(false), mnLockCount(0), @@ -91,7 +92,7 @@ ConfigurationUpdater::~ConfigurationUpdater() } void ConfigurationUpdater::RequestUpdate ( - const Reference<XConfiguration>& rxRequestedConfiguration) + const rtl::Reference<Configuration>& rxRequestedConfiguration) { mxRequestedConfiguration = rxRequestedConfiguration; @@ -270,7 +271,7 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie } void ConfigurationUpdater::CheckPureAnchors ( - const Reference<XConfiguration>& rxConfiguration, + const rtl::Reference<Configuration>& rxConfiguration, vector<Reference<XResourceId> >& rResourcesToDeactivate) { if ( ! rxConfiguration.is()) @@ -279,7 +280,7 @@ void ConfigurationUpdater::CheckPureAnchors ( // Get a list of all resources in the configuration. Sequence<Reference<XResourceId> > aResources( rxConfiguration->getResources( - nullptr, OUString(), AnchorBindingMode_INDIRECT)); + nullptr, u"", AnchorBindingMode_INDIRECT)); auto aResourcesRange = asNonConstRange(aResources); sal_Int32 nCount (aResources.getLength()); diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx index edc21adf78a1..e86d6e6e5e32 100644 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.hxx @@ -25,9 +25,9 @@ #include <memory> #include <vector> -namespace com::sun::star::drawing::framework +namespace sd::framework { -class XConfiguration; +class Configuration; } namespace com::sun::star::drawing::framework { @@ -71,11 +71,10 @@ public: if that is the case. Otherwise it schedules a later call to UpdateConfiguration(). */ - void RequestUpdate(const css::uno::Reference<css::drawing::framework::XConfiguration>& - rxRequestedConfiguration); + void + RequestUpdate(const rtl::Reference<sd::framework::Configuration>& rxRequestedConfiguration); - const css::uno::Reference<css::drawing::framework::XConfiguration>& - GetCurrentConfiguration() const + const rtl::Reference<sd::framework::Configuration>& GetCurrentConfiguration() const { return mxCurrentConfiguration; } @@ -98,7 +97,7 @@ private: /** The current configuration holds the resources that are currently active. It is modified during an update. */ - css::uno::Reference<css::drawing::framework::XConfiguration> mxCurrentConfiguration; + rtl::Reference<sd::framework::Configuration> mxCurrentConfiguration; /** The requested configuration holds the resources that have been requested to activate or to deactivate since the last update. It is @@ -106,7 +105,7 @@ private: maintained by the ConfigurationController and given to the ConfigurationUpdater in the RequestUpdate() method. */ - css::uno::Reference<css::drawing::framework::XConfiguration> mxRequestedConfiguration; + rtl::Reference<sd::framework::Configuration> mxRequestedConfiguration; /** This flag is set to </sal_True> when an update of the current configuration was requested (because the last request in the queue @@ -160,10 +159,9 @@ private: Childless pure anchors are deactivated. This affects only the current configuration. */ - void CheckPureAnchors( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration, - ::std::vector<css::uno::Reference<css::drawing::framework::XResourceId>>& - rResourcesToDeactivate); + void CheckPureAnchors(const rtl::Reference<sd::framework::Configuration>& rxConfiguration, + ::std::vector<css::uno::Reference<css::drawing::framework::XResourceId>>& + rResourcesToDeactivate); /** Remove from the requested configuration all pure anchors that have no child. Requested but not yet activated anchors can not be removed diff --git a/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx b/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx index fa6d415034c8..f422bb1a0ad0 100644 --- a/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx +++ b/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.cxx @@ -45,8 +45,8 @@ GenericConfigurationChangeRequest::~GenericConfigurationChangeRequest() noexcept { } -void SAL_CALL GenericConfigurationChangeRequest::execute ( - const Reference<XConfiguration>& rxConfiguration) +void GenericConfigurationChangeRequest::execute ( + const rtl::Reference<Configuration>& rxConfiguration) { if (!rxConfiguration.is()) return; diff --git a/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.hxx b/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.hxx index 03f2bfa3cf85..06ab95a19b3f 100644 --- a/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.hxx +++ b/sd/source/ui/framework/configuration/GenericConfigurationChangeRequest.hxx @@ -19,7 +19,7 @@ #pragma once -#include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp> +#include <framework/ConfigurationChangeRequest.hxx> #include <com/sun/star/container/XNamed.hpp> #include <comphelper/compbase.hxx> @@ -27,12 +27,12 @@ namespace com::sun::star::drawing::framework { class XResourceId; } namespace sd::framework { -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeRequest, +typedef cppu::ImplInheritanceHelper < + sd::framework::ConfigurationChangeRequest, css::container::XNamed > GenericConfigurationChangeRequestInterfaceBase; -/** This implementation of the XConfigurationChangeRequest interface +/** This implementation of the ConfigurationChangeRequest interface represents a single explicit request for a configuration change. On its execution it may result in other, implicit, configuration changes. For example this is the case when the deactivation of a unique resource is @@ -72,8 +72,8 @@ public: @param rxConfiguration The configuration to which the requested change is made. */ - virtual void SAL_CALL execute ( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration) override; + virtual void execute ( + const rtl::Reference<sd::framework::Configuration>& rxConfiguration) override; // XNamed diff --git a/sd/source/ui/framework/configuration/UpdateRequest.cxx b/sd/source/ui/framework/configuration/UpdateRequest.cxx index d57cb02a6eaf..bf8f7db17e21 100644 --- a/sd/source/ui/framework/configuration/UpdateRequest.cxx +++ b/sd/source/ui/framework/configuration/UpdateRequest.cxx @@ -29,7 +29,7 @@ UpdateRequest::UpdateRequest() noexcept {} UpdateRequest::~UpdateRequest() noexcept {} -void SAL_CALL UpdateRequest::execute(const Reference<XConfiguration>&) +void UpdateRequest::execute(const rtl::Reference<Configuration>&) { // Do nothing here. The configuration is updated when the request queue // becomes empty. diff --git a/sd/source/ui/framework/configuration/UpdateRequest.hxx b/sd/source/ui/framework/configuration/UpdateRequest.hxx index 4f46a3233773..a80d152e1310 100644 --- a/sd/source/ui/framework/configuration/UpdateRequest.hxx +++ b/sd/source/ui/framework/configuration/UpdateRequest.hxx @@ -19,14 +19,14 @@ #pragma once -#include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp> +#include <framework/ConfigurationChangeRequest.hxx> #include <com/sun/star/container/XNamed.hpp> #include <comphelper/compbase.hxx> namespace sd::framework { -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeRequest, +typedef cppu::ImplInheritanceHelper < + sd::framework::ConfigurationChangeRequest, css::container::XNamed > UpdateRequestInterfaceBase; @@ -47,8 +47,8 @@ public: // XConfigurationChangeOperation - virtual void SAL_CALL execute ( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration) override; + virtual void execute ( + const rtl::Reference<sd::framework::Configuration>& rxConfiguration) override; // XNamed diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx index e73ed69043e3..9633f4ff1623 100644 --- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -288,9 +288,9 @@ void SAL_CALL BasicPaneFactory::releaseResource ( } -//===== XConfigurationChangeListener ========================================== +//===== ConfigurationChangeListener ========================================== -void SAL_CALL BasicPaneFactory::notifyConfigurationChange ( +void BasicPaneFactory::notifyConfigurationChange ( const ConfigurationChangeEvent& /* rEvent */ ) { // FIXME: nothing to do diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx b/sd/source/ui/framework/factories/PresentationFactory.cxx index 0edfbed9eaa2..0651bf7bee46 100644 --- a/sd/source/ui/framework/factories/PresentationFactory.cxx +++ b/sd/source/ui/framework/factories/PresentationFactory.cxx @@ -107,9 +107,9 @@ void SAL_CALL PresentationFactory::releaseResource ( } } -//===== XConfigurationChangeListener ========================================== +//===== ConfigurationChangeListener ========================================== -void SAL_CALL PresentationFactory::notifyConfigurationChange ( +void PresentationFactory::notifyConfigurationChange ( const ConfigurationChangeEvent&) {} diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx b/sd/source/ui/framework/module/CenterViewFocusModule.cxx index fc9ba22e81fe..422852030050 100644 --- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx +++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx @@ -20,6 +20,7 @@ #include "CenterViewFocusModule.hxx" #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/FrameworkHelper.hxx> #include <framework/ViewShellWrapper.hxx> @@ -85,7 +86,7 @@ void CenterViewFocusModule::disposing(std::unique_lock<std::mutex>&) mpBase = nullptr; } -void SAL_CALL CenterViewFocusModule::notifyConfigurationChange ( +void CenterViewFocusModule::notifyConfigurationChange ( const ConfigurationChangeEvent& rEvent) { if (mbValid) @@ -103,7 +104,7 @@ void SAL_CALL CenterViewFocusModule::notifyConfigurationChange ( } void CenterViewFocusModule::HandleNewView ( - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { if (!mbNewViewCreated) return; diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.hxx b/sd/source/ui/framework/module/CenterViewFocusModule.hxx index 6e3f9c74d47c..9b19cfe2d835 100644 --- a/sd/source/ui/framework/module/CenterViewFocusModule.hxx +++ b/sd/source/ui/framework/module/CenterViewFocusModule.hxx @@ -19,7 +19,7 @@ #pragma once -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> @@ -32,16 +32,14 @@ class ViewShellBase; namespace sd::framework { class ConfigurationController; - -typedef comphelper::WeakComponentImplHelper<css::drawing::framework::XConfigurationChangeListener> - CenterViewFocusModuleInterfaceBase; +class Configuration; /** This module waits for new views to be created for the center pane and then moves the center view to the top most place on the shell stack. As we are moving away from the shell stack this module may become obsolete or has to be modified. */ -class CenterViewFocusModule final : public CenterViewFocusModuleInterfaceBase +class CenterViewFocusModule final : public sd::framework::ConfigurationChangeListener { public: explicit CenterViewFocusModule(rtl::Reference<sd::DrawController> const& rxController); @@ -49,10 +47,10 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfigurationChangeListener + // ConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void + notifyConfigurationChange(const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener @@ -74,8 +72,7 @@ private: handles a new view in the center pane by moving the associated view shell to the top of the shell stack. */ - void HandleNewView( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + void HandleNewView(const rtl::Reference<sd::framework::Configuration>& rxConfiguration); }; } // end of namespace sd::framework diff --git a/sd/source/ui/framework/module/NotesPaneModule.cxx b/sd/source/ui/framework/module/NotesPaneModule.cxx index 073744b9b741..f4ff256db10d 100644 --- a/sd/source/ui/framework/module/NotesPaneModule.cxx +++ b/sd/source/ui/framework/module/NotesPaneModule.cxx @@ -16,6 +16,7 @@ #include <ViewShellManager.hxx> #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/FrameworkHelper.hxx> #include <framework/ViewShellWrapper.hxx> @@ -136,7 +137,7 @@ IMPL_LINK(NotesPaneModule, EventMultiplexerListener, sd::tools::EventMultiplexer } } -void SAL_CALL NotesPaneModule::notifyConfigurationChange(const ConfigurationChangeEvent& rEvent) +void NotesPaneModule::notifyConfigurationChange(const ConfigurationChangeEvent& rEvent) { if (!mxConfigurationController.is()) return; @@ -239,8 +240,7 @@ bool NotesPaneModule::IsMasterView(const Reference<XView>& xView) } void NotesPaneModule::onResourceRequest( - bool bActivation, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration) + bool bActivation, const rtl::Reference<sd::framework::Configuration>& rxConfiguration) { Sequence<Reference<XResourceId>> aCenterViews = rxConfiguration->getResources( FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL), diff --git a/sd/source/ui/framework/module/NotesPaneModule.hxx b/sd/source/ui/framework/module/NotesPaneModule.hxx index ca05ab4cc379..37d44c085f62 100644 --- a/sd/source/ui/framework/module/NotesPaneModule.hxx +++ b/sd/source/ui/framework/module/NotesPaneModule.hxx @@ -8,7 +8,8 @@ */ #pragma once -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <com/sun/star/drawing/framework/XResourceId.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> #include <tools/link.hxx> @@ -31,11 +32,11 @@ class EventMultiplexerEvent; namespace sd::framework { class ConfigurationController; +class Configuration; /** This module is responsible for handling visibility of NotesPane across modes */ -class NotesPaneModule : public comphelper::WeakComponentImplHelper< - css::drawing::framework::XConfigurationChangeListener> +class NotesPaneModule : public sd::framework::ConfigurationChangeListener { public: /** Create a new module that controls the view tab bar above the view @@ -52,10 +53,10 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfigurationChangeListener + // ConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void + notifyConfigurationChange(const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener @@ -74,9 +75,8 @@ private: bool mbInMasterEditMode = false; void onMainViewSwitch(const OUString& rsViewURL, const bool bIsActivated); - void onResourceRequest( - bool bActivation, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + void onResourceRequest(bool bActivation, + const rtl::Reference<sd::framework::Configuration>& rxConfiguration); bool IsMasterView(const css::uno::Reference<css::drawing::framework::XView>& xView); DECL_LINK(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, void); diff --git a/sd/source/ui/framework/module/ShellStackGuard.cxx b/sd/source/ui/framework/module/ShellStackGuard.cxx index a5aba8acfc3a..764f45bb7a29 100644 --- a/sd/source/ui/framework/module/ShellStackGuard.cxx +++ b/sd/source/ui/framework/module/ShellStackGuard.cxx @@ -20,6 +20,7 @@ #include "ShellStackGuard.hxx" #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/FrameworkHelper.hxx> #include <DrawController.hxx> @@ -77,7 +78,7 @@ void ShellStackGuard::disposing(std::unique_lock<std::mutex>&) mpBase = nullptr; } -void SAL_CALL ShellStackGuard::notifyConfigurationChange ( +void ShellStackGuard::notifyConfigurationChange ( const ConfigurationChangeEvent& rEvent) { if (rEvent.Type == FrameworkHelper::msConfigurationUpdateStartEvent) diff --git a/sd/source/ui/framework/module/ShellStackGuard.hxx b/sd/source/ui/framework/module/ShellStackGuard.hxx index c76190a3bb58..e8552be1e403 100644 --- a/sd/source/ui/framework/module/ShellStackGuard.hxx +++ b/sd/source/ui/framework/module/ShellStackGuard.hxx @@ -21,7 +21,7 @@ #include <framework/ConfigurationController.hxx> -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <rtl/ref.hxx> #include <vcl/idle.hxx> @@ -38,9 +38,6 @@ namespace sd::framework { class ConfigurationController; -typedef comphelper::WeakComponentImplHelper<css::drawing::framework::XConfigurationChangeListener> - ShellStackGuardInterfaceBase; - /** This module locks updates of the current configuration in situations when the shell stack must not be modified. @@ -51,7 +48,7 @@ typedef comphelper::WeakComponentImplHelper<css::drawing::framework::XConfigurat When in the future there are no resources left that use shells then this module can be removed. */ -class ShellStackGuard : public ShellStackGuardInterfaceBase +class ShellStackGuard : public sd::framework::ConfigurationChangeListener { public: explicit ShellStackGuard(rtl::Reference<sd::DrawController> const& rxController); @@ -59,10 +56,10 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfigurationChangeListener + // ConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void + notifyConfigurationChange(const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener diff --git a/sd/source/ui/framework/module/SlideSorterModule.cxx b/sd/source/ui/framework/module/SlideSorterModule.cxx index 39d74b0995fe..6847b7f93f04 100644 --- a/sd/source/ui/framework/module/SlideSorterModule.cxx +++ b/sd/source/ui/framework/module/SlideSorterModule.cxx @@ -22,6 +22,7 @@ #include <comphelper/lok.hxx> #include <framework/FrameworkHelper.hxx> #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <o3tl/test_info.hxx> #include <officecfg/Office/Impress.hxx> #include <DrawController.hxx> @@ -115,7 +116,7 @@ void SlideSorterModule::SaveResourceState() xChanges->commit(); } -void SAL_CALL SlideSorterModule::notifyConfigurationChange ( +void SlideSorterModule::notifyConfigurationChange ( const ConfigurationChangeEvent& rEvent) { if (rEvent.Type == FrameworkHelper::msResourceActivationEvent) @@ -275,7 +276,7 @@ void SlideSorterModule::HandleMainViewSwitch ( void SlideSorterModule::HandleResourceRequest( bool bActivation, - const Reference<XConfiguration>& rxConfiguration) + const rtl::Reference<Configuration>& rxConfiguration) { Sequence<Reference<XResourceId> > aCenterViews = rxConfiguration->getResources( FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL), diff --git a/sd/source/ui/framework/module/SlideSorterModule.hxx b/sd/source/ui/framework/module/SlideSorterModule.hxx index 3edc18e924de..8f2ec428aa5d 100644 --- a/sd/source/ui/framework/module/SlideSorterModule.hxx +++ b/sd/source/ui/framework/module/SlideSorterModule.hxx @@ -19,7 +19,8 @@ #pragma once -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <com/sun/star/drawing/framework/XResourceId.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> #include <memory> @@ -31,10 +32,8 @@ namespace sd { class ViewTabBar; } namespace sd::framework { class ConfigurationController; +class Configuration; -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeListener - > SlideSorterModuleBase; /** This module is responsible for showing the slide sorter bar and the slide sorter view in the center pane. @@ -46,7 +45,7 @@ typedef comphelper::WeakComponentImplHelper < detects this and remembers it for the future. */ class SlideSorterModule final - : public SlideSorterModuleBase + : public sd::framework::ConfigurationChangeListener { public: SlideSorterModule ( @@ -63,9 +62,9 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + // ConfigurationChangeListener + virtual void notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener virtual void SAL_CALL disposing ( @@ -87,7 +86,7 @@ private: const bool bIsActivated); void HandleResourceRequest( bool bActivation, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration); + const rtl::Reference<sd::framework::Configuration>& rxConfiguration); void UpdateViewTabBar ( const rtl::Reference<sd::ViewTabBar>& rxViewTabBar); }; diff --git a/sd/source/ui/framework/module/ToolBarModule.cxx b/sd/source/ui/framework/module/ToolBarModule.cxx index 80d75d5f8438..f7b8235168f5 100644 --- a/sd/source/ui/framework/module/ToolBarModule.cxx +++ b/sd/source/ui/framework/module/ToolBarModule.cxx @@ -25,6 +25,7 @@ #include <EventMultiplexer.hxx> #include <comphelper/servicehelper.hxx> #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/FrameworkHelper.hxx> #include <vcl/EnumContext.hxx> @@ -98,7 +99,7 @@ void ToolBarModule::disposing(std::unique_lock<std::mutex>&) } } -void SAL_CALL ToolBarModule::notifyConfigurationChange ( +void ToolBarModule::notifyConfigurationChange ( const ConfigurationChangeEvent& rEvent) { if (!mxConfigurationController.is()) diff --git a/sd/source/ui/framework/module/ToolBarModule.hxx b/sd/source/ui/framework/module/ToolBarModule.hxx index ab51982610b8..787597d5a83c 100644 --- a/sd/source/ui/framework/module/ToolBarModule.hxx +++ b/sd/source/ui/framework/module/ToolBarModule.hxx @@ -21,7 +21,7 @@ #include <ToolBarManager.hxx> #include <tools/link.hxx> -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <com/sun/star/ui/XContextChangeEventListener.hpp> #include <comphelper/compbase.hxx> #include <o3tl/deleter.hxx> @@ -47,15 +47,11 @@ namespace sd::framework { class ConfigurationController; -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeListener - > ToolBarModuleInterfaceBase; - /** This module is responsible for locking the ToolBarManager during configuration updates and for triggering ToolBarManager updates. */ class ToolBarModule final - : public ToolBarModuleInterfaceBase + : public sd::framework::ConfigurationChangeListener { public: /** Create a new module. @@ -68,10 +64,10 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfigurationChangeListener + // ConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener diff --git a/sd/source/ui/framework/module/ViewTabBarModule.cxx b/sd/source/ui/framework/module/ViewTabBarModule.cxx index 90185db94ea2..336a6220e8c4 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.cxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.cxx @@ -20,6 +20,7 @@ #include "ViewTabBarModule.hxx" #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/FrameworkHelper.hxx> #include <ViewTabBar.hxx> #include <DrawController.hxx> @@ -87,7 +88,7 @@ void ViewTabBarModule::disposing(std::unique_lock<std::mutex>&) } } -void SAL_CALL ViewTabBarModule::notifyConfigurationChange ( +void ViewTabBarModule::notifyConfigurationChange ( const ConfigurationChangeEvent& rEvent) { if (!mxConfigurationController.is()) diff --git a/sd/source/ui/framework/module/ViewTabBarModule.hxx b/sd/source/ui/framework/module/ViewTabBarModule.hxx index 3d2e5e819760..a72d6f5191ba 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.hxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.hxx @@ -19,7 +19,8 @@ #pragma once -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include <com/sun/star/drawing/framework/XResourceId.hpp> +#include <framework/ConfigurationChangeListener.hxx> #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> @@ -30,15 +31,11 @@ namespace sd::framework { class ConfigurationController; -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeListener - > ViewTabBarModuleInterfaceBase; - /** This module is responsible for showing the ViewTabBar above the view in the center pane. */ class ViewTabBarModule - : public ViewTabBarModuleInterfaceBase + : public sd::framework::ConfigurationChangeListener { public: /** Create a new module that controls the view tab bar above the view @@ -57,10 +54,10 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfigurationChangeListener + // ConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + virtual void notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) override; // XEventListener diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 8e565f029089..131ccc0a755a 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -22,6 +22,7 @@ #include <framework/FrameworkHelper.hxx> #include <framework/ConfigurationController.hxx> +#include <framework/ConfigurationChangeEvent.hxx> #include <framework/ResourceId.hxx> #include <framework/ViewShellWrapper.hxx> #include <ViewShellBase.hxx> @@ -51,18 +52,13 @@ namespace { //----- CallbackCaller -------------------------------------------------------- -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfigurationChangeListener - > CallbackCallerInterfaceBase; - /** A CallbackCaller registers as listener at the ConfigurationController object and waits for the notification of one type of event. When that event is received, or when the CallbackCaller detects at its construction that the event will not be sent in the near future, the actual callback object is called and the CallbackCaller destroys itself. */ -class CallbackCaller - : public CallbackCallerInterfaceBase +class CallbackCaller : public sd::framework::ConfigurationChangeListener { public: /** Create a new CallbackCaller object. This object controls its own @@ -92,8 +88,8 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; // XEventListener virtual void SAL_CALL disposing (const lang::EventObject& rEvent) override; - // XConfigurationChangeListener - virtual void SAL_CALL notifyConfigurationChange (const ConfigurationChangeEvent& rEvent) override; + // ConfigurationChangeListener + virtual void notifyConfigurationChange (const sd::framework::ConfigurationChangeEvent& rEvent) override; private: OUString msEventType; @@ -152,7 +148,7 @@ namespace { class FrameworkHelperAllPassFilter { public: - bool operator() (const css::drawing::framework::ConfigurationChangeEvent&) { return true; } + bool operator() (const sd::framework::ConfigurationChangeEvent&) { return true; } }; class FrameworkHelperResourceIdFilter @@ -160,7 +156,7 @@ namespace { public: explicit FrameworkHelperResourceIdFilter ( const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId); - bool operator() (const css::drawing::framework::ConfigurationChangeEvent& rEvent) + bool operator() (const sd::framework::ConfigurationChangeEvent& rEvent) { return mxResourceId.is() && rEvent.ResourceId.is() && mxResourceId->compareTo(rEvent.ResourceId) == 0; } private: @@ -215,7 +211,7 @@ namespace { try { - Reference< XConfiguration > xConfiguration( i_rConfigController->getRequestedConfiguration(), UNO_SET_THROW ); + rtl::Reference< sd::framework::Configuration > xConfiguration( i_rConfigController->getRequestedConfiguration() ); Sequence< Reference< XResourceId > > aViewIds( xConfiguration->getResources( i_rPaneId, FrameworkHelper::msViewURLPrefix, AnchorBindingMode_DIRECT ) ); if ( aViewIds.hasElements() ) @@ -847,8 +843,8 @@ void SAL_CALL CallbackCaller::disposing (const lang::EventObject& rEvent) } } -void SAL_CALL CallbackCaller::notifyConfigurationChange ( - const ConfigurationChangeEvent& rEvent) +void CallbackCaller::notifyConfigurationChange ( + const sd::framework::ConfigurationChangeEvent& rEvent) { if (!(rEvent.Type == msEventType && maFilter(rEvent))) return; diff --git a/sd/source/ui/inc/ViewTabBar.hxx b/sd/source/ui/inc/ViewTabBar.hxx index 67ad0e3fa5d9..d4e0754f719f 100644 --- a/sd/source/ui/inc/ViewTabBar.hxx +++ b/sd/source/ui/inc/ViewTabBar.hxx @@ -20,7 +20,7 @@ #pragma once #include <com/sun/star/drawing/framework/XResource.hpp> -#include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> +#include "framework/ConfigurationChangeListener.hxx" #include <comphelper/compbase.hxx> #include <vcl/InterimItemWindow.hxx> @@ -82,9 +82,9 @@ struct TabBarButton css::uno::Reference<css::drawing::framework::XResourceId> ResourceId; }; -typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XResource, - css::drawing::framework::XConfigurationChangeListener +typedef cppu::ImplInheritanceHelper < + sd::framework::ConfigurationChangeListener, + css::drawing::framework::XResource > ViewTabBarInterfaceBase; /** Tab control for switching between views in the center pane. @@ -121,11 +121,11 @@ public: bool ActivatePage(size_t nIndex); - //----- drawing::framework::XConfigurationChangeListener ------------------ + //----- sd::framework::ConfigurationChangeListener ------------------ - virtual void SAL_CALL + virtual void notifyConfigurationChange ( - const css::drawing::framework::ConfigurationChangeEvent& rEvent) override; + const sd::framework::ConfigurationChangeEvent& rEvent) override; //----- XEventListener ---------------------------------------------------- diff --git a/sd/source/ui/inc/framework/Configuration.hxx b/sd/source/ui/inc/framework/Configuration.hxx index beae62159fae..96202ef58d28 100644 --- a/sd/source/ui/inc/framework/Configuration.hxx +++ b/sd/source/ui/inc/framework/Configuration.hxx @@ -19,9 +19,10 @@ #pragma once -#include <com/sun/star/drawing/framework/XConfiguration.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/drawing/framework/AnchorBindingMode.hpp> +#include <com/sun/star/drawing/framework/XResourceId.hpp> #include <comphelper/compbase.hxx> #include <rtl/ref.hxx> #include <memory> @@ -30,7 +31,6 @@ namespace sd::framework { class ConfigurationController; typedef comphelper::WeakComponentImplHelper < - css::drawing::framework::XConfiguration, css::container::XNamed > ConfigurationInterfaceBase; @@ -75,30 +75,90 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; - // XConfiguration - virtual void SAL_CALL addResource ( + /** Add a resource to the configuration. + <p>This method should be used only by objects that implement the + XConfigurationRequest interface or by the configuration + controller.</p> + @param xResourceId + The resource to add to the configuration. When the specified + resource is already part of the configuration then this call is + silently ignored. + @throws IllegalArgumentException + When an empty resource id is given then an + IllegalArgumentException is thrown. + */ + void addResource ( const css::uno::Reference<css::drawing::framework::XResourceId>& - rxResourceId) override; - - virtual void SAL_CALL removeResource( + rxResourceId); + + /** Remove a resource from the configuration. + <p>This method should be used only by objects that implement the + XConfigurationRequest interface or by the configuration + controller.</p> + @param xResourceId + The resource to remove from the configuration. When the + specified resource is not part of the configuration then this + call is silently ignored. + @throws IllegalArgumentException + When an empty resource id is given then an + IllegalArgumentException is thrown. + */ + void removeResource( const css::uno::Reference<css::drawing::framework::XResourceId>& - rxResourceId) override; - - virtual css::uno::Sequence< css::uno::Reference< - css::drawing::framework::XResourceId> > SAL_CALL getResources ( + rxResourceId); + + /** Returns the list of resources that are bound directly and/or + indirectly to the given anchor. A URL filter can reduce the set of + returned resource ids. + @param xAnchorId + This anchor typically is either a pane or an empty + XResourceId object. An + empty reference is treated like an XResourceId object. + @param sTargetURLPrefix + When a non-empty string is given then resource ids are returned + only when their resource URL matches this prefix, i.e. when it + begins with this prefix or is equal to it. Characters with + special meaning to URLs are not interpreted. In the typical + usage the prefix specifies the type of a resource. A typical + value is "private:resource/floater/", which is the prefix for + pane URLs. In a recursive search, only resource ids at the top + level are matched against this prefix. + <p>Use an empty string to prevent filtering out resource ids.</p> + @param eSearchMode + This flag defines whether to return only resources that are + directly bound to the given anchor or a recursive search is to + be made. Note that for the recursive search and an empty anchor + all resource ids are returned that belong to the configuration. + @return + The set of returned resource ids may be empty when there are no + resource ids that match all conditions. The resources in the + sequence are ordered with respect to the + XResourceId::compareTo() method. + */ + css::uno::Sequence< css::uno::Reference< + css::drawing::framework::XResourceId> > getResources ( const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId, - const OUString& rsResourceURLPrefix, - css::drawing::framework::AnchorBindingMode eMode) override; - - virtual sal_Bool SAL_CALL hasResource ( + std::u16string_view rsResourceURLPrefix, + css::drawing::framework::AnchorBindingMode eMode); + + /** <p>Returns whether the specified resource is part of the + configuration.</p> + This is independent of whether the resource does really exist and is + active, i.e. has a visible representation in the GUI. + @param xResourceId + The id of a resource. May be empty (empty reference or empty + XResourceId object) in which case `FALSE` is + returned. + @return + Returns `TRUE` when the resource is part of the configuration + and `FALSE` when it is not. + */ + bool hasResource ( const css::uno::Reference<css::drawing::framework::XResourceId>& - rxResourceId) override; - - // XCloneable + rxResourceId); - virtual css::uno::Reference<css::util::XCloneable> - SAL_CALL createClone() override; + rtl::Reference<Configuration> createClone(); // XNamed @@ -163,8 +223,8 @@ private: treated like empty configurations. */ bool AreConfigurationsEquivalent ( - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration1, - const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration2); + const rtl::Reference<Configuration>& rxConfiguration1, + const rtl::Reference<Configuration>& rxConfiguration2); } // end of namespace sd::framework diff --git a/offapi/com/sun/star/drawing/framework/ConfigurationChangeEvent.idl b/sd/source/ui/inc/framework/ConfigurationChangeEvent.hxx similarity index 81% rename from offapi/com/sun/star/drawing/framework/ConfigurationChangeEvent.idl rename to sd/source/ui/inc/framework/ConfigurationChangeEvent.hxx index fd7218bce782..8434b622b20b 100644 --- a/offapi/com/sun/star/drawing/framework/ConfigurationChangeEvent.idl +++ b/sd/source/ui/inc/framework/ConfigurationChangeEvent.hxx @@ -17,12 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -module com { module sun { module star { module uno { interface XInterface; }; }; }; }; +#pragma once -module com { module sun { module star { module drawing { module framework { +#include <com/sun/star/lang/EventObject.hpp> +#include <rtl/ref.hxx> -interface XConfiguration; -interface XResourceId; +namespace sd::framework +{ +class Configuration; /** Objects of this class are used for notifying changes of the configuration. @@ -37,35 +39,30 @@ interface XResourceId; general guidelines. See XConfigurationController for a list of event types used by the basic drawing framework.</p> */ -struct ConfigurationChangeEvent - : ::com::sun::star::lang::EventObject +struct ConfigurationChangeEvent final : public ::css::lang::EventObject { /** The type of configuration change is a free-form string. This is the only member that is always set. The values of the other members depend on the configuration change type and may or may not be set. */ - string Type; - + ::rtl::OUString Type; /** The current configuration, depending on the event type, either before or after the change. May be an empty reference. */ - XConfiguration Configuration; - + rtl::Reference<::sd::framework::Configuration> Configuration; /** The resource id that is part of the configuration change. */ - XResourceId ResourceId; - + ::css::uno::Reference<::css::drawing::framework::XResourceId> ResourceId; /** The resource object that corresponds to the ResourceId. May be an empty reference. */ - com::sun::star::uno::XInterface ResourceObject; - + ::css::uno::Reference<::css::uno::XInterface> ResourceObject; /** Each listener is called with exactly the #UserData that was given when the listener was registered. */ - any UserData; + ::css::uno::Any UserData; }; -}; }; }; }; }; // ::com::sun::star::drawing::framework +} // end of namespace sd::framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/drawing/framework/XConfigurationChangeListener.idl b/sd/source/ui/inc/framework/ConfigurationChangeListener.hxx similarity index 70% rename from offapi/com/sun/star/drawing/framework/XConfigurationChangeListener.idl rename to sd/source/ui/inc/framework/ConfigurationChangeListener.hxx index ce8ffefb4f58..b4d965ac4dee 100644 --- a/offapi/com/sun/star/drawing/framework/XConfigurationChangeListener.idl +++ b/sd/source/ui/inc/framework/ConfigurationChangeListener.hxx @@ -17,23 +17,39 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -module com { module sun { module star { module drawing { module framework { +#pragma once + +#include <com/sun/star/lang/XEventListener.hpp> +#include <comphelper/compbase.hxx> +#include <sddllapi.h> + +namespace sd::framework +{ +struct ConfigurationChangeEvent; /** A listener for configuration changes is called when it has been registered at the configuration controller and a configuration change occurs. */ -interface XConfigurationChangeListener - : ::com::sun::star::lang::XEventListener +class SD_DLLPUBLIC ConfigurationChangeListener + : public comphelper::WeakComponentImplHelper<::css::lang::XEventListener> { +public: + using XEventListener::disposing; + using WeakComponentImplHelperBase::disposing; + /** The exact time of when a listener is called (before the change takes place, during the change, or when the change has been made) depends on the change event. The order in which listeners are called is the order in which they are registered (First registered, first called.) */ - void notifyConfigurationChange ([in] ConfigurationChangeEvent aEvent); + virtual void notifyConfigurationChange(const sd::framework::ConfigurationChangeEvent& aEvent) + = 0; + +protected: + virtual ~ConfigurationChangeListener() override; }; -}; }; }; }; }; // ::com::sun::star::drawing::framework +} // end of namespace sd::framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/drawing/framework/XConfigurationChangeRequest.idl b/sd/source/ui/inc/framework/ConfigurationChangeRequest.hxx similarity index 82% rename from offapi/com/sun/star/drawing/framework/XConfigurationChangeRequest.idl rename to sd/source/ui/inc/framework/ConfigurationChangeRequest.hxx index bbdebce3c895..f08f72b2d277 100644 --- a/offapi/com/sun/star/drawing/framework/XConfigurationChangeRequest.idl +++ b/sd/source/ui/inc/framework/ConfigurationChangeRequest.hxx @@ -17,10 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -module com { module sun { module star { module drawing { module framework { +#pragma once -interface XConfiguration; +#include <framework/Configuration.hxx> +#include <rtl/ref.hxx> +namespace sd::framework +{ /** A single explicit request for a configuration change. <p>The requested change is committed to a configuration only when the @@ -35,16 +38,20 @@ interface XConfiguration; <p>This interface is typically used internally by the -e ... etc. - the rest is truncated
