LibreOffice Module framework (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
framework::XMLBasedAcceleratorConfiguration Class Reference

implements a read/write access to the accelerator configuration. More...

#include <acceleratorconfiguration.hxx>

Inheritance diagram for framework::XMLBasedAcceleratorConfiguration:
[legend]
Collaboration diagram for framework::XMLBasedAcceleratorConfiguration:
[legend]

Public Member Functions

 XMLBasedAcceleratorConfiguration (const css::uno::Reference< css::uno::XComponentContext > &xContext)
 
virtual ~XMLBasedAcceleratorConfiguration () override
 
virtual css::uno::Sequence< css::awt::KeyEvent > SAL_CALL getAllKeyEvents () override
 
virtual OUString SAL_CALL getCommandByKeyEvent (const css::awt::KeyEvent &aKeyEvent) override
 
virtual void SAL_CALL setKeyEvent (const css::awt::KeyEvent &aKeyEvent, const OUString &sCommand) override
 
virtual void SAL_CALL removeKeyEvent (const css::awt::KeyEvent &aKeyEvent) override
 
virtual css::uno::Sequence< css::awt::KeyEvent > SAL_CALL getKeyEventsByCommand (const OUString &sCommand) override
 
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPreferredKeyEventsForCommandList (const css::uno::Sequence< OUString > &lCommandList) override
 
virtual void SAL_CALL removeCommandFromAllKeyEvents (const OUString &sCommand) override
 
virtual void SAL_CALL reload () override
 
virtual void SAL_CALL store () override
 
virtual void SAL_CALL storeToStorage (const css::uno::Reference< css::embed::XStorage > &xStorage) override
 
virtual sal_Bool SAL_CALL isModified () override
 
virtual sal_Bool SAL_CALL isReadOnly () override
 
virtual void SAL_CALL setStorage (const css::uno::Reference< css::embed::XStorage > &xStorage) override
 
virtual sal_Bool SAL_CALL hasStorage () override
 
virtual void SAL_CALL addConfigurationListener (const css::uno::Reference< css::ui::XUIConfigurationListener > &xListener) override
 
virtual void SAL_CALL removeConfigurationListener (const css::uno::Reference< css::ui::XUIConfigurationListener > &xListener) override
 
virtual void SAL_CALL reset () override
 
virtual void SAL_CALL addResetListener (const css::uno::Reference< css::form::XResetListener > &xListener) override
 
virtual void SAL_CALL removeResetListener (const css::uno::Reference< css::form::XResetListener > &xListener) override
 
void changesOccurred ()
 

Protected Member Functions

OUString impl_ts_getLocale () const
 return the current office locale. More...
 

Protected Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 the global uno service manager. More...
 
PresetHandler m_aPresetHandler
 used to: i ) copy configuration files from the share to the user layer ii ) provide access to these config files iii) cache all sub storages on the path from the top to the bottom(!) iv ) provide commit for changes. More...
 
AcceleratorCache m_aReadCache
 contains the cached configuration data More...
 
std::unique_ptr< AcceleratorCachem_pWriteCache
 used to implement the copy on write pattern! More...
 

Private Member Functions

void impl_ts_load (const css::uno::Reference< css::io::XInputStream > &xStream)
 load a configuration set, using the given stream. More...
 
void impl_ts_save (const css::uno::Reference< css::io::XOutputStream > &xStream)
 save a configuration set, using the given stream. More...
 
AcceleratorCacheimpl_getCFG (bool bWriteAccessRequested=false)
 returns a reference to one of our internal cache members. More...
 

Detailed Description

implements a read/write access to the accelerator configuration.

Definition at line 53 of file acceleratorconfiguration.hxx.

Constructor & Destructor Documentation

◆ XMLBasedAcceleratorConfiguration()

framework::XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration ( const css::uno::Reference< css::uno::XComponentContext > &  xContext)

Definition at line 84 of file acceleratorconfiguration.cxx.

◆ ~XMLBasedAcceleratorConfiguration()

framework::XMLBasedAcceleratorConfiguration::~XMLBasedAcceleratorConfiguration ( )
overridevirtual

Definition at line 90 of file acceleratorconfiguration.cxx.

References m_pWriteCache, and SAL_WARN_IF.

Member Function Documentation

◆ addConfigurationListener()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::addConfigurationListener ( const css::uno::Reference< css::ui::XUIConfigurationListener > &  xListener)
overridevirtual

Definition at line 337 of file acceleratorconfiguration.cxx.

References SAL_INFO.

◆ addResetListener()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::addResetListener ( const css::uno::Reference< css::form::XResetListener > &  xListener)
overridevirtual

Definition at line 357 of file acceleratorconfiguration.cxx.

References SAL_INFO.

◆ changesOccurred()

void framework::XMLBasedAcceleratorConfiguration::changesOccurred ( )

Definition at line 368 of file acceleratorconfiguration.cxx.

References reload().

◆ getAllKeyEvents()

css::uno::Sequence< css::awt::KeyEvent > SAL_CALL framework::XMLBasedAcceleratorConfiguration::getAllKeyEvents ( )
overridevirtual

◆ getCommandByKeyEvent()

OUString SAL_CALL framework::XMLBasedAcceleratorConfiguration::getCommandByKeyEvent ( const css::awt::KeyEvent &  aKeyEvent)
overridevirtual

◆ getKeyEventsByCommand()

css::uno::Sequence< css::awt::KeyEvent > SAL_CALL framework::XMLBasedAcceleratorConfiguration::getKeyEventsByCommand ( const OUString &  sCommand)
overridevirtual

◆ getPreferredKeyEventsForCommandList()

css::uno::Sequence< css::uno::Any > SAL_CALL framework::XMLBasedAcceleratorConfiguration::getPreferredKeyEventsForCommandList ( const css::uno::Sequence< OUString > &  lCommandList)
overridevirtual

◆ hasStorage()

sal_Bool SAL_CALL framework::XMLBasedAcceleratorConfiguration::hasStorage ( )
overridevirtual

Definition at line 331 of file acceleratorconfiguration.cxx.

References SAL_INFO.

◆ impl_getCFG()

AcceleratorCache & framework::XMLBasedAcceleratorConfiguration::impl_getCFG ( bool  bWriteAccessRequested = false)
private

returns a reference to one of our internal cache members.

@descr We implement the copy-on-write pattern. Doing so we know two caches internally. The second one is used only, if the container was changed.

This method here returns access to one of these caches - depending on the change state of this configuration service.

Parameters
bWriteAccessRequestedif the outside code wish to change the container it must call this method with "sal_True". So the internal cache can be prepared for that (means copy-on-write ...).
Returns
[AcceleratorCache] c++ reference(!) to one of our internal caches.

Definition at line 448 of file acceleratorconfiguration.cxx.

References m_aReadCache, and m_pWriteCache.

Referenced by getAllKeyEvents(), getCommandByKeyEvent(), getKeyEventsByCommand(), getPreferredKeyEventsForCommandList(), removeCommandFromAllKeyEvents(), removeKeyEvent(), and setKeyEvent().

◆ impl_ts_getLocale()

OUString framework::XMLBasedAcceleratorConfiguration::impl_ts_getLocale ( ) const
protected

return the current office locale.

@descr We do not cache this value, because we are not listen for changes on the configuration layer ...

Returns
OUString The current office locale as BCP47 string.

Definition at line 467 of file acceleratorconfiguration.cxx.

◆ impl_ts_load()

void framework::XMLBasedAcceleratorConfiguration::impl_ts_load ( const css::uno::Reference< css::io::XInputStream > &  xStream)
private

load a configuration set, using the given stream.

Parameters
xStreamprovides the XML structure as stream.

Definition at line 373 of file acceleratorconfiguration.cxx.

References m_aReadCache, m_pWriteCache, m_xContext, and xStream.

Referenced by reload().

◆ impl_ts_save()

void framework::XMLBasedAcceleratorConfiguration::impl_ts_save ( const css::uno::Reference< css::io::XOutputStream > &  xStream)
private

save a configuration set, using the given stream.

Parameters
xStreamthe XML structure can be written there.

Definition at line 406 of file acceleratorconfiguration.cxx.

References framework::AcceleratorConfigurationWriter::flush(), m_aReadCache, m_pWriteCache, m_xContext, and xStream.

Referenced by store(), and storeToStorage().

◆ isModified()

sal_Bool SAL_CALL framework::XMLBasedAcceleratorConfiguration::isModified ( )
overridevirtual

Definition at line 305 of file acceleratorconfiguration.cxx.

References m_pWriteCache.

◆ isReadOnly()

sal_Bool SAL_CALL framework::XMLBasedAcceleratorConfiguration::isReadOnly ( )
overridevirtual

◆ reload()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::reload ( )
overridevirtual

◆ removeCommandFromAllKeyEvents()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents ( const OUString &  sCommand)
overridevirtual

◆ removeConfigurationListener()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::removeConfigurationListener ( const css::uno::Reference< css::ui::XUIConfigurationListener > &  xListener)
overridevirtual

Definition at line 342 of file acceleratorconfiguration.cxx.

References SAL_INFO.

◆ removeKeyEvent()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::removeKeyEvent ( const css::awt::KeyEvent &  aKeyEvent)
overridevirtual

◆ removeResetListener()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::removeResetListener ( const css::uno::Reference< css::form::XResetListener > &  xListener)
overridevirtual

Definition at line 362 of file acceleratorconfiguration.cxx.

References SAL_INFO.

◆ reset()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::reset ( )
overridevirtual

◆ setKeyEvent()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::setKeyEvent ( const css::awt::KeyEvent &  aKeyEvent,
const OUString &  sCommand 
)
overridevirtual

◆ setStorage()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::setStorage ( const css::uno::Reference< css::embed::XStorage > &  xStorage)
overridevirtual

Definition at line 326 of file acceleratorconfiguration.cxx.

References SAL_INFO.

◆ store()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::store ( )
overridevirtual

◆ storeToStorage()

void SAL_CALL framework::XMLBasedAcceleratorConfiguration::storeToStorage ( const css::uno::Reference< css::embed::XStorage > &  xStorage)
overridevirtual

Definition at line 286 of file acceleratorconfiguration.cxx.

References impl_ts_save(), TARGET_CURRENT, and xStream.

Member Data Documentation

◆ m_aPresetHandler

PresetHandler framework::XMLBasedAcceleratorConfiguration::m_aPresetHandler
protected

used to: i ) copy configuration files from the share to the user layer ii ) provide access to these config files iii) cache all sub storages on the path from the top to the bottom(!) iv ) provide commit for changes.

Definition at line 73 of file acceleratorconfiguration.hxx.

Referenced by isReadOnly(), reload(), reset(), and store().

◆ m_aReadCache

AcceleratorCache framework::XMLBasedAcceleratorConfiguration::m_aReadCache
protected

contains the cached configuration data

Definition at line 76 of file acceleratorconfiguration.hxx.

Referenced by impl_getCFG(), impl_ts_load(), impl_ts_save(), and reload().

◆ m_pWriteCache

std::unique_ptr<AcceleratorCache> framework::XMLBasedAcceleratorConfiguration::m_pWriteCache
protected

used to implement the copy on write pattern!

Definition at line 79 of file acceleratorconfiguration.hxx.

Referenced by impl_getCFG(), impl_ts_load(), impl_ts_save(), isModified(), and ~XMLBasedAcceleratorConfiguration().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > framework::XMLBasedAcceleratorConfiguration::m_xContext
protected

the global uno service manager.

Must be used to create own needed services.

Definition at line 66 of file acceleratorconfiguration.hxx.

Referenced by impl_ts_load(), and impl_ts_save().


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