23#include <com/sun/star/uno/Any.hxx>
24#include <com/sun/star/uno/Sequence.hxx>
27#include <osl/diagnose.h>
34#include <officecfg/Office/Common.hxx>
39using namespace ::
utl ;
40using namespace ::
osl ;
48#define PROPERTYHANDLE_SYMBOLSET 0
50#define PROPERTYHANDLE_SYMBOLSTYLE 1
56 static std::mutex theSvtMiscOptionsMutex;
57 return theSvtMiscOptionsMutex;
64 ::std::vector<Link<LinkParamNone*,void>>
aList;
88 virtual void Notify(
const Sequence< OUString >& seqPropertyNames )
override;
94 void Load(
const Sequence< OUString >& rPropertyNames );
149 , m_nSymbolsSize( 0 )
150 , m_bIsSymbolsSizeRO( false )
151 , m_bIsSymbolsStyleRO( false )
152 , m_bIconThemeWasSetAutomatically( false )
157 Sequence< Any > seqValues = GetProperties ( seqNames );
158 Sequence< sal_Bool > seqRO = GetReadOnlyStates ( seqNames );
163 DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()),
"SvtMiscOptions_Impl::SvtMiscOptions_Impl()\nI miss some values of configuration keys!\n" );
166 sal_Int32 nPropertyCount = seqValues.getLength();
167 for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
169 if (!seqValues[nProperty].hasValue())
177 OSL_FAIL(
"Wrong type of \"Misc\\SymbolSet\"!" );
186 if (seqValues[nProperty] >>= aIconTheme)
189 OSL_FAIL(
"Wrong type of \"Misc\\SymbolStyle\"!" );
200 EnableNotification( seqNames );
208 assert(!IsModified());
214 Sequence< Any > seqValues = GetProperties( rPropertyNames );
219 DBG_ASSERT( !(rPropertyNames.getLength()!=seqValues.getLength()),
"SvtSecurityOptions_Impl::SvtSecurityOptions_Impl()\nI miss some values of configuration keys!\n" );
222 sal_Int32 nPropertyCount = seqValues.getLength();
223 for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
225 if (!seqValues[nProperty].hasValue())
232 OSL_FAIL(
"Wrong type of \"Misc\\SymbolSet\"!" );
238 if (seqValues[nProperty] >>= aIconTheme)
241 OSL_FAIL(
"Wrong type of \"Misc\\SymbolStyle\"!" );
250 aList.push_back( rLink );
260 for (
auto const& elem :
aList)
261 elem.Call(
nullptr );
279 OUString aTheme(rName);
280 if (aTheme.isEmpty() || aTheme ==
"auto")
307 Load( rPropertyNames );
318 sal_Int32
nCount = seqNames.getLength();
319 Sequence< Any > seqValues (
nCount );
320 auto seqValuesRange = asNonConstRange(seqValues);
321 for( sal_Int32 nProperty=0; nProperty<
nCount; ++nProperty )
342 seqValuesRange[nProperty] <<=
value;
350 PutProperties( seqNames, seqValues );
358 return Sequence<OUString>
372std::weak_ptr<SvtMiscOptions_Impl> g_pMiscOptions;
381 m_pImpl = g_pMiscOptions.lock();
384 m_pImpl = std::make_shared<SvtMiscOptions_Impl>();
402 return officecfg::Office::Common::Misc::SymbolSet::get();
407 m_pImpl->SetSymbolsSize( nSet );
419 if (nStyleIconSize == ToolbarIconSize::Size32)
421 else if (nStyleIconSize == ToolbarIconSize::Large)
427 return eOptSymbolsSize;
447 m_pImpl->AddListenerLink( rLink );
452 m_pImpl->RemoveListenerLink( rLink );
458 return m_pImpl->IconThemeWasSetAutomatically();
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static void MergeSystemSettings(AllSettings &rSettings)
static const AllSettings & GetSettings()
static void SetSettings(const AllSettings &rSettings)
OUString DetermineIconTheme() const
void SetIconTheme(const OUString &)
OUString GetAutomaticallyChosenIconTheme() const
ToolbarIconSize GetToolbarIconSize() const
::std::vector< Link< LinkParamNone *, void > > aList
void RemoveListenerLink(const Link< LinkParamNone *, void > &rLink)
bool IconThemeWasSetAutomatically() const
static OUString GetIconTheme()
virtual void ImplCommit() override
void SetSymbolsSize(sal_Int16 nSet)
virtual ~SvtMiscOptions_Impl() override
static Sequence< OUString > GetPropertyNames()
void AddListenerLink(const Link< LinkParamNone *, void > &rLink)
void Load(const Sequence< OUString > &rPropertyNames)
loads required data from the configuration.
bool m_bIconThemeWasSetAutomatically
virtual void Notify(const Sequence< OUString > &seqPropertyNames) override
void SetIconTheme(const OUString &theme, SetModifiedFlag setModified)
Set the icon theme.
bool IconThemeWasSetAutomatically() const
static sal_Int16 GetCurrentSymbolsSize()
void RemoveListenerLink(const Link< LinkParamNone *, void > &rLink)
static sal_Int16 GetSymbolsSize()
static bool AreCurrentSymbolsLarge()
void SetIconTheme(const OUString &)
void SetSymbolsSize(sal_Int16 eSet)
virtual ~SvtMiscOptions() override
std::shared_ptr< SvtMiscOptions_Impl > m_pImpl
void AddListenerLink(const Link< LinkParamNone *, void > &rLink)
static OUString GetIconTheme()
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral ROOTNODE_MISC
static std::mutex & GetInitMutex()
constexpr OUStringLiteral PROPERTYNAME_NOTEBOOKBARICONSIZE
constexpr OUStringLiteral PROPERTYNAME_SYMBOLSET
#define PROPERTYHANDLE_SYMBOLSTYLE
constexpr OUStringLiteral PROPERTYNAME_SIDEBARICONSIZE
constexpr OUStringLiteral PROPERTYNAME_ICONTHEME
#define PROPERTYHANDLE_SYMBOLSET
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)