1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <config_folders.h>
22 #include <officecfg/Office/Common.hxx>
25 #include <win/svsys.h>
28 #include <comphelper/processfactory.hxx>
29 #include <o3tl/test_info.hxx>
30 #include <rtl/bootstrap.hxx>
32 #include <i18nlangtag/mslangid.hxx>
33 #include <i18nlangtag/languagetag.hxx>
35 #include <comphelper/lok.hxx>
37 #include <vcl/graphicfilter.hxx>
38 #include <IconThemeScanner.hxx>
39 #include <IconThemeSelector.hxx>
40 #include <vcl/IconThemeInfo.hxx>
41 #include <vcl/svapp.hxx>
42 #include <vcl/event.hxx>
43 #include <vcl/settings.hxx>
44 #include <vcl/i18nhelp.hxx>
45 #include <configsettings.hxx>
46 #include <vcl/outdev.hxx>
48 #include <unotools/fontcfg.hxx>
49 #include <unotools/localedatawrapper.hxx>
50 #include <unotools/confignode.hxx>
51 #include <unotools/configmgr.hxx>
52 #include <unotools/syslocale.hxx>
53 #include <unotools/syslocaleoptions.hxx>
55 #include <salframe.hxx>
58 using namespace ::com::sun::star
;
62 MouseSettingsOptions mnOptions
= MouseSettingsOptions::NONE
;
63 sal_uInt64 mnDoubleClkTime
= 500;
64 sal_Int32 mnDoubleClkWidth
= 2;
65 sal_Int32 mnDoubleClkHeight
= 2;
66 sal_Int32 mnStartDragWidth
= 2 ;
67 sal_Int32 mnStartDragHeight
= 2;
68 sal_Int32 mnButtonRepeat
= 90;
69 sal_Int32 mnMenuDelay
= 150;
70 MouseFollowFlags mnFollow
= MouseFollowFlags::Menu
;
71 MouseMiddleButtonAction mnMiddleButtonAction
= MouseMiddleButtonAction::AutoScroll
;
72 MouseWheelBehaviour mnWheelBehavior
= MouseWheelBehaviour::FocusOnly
;
74 bool operator==(const ImplMouseData
& rSet
) const = default;
79 constexpr Size
getInitListBoxPreviewDefaultLogicSize()
88 // Structures simplifying comparison in StyleSettings::operator ==, where for some reason
89 // not all members of ImplStyleData are compared. Adding elements here would automatically
90 // participate in the default comparison methods.
94 Color maActiveBorderColor
;
96 Color maActiveTextColor
;
97 Color maAlternatingRowColor
;
98 Color maDefaultButtonTextColor
;
99 Color maButtonTextColor
;
100 Color maDefaultActionButtonTextColor
;
101 Color maActionButtonTextColor
;
102 Color maFlatButtonTextColor
;
103 Color maDefaultButtonRolloverTextColor
;
104 Color maButtonRolloverTextColor
;
105 Color maDefaultActionButtonRolloverTextColor
;
106 Color maActionButtonRolloverTextColor
;
107 Color maFlatButtonRolloverTextColor
;
108 Color maDefaultButtonPressedRolloverTextColor
;
109 Color maButtonPressedRolloverTextColor
;
110 Color maDefaultActionButtonPressedRolloverTextColor
;
111 Color maActionButtonPressedRolloverTextColor
;
112 Color maFlatButtonPressedRolloverTextColor
;
113 Color maCheckedColor
;
114 Color maDarkShadowColor
;
115 Color maDeactiveBorderColor
;
116 Color maDeactiveColor
;
117 Color maDeactiveTextColor
;
119 Color maDialogTextColor
;
120 Color maDisableColor
;
123 Color maFieldTextColor
;
124 Color maFieldRolloverTextColor
;
125 Color maGroupTextColor
;
127 Color maHelpTextColor
;
129 Color maHighlightColor
;
130 Color maHighlightTextColor
;
131 Color maLabelTextColor
;
132 Color maLightBorderColor
;
135 Color maMenuBarColor
;
136 Color maMenuBarRolloverColor
;
137 Color maMenuBorderColor
;
139 Color maMenuHighlightColor
;
140 Color maMenuHighlightTextColor
;
141 Color maMenuTextColor
;
142 Color maListBoxWindowBackgroundColor
;
143 Color maListBoxWindowTextColor
;
144 Color maListBoxWindowHighlightColor
;
145 Color maListBoxWindowHighlightTextColor
;
146 Color maMenuBarTextColor
;
147 Color maMenuBarRolloverTextColor
;
148 Color maMenuBarHighlightTextColor
;
150 Color maRadioCheckTextColor
;
152 Color maWarningColor
;
153 Color maWarningTextColor
;
155 Color maErrorTextColor
;
156 Color maVisitedLinkColor
;
157 Color maToolTextColor
;
159 Color maWindowTextColor
;
160 Color maWorkspaceColor
;
161 Color maActiveTabColor
;
162 Color maInactiveTabColor
;
163 Color maTabTextColor
;
164 Color maTabRolloverTextColor
;
165 Color maTabHighlightTextColor
;
167 bool operator==(const ColorSet
&) const = default;
173 vcl::Font maHelpFont
;
174 vcl::Font maTitleFont
;
175 vcl::Font maFloatTitleFont
;
176 vcl::Font maMenuFont
;
177 vcl::Font maToolFont
;
178 vcl::Font maLabelFont
;
179 vcl::Font maRadioCheckFont
;
180 vcl::Font maPushButtonFont
;
181 vcl::Font maFieldFont
;
182 vcl::Font maIconFont
;
184 vcl::Font maGroupFont
;
186 bool operator==(const FontSet
&) const = default;
194 void SetStandardStyles();
198 sal_Int32 mnTitleHeight
;
199 sal_Int32 mnFloatTitleHeight
;
200 sal_Int32 mnScrollBarSize
= 16;
201 sal_Int32 mnSpinSize
= 16;
202 sal_Int32 mnCursorSize
= 2;
203 sal_Int32 mnAntialiasedMin
= 0;
204 sal_uInt64 mnCursorBlinkTime
= STYLE_CURSOR_NOBLINKTIME
;
205 DragFullOptions mnDragFullOptions
= DragFullOptions::All
;
206 SelectionOptions mnSelectionOptions
= SelectionOptions::NONE
;
207 DisplayOptions mnDisplayOptions
= DisplayOptions::NONE
;
208 ToolbarIconSize mnToolbarIconSize
= ToolbarIconSize::Unknown
;
209 StyleSettingsOptions mnOptions
= StyleSettingsOptions::NONE
;
210 TriState meUseImagesInMenus
= TRISTATE_INDET
;
211 std::optional
<vcl::IconThemeScanner
> mutable
213 vcl::IconThemeSelector mIconThemeSelector
;
216 sal_Int32 mnMinThumbSize
= 16;
217 TriState meContextMenuShortcuts
= TRISTATE_INDET
;
218 DialogStyle maDialogStyle
;
220 bool mnUseFlatMenus
: 1;
221 bool mbHighContrast
: 1;
222 bool mbUseSystemUIFonts
: 1;
224 * Disabling AA doesn't actually disable AA of fonts, instead it is taken
225 * from system settings.
227 bool mbUseFontAAFromSystem
: 1;
228 bool mbUseSubpixelAA
: 1;
229 bool mbAutoMnemonic
: 1 = true;
230 bool mnUseFlatBorders
: 1;
231 bool mbPreferredUseImagesInMenus
: 1;
232 bool mbSkipDisabledInMenus
: 1;
233 bool mbHideDisabledMenuItems
: 1;
234 bool mbPreferredContextMenuShortcuts
: 1;
235 //mbPrimaryButtonWarpsSlider == true for "jump to here" behavior for primary button, otherwise
236 //primary means scroll by single page. Secondary button takes the alternative behaviour
237 bool mbPrimaryButtonWarpsSlider
: 1;
238 bool mbPreviewUsesCheckeredBackground
: 1 = true;
240 sal_uInt16 mnEdgeBlending
= 35;
241 Color maEdgeBlendingTopLeftColor
= Color(0xC0, 0xC0, 0xC0);
242 Color maEdgeBlendingBottomRightColor
= Color(0x40, 0x40, 0x40);
243 sal_uInt16 mnListBoxMaximumLineCount
= 25;
245 // For some reason this isn't actually the column count that gets used, at least on iOS, but
246 // instead what SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() in
247 // svtools/source/config/accessibilityoptions.cxx returns.
248 sal_uInt16 mnColorValueSetColumnCount
= 12;
249 ComboBoxTextSelectionMode meComboBoxTextSelectionMode
= ComboBoxTextSelectionMode::SelectText
;
250 Size maListBoxPreviewDefaultLogicSize
= getInitListBoxPreviewDefaultLogicSize();
251 // on-demand calculated in GetListBoxPreviewDefaultPixelSize()
252 Size
mutable maListBoxPreviewDefaultPixelSize
;
254 OUString
mutable maPersonaHeaderFooter
; ///< Cache the settings to detect changes.
256 BitmapEx
mutable maPersonaHeaderBitmap
; ///< Cache the header bitmap.
257 BitmapEx
mutable maPersonaFooterBitmap
; ///< Cache the footer bitmap.
258 std::optional
<Color
> mutable maPersonaMenuBarTextColor
; ///< Cache the menubar color.
260 bool operator==(const ImplStyleData
& rSet
) const;
266 bool mbEnableLocalizedDecimalSep
;
267 TriState mnDisablePrinting
;
272 sal_Int32 mnTipTimeout
= 3000;
275 struct ImplAllSettingsData
277 ImplAllSettingsData();
278 ImplAllSettingsData( const ImplAllSettingsData
& rData
);
279 ~ImplAllSettingsData();
281 MouseSettings maMouseSettings
;
282 StyleSettings maStyleSettings
;
283 MiscSettings maMiscSettings
;
284 HelpSettings maHelpSettings
;
285 SvtSysLocale maSysLocale
;
286 LanguageTag maLocale
;
287 LanguageTag maUILocale
;
288 mutable std::unique_ptr
<LocaleDataWrapper
> mpLocaleDataWrapper
;
289 mutable std::unique_ptr
<LocaleDataWrapper
> mpUILocaleDataWrapper
;
290 mutable std::unique_ptr
<LocaleDataWrapper
> mpNeutralLocaleDataWrapper
;
291 mutable std::unique_ptr
<vcl::I18nHelper
> mpI18nHelper
;
292 mutable std::unique_ptr
<vcl::I18nHelper
> mpUII18nHelper
;
294 bool operator==(const ImplAllSettingsData
& rSet
) const;
298 MouseSettings::SetOptions(MouseSettingsOptions nOptions
)
300 mxData
->mnOptions
= nOptions
;
304 MouseSettings::GetOptions() const
306 return mxData
->mnOptions
;
310 MouseSettings::SetDoubleClickTime( sal_uInt64 nDoubleClkTime
)
312 mxData
->mnDoubleClkTime
= nDoubleClkTime
;
316 MouseSettings::GetDoubleClickTime() const
318 return mxData
->mnDoubleClkTime
;
322 MouseSettings::SetDoubleClickWidth( sal_Int32 nDoubleClkWidth
)
324 mxData
->mnDoubleClkWidth
= nDoubleClkWidth
;
328 MouseSettings::GetDoubleClickWidth() const
330 return mxData
->mnDoubleClkWidth
;
334 MouseSettings::SetDoubleClickHeight( sal_Int32 nDoubleClkHeight
)
336 mxData
->mnDoubleClkHeight
= nDoubleClkHeight
;
340 MouseSettings::GetDoubleClickHeight() const
342 return mxData
->mnDoubleClkHeight
;
346 MouseSettings::SetStartDragWidth( sal_Int32 nDragWidth
)
348 mxData
->mnStartDragWidth
= nDragWidth
;
352 MouseSettings::GetStartDragWidth() const
354 return mxData
->mnStartDragWidth
;
358 MouseSettings::SetStartDragHeight( sal_Int32 nDragHeight
)
360 mxData
->mnStartDragHeight
= nDragHeight
;
364 MouseSettings::GetStartDragHeight() const
366 return mxData
->mnStartDragHeight
;
370 MouseSettings::GetStartDragCode()
376 MouseSettings::GetContextMenuCode()
382 MouseSettings::GetContextMenuClicks()
388 MouseSettings::GetScrollRepeat()
394 MouseSettings::GetButtonStartRepeat()
400 MouseSettings::SetButtonRepeat( sal_Int32 nRepeat
)
402 mxData
->mnButtonRepeat
= nRepeat
;
406 MouseSettings::GetButtonRepeat() const
408 return mxData
->mnButtonRepeat
;
412 MouseSettings::GetActionDelay()
418 MouseSettings::SetMenuDelay( sal_Int32 nDelay
)
420 mxData
->mnMenuDelay
= nDelay
;
424 MouseSettings::GetMenuDelay() const
426 return mxData
->mnMenuDelay
;
430 MouseSettings::SetFollow( MouseFollowFlags nFollow
)
432 mxData
->mnFollow
= nFollow
;
436 MouseSettings::GetFollow() const
438 return mxData
->mnFollow
;
442 MouseSettings::SetMiddleButtonAction( MouseMiddleButtonAction nAction
)
444 mxData
->mnMiddleButtonAction
= nAction
;
447 MouseMiddleButtonAction
448 MouseSettings::GetMiddleButtonAction() const
450 return mxData
->mnMiddleButtonAction
;
454 MouseSettings::SetWheelBehavior( MouseWheelBehaviour nBehavior
)
456 mxData
->mnWheelBehavior
= nBehavior
;
460 MouseSettings::GetWheelBehavior() const
462 return mxData
->mnWheelBehavior
;
465 MouseSettings::MouseSettings() = default;
466 MouseSettings::MouseSettings(const MouseSettings
&) = default;
467 MouseSettings::~MouseSettings() = default;
468 MouseSettings
& MouseSettings::operator=(const MouseSettings
&) = default;
470 // Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration
471 bool MouseSettings::operator ==( const MouseSettings
& rSet
) const
473 return mxData
== rSet
.mxData
;
476 ImplStyleData::ImplStyleData()
481 void ImplStyleData::SetStandardStyles()
483 vcl::Font
aStdFont( FAMILY_SWISS
, Size( 0, 8 ) );
484 aStdFont
.SetCharSet( osl_getThreadTextEncoding() );
485 aStdFont
.SetWeight( WEIGHT_NORMAL
);
486 if (!comphelper::IsFuzzing())
487 aStdFont
.SetFamilyName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag(u
"en"_ustr
)));
489 aStdFont
.SetFamilyName(u
"Liberation Sans"_ustr
);
490 maFonts
.maAppFont
= aStdFont
;
491 maFonts
.maHelpFont
= aStdFont
;
492 maFonts
.maMenuFont
= aStdFont
;
493 maFonts
.maToolFont
= aStdFont
;
494 maFonts
.maGroupFont
= aStdFont
;
495 maFonts
.maLabelFont
= aStdFont
;
496 maFonts
.maRadioCheckFont
= aStdFont
;
497 maFonts
.maPushButtonFont
= aStdFont
;
498 maFonts
.maFieldFont
= aStdFont
;
499 maFonts
.maIconFont
= aStdFont
;
500 maFonts
.maTabFont
= aStdFont
;
502 aStdFont
.SetWeight( WEIGHT_BOLD
);
503 maFonts
.maFloatTitleFont
= maFonts
.maTitleFont
= std::move(aStdFont
);
505 maColors
.maFaceColor
= COL_LIGHTGRAY
;
506 maColors
.maCheckedColor
= Color( 0xCC, 0xCC, 0xCC );
507 maColors
.maLightColor
= COL_WHITE
;
508 maColors
.maLightBorderColor
= COL_LIGHTGRAY
;
509 maColors
.maShadowColor
= COL_GRAY
;
510 maColors
.maDarkShadowColor
= COL_BLACK
;
512 maColors
.maWarningColor
= Color(0xFE, 0xEF, 0xB3); // tdf#105829
513 maColors
.maWarningTextColor
= Color(0x70, 0x43, 0x00);
514 maColors
.maErrorColor
= Color(0xFF, 0xBA, 0xBA);
515 maColors
.maErrorTextColor
= Color(0x7A, 0x00, 0x06);
517 maColors
.maDefaultButtonTextColor
= COL_BLACK
;
518 maColors
.maButtonTextColor
= COL_BLACK
;
519 maColors
.maDefaultActionButtonTextColor
= COL_BLACK
;
520 maColors
.maActionButtonTextColor
= COL_BLACK
;
521 maColors
.maFlatButtonTextColor
= COL_BLACK
;
522 maColors
.maDefaultButtonRolloverTextColor
= COL_BLACK
;
523 maColors
.maButtonRolloverTextColor
= COL_BLACK
;
524 maColors
.maDefaultActionButtonRolloverTextColor
= COL_BLACK
;
525 maColors
.maActionButtonRolloverTextColor
= COL_BLACK
;
526 maColors
.maFlatButtonRolloverTextColor
= COL_BLACK
;
527 maColors
.maDefaultButtonPressedRolloverTextColor
= COL_BLACK
;
528 maColors
.maButtonPressedRolloverTextColor
= COL_BLACK
;
529 maColors
.maDefaultActionButtonPressedRolloverTextColor
= COL_BLACK
;
530 maColors
.maActionButtonPressedRolloverTextColor
= COL_BLACK
;
531 maColors
.maFlatButtonPressedRolloverTextColor
= COL_BLACK
;
533 maColors
.maRadioCheckTextColor
= COL_BLACK
;
534 maColors
.maGroupTextColor
= COL_BLACK
;
535 maColors
.maLabelTextColor
= COL_BLACK
;
536 maColors
.maWindowColor
= COL_WHITE
;
537 maColors
.maWindowTextColor
= COL_BLACK
;
538 maColors
.maDialogColor
= COL_LIGHTGRAY
;
539 maColors
.maDialogTextColor
= COL_BLACK
;
540 maColors
.maWorkspaceColor
= Color( 0xDF, 0xDF, 0xDE );
541 maColors
.maMonoColor
= COL_BLACK
;
542 maColors
.maFieldColor
= COL_WHITE
;
543 maColors
.maFieldTextColor
= COL_BLACK
;
544 maColors
.maFieldRolloverTextColor
= COL_BLACK
;
545 maColors
.maActiveBorderColor
= COL_LIGHTGRAY
;
546 maColors
.maDeactiveColor
= COL_GRAY
;
547 maColors
.maDeactiveTextColor
= COL_LIGHTGRAY
;
548 maColors
.maDeactiveBorderColor
= COL_LIGHTGRAY
;
549 maColors
.maMenuColor
= COL_LIGHTGRAY
;
550 maColors
.maMenuBarColor
= COL_LIGHTGRAY
;
551 maColors
.maMenuBarRolloverColor
= COL_BLUE
;
552 maColors
.maMenuBorderColor
= COL_LIGHTGRAY
;
553 maColors
.maMenuTextColor
= COL_BLACK
;
554 maColors
.maListBoxWindowBackgroundColor
= COL_WHITE
;
555 maColors
.maListBoxWindowTextColor
= COL_BLACK
;
556 maColors
.maListBoxWindowHighlightColor
= COL_BLUE
;
557 maColors
.maListBoxWindowHighlightTextColor
= COL_WHITE
;
558 maColors
.maMenuBarTextColor
= COL_BLACK
;
559 maColors
.maMenuBarRolloverTextColor
= COL_WHITE
;
560 maColors
.maMenuBarHighlightTextColor
= COL_WHITE
;
561 maColors
.maMenuHighlightColor
= COL_BLUE
;
562 maColors
.maMenuHighlightTextColor
= COL_WHITE
;
563 maColors
.maAccentColor
= COL_RED
;
564 maColors
.maHighlightColor
= COL_BLUE
;
565 maColors
.maHighlightTextColor
= COL_WHITE
;
566 // make active like highlight, except with a small contrast
567 maColors
.maActiveColor
= maColors
.maHighlightColor
;
568 maColors
.maActiveColor
.IncreaseLuminance(32);
569 maColors
.maActiveTextColor
= maColors
.maHighlightTextColor
;
570 maColors
.maActiveTabColor
= COL_WHITE
;
571 maColors
.maInactiveTabColor
= COL_LIGHTGRAY
;
572 maColors
.maTabTextColor
= COL_BLACK
;
573 maColors
.maTabRolloverTextColor
= COL_BLACK
;
574 maColors
.maTabHighlightTextColor
= COL_BLACK
;
575 maColors
.maDisableColor
= COL_GRAY
;
576 maColors
.maHelpColor
= Color( 0xFF, 0xFF, 0xE0 );
577 maColors
.maHelpTextColor
= COL_BLACK
;
578 maColors
.maLinkColor
= COL_BLUE
;
579 maColors
.maVisitedLinkColor
= Color( 0x00, 0x00, 0xCC );
580 maColors
.maToolTextColor
= COL_BLACK
;
581 maColors
.maAlternatingRowColor
= Color( 0xEE, 0xEE, 0xEE );
584 mnFloatTitleHeight
= 13;
585 mbHighContrast
= false;
586 mbUseSystemUIFonts
= true;
587 mbUseFontAAFromSystem
= true;
588 mbUseSubpixelAA
= true;
589 mnUseFlatBorders
= false;
590 mnUseFlatMenus
= false;
591 mbPreferredUseImagesInMenus
= true;
592 mbSkipDisabledInMenus
= false;
593 mbHideDisabledMenuItems
= false;
594 mbPreferredContextMenuShortcuts
= true;
595 mbPrimaryButtonWarpsSlider
= false;
598 StyleSettings::StyleSettings() = default;
599 StyleSettings::StyleSettings(const StyleSettings
&) = default;
600 StyleSettings::~StyleSettings() = default;
601 StyleSettings
& StyleSettings::operator=(const StyleSettings
&) = default;
604 StyleSettings::SetFaceColor( const Color
& rColor
)
606 mxData
->maColors
.maFaceColor
= rColor
;
610 StyleSettings::GetFaceColor() const
612 return mxData
->maColors
.maFaceColor
;
616 StyleSettings::SetCheckedColor( const Color
& rColor
)
618 mxData
->maColors
.maCheckedColor
= rColor
;
622 StyleSettings::GetCheckedColor() const
624 return mxData
->maColors
.maCheckedColor
;
628 StyleSettings::SetLightColor( const Color
& rColor
)
630 mxData
->maColors
.maLightColor
= rColor
;
634 StyleSettings::GetLightColor() const
636 return mxData
->maColors
.maLightColor
;
640 StyleSettings::SetLightBorderColor( const Color
& rColor
)
642 mxData
->maColors
.maLightBorderColor
= rColor
;
646 StyleSettings::GetLightBorderColor() const
648 return mxData
->maColors
.maLightBorderColor
;
652 StyleSettings::SetWarningColor( const Color
& rColor
)
654 mxData
->maColors
.maWarningColor
= rColor
;
658 StyleSettings::GetWarningColor() const
660 return mxData
->maColors
.maWarningColor
;
664 StyleSettings::SetWarningTextColor( const Color
& rColor
)
666 mxData
->maColors
.maWarningTextColor
= rColor
;
670 StyleSettings::GetWarningTextColor() const
672 return mxData
->maColors
.maWarningTextColor
;
676 StyleSettings::SetErrorColor( const Color
& rColor
)
678 mxData
->maColors
.maErrorColor
= rColor
;
682 StyleSettings::GetErrorColor() const
684 return mxData
->maColors
.maErrorColor
;
688 StyleSettings::SetErrorTextColor( const Color
& rColor
)
690 mxData
->maColors
.maErrorTextColor
= rColor
;
694 StyleSettings::GetErrorTextColor() const
696 return mxData
->maColors
.maErrorTextColor
;
700 StyleSettings::SetShadowColor( const Color
& rColor
)
702 mxData
->maColors
.maShadowColor
= rColor
;
706 StyleSettings::GetShadowColor() const
708 return mxData
->maColors
.maShadowColor
;
712 StyleSettings::SetDarkShadowColor( const Color
& rColor
)
714 mxData
->maColors
.maDarkShadowColor
= rColor
;
718 StyleSettings::GetDarkShadowColor() const
720 return mxData
->maColors
.maDarkShadowColor
;
724 StyleSettings::SetDefaultButtonTextColor( const Color
& rColor
)
726 mxData
->maColors
.maDefaultButtonTextColor
= rColor
;
730 StyleSettings::GetDefaultButtonTextColor() const
732 return mxData
->maColors
.maDefaultButtonTextColor
;
736 StyleSettings::SetButtonTextColor( const Color
& rColor
)
738 mxData
->maColors
.maButtonTextColor
= rColor
;
742 StyleSettings::GetButtonTextColor() const
744 return mxData
->maColors
.maButtonTextColor
;
748 StyleSettings::SetDefaultActionButtonTextColor( const Color
& rColor
)
750 mxData
->maColors
.maDefaultActionButtonTextColor
= rColor
;
754 StyleSettings::GetDefaultActionButtonTextColor() const
756 return mxData
->maColors
.maDefaultActionButtonTextColor
;
760 StyleSettings::SetActionButtonTextColor( const Color
& rColor
)
762 mxData
->maColors
.maActionButtonTextColor
= rColor
;
766 StyleSettings::GetActionButtonTextColor() const
768 return mxData
->maColors
.maActionButtonTextColor
;
772 StyleSettings::SetFlatButtonTextColor( const Color
& rColor
)
774 mxData
->maColors
.maFlatButtonTextColor
= rColor
;
778 StyleSettings::GetFlatButtonTextColor() const
780 return mxData
->maColors
.maFlatButtonTextColor
;
784 StyleSettings::SetDefaultButtonRolloverTextColor( const Color
& rColor
)
786 mxData
->maColors
.maDefaultButtonRolloverTextColor
= rColor
;
790 StyleSettings::GetDefaultButtonRolloverTextColor() const
792 return mxData
->maColors
.maDefaultButtonRolloverTextColor
;
796 StyleSettings::SetButtonRolloverTextColor( const Color
& rColor
)
798 mxData
->maColors
.maButtonRolloverTextColor
= rColor
;
802 StyleSettings::GetButtonRolloverTextColor() const
804 return mxData
->maColors
.maButtonRolloverTextColor
;
808 StyleSettings::SetDefaultActionButtonRolloverTextColor( const Color
& rColor
)
810 mxData
->maColors
.maDefaultActionButtonRolloverTextColor
= rColor
;
814 StyleSettings::GetDefaultActionButtonRolloverTextColor() const
816 return mxData
->maColors
.maDefaultActionButtonRolloverTextColor
;
820 StyleSettings::SetActionButtonRolloverTextColor( const Color
& rColor
)
822 mxData
->maColors
.maActionButtonRolloverTextColor
= rColor
;
826 StyleSettings::GetActionButtonRolloverTextColor() const
828 return mxData
->maColors
.maActionButtonRolloverTextColor
;
832 StyleSettings::SetFlatButtonRolloverTextColor( const Color
& rColor
)
834 mxData
->maColors
.maFlatButtonRolloverTextColor
= rColor
;
838 StyleSettings::GetFlatButtonRolloverTextColor() const
840 return mxData
->maColors
.maFlatButtonRolloverTextColor
;
844 StyleSettings::SetDefaultButtonPressedRolloverTextColor( const Color
& rColor
)
846 mxData
->maColors
.maDefaultButtonPressedRolloverTextColor
= rColor
;
850 StyleSettings::GetDefaultButtonPressedRolloverTextColor() const
852 return mxData
->maColors
.maDefaultButtonPressedRolloverTextColor
;
856 StyleSettings::SetButtonPressedRolloverTextColor( const Color
& rColor
)
858 mxData
->maColors
.maButtonPressedRolloverTextColor
= rColor
;
862 StyleSettings::GetButtonPressedRolloverTextColor() const
864 return mxData
->maColors
.maButtonPressedRolloverTextColor
;
868 StyleSettings::SetDefaultActionButtonPressedRolloverTextColor( const Color
& rColor
)
870 mxData
->maColors
.maDefaultActionButtonPressedRolloverTextColor
= rColor
;
874 StyleSettings::GetDefaultActionButtonPressedRolloverTextColor() const
876 return mxData
->maColors
.maDefaultActionButtonPressedRolloverTextColor
;
880 StyleSettings::SetActionButtonPressedRolloverTextColor( const Color
& rColor
)
882 mxData
->maColors
.maActionButtonPressedRolloverTextColor
= rColor
;
886 StyleSettings::GetActionButtonPressedRolloverTextColor() const
888 return mxData
->maColors
.maActionButtonPressedRolloverTextColor
;
892 StyleSettings::SetFlatButtonPressedRolloverTextColor( const Color
& rColor
)
894 mxData
->maColors
.maFlatButtonPressedRolloverTextColor
= rColor
;
898 StyleSettings::GetFlatButtonPressedRolloverTextColor() const
900 return mxData
->maColors
.maFlatButtonPressedRolloverTextColor
;
904 StyleSettings::SetRadioCheckTextColor( const Color
& rColor
)
906 mxData
->maColors
.maRadioCheckTextColor
= rColor
;
910 StyleSettings::GetRadioCheckTextColor() const
912 return mxData
->maColors
.maRadioCheckTextColor
;
916 StyleSettings::SetGroupTextColor( const Color
& rColor
)
918 mxData
->maColors
.maGroupTextColor
= rColor
;
922 StyleSettings::GetGroupTextColor() const
924 return mxData
->maColors
.maGroupTextColor
;
928 StyleSettings::SetLabelTextColor( const Color
& rColor
)
930 mxData
->maColors
.maLabelTextColor
= rColor
;
934 StyleSettings::GetLabelTextColor() const
936 return mxData
->maColors
.maLabelTextColor
;
940 StyleSettings::SetWindowColor( const Color
& rColor
)
942 mxData
->maColors
.maWindowColor
= rColor
;
946 StyleSettings::GetWindowColor() const
948 return mxData
->maColors
.maWindowColor
;
952 StyleSettings::SetWindowTextColor( const Color
& rColor
)
954 mxData
->maColors
.maWindowTextColor
= rColor
;
958 StyleSettings::GetWindowTextColor() const
960 return mxData
->maColors
.maWindowTextColor
;
964 StyleSettings::SetDialogColor( const Color
& rColor
)
966 mxData
->maColors
.maDialogColor
= rColor
;
970 StyleSettings::GetDialogColor() const
972 return mxData
->maColors
.maDialogColor
;
976 StyleSettings::SetDialogTextColor( const Color
& rColor
)
978 mxData
->maColors
.maDialogTextColor
= rColor
;
982 StyleSettings::GetDialogTextColor() const
984 return mxData
->maColors
.maDialogTextColor
;
988 StyleSettings::SetWorkspaceColor( const Color
& rColor
)
990 mxData
->maColors
.maWorkspaceColor
= rColor
;
994 StyleSettings::GetWorkspaceColor() const
996 return mxData
->maColors
.maWorkspaceColor
;
1000 StyleSettings::SetFieldColor( const Color
& rColor
)
1002 mxData
->maColors
.maFieldColor
= rColor
;
1006 StyleSettings::GetFieldColor() const
1008 return mxData
->maColors
.maFieldColor
;
1012 StyleSettings::SetFieldTextColor( const Color
& rColor
)
1014 mxData
->maColors
.maFieldTextColor
= rColor
;
1018 StyleSettings::GetFieldTextColor() const
1020 return mxData
->maColors
.maFieldTextColor
;
1024 StyleSettings::SetFieldRolloverTextColor( const Color
& rColor
)
1026 mxData
->maColors
.maFieldRolloverTextColor
= rColor
;
1030 StyleSettings::GetFieldRolloverTextColor() const
1032 return mxData
->maColors
.maFieldRolloverTextColor
;
1036 StyleSettings::SetActiveColor( const Color
& rColor
)
1038 mxData
->maColors
.maActiveColor
= rColor
;
1042 StyleSettings::GetActiveColor() const
1044 return mxData
->maColors
.maActiveColor
;
1048 StyleSettings::SetActiveTextColor( const Color
& rColor
)
1050 mxData
->maColors
.maActiveTextColor
= rColor
;
1054 StyleSettings::GetActiveTextColor() const
1056 return mxData
->maColors
.maActiveTextColor
;
1060 StyleSettings::SetActiveBorderColor( const Color
& rColor
)
1062 mxData
->maColors
.maActiveBorderColor
= rColor
;
1066 StyleSettings::GetActiveBorderColor() const
1068 return mxData
->maColors
.maActiveBorderColor
;
1072 StyleSettings::SetDeactiveColor( const Color
& rColor
)
1074 mxData
->maColors
.maDeactiveColor
= rColor
;
1078 StyleSettings::GetDeactiveColor() const
1080 return mxData
->maColors
.maDeactiveColor
;
1084 StyleSettings::SetDeactiveTextColor( const Color
& rColor
)
1086 mxData
->maColors
.maDeactiveTextColor
= rColor
;
1090 StyleSettings::GetDeactiveTextColor() const
1092 return mxData
->maColors
.maDeactiveTextColor
;
1096 StyleSettings::SetDeactiveBorderColor( const Color
& rColor
)
1098 mxData
->maColors
.maDeactiveBorderColor
= rColor
;
1102 StyleSettings::GetDeactiveBorderColor() const
1104 return mxData
->maColors
.maDeactiveBorderColor
;
1108 StyleSettings::SetAccentColor( const Color
& rColor
)
1110 mxData
->maColors
.maAccentColor
= rColor
;
1114 StyleSettings::GetAccentColor() const
1116 return mxData
->maColors
.maAccentColor
;
1120 StyleSettings::SetHighlightColor( const Color
& rColor
)
1122 mxData
->maColors
.maHighlightColor
= rColor
;
1126 StyleSettings::GetHighlightColor() const
1128 return mxData
->maColors
.maHighlightColor
;
1132 StyleSettings::SetHighlightTextColor( const Color
& rColor
)
1134 mxData
->maColors
.maHighlightTextColor
= rColor
;
1138 StyleSettings::GetHighlightTextColor() const
1140 return mxData
->maColors
.maHighlightTextColor
;
1144 StyleSettings::SetDisableColor( const Color
& rColor
)
1146 mxData
->maColors
.maDisableColor
= rColor
;
1150 StyleSettings::GetDisableColor() const
1152 return mxData
->maColors
.maDisableColor
;
1156 StyleSettings::SetHelpColor( const Color
& rColor
)
1158 mxData
->maColors
.maHelpColor
= rColor
;
1162 StyleSettings::GetHelpColor() const
1164 return mxData
->maColors
.maHelpColor
;
1168 StyleSettings::SetHelpTextColor( const Color
& rColor
)
1170 mxData
->maColors
.maHelpTextColor
= rColor
;
1174 StyleSettings::GetHelpTextColor() const
1176 return mxData
->maColors
.maHelpTextColor
;
1180 StyleSettings::SetMenuColor( const Color
& rColor
)
1182 mxData
->maColors
.maMenuColor
= rColor
;
1186 StyleSettings::GetMenuColor() const
1188 return mxData
->maColors
.maMenuColor
;
1192 StyleSettings::SetMenuBarColor( const Color
& rColor
)
1194 mxData
->maColors
.maMenuBarColor
= rColor
;
1198 StyleSettings::GetMenuBarColor() const
1200 return mxData
->maColors
.maMenuBarColor
;
1204 StyleSettings::SetMenuBarRolloverColor( const Color
& rColor
)
1206 mxData
->maColors
.maMenuBarRolloverColor
= rColor
;
1210 StyleSettings::GetMenuBarRolloverColor() const
1212 return mxData
->maColors
.maMenuBarRolloverColor
;
1216 StyleSettings::SetMenuBorderColor( const Color
& rColor
)
1218 mxData
->maColors
.maMenuBorderColor
= rColor
;
1222 StyleSettings::GetMenuBorderColor() const
1224 return mxData
->maColors
.maMenuBorderColor
;
1228 StyleSettings::SetMenuTextColor( const Color
& rColor
)
1230 mxData
->maColors
.maMenuTextColor
= rColor
;
1234 StyleSettings::GetMenuTextColor() const
1236 return mxData
->maColors
.maMenuTextColor
;
1240 StyleSettings::SetMenuBarTextColor( const Color
& rColor
)
1242 mxData
->maColors
.maMenuBarTextColor
= rColor
;
1246 StyleSettings::GetMenuBarTextColor() const
1248 return mxData
->maColors
.maMenuBarTextColor
;
1252 StyleSettings::SetMenuBarRolloverTextColor( const Color
& rColor
)
1254 mxData
->maColors
.maMenuBarRolloverTextColor
= rColor
;
1258 StyleSettings::GetMenuBarRolloverTextColor() const
1260 return mxData
->maColors
.maMenuBarRolloverTextColor
;
1264 StyleSettings::SetMenuBarHighlightTextColor( const Color
& rColor
)
1266 mxData
->maColors
.maMenuBarHighlightTextColor
= rColor
;
1270 StyleSettings::GetMenuBarHighlightTextColor() const
1272 return mxData
->maColors
.maMenuBarHighlightTextColor
;
1276 StyleSettings::SetMenuHighlightColor( const Color
& rColor
)
1278 mxData
->maColors
.maMenuHighlightColor
= rColor
;
1282 StyleSettings::GetMenuHighlightColor() const
1284 return mxData
->maColors
.maMenuHighlightColor
;
1288 StyleSettings::SetMenuHighlightTextColor( const Color
& rColor
)
1290 mxData
->maColors
.maMenuHighlightTextColor
= rColor
;
1294 StyleSettings::GetMenuHighlightTextColor() const
1296 return mxData
->maColors
.maMenuHighlightTextColor
;
1300 StyleSettings::SetListBoxWindowBackgroundColor( const Color
& rColor
)
1302 mxData
->maColors
.maListBoxWindowBackgroundColor
= rColor
;
1306 StyleSettings::GetListBoxWindowBackgroundColor() const
1308 return mxData
->maColors
.maListBoxWindowBackgroundColor
;
1312 StyleSettings::SetListBoxWindowTextColor( const Color
& rColor
)
1314 mxData
->maColors
.maListBoxWindowTextColor
= rColor
;
1318 StyleSettings::GetListBoxWindowTextColor() const
1320 return mxData
->maColors
.maListBoxWindowTextColor
;
1324 StyleSettings::SetListBoxWindowHighlightColor( const Color
& rColor
)
1326 mxData
->maColors
.maListBoxWindowHighlightColor
= rColor
;
1330 StyleSettings::GetListBoxWindowHighlightColor() const
1332 return mxData
->maColors
.maListBoxWindowHighlightColor
;
1336 StyleSettings::SetListBoxWindowHighlightTextColor( const Color
& rColor
)
1338 mxData
->maColors
.maListBoxWindowHighlightTextColor
= rColor
;
1342 StyleSettings::GetListBoxWindowHighlightTextColor() const
1344 return mxData
->maColors
.maListBoxWindowHighlightTextColor
;
1348 StyleSettings::SetTabTextColor( const Color
& rColor
)
1350 mxData
->maColors
.maTabTextColor
= rColor
;
1354 StyleSettings::GetTabTextColor() const
1356 return mxData
->maColors
.maTabTextColor
;
1360 StyleSettings::SetTabRolloverTextColor( const Color
& rColor
)
1362 mxData
->maColors
.maTabRolloverTextColor
= rColor
;
1366 StyleSettings::GetTabRolloverTextColor() const
1368 return mxData
->maColors
.maTabRolloverTextColor
;
1372 StyleSettings::SetTabHighlightTextColor( const Color
& rColor
)
1374 mxData
->maColors
.maTabHighlightTextColor
= rColor
;
1378 StyleSettings::GetTabHighlightTextColor() const
1380 return mxData
->maColors
.maTabHighlightTextColor
;
1384 StyleSettings::SetLinkColor( const Color
& rColor
)
1386 mxData
->maColors
.maLinkColor
= rColor
;
1390 StyleSettings::GetLinkColor() const
1392 return mxData
->maColors
.maLinkColor
;
1396 StyleSettings::SetVisitedLinkColor( const Color
& rColor
)
1398 mxData
->maColors
.maVisitedLinkColor
= rColor
;
1402 StyleSettings::GetVisitedLinkColor() const
1404 return mxData
->maColors
.maVisitedLinkColor
;
1408 StyleSettings::SetToolTextColor( const Color
& rColor
)
1410 mxData
->maColors
.maToolTextColor
= rColor
;
1414 StyleSettings::GetToolTextColor() const
1416 return mxData
->maColors
.maToolTextColor
;
1420 StyleSettings::SetMonoColor( const Color
& rColor
)
1422 mxData
->maColors
.maMonoColor
= rColor
;
1426 StyleSettings::GetMonoColor() const
1428 return mxData
->maColors
.maMonoColor
;
1432 StyleSettings::SetActiveTabColor( const Color
& rColor
)
1434 mxData
->maColors
.maActiveTabColor
= rColor
;
1438 StyleSettings::GetActiveTabColor() const
1440 return mxData
->maColors
.maActiveTabColor
;
1444 StyleSettings::SetInactiveTabColor( const Color
& rColor
)
1446 mxData
->maColors
.maInactiveTabColor
= rColor
;
1450 StyleSettings::GetInactiveTabColor() const
1452 return mxData
->maColors
.maInactiveTabColor
;
1455 void StyleSettings::SetAlternatingRowColor(const Color
& rColor
)
1457 mxData
->maColors
.maAlternatingRowColor
= rColor
;
1461 StyleSettings::GetAlternatingRowColor() const
1463 return mxData
->maColors
.maAlternatingRowColor
;
1467 StyleSettings::SetUseSystemUIFonts( bool bUseSystemUIFonts
)
1469 mxData
->mbUseSystemUIFonts
= bUseSystemUIFonts
;
1473 StyleSettings::GetUseSystemUIFonts() const
1475 return mxData
->mbUseSystemUIFonts
;
1478 void StyleSettings::SetUseFontAAFromSystem(bool bUseFontAAFromSystem
)
1480 mxData
->mbUseFontAAFromSystem
= bUseFontAAFromSystem
;
1483 bool StyleSettings::GetUseFontAAFromSystem() const
1485 return mxData
->mbUseFontAAFromSystem
;
1488 void StyleSettings::SetUseSubpixelAA(bool val
)
1490 mxData
->mbUseSubpixelAA
= val
;
1493 bool StyleSettings::GetUseSubpixelAA() const
1495 return mxData
->mbUseSubpixelAA
;
1499 StyleSettings::SetUseFlatBorders( bool bUseFlatBorders
)
1501 mxData
->mnUseFlatBorders
= bUseFlatBorders
;
1505 StyleSettings::GetUseFlatBorders() const
1507 return mxData
->mnUseFlatBorders
;
1511 StyleSettings::SetUseFlatMenus( bool bUseFlatMenus
)
1513 mxData
->mnUseFlatMenus
= bUseFlatMenus
;
1517 StyleSettings::GetUseFlatMenus() const
1519 return mxData
->mnUseFlatMenus
;
1523 StyleSettings::SetUseImagesInMenus( TriState eUseImagesInMenus
)
1525 mxData
->meUseImagesInMenus
= eUseImagesInMenus
;
1529 StyleSettings::SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus
)
1531 mxData
->mbPreferredUseImagesInMenus
= bPreferredUseImagesInMenus
;
1535 StyleSettings::GetPreferredUseImagesInMenus() const
1537 return mxData
->mbPreferredUseImagesInMenus
;
1541 StyleSettings::SetSkipDisabledInMenus( bool bSkipDisabledInMenus
)
1543 mxData
->mbSkipDisabledInMenus
= bSkipDisabledInMenus
;
1547 StyleSettings::GetSkipDisabledInMenus() const
1549 return mxData
->mbSkipDisabledInMenus
;
1553 StyleSettings::SetHideDisabledMenuItems( bool bHideDisabledMenuItems
)
1555 mxData
->mbHideDisabledMenuItems
= bHideDisabledMenuItems
;
1559 StyleSettings::GetHideDisabledMenuItems() const
1561 return mxData
->mbHideDisabledMenuItems
;
1565 StyleSettings::SetContextMenuShortcuts( TriState eContextMenuShortcuts
)
1567 mxData
->meContextMenuShortcuts
= eContextMenuShortcuts
;
1571 StyleSettings::GetContextMenuShortcuts() const
1573 switch (mxData
->meContextMenuShortcuts
)
1575 case TRISTATE_FALSE
:
1579 default: // TRISTATE_INDET:
1580 return GetPreferredContextMenuShortcuts();
1585 StyleSettings::SetPreferredContextMenuShortcuts( bool bContextMenuShortcuts
)
1587 mxData
->mbPreferredContextMenuShortcuts
= bContextMenuShortcuts
;
1591 StyleSettings::GetPreferredContextMenuShortcuts() const
1593 return mxData
->mbPreferredContextMenuShortcuts
;
1597 StyleSettings::SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider
)
1599 mxData
->mbPrimaryButtonWarpsSlider
= bPrimaryButtonWarpsSlider
;
1603 StyleSettings::GetPrimaryButtonWarpsSlider() const
1605 return mxData
->mbPrimaryButtonWarpsSlider
;
1609 StyleSettings::SetAppFont( const vcl::Font
& rFont
)
1611 mxData
->maFonts
.maAppFont
= rFont
;
1615 StyleSettings::GetAppFont() const
1617 return mxData
->maFonts
.maAppFont
;
1621 StyleSettings::SetHelpFont( const vcl::Font
& rFont
)
1623 mxData
->maFonts
.maHelpFont
= rFont
;
1627 StyleSettings::GetHelpFont() const
1629 return mxData
->maFonts
.maHelpFont
;
1633 StyleSettings::SetTitleFont( const vcl::Font
& rFont
)
1635 mxData
->maFonts
.maTitleFont
= rFont
;
1639 StyleSettings::GetTitleFont() const
1641 return mxData
->maFonts
.maTitleFont
;
1645 StyleSettings::SetFloatTitleFont( const vcl::Font
& rFont
)
1647 mxData
->maFonts
.maFloatTitleFont
= rFont
;
1651 StyleSettings::GetFloatTitleFont() const
1653 return mxData
->maFonts
.maFloatTitleFont
;
1657 StyleSettings::SetMenuFont( const vcl::Font
& rFont
)
1659 mxData
->maFonts
.maMenuFont
= rFont
;
1663 StyleSettings::GetMenuFont() const
1665 return mxData
->maFonts
.maMenuFont
;
1669 StyleSettings::SetToolFont( const vcl::Font
& rFont
)
1671 mxData
->maFonts
.maToolFont
= rFont
;
1675 StyleSettings::GetToolFont() const
1677 return mxData
->maFonts
.maToolFont
;
1681 StyleSettings::SetGroupFont( const vcl::Font
& rFont
)
1683 mxData
->maFonts
.maGroupFont
= rFont
;
1687 StyleSettings::GetGroupFont() const
1689 return mxData
->maFonts
.maGroupFont
;
1693 StyleSettings::SetLabelFont( const vcl::Font
& rFont
)
1695 mxData
->maFonts
.maLabelFont
= rFont
;
1699 StyleSettings::GetLabelFont() const
1701 return mxData
->maFonts
.maLabelFont
;
1705 StyleSettings::SetRadioCheckFont( const vcl::Font
& rFont
)
1707 mxData
->maFonts
.maRadioCheckFont
= rFont
;
1711 StyleSettings::GetRadioCheckFont() const
1713 return mxData
->maFonts
.maRadioCheckFont
;
1717 StyleSettings::SetPushButtonFont( const vcl::Font
& rFont
)
1719 mxData
->maFonts
.maPushButtonFont
= rFont
;
1723 StyleSettings::GetPushButtonFont() const
1725 return mxData
->maFonts
.maPushButtonFont
;
1729 StyleSettings::SetFieldFont( const vcl::Font
& rFont
)
1731 mxData
->maFonts
.maFieldFont
= rFont
;
1735 StyleSettings::GetFieldFont() const
1737 return mxData
->maFonts
.maFieldFont
;
1741 StyleSettings::SetIconFont( const vcl::Font
& rFont
)
1743 mxData
->maFonts
.maIconFont
= rFont
;
1747 StyleSettings::GetIconFont() const
1749 return mxData
->maFonts
.maIconFont
;
1753 StyleSettings::SetTabFont( const vcl::Font
& rFont
)
1755 mxData
->maFonts
.maTabFont
= rFont
;
1759 StyleSettings::GetTabFont() const
1761 return mxData
->maFonts
.maTabFont
;
1765 StyleSettings::GetBorderSize()
1771 StyleSettings::SetTitleHeight( sal_Int32 nSize
)
1773 mxData
->mnTitleHeight
= nSize
;
1777 StyleSettings::GetTitleHeight() const
1779 return mxData
->mnTitleHeight
;
1783 StyleSettings::SetFloatTitleHeight( sal_Int32 nSize
)
1785 mxData
->mnFloatTitleHeight
= nSize
;
1789 StyleSettings::GetFloatTitleHeight() const
1791 return mxData
->mnFloatTitleHeight
;
1795 StyleSettings::SetScrollBarSize( sal_Int32 nSize
)
1797 mxData
->mnScrollBarSize
= nSize
;
1801 StyleSettings::GetScrollBarSize() const
1803 return mxData
->mnScrollBarSize
;
1807 StyleSettings::SetMinThumbSize( sal_Int32 nSize
)
1809 mxData
->mnMinThumbSize
= nSize
;
1813 StyleSettings::GetMinThumbSize() const
1815 return mxData
->mnMinThumbSize
;
1819 StyleSettings::SetSpinSize( sal_Int32 nSize
)
1821 mxData
->mnSpinSize
= nSize
;
1825 StyleSettings::GetSpinSize() const
1827 return mxData
->mnSpinSize
;
1831 StyleSettings::GetSplitSize()
1837 StyleSettings::SetCursorSize( sal_Int32 nSize
)
1839 mxData
->mnCursorSize
= nSize
;
1843 StyleSettings::GetCursorSize() const
1845 return mxData
->mnCursorSize
;
1849 StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime
)
1851 mxData
->mnCursorBlinkTime
= nBlinkTime
;
1855 StyleSettings::GetCursorBlinkTime() const
1857 return mxData
->mnCursorBlinkTime
;
1861 StyleSettings::SetDragFullOptions( DragFullOptions nOptions
)
1863 mxData
->mnDragFullOptions
= nOptions
;
1867 StyleSettings::GetDragFullOptions() const
1869 return mxData
->mnDragFullOptions
;
1873 StyleSettings::SetSelectionOptions( SelectionOptions nOptions
)
1875 mxData
->mnSelectionOptions
= nOptions
;
1879 StyleSettings::GetSelectionOptions() const
1881 return mxData
->mnSelectionOptions
;
1885 StyleSettings::SetDisplayOptions( DisplayOptions nOptions
)
1887 mxData
->mnDisplayOptions
= nOptions
;
1891 StyleSettings::GetDisplayOptions() const
1893 return mxData
->mnDisplayOptions
;
1897 StyleSettings::SetAntialiasingMinPixelHeight( sal_Int32 nMinPixel
)
1899 mxData
->mnAntialiasedMin
= nMinPixel
;
1903 StyleSettings::GetAntialiasingMinPixelHeight() const
1905 return mxData
->mnAntialiasedMin
;
1909 StyleSettings::SetOptions( StyleSettingsOptions nOptions
)
1911 mxData
->mnOptions
= nOptions
;
1915 StyleSettings::SetAutoMnemonic( bool bAutoMnemonic
)
1917 mxData
->mbAutoMnemonic
= bAutoMnemonic
;
1921 StyleSettings::GetAutoMnemonic() const
1923 return mxData
->mbAutoMnemonic
;
1927 StyleSettings::GetDockingFloatsSupported()
1929 ImplSVData
* pSVData
= ImplGetSVData();
1930 return pSVData
->maNWFData
.mbCanDetermineWindowPosition
;
1934 StyleSettings::SetToolbarIconSize( ToolbarIconSize nSize
)
1936 mxData
->mnToolbarIconSize
= nSize
;
1940 StyleSettings::GetToolbarIconSize() const
1942 return mxData
->mnToolbarIconSize
;
1945 Size
StyleSettings::GetToolbarIconSizePixel() const
1947 switch (GetToolbarIconSize())
1949 case ToolbarIconSize::Large
:
1950 return Size(24, 24);
1951 case ToolbarIconSize::Size32
:
1952 return Size(32, 32);
1953 case ToolbarIconSize::Small
:
1955 return Size(16, 16);
1960 StyleSettings::GetDialogStyle() const
1962 return mxData
->maDialogStyle
;
1966 StyleSettings::SetEdgeBlending(sal_uInt16 nCount
)
1968 mxData
->mnEdgeBlending
= nCount
;
1972 StyleSettings::GetEdgeBlending() const
1974 return mxData
->mnEdgeBlending
;
1978 StyleSettings::GetEdgeBlendingTopLeftColor() const
1980 return mxData
->maEdgeBlendingTopLeftColor
;
1984 StyleSettings::GetEdgeBlendingBottomRightColor() const
1986 return mxData
->maEdgeBlendingBottomRightColor
;
1990 StyleSettings::SetListBoxMaximumLineCount(sal_uInt16 nCount
)
1992 mxData
->mnListBoxMaximumLineCount
= nCount
;
1996 StyleSettings::GetListBoxMaximumLineCount() const
1998 return mxData
->mnListBoxMaximumLineCount
;
2002 StyleSettings::SetColorValueSetColumnCount(sal_uInt16 nCount
)
2004 mxData
->mnColorValueSetColumnCount
= nCount
;
2008 StyleSettings::GetColorValueSetColumnCount() const
2010 return mxData
->mnColorValueSetColumnCount
;
2014 StyleSettings::GetListBoxPreviewDefaultLineWidth()
2019 void StyleSettings::SetComboBoxTextSelectionMode(
2020 ComboBoxTextSelectionMode eMode
)
2022 mxData
->meComboBoxTextSelectionMode
= eMode
;
2025 ComboBoxTextSelectionMode
StyleSettings::GetComboBoxTextSelectionMode() const
2027 return mxData
->meComboBoxTextSelectionMode
;
2031 StyleSettings::SetPreviewUsesCheckeredBackground(bool bNew
)
2033 mxData
->mbPreviewUsesCheckeredBackground
= bNew
;
2037 StyleSettings::GetPreviewUsesCheckeredBackground() const
2039 return mxData
->mbPreviewUsesCheckeredBackground
;
2042 void StyleSettings::SetListBoxPreviewDefaultLogicSize(Size
const& rSize
)
2044 auto* myData
= mxData
.get();
2045 myData
->maListBoxPreviewDefaultLogicSize
= rSize
;
2046 mxData
->maListBoxPreviewDefaultPixelSize
= {}; // recalc
2049 const Size
& StyleSettings::GetListBoxPreviewDefaultPixelSize() const
2051 if(0 == mxData
->maListBoxPreviewDefaultPixelSize
.Width() || 0 == mxData
->maListBoxPreviewDefaultPixelSize
.Height())
2053 mxData
->maListBoxPreviewDefaultPixelSize
=
2054 Application::GetDefaultDevice()->LogicToPixel(mxData
->maListBoxPreviewDefaultLogicSize
, MapMode(MapUnit::MapAppFont
));
2057 return mxData
->maListBoxPreviewDefaultPixelSize
;
2060 void StyleSettings::Set3DColors( const Color
& rColor
)
2062 auto* myData
= mxData
.get();
2063 myData
->maColors
.maFaceColor
= rColor
;
2064 myData
->maColors
.maLightBorderColor
= rColor
;
2065 myData
->maColors
.maMenuBorderColor
= rColor
;
2066 myData
->maColors
.maDarkShadowColor
= COL_BLACK
;
2067 if ( rColor
!= COL_LIGHTGRAY
)
2069 myData
->maColors
.maLightColor
= rColor
;
2070 myData
->maColors
.maShadowColor
= rColor
;
2071 myData
->maColors
.maDarkShadowColor
= rColor
;
2073 if (!rColor
.IsDark())
2075 myData
->maColors
.maLightColor
.IncreaseLuminance(64);
2076 myData
->maColors
.maShadowColor
.DecreaseLuminance(64);
2077 myData
->maColors
.maDarkShadowColor
.DecreaseLuminance(100);
2081 myData
->maColors
.maLightColor
.DecreaseLuminance(64);
2082 myData
->maColors
.maShadowColor
.IncreaseLuminance(64);
2083 myData
->maColors
.maDarkShadowColor
.IncreaseLuminance(100);
2086 sal_uInt8 nRed
= (myData
->maColors
.maLightColor
.GetRed() + myData
->maColors
.maShadowColor
.GetRed()) / 2;
2087 sal_uInt8 nGreen
= (myData
->maColors
.maLightColor
.GetGreen() + myData
->maColors
.maShadowColor
.GetGreen()) / 2;
2088 sal_uInt8 nBlue
= (myData
->maColors
.maLightColor
.GetBlue() + myData
->maColors
.maShadowColor
.GetBlue()) / 2;
2089 myData
->maColors
.maCheckedColor
= Color(nRed
, nGreen
, nBlue
);
2093 myData
->maColors
.maCheckedColor
= Color( 0x99, 0x99, 0x99 );
2094 myData
->maColors
.maLightColor
= COL_WHITE
;
2095 myData
->maColors
.maShadowColor
= COL_GRAY
;
2099 void StyleSettings::SetCheckedColorSpecialCase( )
2101 auto* myData
= mxData
.get();
2102 // Light gray checked color special case
2103 if ( GetFaceColor() == COL_LIGHTGRAY
)
2104 myData
->maColors
.maCheckedColor
= Color(0xCC, 0xCC, 0xCC);
2107 sal_uInt8 nRed
= static_cast<sal_uInt8
>((static_cast<sal_uInt16
>(myData
->maColors
.maFaceColor
.GetRed()) + static_cast<sal_uInt16
>(myData
->maColors
.maLightColor
.GetRed()))/2);
2108 sal_uInt8 nGreen
= static_cast<sal_uInt8
>((static_cast<sal_uInt16
>(myData
->maColors
.maFaceColor
.GetGreen()) + static_cast<sal_uInt16
>(myData
->maColors
.maLightColor
.GetGreen()))/2);
2109 sal_uInt8 nBlue
= static_cast<sal_uInt8
>((static_cast<sal_uInt16
>(myData
->maColors
.maFaceColor
.GetBlue()) + static_cast<sal_uInt16
>(myData
->maColors
.maLightColor
.GetBlue()))/2);
2110 myData
->maColors
.maCheckedColor
= Color(nRed
, nGreen
, nBlue
);
2114 bool StyleSettings::GetUseImagesInMenus() const
2116 // icon mode selected in Tools -> Options... -> OpenOffice.org -> View
2117 switch (mxData
->meUseImagesInMenus
) {
2118 case TRISTATE_FALSE
:
2122 default: // TRISTATE_INDET:
2123 return GetPreferredUseImagesInMenus();
2127 static BitmapEx
readBitmapEx( const OUString
& rPath
)
2129 OUString
aPath( rPath
);
2130 rtl::Bootstrap::expandMacros( aPath
);
2134 if ( GraphicFilter::LoadGraphic( aPath
, OUString(), aGraphic
) != ERRCODE_NONE
)
2136 return aGraphic
.GetBitmapEx();
2141 enum WhichPersona
{ PERSONA_HEADER
, PERSONA_FOOTER
};
2145 /** Update the setting of the Persona header / footer in ImplStyleData */
2146 static void setupPersonaHeaderFooter( WhichPersona eWhich
, OUString
& rHeaderFooter
, BitmapEx
& rHeaderFooterBitmap
, std::optional
<Color
>& rMenuBarTextColor
)
2148 // don't burn time loading images we don't need.
2149 if ( Application::IsHeadlessModeEnabled() )
2152 // read from the configuration
2153 OUString
aPersona( officecfg::Office::Common::Misc::Persona::get() );
2154 OUString
aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get() );
2156 // have the settings changed? marks if header /footer prepared before
2157 //should maybe extended to a flag that marks if header /footer /both are loaded
2158 OUString aOldValue
= eWhich
==PERSONA_HEADER
?OUString(aPersona
+ ";" + aPersonaSettings
+";h" ):OUString(aPersona
+ ";" + aPersonaSettings
+";f" );
2159 if ( rHeaderFooter
== aOldValue
)
2162 rHeaderFooter
= aOldValue
;
2163 rHeaderFooterBitmap
= BitmapEx();
2164 rMenuBarTextColor
.reset();
2166 // now read the new values and setup bitmaps
2167 OUString aHeader
, aFooter
;
2168 if ( aPersona
== "own" || aPersona
== "default" )
2170 sal_Int32 nIndex
= 0;
2172 // Skip the persona slug, name, and preview
2173 aHeader
= aPersonaSettings
.getToken( 3, ';', nIndex
);
2176 aFooter
= aPersonaSettings
.getToken( 0, ';', nIndex
);
2178 // change menu text color, advance nIndex to skip the '#'
2181 OUString aColor
= aPersonaSettings
.getToken( 0, ';', ++nIndex
);
2182 rMenuBarTextColor
= Color( ColorTransparency
, aColor
.toUInt32( 16 ) );
2188 case PERSONA_HEADER
: aName
= aHeader
; break;
2189 case PERSONA_FOOTER
: aName
= aFooter
; break;
2192 if ( !aName
.isEmpty() )
2194 OUString
gallery(u
""_ustr
);
2195 // try the gallery first, then the program path:
2196 if ( aPersona
== "own" && !aPersonaSettings
.startsWith( "vnd.sun.star.expand" ) )
2198 gallery
= "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
"/" SAL_CONFIGFILE( "bootstrap") "::UserInstallation}";
2199 rtl::Bootstrap::expandMacros( gallery
);
2200 gallery
+= "/user/gallery/personas/";
2202 else if ( aPersona
== "default" )
2204 gallery
= "$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER
"/gallery/personas/";
2206 rHeaderFooterBitmap
= readBitmapEx( gallery
+ aName
);
2208 if ( rHeaderFooterBitmap
.IsEmpty() )
2209 rHeaderFooterBitmap
= readBitmapEx( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
"/" + aName
);
2212 // Something went wrong. Probably, the images are missing. Clear the persona properties in the registry.
2214 if( rHeaderFooterBitmap
.IsEmpty() )
2216 std::shared_ptr
<comphelper::ConfigurationChanges
> batch(comphelper::ConfigurationChanges::create());
2217 officecfg::Office::Common::Misc::Persona::set( u
"no"_ustr
, batch
);
2218 officecfg::Office::Common::Misc::PersonaSettings::set( u
""_ustr
, batch
);
2223 BitmapEx
const & StyleSettings::GetPersonaHeader() const
2225 setupPersonaHeaderFooter( PERSONA_HEADER
, mxData
->maPersonaHeaderFooter
, mxData
->maPersonaHeaderBitmap
, mxData
->maPersonaMenuBarTextColor
);
2226 return mxData
->maPersonaHeaderBitmap
;
2229 BitmapEx
const & StyleSettings::GetPersonaFooter() const
2231 setupPersonaHeaderFooter( PERSONA_FOOTER
, mxData
->maPersonaHeaderFooter
, mxData
->maPersonaFooterBitmap
, mxData
->maPersonaMenuBarTextColor
);
2232 return mxData
->maPersonaFooterBitmap
;
2235 const std::optional
<Color
>& StyleSettings::GetPersonaMenuBarTextColor() const
2238 return mxData
->maPersonaMenuBarTextColor
;
2241 void StyleSettings::SetStandardStyles()
2243 mxData
->SetStandardStyles();
2246 Color
StyleSettings::GetFaceGradientColor() const
2248 // compute a brighter face color that can be used in gradients
2249 // for a convex look (eg toolbars)
2252 GetFaceColor().RGBtoHSB( h
, s
, b
);
2255 return Color::HSBtoRGB( h
, s
, b
);
2258 Color
StyleSettings::GetSeparatorColor() const
2260 // compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP)
2262 GetShadowColor().RGBtoHSB( h
, s
, b
);
2265 return Color::HSBtoRGB( h
, s
, b
);
2268 // Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration
2269 bool StyleSettings::operator ==( const StyleSettings
& rSet
) const
2271 return mxData
== rSet
.mxData
;
2274 bool ImplStyleData::operator==(const ImplStyleData
& rSet
) const
2276 if (mIconTheme
!= rSet
.mIconTheme
) {
2280 if (mIconThemeSelector
!= rSet
.mIconThemeSelector
) {
2284 return (mnOptions
== rSet
.mnOptions
) &&
2285 (mbAutoMnemonic
== rSet
.mbAutoMnemonic
) &&
2286 (mnDragFullOptions
== rSet
.mnDragFullOptions
) &&
2287 (mnSelectionOptions
== rSet
.mnSelectionOptions
) &&
2288 (mnDisplayOptions
== rSet
.mnDisplayOptions
) &&
2289 (mnCursorSize
== rSet
.mnCursorSize
) &&
2290 (mnCursorBlinkTime
== rSet
.mnCursorBlinkTime
) &&
2291 (mnTitleHeight
== rSet
.mnTitleHeight
) &&
2292 (mnFloatTitleHeight
== rSet
.mnFloatTitleHeight
) &&
2293 (mnScrollBarSize
== rSet
.mnScrollBarSize
) &&
2294 (mnMinThumbSize
== rSet
.mnMinThumbSize
) &&
2295 (mnSpinSize
== rSet
.mnSpinSize
) &&
2296 (mnAntialiasedMin
== rSet
.mnAntialiasedMin
) &&
2297 (mbHighContrast
== rSet
.mbHighContrast
) &&
2298 (mbUseSystemUIFonts
== rSet
.mbUseSystemUIFonts
) &&
2299 (mbUseFontAAFromSystem
== rSet
.mbUseFontAAFromSystem
) &&
2300 (mbUseSubpixelAA
== rSet
.mbUseSubpixelAA
) &&
2301 (mnUseFlatBorders
== rSet
.mnUseFlatBorders
) &&
2302 (mnUseFlatMenus
== rSet
.mnUseFlatMenus
) &&
2303 (maColors
== rSet
.maColors
) &&
2304 (maFonts
== rSet
.maFonts
) &&
2305 (meUseImagesInMenus
== rSet
.meUseImagesInMenus
) &&
2306 (mbPreferredUseImagesInMenus
== rSet
.mbPreferredUseImagesInMenus
) &&
2307 (mbSkipDisabledInMenus
== rSet
.mbSkipDisabledInMenus
) &&
2308 (mbHideDisabledMenuItems
== rSet
.mbHideDisabledMenuItems
) &&
2309 (mbPreferredContextMenuShortcuts
== rSet
.mbPreferredContextMenuShortcuts
) &&
2310 (meContextMenuShortcuts
== rSet
.meContextMenuShortcuts
) &&
2311 (mbPrimaryButtonWarpsSlider
== rSet
.mbPrimaryButtonWarpsSlider
) &&
2312 (mnEdgeBlending
== rSet
.mnEdgeBlending
) &&
2313 (maEdgeBlendingTopLeftColor
== rSet
.maEdgeBlendingTopLeftColor
) &&
2314 (maEdgeBlendingBottomRightColor
== rSet
.maEdgeBlendingBottomRightColor
) &&
2315 (mnListBoxMaximumLineCount
== rSet
.mnListBoxMaximumLineCount
) &&
2316 (mnColorValueSetColumnCount
== rSet
.mnColorValueSetColumnCount
) &&
2317 (maListBoxPreviewDefaultLogicSize
== rSet
.maListBoxPreviewDefaultLogicSize
) &&
2318 (mbPreviewUsesCheckeredBackground
== rSet
.mbPreviewUsesCheckeredBackground
);
2321 ImplMiscData::ImplMiscData() :
2322 mnDisablePrinting(TRISTATE_INDET
)
2324 static const char* pEnv
= getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
2325 mbEnableLocalizedDecimalSep
= (pEnv
!= nullptr);
2328 MiscSettings::MiscSettings()
2329 : mxData(std::make_shared
<ImplMiscData
>())
2333 bool MiscSettings::operator ==( const MiscSettings
& rSet
) const
2335 if ( mxData
== rSet
.mxData
)
2338 return (mxData
->mnDisablePrinting
== rSet
.mxData
->mnDisablePrinting
) &&
2339 (mxData
->mbEnableLocalizedDecimalSep
== rSet
.mxData
->mbEnableLocalizedDecimalSep
);
2343 MiscSettings::operator !=( const MiscSettings
& rSet
) const
2345 return !(*this == rSet
);
2348 bool MiscSettings::GetDisablePrinting() const
2350 if( mxData
->mnDisablePrinting
== TRISTATE_INDET
)
2353 vcl::SettingsConfigItem::get()->
2354 getValue( u
"DesktopManagement"_ustr
,
2355 u
"DisablePrinting"_ustr
);
2356 mxData
->mnDisablePrinting
= aEnable
.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE
: TRISTATE_FALSE
;
2359 return mxData
->mnDisablePrinting
!= TRISTATE_FALSE
;
2362 bool MiscSettings::GetEnableATToolSupport()
2364 static const char* pEnv
= getenv("SAL_ACCESSIBILITY_ENABLED");
2366 return pEnv
[0] != '0';
2368 ImplSVData
* pSVData
= ImplGetSVData();
2369 return pSVData
->mxAccessBridge
.is();
2372 void MiscSettings::SetEnableLocalizedDecimalSep( bool bEnable
)
2374 // copy if other references exist
2375 if (mxData
.use_count() > 1)
2377 mxData
= std::make_shared
<ImplMiscData
>(*mxData
);
2379 mxData
->mbEnableLocalizedDecimalSep
= bEnable
;
2382 bool MiscSettings::GetEnableLocalizedDecimalSep() const
2384 return mxData
->mbEnableLocalizedDecimalSep
;
2387 int MiscSettings::GetDarkMode()
2389 return officecfg::Office::Common::Misc::Appearance::get();
2392 void MiscSettings::SetDarkMode(int nMode
)
2394 std::shared_ptr
<comphelper::ConfigurationChanges
> batch(comphelper::ConfigurationChanges::create());
2395 officecfg::Office::Common::Misc::Appearance::set(nMode
, batch
);
2398 vcl::Window
*pWin
= Application::GetFirstTopLevelWindow();
2401 pWin
->ImplGetFrame()->UpdateDarkMode();
2402 pWin
= Application::GetNextTopLevelWindow(pWin
);
2406 bool MiscSettings::GetUseDarkMode()
2408 vcl::Window
* pDefWindow
= ImplGetDefaultWindow();
2409 if (pDefWindow
== nullptr)
2411 return pDefWindow
->ImplGetFrame()->GetUseDarkMode();
2414 int MiscSettings::GetAppColorMode()
2416 if (comphelper::IsFuzzing())
2418 return officecfg::Office::Common::Misc::ApplicationAppearance::get();
2421 void MiscSettings::SetAppColorMode(int nMode
)
2423 std::shared_ptr
<comphelper::ConfigurationChanges
> batch(comphelper::ConfigurationChanges::create());
2424 officecfg::Office::Common::Misc::ApplicationAppearance::set(nMode
, batch
);
2428 bool MiscSettings::GetUseReducedAnimation()
2430 vcl::Window
* pDefWindow
= ImplGetDefaultWindow();
2431 if (pDefWindow
== nullptr)
2433 return pDefWindow
->ImplGetFrame()->GetUseReducedAnimation();
2436 // tdf#115688: Let the user choose in the accessibility option page ("Tools" --> "Options" --> "Accessibility --> "Allow other animations") if the "marching ants" animation is allowed.
2437 // tdf#161765: Let the user choose which animation settings to use: OS's / LO's
2438 // New options: "System"/"No"/"Yes".
2439 // Do respect OS's animation setting if the user has selected the option "System"
2440 bool MiscSettings::IsAnimatedOthersAllowed()
2442 sal_Int16 nAllowAnimatedOthers
= officecfg::Office::Common::Accessibility::AllowAnimatedOthers::get();
2443 bool bIsAllowed
= false; // false is the default value, if someone sets the enum to other values than the allowed ones.
2444 switch (nAllowAnimatedOthers
)
2446 case 0: // "System": Use OS's setting
2447 bIsAllowed
= ! MiscSettings::GetUseReducedAnimation();
2449 case 1: // "No": Disallow animation
2452 case 2: // "Yes": Allow animation
2456 SAL_WARN( "accessibility", "Invalid value of AllowAnimatedOthers: 0x" << std::hex
<< nAllowAnimatedOthers
<< std::dec
);
2462 // tdf#161765: Let the user choose which animation settings to use: OS's / LO's
2463 // New options: "System"/"No"/"Yes".
2464 // Do respect OS's animation setting if the user has selected the option "System"
2465 bool MiscSettings::IsAnimatedGraphicAllowed()
2467 sal_Int16 nAllowAnimatedGraphic
= officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::get();
2468 bool bIsAllowed
= false; // false is the default value, if someone sets the enum to other values than the allowed ones.
2469 switch (nAllowAnimatedGraphic
)
2471 case 0: // "System": Use OS's setting
2472 bIsAllowed
= ! MiscSettings::GetUseReducedAnimation();
2474 case 1: // "No": Disallow animation
2477 case 2: // "Yes": Allow animation
2481 SAL_WARN( "accessibility", "Invalid value of officecfg::Office::Common::Accessibility::AllowAnimatedGraphic: 0x" << std::hex
<< nAllowAnimatedGraphic
<< std::dec
);
2487 // tdf#161765: Let the user choose which animation settings to use: OS's / LO's
2488 // New options: "System"/"No"/"Yes".
2489 // Do respect OS's animation setting if the user has selected the option "System"
2490 bool MiscSettings::IsAnimatedTextAllowed()
2492 sal_Int16 nAllowAnimatedText
= officecfg::Office::Common::Accessibility::AllowAnimatedText::get();
2493 bool bIsAllowed
= false; // false is the default value, if someone sets the enum to other values than the allowed ones.
2494 switch (nAllowAnimatedText
)
2496 case 0: // "System": Use OS's setting
2497 bIsAllowed
= ! MiscSettings::GetUseReducedAnimation();
2499 case 1: // "No": Disallow animation
2502 case 2: // "Yes": Allow animation
2506 SAL_WARN( "accessibility", "Invalid value of officecfg::Office::Common::Accessibility::AllowAnimatedText: 0x" << std::hex
<< nAllowAnimatedText
<< std::dec
);
2512 HelpSettings::HelpSettings()
2513 : mxData(std::make_shared
<ImplHelpData
>())
2517 bool HelpSettings::operator ==( const HelpSettings
& rSet
) const
2519 if ( mxData
== rSet
.mxData
)
2522 return (mxData
->mnTipTimeout
== rSet
.mxData
->mnTipTimeout
);
2526 HelpSettings::GetTipDelay()
2532 HelpSettings::SetTipTimeout( sal_Int32 nTipTimeout
)
2534 // copy if other references exist
2535 if (mxData
.use_count() > 1)
2537 mxData
= std::make_shared
<ImplHelpData
>(*mxData
);
2539 mxData
->mnTipTimeout
= nTipTimeout
;
2543 HelpSettings::GetTipTimeout() const
2545 return mxData
->mnTipTimeout
;
2549 HelpSettings::GetBalloonDelay()
2555 HelpSettings::operator !=( const HelpSettings
& rSet
) const
2557 return !(*this == rSet
);
2560 ImplAllSettingsData::ImplAllSettingsData()
2562 maLocale( maSysLocale
.GetLanguageTag() ),
2563 maUILocale( maSysLocale
.GetUILanguageTag() )
2565 if (!comphelper::IsFuzzing())
2566 maMiscSettings
.SetEnableLocalizedDecimalSep( maSysLocale
.GetOptions().IsDecimalSeparatorAsLocale() );
2569 ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData
& rData
) :
2570 maMouseSettings( rData
.maMouseSettings
),
2571 maStyleSettings( rData
.maStyleSettings
),
2572 maMiscSettings( rData
.maMiscSettings
),
2573 maHelpSettings( rData
.maHelpSettings
),
2574 maLocale( rData
.maLocale
),
2575 maUILocale( rData
.maUILocale
)
2577 // Create the cache objects new when their getter is called.
2580 ImplAllSettingsData::~ImplAllSettingsData()
2582 mpLocaleDataWrapper
.reset();
2583 mpUILocaleDataWrapper
.reset();
2584 mpNeutralLocaleDataWrapper
.reset();
2585 mpI18nHelper
.reset();
2586 mpUII18nHelper
.reset();
2589 AllSettings::AllSettings() = default;
2590 AllSettings::AllSettings(const AllSettings
&) = default;
2591 AllSettings::~AllSettings() = default;
2592 AllSettings
& AllSettings::operator=(const AllSettings
&) = default;
2594 AllSettingsFlags
AllSettings::Update( AllSettingsFlags nFlags
, const AllSettings
& rSet
)
2596 const auto* constData
= std::as_const(mxData
).get();
2597 AllSettingsFlags nChangeFlags
= AllSettingsFlags::NONE
;
2599 if ( nFlags
& AllSettingsFlags::MOUSE
)
2601 if (constData
->maMouseSettings
!= rSet
.mxData
->maMouseSettings
)
2603 mxData
->maMouseSettings
= rSet
.mxData
->maMouseSettings
;
2604 nChangeFlags
|= AllSettingsFlags::MOUSE
;
2608 if ( nFlags
& AllSettingsFlags::STYLE
)
2610 if (constData
->maStyleSettings
!= rSet
.mxData
->maStyleSettings
)
2612 mxData
->maStyleSettings
= rSet
.mxData
->maStyleSettings
;
2613 nChangeFlags
|= AllSettingsFlags::STYLE
;
2617 if ( nFlags
& AllSettingsFlags::MISC
)
2619 if (constData
->maMiscSettings
!= rSet
.mxData
->maMiscSettings
)
2621 mxData
->maMiscSettings
= rSet
.mxData
->maMiscSettings
;
2622 nChangeFlags
|= AllSettingsFlags::MISC
;
2626 if ( nFlags
& AllSettingsFlags::LOCALE
)
2628 if (constData
->maLocale
!= rSet
.mxData
->maLocale
)
2630 SetLanguageTag( rSet
.mxData
->maLocale
);
2631 nChangeFlags
|= AllSettingsFlags::LOCALE
;
2635 return nChangeFlags
;
2638 AllSettingsFlags
AllSettings::GetChangeFlags( const AllSettings
& rSet
) const
2641 AllSettingsFlags nChangeFlags
= AllSettingsFlags::NONE
;
2643 if ( mxData
->maStyleSettings
!= rSet
.mxData
->maStyleSettings
)
2644 nChangeFlags
|= AllSettingsFlags::STYLE
;
2646 if ( mxData
->maMiscSettings
!= rSet
.mxData
->maMiscSettings
)
2647 nChangeFlags
|= AllSettingsFlags::MISC
;
2649 if ( mxData
->maLocale
!= rSet
.mxData
->maLocale
)
2650 nChangeFlags
|= AllSettingsFlags::LOCALE
;
2652 return nChangeFlags
;
2655 // Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration
2656 bool AllSettings::operator ==( const AllSettings
& rSet
) const
2658 return mxData
== rSet
.mxData
;
2661 bool ImplAllSettingsData::operator==(const ImplAllSettingsData
& rSet
) const
2663 return (maMouseSettings
== rSet
.maMouseSettings
) &&
2664 (maStyleSettings
== rSet
.maStyleSettings
) &&
2665 (maMiscSettings
== rSet
.maMiscSettings
) &&
2666 (maHelpSettings
== rSet
.maHelpSettings
) &&
2667 (maLocale
== rSet
.maLocale
);
2670 void AllSettings::SetLanguageTag(const OUString
& rLanguage
, bool bCanonicalize
)
2672 SetLanguageTag(LanguageTag(rLanguage
, bCanonicalize
));
2675 void AllSettings::SetLanguageTag( const LanguageTag
& rLanguageTag
)
2677 if (std::as_const(mxData
)->maLocale
== rLanguageTag
)
2680 auto* myData
= mxData
.get();
2683 = rLanguageTag
.isSystemLocale() ? GetSysLocale().GetLanguageTag() : rLanguageTag
;
2685 if ( myData
->mpLocaleDataWrapper
)
2687 myData
->mpLocaleDataWrapper
.reset();
2689 if ( myData
->mpI18nHelper
)
2691 myData
->mpI18nHelper
.reset();
2697 bool GetConfigLayoutRTL(bool bMath
)
2699 static const char* pEnv
= getenv("SAL_RTL_ENABLED" );
2700 static int nUIMirroring
= -1; // -1: undef, 0: auto, 1: on 2: off
2702 // environment always overrides
2708 if( nUIMirroring
== -1 )
2710 nUIMirroring
= 0; // ask configuration only once
2711 utl::OConfigurationNode aNode
= utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
2712 comphelper::getProcessComponentContext(),
2713 u
"org.openoffice.Office.Common/I18N/CTL"_ustr
); // note: case sensitive !
2714 if ( aNode
.isValid() )
2717 css::uno::Any aValue
= aNode
.getNodeValue( u
"UIMirroring"_ustr
);
2718 if( aValue
>>= bTmp
)
2720 // found true or false; if it was nil, nothing is changed
2721 nUIMirroring
= bTmp
? 1 : 2;
2726 if( nUIMirroring
== 0 ) // no config found (eg, setup) or default (nil) was set: check language
2728 LanguageType aLang
= SvtSysLocaleOptions().GetRealUILanguageTag().getLanguageType();
2730 bRTL
= MsLangId::isRightToLeftMath( aLang
);
2732 bRTL
= MsLangId::isRightToLeft( aLang
);
2735 bRTL
= (nUIMirroring
== 1);
2741 bool AllSettings::GetLayoutRTL()
2743 if (comphelper::IsFuzzing())
2745 return GetConfigLayoutRTL(false);
2748 bool AllSettings::GetMathLayoutRTL()
2750 if (comphelper::IsFuzzing())
2752 return GetConfigLayoutRTL(true);
2755 const LanguageTag
& AllSettings::GetLanguageTag() const
2757 if (comphelper::IsFuzzing())
2759 static LanguageTag
aRet(u
"en-US"_ustr
);
2763 if (comphelper::LibreOfficeKit::isActive())
2764 return comphelper::LibreOfficeKit::getLanguageTag();
2766 assert(!mxData
->maLocale
.isSystemLocale());
2768 return mxData
->maLocale
;
2771 const LanguageTag
& AllSettings::GetUILanguageTag() const
2773 if (comphelper::IsFuzzing())
2775 static LanguageTag
aRet(u
"en-US"_ustr
);
2779 if (comphelper::LibreOfficeKit::isActive())
2780 return comphelper::LibreOfficeKit::getLanguageTag();
2782 assert(!mxData
->maUILocale
.isSystemLocale());
2784 return mxData
->maUILocale
;
2787 const LocaleDataWrapper
& AllSettings::GetLocaleDataWrapper() const
2789 if ( !mxData
->mpLocaleDataWrapper
)
2790 mxData
->mpLocaleDataWrapper
.reset( new LocaleDataWrapper(
2791 comphelper::getProcessComponentContext(), GetLanguageTag() ) );
2792 return *mxData
->mpLocaleDataWrapper
;
2795 const LocaleDataWrapper
& AllSettings::GetUILocaleDataWrapper() const
2797 if ( !mxData
->mpUILocaleDataWrapper
)
2798 mxData
->mpUILocaleDataWrapper
.reset( new LocaleDataWrapper(
2799 comphelper::getProcessComponentContext(), GetUILanguageTag() ) );
2800 return *mxData
->mpUILocaleDataWrapper
;
2803 const LocaleDataWrapper
& AllSettings::GetNeutralLocaleDataWrapper() const
2805 if ( !mxData
->mpNeutralLocaleDataWrapper
)
2806 mxData
->mpNeutralLocaleDataWrapper
.reset( new LocaleDataWrapper(
2807 comphelper::getProcessComponentContext(), LanguageTag(u
"en-US"_ustr
) ) );
2808 return *mxData
->mpNeutralLocaleDataWrapper
;
2811 const vcl::I18nHelper
& AllSettings::GetLocaleI18nHelper() const
2813 if ( !mxData
->mpI18nHelper
) {
2814 mxData
->mpI18nHelper
.reset( new vcl::I18nHelper(
2815 comphelper::getProcessComponentContext(), GetLanguageTag() ) );
2817 return *mxData
->mpI18nHelper
;
2820 const vcl::I18nHelper
& AllSettings::GetUILocaleI18nHelper() const
2822 if ( !mxData
->mpUII18nHelper
) {
2823 mxData
->mpUII18nHelper
.reset( new vcl::I18nHelper(
2824 comphelper::getProcessComponentContext(), GetUILanguageTag() ) );
2826 return *mxData
->mpUII18nHelper
;
2829 void AllSettings::LocaleSettingsChanged( ConfigurationHints nHint
)
2831 AllSettings
aAllSettings( Application::GetSettings() );
2832 if ( nHint
& ConfigurationHints::DecSep
)
2834 MiscSettings aMiscSettings
= aAllSettings
.GetMiscSettings();
2835 bool bIsDecSepAsLocale
= aAllSettings
.GetSysLocale().GetOptions().IsDecimalSeparatorAsLocale();
2836 if ( aMiscSettings
.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale
)
2838 aMiscSettings
.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale
);
2839 aAllSettings
.SetMiscSettings( aMiscSettings
);
2843 if ( nHint
& ConfigurationHints::Locale
)
2844 aAllSettings
.SetLanguageTag(aAllSettings
.GetSysLocale().GetOptions().GetLanguageTag());
2846 Application::SetSettings( aAllSettings
);
2849 const StyleSettings
&
2850 AllSettings::GetStyleSettings() const
2852 return mxData
->maStyleSettings
;
2855 StyleSettingsOptions
2856 StyleSettings::GetOptions() const
2858 return mxData
->mnOptions
;
2861 std::vector
<vcl::IconThemeInfo
> const &
2862 StyleSettings::GetInstalledIconThemes() const
2864 if (!mxData
->mIconThemeScanner
) {
2865 mxData
->mIconThemeScanner
.emplace(vcl::IconThemeScanner::GetStandardIconThemePath());
2867 return mxData
->mIconThemeScanner
->GetFoundIconThemes();
2871 StyleSettings::GetAutomaticallyChosenIconTheme() const
2873 return mxData
->mIconThemeSelector
.SelectIconThemeForDesktopEnvironment(
2874 GetInstalledIconThemes(),
2875 Application::GetDesktopEnvironment());
2879 StyleSettings::SetIconTheme(const OUString
& theme
)
2881 mxData
->mIconTheme
= theme
;
2885 StyleSettings::DetermineIconTheme() const
2887 OUString
sTheme(mxData
->mIconTheme
);
2888 if (sTheme
.isEmpty())
2890 if (comphelper::IsFuzzing())
2894 // read from the configuration, or fallback to what the desktop wants
2895 sTheme
= officecfg::Office::Common::Misc::SymbolStyle::get();
2897 if (sTheme
.isEmpty() || sTheme
== "auto")
2898 sTheme
= GetAutomaticallyChosenIconTheme();
2902 return mxData
->mIconThemeSelector
.SelectIconTheme(
2903 GetInstalledIconThemes(),
2908 StyleSettings::SetHighContrastMode(bool bHighContrast
)
2910 if (std::as_const(mxData
)->mbHighContrast
== bHighContrast
) {
2914 auto* myData
= mxData
.get();
2915 myData
->mbHighContrast
= bHighContrast
;
2916 myData
->mIconThemeSelector
.SetUseHighContrastTheme(bHighContrast
);
2920 StyleSettings::GetHighContrastMode() const
2922 return mxData
->mbHighContrast
;
2926 StyleSettings::SetPreferredIconTheme(const OUString
& theme
, bool bDarkIconTheme
)
2928 auto* myData
= mxData
.get();
2929 const bool bChanged
= myData
->mIconThemeSelector
.SetPreferredIconTheme(theme
, bDarkIconTheme
);
2932 // clear this so it is recalculated if it was selected as the automatic theme
2933 myData
->mIconTheme
.clear();
2938 AllSettings::SetMouseSettings( const MouseSettings
& rSet
)
2940 mxData
->maMouseSettings
= rSet
;
2943 const MouseSettings
&
2944 AllSettings::GetMouseSettings() const
2946 return mxData
->maMouseSettings
;
2950 AllSettings::SetStyleSettings( const StyleSettings
& rSet
)
2952 mxData
->maStyleSettings
= rSet
;
2956 AllSettings::SetMiscSettings( const MiscSettings
& rSet
)
2958 mxData
->maMiscSettings
= rSet
;
2962 AllSettings::GetMiscSettings() const
2964 return mxData
->maMiscSettings
;
2968 AllSettings::SetHelpSettings( const HelpSettings
& rSet
)
2970 mxData
->maHelpSettings
= rSet
;
2974 AllSettings::GetHelpSettings() const
2976 return mxData
->maHelpSettings
;
2980 AllSettings::GetSysLocale() const
2982 return mxData
->maSysLocale
;
2986 void StyleSettings::BatchSetBackgrounds( const Color
&aBackColor
,
2987 bool bCheckedColorSpecialCase
)
2989 Set3DColors( aBackColor
);
2990 SetFaceColor( aBackColor
);
2991 SetDialogColor( aBackColor
);
2992 SetWorkspaceColor( aBackColor
);
2994 if (bCheckedColorSpecialCase
)
2995 SetCheckedColorSpecialCase();
2998 void StyleSettings::BatchSetFonts( const vcl::Font
& aAppFont
,
2999 const vcl::Font
& aLabelFont
)
3001 SetAppFont( aAppFont
);
3002 SetPushButtonFont( aAppFont
);
3003 SetToolFont( aAppFont
);
3004 SetHelpFont( aAppFont
);
3006 SetMenuFont( aLabelFont
);
3007 SetTabFont( aLabelFont
);
3008 SetLabelFont( aLabelFont
);
3009 SetRadioCheckFont( aLabelFont
);
3010 SetFieldFont( aLabelFont
);
3011 SetGroupFont( aLabelFont
);
3012 SetIconFont( aLabelFont
);
3015 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */