LibreOffice Module unotools (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
utl::ConfigItem Class Referenceabstract

#include <configitem.hxx>

Inheritance diagram for utl::ConfigItem:
[legend]
Collaboration diagram for utl::ConfigItem:
[legend]

Public Member Functions

virtual ~ConfigItem () override
 
 ConfigItem (ConfigItem const &)=default
 
 ConfigItem (ConfigItem &&)=default
 
ConfigItemoperator= (ConfigItem const &)=delete
 
ConfigItemoperator= (ConfigItem &&)=delete
 
virtual void Notify (const css::uno::Sequence< OUString > &aPropertyNames)=0
 is called from the ConfigManager before application ends of from the PropertyChangeListener if the sub tree broadcasts changes. More...
 
const OUString & GetSubTreeName () const
 
bool IsModified () const
 
void Commit ()
 
ConfigItemMode GetMode () const
 
- Public Member Functions inherited from utl::ConfigurationBroadcaster
void AddListener (utl::ConfigurationListener *pListener)
 
void RemoveListener (utl::ConfigurationListener const *pListener)
 
void NotifyListeners (ConfigurationHints nHint)
 
 ConfigurationBroadcaster ()
 
 ConfigurationBroadcaster (ConfigurationBroadcaster const &)
 
virtual ~ConfigurationBroadcaster ()
 
ConfigurationBroadcasteroperator= (ConfigurationBroadcaster const &other)
 
virtual void BlockBroadcasts (bool bBlock)
 

Static Public Member Functions

static css::uno::Sequence< OUString > GetNodeNames (css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, ConfigNameFormat eFormat)
 
static css::uno::Sequence< css::uno::Any > GetProperties (css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
 
static bool PutProperties (css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues, bool bAllLocales)
 
static bool ClearNodeSet (css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode)
 
static bool ReplaceSetProperties (css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues, bool bAllLocales)
 
static bool SetSetProperties (css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
 

Protected Member Functions

 ConfigItem (OUString aSubTree, ConfigItemMode nMode=ConfigItemMode::NONE)
 
void SetModified ()
 
void ClearModified ()
 
css::uno::Sequence< css::uno::Any > GetProperties (const css::uno::Sequence< OUString > &rNames)
 
css::uno::Sequence< sal_BoolGetReadOnlyStates (const css::uno::Sequence< OUString > &rNames)
 
bool PutProperties (const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues)
 
bool EnableNotification (const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
 enables notifications about changes on selected sub nodes/values More...
 
void DisableNotification ()
 disables notifications about changes on sub nodes/values, which previously had been enabled with EnableNotification More...
 
css::uno::Sequence< OUString > GetNodeNames (const OUString &rNode)
 
css::uno::Sequence< OUString > GetNodeNames (const OUString &rNode, ConfigNameFormat eFormat)
 
bool ClearNodeSet (const OUString &rNode)
 
bool ClearNodeElements (const OUString &rNode, css::uno::Sequence< OUString > const &rElements)
 
bool SetSetProperties (const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
 
bool ReplaceSetProperties (const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
 
bool AddNode (const OUString &rNode, const OUString &rNewNode)
 

Private Member Functions

void RemoveChangesListener ()
 
void CallNotify (const css::uno::Sequence< OUString > &aPropertyNames)
 
css::uno::Reference< css::container::XHierarchicalNameAccess > GetTree ()
 
virtual void ImplCommit ()=0
 writes the changed values into the sub tree. More...
 

Static Private Member Functions

static void impl_packLocalizedProperties (const css::uno::Sequence< OUString > &lInNames, const css::uno::Sequence< css::uno::Any > &lInValues, css::uno::Sequence< css::uno::Any > &lOutValues)
 
static void impl_unpackLocalizedProperties (const css::uno::Sequence< OUString > &lInNames, const css::uno::Sequence< css::uno::Any > &lInValues, css::uno::Sequence< OUString > &lOutNames, css::uno::Sequence< css::uno::Any > &lOutValues)
 

Private Attributes

const OUString sSubTree
 
css::uno::Reference< css::container::XHierarchicalNameAccess > m_xHierarchyAccess
 
css::uno::Reference< css::util::XChangesListener > xChangeLstnr
 
ConfigItemMode m_nMode
 
bool m_bIsModified
 
bool m_bEnableInternalNotification
 
sal_Int16 m_nInValueChange
 

Friends

class ConfigChangeListener_Impl
 
class ConfigManager
 

Detailed Description

Definition at line 67 of file configitem.hxx.

Constructor & Destructor Documentation

◆ ConfigItem() [1/3]

ConfigItem::ConfigItem ( OUString  aSubTree,
ConfigItemMode  nMode = ConfigItemMode::NONE 
)
explicitprotected

◆ ~ConfigItem()

ConfigItem::~ConfigItem ( )
overridevirtual

◆ ConfigItem() [2/3]

utl::ConfigItem::ConfigItem ( ConfigItem const &  )
default

◆ ConfigItem() [3/3]

utl::ConfigItem::ConfigItem ( ConfigItem &&  )
default

Member Function Documentation

◆ AddNode()

bool ConfigItem::AddNode ( const OUString &  rNode,
const OUString &  rNewNode 
)
protected

◆ CallNotify()

void ConfigItem::CallNotify ( const css::uno::Sequence< OUString > &  aPropertyNames)
private

◆ ClearModified()

void ConfigItem::ClearModified ( )
protected

◆ ClearNodeElements()

bool ConfigItem::ClearNodeElements ( const OUString &  rNode,
css::uno::Sequence< OUString > const &  rElements 
)
protected

Definition at line 780 of file configitem.cxx.

References Any, GetTree(), m_nInValueChange, and TOOLS_WARN_EXCEPTION.

◆ ClearNodeSet() [1/2]

bool ConfigItem::ClearNodeSet ( const OUString &  rNode)
protected

Definition at line 730 of file configitem.cxx.

References ClearNodeSet(), GetTree(), and m_nInValueChange.

Referenced by ClearNodeSet(), and GlobalEventConfig_Impl::ImplCommit().

◆ ClearNodeSet() [2/2]

bool ConfigItem::ClearNodeSet ( css::uno::Reference< css::container::XHierarchicalNameAccess > const &  xHierarchyAccess,
const OUString &  rNode 
)
static

Definition at line 740 of file configitem.cxx.

References Any, and TOOLS_WARN_EXCEPTION.

◆ Commit()

void ConfigItem::Commit ( )

◆ DisableNotification()

void ConfigItem::DisableNotification ( )
protected

disables notifications about changes on sub nodes/values, which previously had been enabled with EnableNotification

See also
Notify
EnableNotification

Definition at line 598 of file configitem.cxx.

References RemoveChangesListener(), and xChangeLstnr.

◆ EnableNotification()

bool ConfigItem::EnableNotification ( const css::uno::Sequence< OUString > &  rNames,
bool  bEnableInternalNotification = false 
)
protected

enables notifications about changes on selected sub nodes/values

Before calling this method a second time for a possibly changed node/value set, you must disable the current notifications by calling DisableNotification.

See also
Notify
DisableNotification

Definition at line 604 of file configitem.cxx.

References ConfigChangeListener_Impl, GetTree(), m_bEnableInternalNotification, m_nMode, ReleaseTree, and xChangeLstnr.

Referenced by GlobalEventConfig_Impl::GlobalEventConfig_Impl(), SvtFilterOptions::SvtFilterOptions(), SvtLinguConfigItem::SvtLinguConfigItem(), SvtModuleOptions_Impl::SvtModuleOptions_Impl(), and SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl().

◆ GetMode()

ConfigItemMode utl::ConfigItem::GetMode ( ) const
inline

Definition at line 181 of file configitem.hxx.

Referenced by utl::ConfigManager::acquireTree().

◆ GetNodeNames() [1/3]

Sequence< OUString > ConfigItem::GetNodeNames ( const OUString &  rNode)
protected

◆ GetNodeNames() [2/3]

Sequence< OUString > ConfigItem::GetNodeNames ( const OUString &  rNode,
ConfigNameFormat  eFormat 
)
protected

Definition at line 692 of file configitem.cxx.

References GetNodeNames(), and GetTree().

◆ GetNodeNames() [3/3]

Sequence< OUString > ConfigItem::GetNodeNames ( css::uno::Reference< css::container::XHierarchicalNameAccess > const &  xHierarchyAccess,
const OUString &  rNode,
ConfigNameFormat  eFormat 
)
static

Definition at line 700 of file configitem.cxx.

References Any, lcl_normalizeLocalNames(), and TOOLS_WARN_EXCEPTION.

◆ GetProperties() [1/2]

css::uno::Sequence< css::uno::Any > utl::ConfigItem::GetProperties ( const css::uno::Sequence< OUString > &  rNames)
protected

◆ GetProperties() [2/2]

static css::uno::Sequence< css::uno::Any > utl::ConfigItem::GetProperties ( css::uno::Reference< css::container::XHierarchicalNameAccess > const &  xHierarchyAccess,
const css::uno::Sequence< OUString > &  rNames,
bool  bAllLocales 
)
static

◆ GetReadOnlyStates()

Sequence< sal_Bool > ConfigItem::GetReadOnlyStates ( const css::uno::Sequence< OUString > &  rNames)
protected

◆ GetSubTreeName()

const OUString & utl::ConfigItem::GetSubTreeName ( ) const
inline

Definition at line 175 of file configitem.hxx.

Referenced by utl::ConfigManager::acquireTree().

◆ GetTree()

Reference< XHierarchicalNameAccess > ConfigItem::GetTree ( )
private

◆ impl_packLocalizedProperties()

void ConfigItem::impl_packLocalizedProperties ( const css::uno::Sequence< OUString > &  lInNames,
const css::uno::Sequence< css::uno::Any > &  lInValues,
css::uno::Sequence< css::uno::Any > &  lOutValues 
)
staticprivate

Definition at line 172 of file configitem.cxx.

◆ impl_unpackLocalizedProperties()

void ConfigItem::impl_unpackLocalizedProperties ( const css::uno::Sequence< OUString > &  lInNames,
const css::uno::Sequence< css::uno::Any > &  lInValues,
css::uno::Sequence< OUString > &  lOutNames,
css::uno::Sequence< css::uno::Any > &  lOutValues 
)
staticprivate

Definition at line 239 of file configitem.cxx.

References Translate::get().

◆ ImplCommit()

virtual void utl::ConfigItem::ImplCommit ( )
privatepure virtual

writes the changed values into the sub tree.

Private and only called from non-virtual public Commit().

Implemented in SvtFilterOptions, GlobalEventConfig_Impl, SvtLinguConfigItem, SvtModuleOptions_Impl, SvtSearchOptions_Impl, and SvtSysLocaleOptions_Impl.

Referenced by Commit().

◆ IsModified()

bool utl::ConfigItem::IsModified ( ) const
inline

◆ Notify()

virtual void utl::ConfigItem::Notify ( const css::uno::Sequence< OUString > &  aPropertyNames)
pure virtual

is called from the ConfigManager before application ends of from the PropertyChangeListener if the sub tree broadcasts changes.

Implemented in SvtFilterOptions, GlobalEventConfig_Impl, SvtSearchOptions_Impl, SvtSysLocaleOptions_Impl, SvtModuleOptions_Impl, and SvtLinguConfigItem.

Referenced by CallNotify().

◆ operator=() [1/2]

ConfigItem & utl::ConfigItem::operator= ( ConfigItem &&  )
delete

◆ operator=() [2/2]

ConfigItem & utl::ConfigItem::operator= ( ConfigItem const &  )
delete

◆ PutProperties() [1/2]

bool utl::ConfigItem::PutProperties ( const css::uno::Sequence< OUString > &  rNames,
const css::uno::Sequence< css::uno::Any > &  rValues 
)
protected

◆ PutProperties() [2/2]

static bool utl::ConfigItem::PutProperties ( css::uno::Reference< css::container::XHierarchicalNameAccess > const &  xHierarchyAccess,
const css::uno::Sequence< OUString > &  rNames,
const css::uno::Sequence< css::uno::Any > &  rValues,
bool  bAllLocales 
)
static

◆ RemoveChangesListener()

void ConfigItem::RemoveChangesListener ( )
private

◆ ReplaceSetProperties() [1/2]

bool utl::ConfigItem::ReplaceSetProperties ( const OUString &  rNode,
const css::uno::Sequence< css::beans::PropertyValue > &  rValues 
)
protected

◆ ReplaceSetProperties() [2/2]

static bool utl::ConfigItem::ReplaceSetProperties ( css::uno::Reference< css::container::XHierarchicalNameAccess > const &  xHierarchyAccess,
const OUString &  rNode,
const css::uno::Sequence< css::beans::PropertyValue > &  rValues,
bool  bAllLocales 
)
static

◆ SetModified()

void ConfigItem::SetModified ( )
protected

Definition at line 1163 of file configitem.cxx.

References m_bIsModified.

Referenced by SvtFilterOptions::EnableMSOLockFileCreation(), GlobalEventConfig_Impl::replaceByName(), SvtSearchOptions_Impl::Save(), SvtFilterOptions::SetCalc2Excel(), SvtFilterOptions::SetCharBackground2Highlighting(), SvtFilterOptions::SetCharBackground2Shading(), SvtSysLocaleOptions_Impl::SetCurrencyString(), SvtSysLocaleOptions_Impl::SetDatePatternsString(), SvtSysLocaleOptions_Impl::SetDecimalSeparatorAsLocale(), SvtFilterOptions::SetExcel2Calc(), SvtModuleOptions_Impl::SetFactoryDefaultFilter(), SvtModuleOptions_Impl::SetFactoryStandardTemplate(), SvtSearchOptions_Impl::SetFlag(), SvtSysLocaleOptions_Impl::SetIgnoreLanguageChange(), SvtFilterOptions::SetImpress2PowerPoint(), SvtFilterOptions::SetLoadExcelBasicCode(), SvtFilterOptions::SetLoadExcelBasicExecutable(), SvtFilterOptions::SetLoadExcelBasicStorage(), SvtFilterOptions::SetLoadPPointBasicCode(), SvtFilterOptions::SetLoadPPointBasicStorage(), SvtFilterOptions::SetLoadWordBasicCode(), SvtFilterOptions::SetLoadWordBasicExecutable(), SvtFilterOptions::SetLoadWordBasicStorage(), SvtSysLocaleOptions_Impl::SetLocaleString(), SvtFilterOptions::SetMath2MathType(), SvtFilterOptions::SetMathType2Math(), SvtFilterOptions::SetPowerPoint2Impress(), SvtFilterOptions::SetSmartArt2Shape(), SvtSysLocaleOptions_Impl::SetUILocaleString(), SvtFilterOptions::SetVisio2Draw(), SvtFilterOptions::SetWinWord2Writer(), SvtFilterOptions::SetWriter2WinWord(), and SvtSearchOptions_Impl::SvtSearchOptions_Impl().

◆ SetSetProperties() [1/2]

bool utl::ConfigItem::SetSetProperties ( const OUString &  rNode,
const css::uno::Sequence< css::beans::PropertyValue > &  rValues 
)
protected

◆ SetSetProperties() [2/2]

static bool utl::ConfigItem::SetSetProperties ( css::uno::Reference< css::container::XHierarchicalNameAccess > const &  xHierarchyAccess,
const OUString &  rNode,
const css::uno::Sequence< css::beans::PropertyValue > &  rValues 
)
static

Friends And Related Function Documentation

◆ ConfigChangeListener_Impl

friend class ConfigChangeListener_Impl
friend

Definition at line 69 of file configitem.hxx.

Referenced by EnableNotification().

◆ ConfigManager

friend class ConfigManager
friend

Definition at line 70 of file configitem.hxx.

Member Data Documentation

◆ m_bEnableInternalNotification

bool utl::ConfigItem::m_bEnableInternalNotification
private

Definition at line 79 of file configitem.hxx.

Referenced by CallNotify(), and EnableNotification().

◆ m_bIsModified

bool utl::ConfigItem::m_bIsModified
private

Definition at line 78 of file configitem.hxx.

Referenced by ClearModified(), and SetModified().

◆ m_nInValueChange

sal_Int16 utl::ConfigItem::m_nInValueChange
private

Definition at line 80 of file configitem.hxx.

Referenced by AddNode(), CallNotify(), ClearNodeElements(), and ClearNodeSet().

◆ m_nMode

ConfigItemMode utl::ConfigItem::m_nMode
private

Definition at line 77 of file configitem.hxx.

Referenced by EnableNotification().

◆ m_xHierarchyAccess

css::uno::Reference< css::container::XHierarchicalNameAccess> utl::ConfigItem::m_xHierarchyAccess
private

Definition at line 74 of file configitem.hxx.

Referenced by ConfigItem(), and GetTree().

◆ sSubTree

const OUString utl::ConfigItem::sSubTree
private

Definition at line 72 of file configitem.hxx.

◆ xChangeLstnr

css::uno::Reference< css::util::XChangesListener > utl::ConfigItem::xChangeLstnr
private

Definition at line 76 of file configitem.hxx.

Referenced by DisableNotification(), EnableNotification(), and RemoveChangesListener().


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