LibreOffice Module sd (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::framework::Configuration Class Referencefinal

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. More...

#include <Configuration.hxx>

Inheritance diagram for sd::framework::Configuration:
[legend]
Collaboration diagram for sd::framework::Configuration:
[legend]

Classes

class  ResourceContainer
 

Public Member Functions

 Configuration (const css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > &rxBroadcaster, bool bBroadcastRequestEvents)
 Create a new configuration with a broadcaster that is used to send events about requested configuration changes. More...
 
virtual ~Configuration () override
 
virtual void disposing (std::unique_lock< std::mutex > &) override
 
virtual void SAL_CALL addResource (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) override
 
virtual void SAL_CALL 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 (const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId, const OUString &rsResourceURLPrefix, css::drawing::framework::AnchorBindingMode eMode) override
 
virtual sal_Bool SAL_CALL hasResource (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) override
 
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone () override
 
virtual OUString SAL_CALL getName () override
 Return a human readable string representation. More...
 
virtual void SAL_CALL setName (const OUString &rName) override
 This call is ignored because the XNamed interface is (mis)used to give access to a human readable name for debugging purposes. More...
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelper< typename... Ifc >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 

Private Member Functions

 Configuration (const css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > &rxBroadcaster, bool bBroadcastRequestEvents, const ResourceContainer &rResourceContainer)
 This private variant of the constructor is used for cloning a Configuration object. More...
 
void PostEvent (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId, const bool bActivation)
 Send an event to all interested listeners that a resource has been added or removed. More...
 
void ThrowIfDisposed () const
 When the called object has already been disposed this method throws an exception and does not return. More...
 

Private Attributes

std::unique_ptr< ResourceContainermpResourceContainer
 The resource container holds the URLs of unique resource and of resource linked to unique resources. More...
 
css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > mxBroadcaster
 The broadcaster used for notifying listeners of requests for configuration changes. More...
 
bool mbBroadcastRequestEvents
 

Additional Inherited Members

- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

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 URLs rather than references so that not only the current configuration but also a requested configuration can be represented.

A resource URL describes the type of a resource, not its actual instance. For resources, like panes, that are unique with respect to an application frame, that does not mean much of a difference. For other resources like views, that may have more than one instance per application frame, this is different. To identify them unambiguously a second URL, one of a unique resource, is necessary. This second URL is called the anchor of the first. The two types of resources are called unique and linked respectively.

Direct manipulation of a configuration object is not advised with the exception of the configuration controller and objects that implement the XConfigurationChangeOperation interface.

Definition at line 58 of file Configuration.hxx.

Constructor & Destructor Documentation

◆ Configuration() [1/2]

sd::framework::Configuration::Configuration ( const css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > &  rxBroadcaster,
bool  bBroadcastRequestEvents 
)

Create a new configuration with a broadcaster that is used to send events about requested configuration changes.

Parameters
rxBroadcasterThis broadcaster is typically the same as the one used by the ConfigurationController.
bBroadcastRequestEventsWhen this is <TRUE> then modifications to the configuration trigger the broadcasting of "ResourceActivationRequestEvent" and "ResourceDeactivationRequestEvent". When this flag is <FALSE> then events with type "ResourceActivationEvent" and "ResourceDeactivationEvent" are broadcasted.

Referenced by createClone().

◆ ~Configuration()

sd::framework::Configuration::~Configuration ( )
overridevirtual

Definition at line 81 of file Configuration.cxx.

◆ Configuration() [2/2]

sd::framework::Configuration::Configuration ( const css::uno::Reference< css::drawing::framework::XConfigurationControllerBroadcaster > &  rxBroadcaster,
bool  bBroadcastRequestEvents,
const ResourceContainer rResourceContainer 
)
private

This private variant of the constructor is used for cloning a Configuration object.

Parameters
rResourceContainerThe new Configuration is created with a copy of the elements in this container.

Member Function Documentation

◆ addResource()

void SAL_CALL sd::framework::Configuration::addResource ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxResourceId)
overridevirtual

