LibreOffice Module svtools (master) 1
extcolorcfg.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <map>
23#include <string_view>
24
26#include <com/sun/star/uno/Any.hxx>
27#include <com/sun/star/uno/Sequence.hxx>
28#include <com/sun/star/beans/PropertyValue.hpp>
29#include <tools/color.hxx>
31#include <com/sun/star/uno/Sequence.h>
33#include <svl/hint.hxx>
34#include <mutex>
35#include <sal/log.hxx>
36#include <osl/diagnose.h>
37#include <o3tl/string_view.hxx>
38
39#include <vcl/svapp.hxx>
40#include <vcl/settings.hxx>
41#include <vcl/event.hxx>
42
43
44using namespace utl;
45using namespace com::sun::star;
46
47
48namespace svtools
49{
50
51static sal_Int32 nExtendedColorRefCount_Impl = 0;
52namespace
53{
54 std::mutex& ColorMutex_Impl()
55 {
56 static std::mutex SINGLETON;
57 return SINGLETON;
58 }
59}
60
61ExtendedColorConfig_Impl* ExtendedColorConfig::m_pImpl = nullptr;
62
64{
65 typedef std::map<OUString, OUString> TDisplayNames;
66 typedef std::map<OUString, ExtendedColorConfigValue> TConfigValues;
67 typedef ::std::vector<TConfigValues::iterator> TMapPos;
68 typedef ::std::pair< TConfigValues, TMapPos > TComponentMapping;
69 typedef std::map<OUString, TComponentMapping> TComponents;
72 ::std::vector<TComponents::iterator> m_aConfigValuesPos;
73
76 static bool m_bLockBroadcast;
78
79 uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme);
80 void FillComponentColors(const uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames);
81
82 virtual void ImplCommit() override;
83
84public:
85 explicit ExtendedColorConfig_Impl();
86 virtual ~ExtendedColorConfig_Impl() override;
87
88 void Load(const OUString& rScheme);
90 //changes the name of the current scheme but doesn't load it!
91 void SetCurrentSchemeName(const OUString& rSchemeName) {m_sLoadedScheme = rSchemeName;}
92 bool ExistsScheme(std::u16string_view _sSchemeName);
93 virtual void Notify( const uno::Sequence<OUString>& aPropertyNames) override;
94
95 sal_Int32 GetComponentCount() const;
96 OUString GetComponentName(sal_uInt32 _nPos) const;
97 OUString GetComponentDisplayName(const OUString& _sComponentName) const;
98 sal_Int32 GetComponentColorCount(const OUString& _sName) const;
99 ExtendedColorConfigValue GetComponentColorConfigValue(const OUString& _sName,sal_uInt32 _nPos) const;
100
101 ExtendedColorConfigValue GetColorConfigValue(const OUString& _sComponentName,const OUString& _sName)
102 {
103 TComponents::iterator aFind = m_aConfigValues.find(_sComponentName);
104 if ( aFind != m_aConfigValues.end() )
105 {
106 TConfigValues::iterator aFind2 = aFind->second.first.find(_sName);
107 if ( aFind2 != aFind->second.first.end() )
108 return aFind2->second;
109 }
110#if OSL_DEBUG_LEVEL > 0
111 SAL_WARN( "svtools", "Could find the required config:\n"
112 "component: " << _sComponentName
113 << "\nname: " << _sName );
114#endif
116 }
117 void SetColorConfigValue(const OUString& _sName,
118 const ExtendedColorConfigValue& rValue );
119
120 void AddScheme(const OUString& rNode);
121 void RemoveScheme(const OUString& rNode);
122 using ConfigItem::SetModified;
123 using ConfigItem::ClearModified;
124 void SettingsChanged();
125
126 static void DisableBroadcast();
127 static void EnableBroadcast();
128
129 static void LockBroadcast();
130 static void UnlockBroadcast();
131
132 DECL_LINK( DataChangedEventListener, VclSimpleEvent&, void );
133};
134
135uno::Sequence< OUString> ExtendedColorConfig_Impl::GetPropertyNames(const OUString& rScheme)
136{
137 uno::Sequence< OUString> aNames(GetNodeNames(rScheme));
138 for(OUString & i : asNonConstRange(aNames))
139 {
140 i = rScheme + "/" + i;
141 }
142 return aNames;
143}
144
146{
147 return m_aConfigValues.size();
148}
149
150sal_Int32 ExtendedColorConfig_Impl::GetComponentColorCount(const OUString& _sName) const
151{
152 sal_Int32 nSize = 0;
153 TComponents::const_iterator aFind = m_aConfigValues.find(_sName);
154 if ( aFind != m_aConfigValues.end() )
155 {
156 nSize = aFind->second.first.size();
157 }
158 return nSize;
159}
160
162{
163 TComponents::const_iterator aFind = m_aConfigValues.find(_sName);
164 if ( aFind != m_aConfigValues.end() )
165 {
166 if ( _nPos < aFind->second.second.size() )
167 {
168 return aFind->second.second[_nPos]->second;
169 }
170 }
172}
173
174OUString ExtendedColorConfig_Impl::GetComponentDisplayName(const OUString& _sComponentName) const
175{
176 OUString sRet;
177 TDisplayNames::const_iterator aFind = m_aComponentDisplayNames.find(_sComponentName);
178 if ( aFind != m_aComponentDisplayNames.end() )
179 sRet = aFind->second;
180 return sRet;
181}
182
183OUString ExtendedColorConfig_Impl::GetComponentName(sal_uInt32 _nPos) const
184{
185 OUString sRet;
186 if ( _nPos < m_aConfigValuesPos.size() )
187 sRet = m_aConfigValuesPos[_nPos]->first;
188 return sRet;
189}
190
194 ConfigItem("Office.ExtendedColorScheme"),
195 m_bIsBroadcastEnabled(true)
196{
197 //try to register on the root node - if possible
198 uno::Sequence < OUString > aNames(1);
199 EnableNotification( aNames );
200 Load(OUString());
201
202 ::Application::AddEventListener( LINK(this, ExtendedColorConfig_Impl, DataChangedEventListener) );
203
204}
205
207{
208 ::Application::RemoveEventListener( LINK(this, ExtendedColorConfig_Impl, DataChangedEventListener) );
209}
210
212{
215}
216
218{
221}
222
223static void lcl_addString(uno::Sequence < OUString >& _rSeq,std::u16string_view _sAdd)
224{
225 for(OUString & i : asNonConstRange(_rSeq))
226 i += _sAdd;
227}
228
229void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
230{
232 m_aConfigValuesPos.clear();
233 m_aConfigValues.clear();
234
235 // fill display names
236 TDisplayNames aDisplayNameMap;
237 uno::Sequence < OUString > aComponentNames = GetPropertyNames("EntryNames");
238 OUString sDisplayName("/DisplayName");
239 for(OUString & componentName : asNonConstRange(aComponentNames))
240 {
241 uno::Sequence< uno::Any > aComponentDisplayNamesValue = GetProperties( { componentName + sDisplayName } );
242 OUString sComponentDisplayName;
243 if ( aComponentDisplayNamesValue.hasElements() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) )
244 {
245 m_aComponentDisplayNames.emplace(componentName.getToken(1, '/'),sComponentDisplayName);
246 }
247
248 componentName += "/Entries";
249 uno::Sequence < OUString > aDisplayNames = GetPropertyNames(componentName);
250 lcl_addString(aDisplayNames,sDisplayName);
251
252 uno::Sequence< uno::Any > aDisplayNamesValue = GetProperties( aDisplayNames );
253
254 const OUString* pDispIter = aDisplayNames.getConstArray();
255 const OUString* pDispEnd = pDispIter + aDisplayNames.getLength();
256 for(sal_Int32 j = 0;pDispIter != pDispEnd;++pDispIter,++j)
257 {
258 sal_Int32 nIndex = 0;
259 o3tl::getToken(*pDispIter, 0, '/', nIndex);
260 std::u16string_view sName = pDispIter->subView(nIndex);
261 sName = sName.substr(0, sName.rfind(sDisplayName));
262 OUString sCurrentDisplayName;
263 aDisplayNamesValue[j] >>= sCurrentDisplayName;
264 aDisplayNameMap.emplace(OUString(sName),sCurrentDisplayName);
265 }
266 }
267
268 // load color settings
269 OUString sScheme(rScheme);
270
271 if(sScheme.isEmpty())
272 {
273 //detect current scheme name
274 uno::Sequence < OUString > aCurrent { "ExtendedColorScheme/CurrentColorScheme" };
275 uno::Sequence< uno::Any > aCurrentVal = GetProperties( aCurrent );
276 aCurrentVal.getConstArray()[0] >>= sScheme;
277 } // if(!sScheme.getLength())
278
279 m_sLoadedScheme = sScheme;
280 OUString sBase = "ExtendedColorScheme/ColorSchemes/"
281 + sScheme;
282
283 bool bFound = ExistsScheme(sScheme);
284 if ( bFound )
285 {
286 aComponentNames = GetPropertyNames(sBase);
287 FillComponentColors(aComponentNames,aDisplayNameMap);
288 }
289
290 if ( m_sLoadedScheme.isEmpty() )
291 m_sLoadedScheme = "default";
292
293 if ( sScheme != "default" )
294 {
295 if ( ExistsScheme(u"default") )
296 {
297 aComponentNames = GetPropertyNames("ExtendedColorScheme/ColorSchemes/default");
298 FillComponentColors(aComponentNames,aDisplayNameMap);
299 }
300 }
301 if ( !bFound && !sScheme.isEmpty() )
302 {
303 AddScheme(sScheme);
305 }
306}
307
308void ExtendedColorConfig_Impl::FillComponentColors(const uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames)
309{
310 static constexpr OUStringLiteral sColorEntries(u"/Entries");
311 for(OUString const & component : _rComponents)
312 {
313 OUString sComponentName = component.copy(component.lastIndexOf('/')+1);
314 if ( m_aConfigValues.find(sComponentName) == m_aConfigValues.end() )
315 {
316 OUString sEntry = component + sColorEntries;
317
318 uno::Sequence < OUString > aColorNames = GetPropertyNames(sEntry);
319 uno::Sequence < OUString > aDefaultColorNames = aColorNames;
320
321 static constexpr OUStringLiteral sColor(u"/Color");
322 lcl_addString(aColorNames,sColor);
323 lcl_addString(aDefaultColorNames,u"/DefaultColor");
324 uno::Sequence< uno::Any > aColors = GetProperties( aColorNames );
325 const uno::Any* pColors = aColors.getConstArray();
326
327 uno::Sequence< uno::Any > aDefaultColors = GetProperties( aDefaultColorNames );
328 bool bDefaultColorFound = aDefaultColors.hasElements();
329 const uno::Any* pDefaultColors = aDefaultColors.getConstArray();
330
331 OUString* pColorIter = aColorNames.getArray();
332 OUString* pColorEnd = pColorIter + aColorNames.getLength();
333
334 m_aConfigValuesPos.push_back(m_aConfigValues.emplace(sComponentName,TComponentMapping(TConfigValues(),TMapPos())).first);
335 TConfigValues& aConfigValues = (*m_aConfigValuesPos.rbegin())->second.first;
336 TMapPos& aConfigValuesPos = (*m_aConfigValuesPos.rbegin())->second.second;
337 for(int i = 0; pColorIter != pColorEnd; ++pColorIter ,++i)
338 {
339 if ( aConfigValues.find(*pColorIter) == aConfigValues.end() )
340 {
341 sal_Int32 nIndex = 0;
342 o3tl::getToken(*pColorIter, 2, '/', nIndex);
343 OUString sName(pColorIter->copy(nIndex)),sDisplayName;
344 OUString sTemp = sName.copy(0,sName.lastIndexOf(sColor));
345
346 TDisplayNames::const_iterator aFind = _rDisplayNames.find(sTemp);
347 sName = sName.getToken(2, '/');
348 OSL_ENSURE(aFind != _rDisplayNames.end(),"DisplayName is not in EntryNames config list!");
349 if ( aFind != _rDisplayNames.end() )
350 sDisplayName = aFind->second;
351
352 OSL_ENSURE(pColors[i].hasValue(),"Color config entry has NIL as color value set!");
353 OSL_ENSURE(pDefaultColors[i].hasValue(),"Color config entry has NIL as color value set!");
354 Color nColor, nDefaultColor;
355 pColors[i] >>= nColor;
356 if ( bDefaultColorFound )
357 pDefaultColors[i] >>= nDefaultColor;
358 else
359 nDefaultColor = nColor;
360 ExtendedColorConfigValue aValue(sName,sDisplayName,nColor,nDefaultColor);
361 aConfigValuesPos.push_back(aConfigValues.emplace(sName,aValue).first);
362 }
363 } // for(int i = 0; pColorIter != pColorEnd; ++pColorIter ,++i)
364 }
365 }
366}
367
368void ExtendedColorConfig_Impl::Notify( const uno::Sequence<OUString>& /*rPropertyNames*/)
369{
370 //loading via notification always uses the default setting
371 Load(OUString());
372
373 SolarMutexGuard aVclGuard;
374
376 {
378 }
379 else
380 Broadcast(SfxHint(SfxHintId::ColorsChanged));
381}
382
384{
385 if ( m_sLoadedScheme.isEmpty() )
386 return;
387 static constexpr OUStringLiteral sColorEntries(u"Entries");
388 static constexpr OUStringLiteral sColor(u"/Color");
389 OUString sBase = "ExtendedColorScheme/ColorSchemes/"
391 static constexpr OUStringLiteral s_sSep(u"/");
392
393 for (auto const& configValue : m_aConfigValues)
394 {
395 if ( ConfigItem::AddNode(sBase, configValue.first) )
396 {
397 OUString sNode = sBase
398 + s_sSep
399 + configValue.first
400 //ConfigItem::AddNode(sNode, sColorEntries);
401 + s_sSep
402 + sColorEntries;
403
404 uno::Sequence < beans::PropertyValue > aPropValues(configValue.second.first.size());
405 beans::PropertyValue* pPropValues = aPropValues.getArray();
406 for (auto const& elem : configValue.second.first)
407 {
408 pPropValues->Name = sNode + s_sSep + elem.first;
409 ConfigItem::AddNode(sNode, elem.first);
410 pPropValues->Name += sColor;
411 pPropValues->Value <<= elem.second.getColor();
412 // the default color will never be changed
413 ++pPropValues;
414 }
415 SetSetProperties("ExtendedColorScheme/ColorSchemes", aPropValues);
416 }
417 }
418
420}
421
423{
424 //save current scheme name
425 uno::Sequence < OUString > aCurrent { "ExtendedColorScheme/CurrentColorScheme" };
426 uno::Sequence< uno::Any > aCurrentVal(1);
427 aCurrentVal.getArray()[0] <<= m_sLoadedScheme;
428 PutProperties(aCurrent, aCurrentVal);
429}
430
431bool ExtendedColorConfig_Impl::ExistsScheme(std::u16string_view _sSchemeName)
432{
433 OUString sBase("ExtendedColorScheme/ColorSchemes");
434
435 uno::Sequence < OUString > aComponentNames = GetPropertyNames(sBase);
436 sBase += OUString::Concat("/") + _sSchemeName;
437 return comphelper::findValue(aComponentNames, sBase) != -1;
438}
439
441{
442 TComponents::iterator aFind = m_aConfigValues.find(_sName);
443 if ( aFind != m_aConfigValues.end() )
444 {
445 TConfigValues::iterator aFind2 = aFind->second.first.find(rValue.getName());
446 if ( aFind2 != aFind->second.first.end() )
447 aFind2->second = rValue;
448 SetModified();
449 }
450}
451
452void ExtendedColorConfig_Impl::AddScheme(const OUString& rScheme)
453{
454 if(ConfigItem::AddNode("ExtendedColorScheme/ColorSchemes", rScheme))
455 {
456 m_sLoadedScheme = rScheme;
457 Commit();
458 }
459}
460
461void ExtendedColorConfig_Impl::RemoveScheme(const OUString& rScheme)
462{
463 uno::Sequence< OUString > aElements { rScheme };
464 ClearNodeElements("ExtendedColorScheme/ColorSchemes", aElements);
465}
466
468{
469 SolarMutexGuard aVclGuard;
470
471 Broadcast( SfxHint( SfxHintId::ColorsChanged ) );
472}
473
475{
476 m_bLockBroadcast = true;
477}
478
480{
482 {
485 {
487 {
489 ExtendedColorConfig::m_pImpl->Broadcast(SfxHint(SfxHintId::ColorsChanged));
490 }
491 }
492 }
493 m_bLockBroadcast = false;
494}
495
496IMPL_LINK( ExtendedColorConfig_Impl, DataChangedEventListener, VclSimpleEvent&, rEvent, void )
497{
498 if ( rEvent.GetId() == VclEventId::ApplicationDataChanged )
499 {
500 DataChangedEvent* pData = static_cast<DataChangedEvent*>(static_cast<VclWindowEvent&>(rEvent).GetData());
501 if ( (pData->GetType() == DataChangedEventType::SETTINGS) &&
502 (pData->GetFlags() & AllSettingsFlags::STYLE) )
503 {
505 }
506 }
507}
508
509
511{
512 std::unique_lock aGuard( ColorMutex_Impl() );
513 if ( !m_pImpl )
517}
518
520{
521 std::unique_lock aGuard( ColorMutex_Impl() );
524 {
525 delete m_pImpl;
526 m_pImpl = nullptr;
527 }
528}
529
530ExtendedColorConfigValue ExtendedColorConfig::GetColorValue(const OUString& _sComponentName,const OUString& _sName)const
531{
532 return m_pImpl->GetColorConfigValue(_sComponentName,_sName);
533}
534
536{
537 return m_pImpl->GetComponentCount();
538}
539
540sal_Int32 ExtendedColorConfig::GetComponentColorCount(const OUString& _sName) const
541{
542 return m_pImpl->GetComponentColorCount(_sName);
543}
544
546{
548}
549
550OUString ExtendedColorConfig::GetComponentName(sal_uInt32 _nPos) const
551{
553}
554
555OUString ExtendedColorConfig::GetComponentDisplayName(const OUString& _sComponentName) const
556{
557 return m_pImpl->GetComponentDisplayName(_sComponentName);
558}
559
561{
562 SolarMutexGuard aVclGuard;
563
564 Broadcast( rHint );
565}
566
569 m_bModified(false)
570{
572}
573
575{
577 if(m_bModified)
578 m_pImpl->SetModified();
579 if(m_pImpl->IsModified())
580 m_pImpl->Commit();
581}
582
583void EditableExtendedColorConfig::DeleteScheme(const OUString& rScheme )
584{
585 m_pImpl->RemoveScheme(rScheme);
586}
587
588void EditableExtendedColorConfig::AddScheme(const OUString& rScheme )
589{
590 m_pImpl->AddScheme(rScheme);
591}
592
593void EditableExtendedColorConfig::LoadScheme(const OUString& rScheme )
594{
595 if(m_bModified)
596 m_pImpl->SetModified();
597 if(m_pImpl->IsModified())
598 m_pImpl->Commit();
599 m_bModified = false;
600 m_pImpl->Load(rScheme);
601 //the name of the loaded scheme has to be committed separately
602 m_pImpl->CommitCurrentSchemeName();
603}
604
605// Changes the name of the current scheme but doesn't load it!
607{
608 m_pImpl->SetCurrentSchemeName(rScheme);
609 m_pImpl->CommitCurrentSchemeName();
610}
611
613 const OUString& _sName, const ExtendedColorConfigValue& rValue)
614{
615 m_pImpl->SetColorConfigValue(_sName, rValue);
616 m_pImpl->ClearModified();
617 m_bModified = true;
618}
619
621{
622 m_bModified = true;
623}
624
626{
627 if(m_bModified)
628 m_pImpl->SetModified();
629 if(m_pImpl->IsModified())
630 m_pImpl->Commit();
631 m_bModified = false;
632}
633
635{
637}
638
640{
642}
643
645{
646 return m_pImpl->GetComponentCount();
647}
648
649sal_Int32 EditableExtendedColorConfig::GetComponentColorCount(const OUString& _sName) const
650{
651 return m_pImpl->GetComponentColorCount(_sName);
652}
653
655{
656 return m_pImpl->GetComponentColorConfigValue(_sName,_nPos);
657}
658
659OUString EditableExtendedColorConfig::GetComponentName(sal_uInt32 _nPos) const
660{
661 return m_pImpl->GetComponentName(_nPos);
662}
663}//namespace svtools
664
665/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
void Broadcast(const SfxHint &rHint)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
void AddScheme(const OUString &rScheme)
void SetColorValue(const OUString &_sComponentName, const ExtendedColorConfigValue &rValue)
OUString GetComponentName(sal_uInt32 _nPos) const
void DeleteScheme(const OUString &rScheme)
void SetCurrentSchemeName(const OUString &rScheme)
ExtendedColorConfigValue GetComponentColorConfigValue(const OUString &_sName, sal_uInt32 _nPos) const
std::unique_ptr< ExtendedColorConfig_Impl > m_pImpl
Definition: extcolorcfg.hxx:82
void LoadScheme(const OUString &rScheme)
sal_Int32 GetComponentColorCount(const OUString &_sName) const
const OUString & getName() const
Definition: extcolorcfg.hxx:52
virtual ~ExtendedColorConfig_Impl() override
void RemoveScheme(const OUString &rNode)
void SetCurrentSchemeName(const OUString &rSchemeName)
Definition: extcolorcfg.cxx:91
::std::vector< TConfigValues::iterator > TMapPos
Definition: extcolorcfg.cxx:67
std::map< OUString, OUString > TDisplayNames
Definition: extcolorcfg.cxx:65
std::map< OUString, TComponentMapping > TComponents
Definition: extcolorcfg.cxx:69
bool ExistsScheme(std::u16string_view _sSchemeName)
virtual void ImplCommit() override
std::map< OUString, ExtendedColorConfigValue > TConfigValues
Definition: extcolorcfg.cxx:66
ExtendedColorConfigValue GetComponentColorConfigValue(const OUString &_sName, sal_uInt32 _nPos) const
ExtendedColorConfigValue GetColorConfigValue(const OUString &_sComponentName, const OUString &_sName)
uno::Sequence< OUString > GetPropertyNames(const OUString &rScheme)
virtual void Notify(const uno::Sequence< OUString > &aPropertyNames) override
void FillComponentColors(const uno::Sequence< OUString > &_rComponents, const TDisplayNames &_rDisplayNames)
::std::vector< TComponents::iterator > m_aConfigValuesPos
Definition: extcolorcfg.cxx:72
OUString GetComponentName(sal_uInt32 _nPos) const
void SetColorConfigValue(const OUString &_sName, const ExtendedColorConfigValue &rValue)
sal_Int32 GetComponentColorCount(const OUString &_sName) const
OUString GetComponentDisplayName(const OUString &_sComponentName) const
void Load(const OUString &rScheme)
void AddScheme(const OUString &rNode)
::std::pair< TConfigValues, TMapPos > TComponentMapping
Definition: extcolorcfg.cxx:68
DECL_LINK(DataChangedEventListener, VclSimpleEvent &, void)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
friend class ExtendedColorConfig_Impl
Definition: extcolorcfg.hxx:62
OUString GetComponentName(sal_uInt32 _nPos) const
sal_Int32 GetComponentCount() const
OUString GetComponentDisplayName(const OUString &_sComponentName) const
virtual ~ExtendedColorConfig() override
ExtendedColorConfigValue GetComponentColorConfigValue(const OUString &_sComponentName, sal_uInt32 _nPos) const
static ExtendedColorConfig_Impl * m_pImpl
Definition: extcolorcfg.hxx:64
ExtendedColorConfigValue GetColorValue(const OUString &_sComponentName, const OUString &_sName) const
sal_Int32 GetComponentColorCount(const OUString &_sName) const
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 SetSetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
static css::uno::Sequence< css::uno::Any > GetProperties(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const css::uno::Sequence< OUString > &rNames, bool bAllLocales)
bool ClearNodeElements(const OUString &rNode, css::uno::Sequence< OUString > const &rElements)
static css::uno::Sequence< OUString > GetNodeNames(css::uno::Reference< css::container::XHierarchicalNameAccess > const &xHierarchyAccess, const OUString &rNode, ConfigNameFormat eFormat)
constexpr OUStringLiteral sColor
Definition: colrdlg.cxx:42
float u
OUString sName
OUString sDisplayName
sal_Int32 nIndex
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
int i
constexpr OUStringLiteral first
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
static void lcl_addString(uno::Sequence< OUString > &_rSeq, std::u16string_view _sAdd)
IMPL_LINK(ColorConfig_Impl, DataChangedEventListener, VclSimpleEvent &, rEvent, void)
Definition: colorcfg.cxx:326
static sal_Int32 nExtendedColorRefCount_Impl
Definition: extcolorcfg.cxx:51
@ SettingsChanged
sal_Int32 _nPos