LibreOffice Module framework (master) 1
|
implements a read/write access to the accelerator configuration. More...
#include <acceleratorconfiguration.hxx>
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< AcceleratorCache > | m_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... | |
AcceleratorCache & | impl_getCFG (bool bWriteAccessRequested=false) |
returns a reference to one of our internal cache members. More... | |
implements a read/write access to the accelerator configuration.
Definition at line 53 of file acceleratorconfiguration.hxx.
framework::XMLBasedAcceleratorConfiguration::XMLBasedAcceleratorConfiguration | ( | const css::uno::Reference< css::uno::XComponentContext > & | xContext | ) |
Definition at line 84 of file acceleratorconfiguration.cxx.
|
overridevirtual |
Definition at line 90 of file acceleratorconfiguration.cxx.
References m_pWriteCache, and SAL_WARN_IF.
|
overridevirtual |
Definition at line 337 of file acceleratorconfiguration.cxx.
References SAL_INFO.
|
overridevirtual |
Definition at line 357 of file acceleratorconfiguration.cxx.
References SAL_INFO.
void framework::XMLBasedAcceleratorConfiguration::changesOccurred | ( | ) |
Definition at line 368 of file acceleratorconfiguration.cxx.
References reload().
|
overridevirtual |
Definition at line 95 of file acceleratorconfiguration.cxx.
References comphelper::containerToSequence(), framework::AcceleratorCache::getAllKeys(), and impl_getCFG().
|
overridevirtual |
Definition at line 103 of file acceleratorconfiguration.cxx.
References framework::AcceleratorCache::getCommandByKey(), framework::AcceleratorCache::hasKey(), and impl_getCFG().
|
overridevirtual |
Definition at line 150 of file acceleratorconfiguration.cxx.
References comphelper::containerToSequence(), framework::AcceleratorCache::getKeysByCommand(), framework::AcceleratorCache::hasCommand(), and impl_getCFG().
|
overridevirtual |
Definition at line 169 of file acceleratorconfiguration.cxx.
References framework::AcceleratorCache::getKeysByCommand(), framework::AcceleratorCache::hasCommand(), i, and impl_getCFG().
|
overridevirtual |
Definition at line 331 of file acceleratorconfiguration.cxx.
References SAL_INFO.
|
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.
bWriteAccessRequested | if 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 ...). |
Definition at line 448 of file acceleratorconfiguration.cxx.
References m_aReadCache, and m_pWriteCache.
Referenced by getAllKeyEvents(), getCommandByKeyEvent(), getKeyEventsByCommand(), getPreferredKeyEventsForCommandList(), removeCommandFromAllKeyEvents(), removeKeyEvent(), and setKeyEvent().
|
protected |
return the current office locale.
@descr We do not cache this value, because we are not listen for changes on the configuration layer ...
Definition at line 467 of file acceleratorconfiguration.cxx.
|
private |
load a configuration set, using the given stream.
xStream | provides 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().
|
private |
save a configuration set, using the given stream.
xStream | the 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().
|
overridevirtual |
Definition at line 305 of file acceleratorconfiguration.cxx.
References m_pWriteCache.
|
overridevirtual |
Definition at line 311 of file acceleratorconfiguration.cxx.
References m_aPresetHandler, framework::PresetHandler::openTarget(), TARGET_CURRENT, and xStream.
|
overridevirtual |
Definition at line 219 of file acceleratorconfiguration.cxx.
References impl_ts_load(), m_aPresetHandler, m_aReadCache, framework::PresetHandler::openPreset(), framework::PresetHandler::openTarget(), PRESET_DEFAULT, TARGET_CURRENT, and xStream.
Referenced by changesOccurred(), and reset().
|
overridevirtual |
Definition at line 202 of file acceleratorconfiguration.cxx.
References framework::AcceleratorCache::hasCommand(), impl_getCFG(), and framework::AcceleratorCache::removeCommand().
|
overridevirtual |
Definition at line 342 of file acceleratorconfiguration.cxx.
References SAL_INFO.
|
overridevirtual |
Definition at line 139 of file acceleratorconfiguration.cxx.
References framework::AcceleratorCache::hasKey(), impl_getCFG(), and framework::AcceleratorCache::removeKey().
|
overridevirtual |
Definition at line 362 of file acceleratorconfiguration.cxx.
References SAL_INFO.
|
overridevirtual |
Definition at line 347 of file acceleratorconfiguration.cxx.
References framework::PresetHandler::copyPresetToTarget(), m_aPresetHandler, PRESET_DEFAULT, reload(), and TARGET_CURRENT.
|
overridevirtual |
Definition at line 114 of file acceleratorconfiguration.cxx.
References impl_getCFG(), and framework::AcceleratorCache::setKeyCommandPair().
|
overridevirtual |
Definition at line 326 of file acceleratorconfiguration.cxx.
References SAL_INFO.
|
overridevirtual |
Definition at line 260 of file acceleratorconfiguration.cxx.
References framework::PresetHandler::commitUserChanges(), impl_ts_save(), m_aPresetHandler, framework::PresetHandler::openTarget(), TARGET_CURRENT, and xStream.
|
overridevirtual |
Definition at line 286 of file acceleratorconfiguration.cxx.
References impl_ts_save(), TARGET_CURRENT, and xStream.
|
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().
|
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().
|
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().
|
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().