◆ createClone()

Reference< util::XCloneable > SAL_CALL sd::framework::Configuration::createClone ( )
overridevirtual

◆ disposing()

void sd::framework::Configuration::disposing ( std::unique_lock< std::mutex > &  )
overridevirtual

Reimplemented from comphelper::WeakComponentImplHelperBase.

Definition at line 85 of file Configuration.cxx.

References mpResourceContainer, and mxBroadcaster.

◆ getName()

OUString SAL_CALL sd::framework::Configuration::getName ( )
overridevirtual

Return a human readable string representation.

This is used for debugging purposes.

Definition at line 190 of file Configuration.cxx.

References comphelper::UnoImplBase::m_aMutex, comphelper::UnoImplBase::m_bDisposed, mpResourceContainer, and sd::framework::FrameworkHelper::ResourceIdToString().

◆ getResources()

Sequence< Reference< XResourceId > > SAL_CALL sd::framework::Configuration::getResources ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxAnchorId,
const OUString &  rsResourceURLPrefix,
css::drawing::framework::AnchorBindingMode  eMode 
)
overridevirtual

◆ hasResource()

sal_Bool SAL_CALL sd::framework::Configuration::hasResource ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxResourceId)
overridevirtual

◆ PostEvent()

void sd::framework::Configuration::PostEvent ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxResourceId,
const bool  bActivation 
)
private

Send an event to all interested listeners that a resource has been added or removed.

The event is sent to the listeners via the ConfigurationController.

Parameters
rxResourceIdThe resource that is added to or removed from the configuration.
bActivationThis specifies whether an activation or deactivation is broadcasted. The mbBroadcastRequestEvents member is also taken into account when the actual event type field is determined.

Definition at line 218 of file Configuration.cxx.

References aEvent, mbBroadcastRequestEvents, sd::framework::FrameworkHelper::msResourceActivationEvent, sd::framework::FrameworkHelper::msResourceActivationRequestEvent, sd::framework::FrameworkHelper::msResourceDeactivationEvent, sd::framework::FrameworkHelper::msResourceDeactivationRequestEvent, and mxBroadcaster.

Referenced by addResource(), and removeResource().

◆ removeResource()

void SAL_CALL sd::framework::Configuration::removeResource ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxResourceId)
overridevirtual

◆ setName()

void SAL_CALL sd::framework::Configuration::setName ( const OUString &  rName)
overridevirtual

This call is ignored because the XNamed interface is (mis)used to give access to a human readable name for debugging purposes.

Definition at line 213 of file Configuration.cxx.

◆ ThrowIfDisposed()

void sd::framework::Configuration::ThrowIfDisposed ( ) const
private

When the called object has already been disposed this method throws an exception and does not return.

Exceptions
css::lang::DisposedException

Definition at line 244 of file Configuration.cxx.

References comphelper::UnoImplBase::m_bDisposed.

Referenced by addResource(), createClone(), getResources(), hasResource(), and removeResource().

Member Data Documentation

◆ mbBroadcastRequestEvents

bool sd::framework::Configuration::mbBroadcastRequestEvents
private

Definition at line 130 of file Configuration.hxx.

Referenced by createClone(), and PostEvent().

◆ mpResourceContainer

std::unique_ptr<ResourceContainer> sd::framework::Configuration::mpResourceContainer
private

The resource container holds the URLs of unique resource and of resource linked to unique resources.

Definition at line 122 of file Configuration.hxx.

Referenced by addResource(), createClone(), disposing(), getName(), getResources(), hasResource(), and removeResource().

◆ mxBroadcaster

css::uno::Reference<css::drawing::framework::XConfigurationControllerBroadcaster> sd::framework::Configuration::mxBroadcaster
private

The broadcaster used for notifying listeners of requests for configuration changes.

Definition at line 128 of file Configuration.hxx.

Referenced by createClone(), disposing(), and PostEvent().


The documentation for this class was generated from the following files: