LibreOffice Module vcl (master)  1
app/settings.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 <config_folders.h>
21 
22 #include <officecfg/Office/Common.hxx>
23 
24 #ifdef _WIN32
25 #include <win/svsys.h>
26 #endif
27 
29 #include <rtl/bootstrap.hxx>
30 
31 #include <i18nlangtag/mslangid.hxx>
33 
34 #include <comphelper/lok.hxx>
35 
36 #include <vcl/graphicfilter.hxx>
37 #include <vcl/IconThemeScanner.hxx>
39 #include <vcl/IconThemeInfo.hxx>
40 #include <vcl/svapp.hxx>
41 #include <vcl/event.hxx>
42 #include <vcl/settings.hxx>
43 #include <vcl/i18nhelp.hxx>
44 #include <vcl/configsettings.hxx>
45 #include <vcl/outdev.hxx>
46 
47 #include <unotools/fontcfg.hxx>
49 #include <unotools/confignode.hxx>
50 #include <unotools/configmgr.hxx>
51 #include <unotools/syslocale.hxx>
53 
54 using namespace ::com::sun::star;
55 
56 #include <svdata.hxx>
57 
59 {
61  sal_uInt64 mnDoubleClkTime = 500;
62  long mnDoubleClkWidth = 2;
64  long mnStartDragWidth = 2 ;
71 };
72 
74 {
75  ImplStyleData();
77 
78  void SetStandardStyles();
79 
155  sal_uInt64 mnCursorBlinkTime;
174  std::shared_ptr<vcl::IconThemeScanner>
176  std::shared_ptr<vcl::IconThemeSelector>
178 
179  OUString mIconTheme;
184  //mbPrimaryButtonWarpsSlider == true for "jump to here" behavior for primary button, otherwise
185  //primary means scroll by single page. Secondary button takes the alternative behaviour
188 
189  sal_uInt16 mnEdgeBlending;
197 
199 
202  o3tl::optional<Color> maPersonaMenuBarTextColor;
203 };
204 
206 {
207  ImplMiscData();
211 };
212 
214 {
216 };
217 
219 {
223 
230  std::unique_ptr<LocaleDataWrapper> mpLocaleDataWrapper;
231  std::unique_ptr<LocaleDataWrapper> mpUILocaleDataWrapper;
232  std::unique_ptr<vcl::I18nHelper> mpI18nHelper;
233  std::unique_ptr<vcl::I18nHelper> mpUII18nHelper;
235 };
236 
237 void
239 {
240  CopyData();
241  mxData->mnOptions = nOptions;
242 }
243 
246 {
247  return mxData->mnOptions;
248 }
249 
250 void
251 MouseSettings::SetDoubleClickTime( sal_uInt64 nDoubleClkTime )
252 {
253  CopyData();
254  mxData->mnDoubleClkTime = nDoubleClkTime;
255 }
256 
257 sal_uInt64
259 {
260  return mxData->mnDoubleClkTime;
261 }
262 
263 void
264 MouseSettings::SetDoubleClickWidth( long nDoubleClkWidth )
265 {
266  CopyData();
267  mxData->mnDoubleClkWidth = nDoubleClkWidth;
268 }
269 
270 long
272 {
273  return mxData->mnDoubleClkWidth;
274 }
275 
276 void
277 MouseSettings::SetDoubleClickHeight( long nDoubleClkHeight )
278 {
279  CopyData();
280  mxData->mnDoubleClkHeight = nDoubleClkHeight;
281 }
282 
283 long
285 {
286  return mxData->mnDoubleClkHeight;
287 }
288 
289 void
291 {
292  CopyData();
293  mxData->mnStartDragWidth = nDragWidth;
294 }
295 
296 long
298 {
299  return mxData->mnStartDragWidth;
300 }
301 
302 void
304 {
305  CopyData();
306  mxData->mnStartDragHeight = nDragHeight;
307 }
308 
309 long
311 {
312  return mxData->mnStartDragHeight;
313 }
314 
315 sal_uInt16
317 {
318  return MOUSE_LEFT;
319 }
320 
321 sal_uInt16
323 {
324  return MOUSE_RIGHT;
325 }
326 
327 sal_uInt16
329 {
330  return 1;
331 }
332 
333 sal_uLong
335 {
336  return 100;
337 }
338 
339 sal_uLong
341 {
342  return 370;
343 }
344 
345 void
347 {
348  CopyData();
349  mxData->mnButtonRepeat = nRepeat;
350 }
351 
352 sal_uLong
354 {
355  return mxData->mnButtonRepeat;
356 }
357 
358 sal_uLong
360 {
361  return 250;
362 }
363 
364 void
366 {
367  CopyData();
368  mxData->mnMenuDelay = nDelay;
369 }
370 
371 sal_uLong
373 {
374  return mxData->mnMenuDelay;
375 }
376 
377 void
379 {
380  CopyData();
381  mxData->mnFollow = nFollow;
382 }
383 
386 {
387  return mxData->mnFollow;
388 }
389 
390 void
392 {
393  CopyData();
394  mxData->mnMiddleButtonAction = nAction;
395 }
396 
399 {
400  return mxData->mnMiddleButtonAction;
401 }
402 
403 void
405 {
406  CopyData();
407  mxData->mnWheelBehavior = nBehavior;
408 }
409 
412 {
413  return mxData->mnWheelBehavior;
414 }
415 
416 bool
418 {
419  return !(*this == rSet);
420 }
421 
423  : mxData(std::make_shared<ImplMouseData>())
424 {
425 }
426 
428 {
429  // copy if other references exist
430  if (mxData.use_count() > 1)
431  {
432  mxData = std::make_shared<ImplMouseData>(*mxData);
433  }
434 }
435 
436 bool MouseSettings::operator ==( const MouseSettings& rSet ) const
437 {
438  if ( mxData == rSet.mxData )
439  return true;
440 
441  return
442  (mxData->mnOptions == rSet.mxData->mnOptions) &&
443  (mxData->mnDoubleClkTime == rSet.mxData->mnDoubleClkTime) &&
444  (mxData->mnDoubleClkWidth == rSet.mxData->mnDoubleClkWidth) &&
445  (mxData->mnDoubleClkHeight == rSet.mxData->mnDoubleClkHeight) &&
446  (mxData->mnStartDragWidth == rSet.mxData->mnStartDragWidth) &&
447  (mxData->mnStartDragHeight == rSet.mxData->mnStartDragHeight) &&
448  (mxData->mnMiddleButtonAction == rSet.mxData->mnMiddleButtonAction) &&
449  (mxData->mnButtonRepeat == rSet.mxData->mnButtonRepeat) &&
450  (mxData->mnMenuDelay == rSet.mxData->mnMenuDelay) &&
451  (mxData->mnFollow == rSet.mxData->mnFollow) &&
452  (mxData->mnWheelBehavior == rSet.mxData->mnWheelBehavior );
453 }
454 
456  mnScrollBarSize(16),
457  mnSpinSize(16),
458  mnCursorSize(2),
459  mnAntialiasedMin(0),
460  mnCursorBlinkTime(STYLE_CURSOR_NOBLINKTIME),
461  mnDragFullOptions(DragFullOptions::All),
462  mnSelectionOptions(SelectionOptions::NONE),
463  mnDisplayOptions(DisplayOptions::NONE),
464  mnToolbarIconSize(ToolbarIconSize::Unknown),
465  mnOptions(StyleSettingsOptions::NONE),
466  mbAutoMnemonic(true),
467  meUseImagesInMenus(TRISTATE_INDET),
468  mnMinThumbSize(16),
469  mIconThemeSelector(new vcl::IconThemeSelector()),
470  meContextMenuShortcuts(TRISTATE_INDET),
471  mnEdgeBlending(35),
472  maEdgeBlendingTopLeftColor(Color(0xC0, 0xC0, 0xC0)),
473  maEdgeBlendingBottomRightColor(Color(0x40, 0x40, 0x40)),
474  mnListBoxMaximumLineCount(25),
475  // For some reason this isn't actually the column count that gets used, at least on iOS, but
476  // instead what SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() in
477  // svtools/source/config/accessibilityoptions.cxx returns.
478  mnColorValueSetColumnCount(12),
479 #ifdef IOS
480  maListBoxPreviewDefaultLogicSize(Size(30, 30)),
481 #else
482  maListBoxPreviewDefaultLogicSize(Size(15, 7)),
483 #endif
484  maListBoxPreviewDefaultPixelSize(Size(0, 0)), // on-demand calculated in GetListBoxPreviewDefaultPixelSize(),
485  mbPreviewUsesCheckeredBackground(true)
486 {
488 }
489 
491  maActiveBorderColor( rData.maActiveBorderColor ),
492  maActiveColor( rData.maActiveColor ),
493  maActiveTextColor( rData.maActiveTextColor ),
494  maAlternatingRowColor( rData.maAlternatingRowColor ),
495  maButtonTextColor( rData.maButtonTextColor ),
496  maDefaultActionButtonTextColor( rData.maDefaultActionButtonTextColor ),
497  maActionButtonTextColor( rData.maActionButtonTextColor ),
498  maActionButtonRolloverTextColor( rData.maActionButtonRolloverTextColor ),
499  maButtonRolloverTextColor( rData.maButtonRolloverTextColor ),
500  maButtonPressedRolloverTextColor( rData.maButtonPressedRolloverTextColor ),
501  maCheckedColor( rData.maCheckedColor ),
502  maDarkShadowColor( rData.maDarkShadowColor ),
503  maDeactiveBorderColor( rData.maDeactiveBorderColor ),
504  maDeactiveColor( rData.maDeactiveColor ),
505  maDeactiveTextColor( rData.maDeactiveTextColor ),
506  maDialogColor( rData.maDialogColor ),
507  maDialogTextColor( rData.maDialogTextColor ),
508  maDisableColor( rData.maDisableColor ),
509  maFaceColor( rData.maFaceColor ),
510  maFieldColor( rData.maFieldColor ),
511  maFieldTextColor( rData.maFieldTextColor ),
512  maFieldRolloverTextColor( rData.maFieldRolloverTextColor ),
513  maFontColor( rData.maFontColor ),
514  maGroupTextColor( rData.maGroupTextColor ),
515  maHelpColor( rData.maHelpColor ),
516  maHelpTextColor( rData.maHelpTextColor ),
517  maHighlightColor( rData.maHighlightColor ),
518  maHighlightLinkColor( rData.maHighlightLinkColor ),
519  maHighlightTextColor( rData.maHighlightTextColor ),
520  maLabelTextColor( rData.maLabelTextColor ),
521  maLightBorderColor( rData.maLightBorderColor ),
522  maLightColor( rData.maLightColor ),
523  maLinkColor( rData.maLinkColor ),
524  maMenuBarColor( rData.maMenuBarColor ),
525  maMenuBarRolloverColor( rData.maMenuBarRolloverColor ),
526  maMenuBorderColor( rData.maMenuBorderColor ),
527  maMenuColor( rData.maMenuColor ),
528  maMenuHighlightColor( rData.maMenuHighlightColor ),
529  maMenuHighlightTextColor( rData.maMenuHighlightTextColor ),
530  maMenuTextColor( rData.maMenuTextColor ),
531  maMenuBarTextColor( rData.maMenuBarTextColor ),
532  maMenuBarRolloverTextColor( rData.maMenuBarRolloverTextColor ),
533  maMenuBarHighlightTextColor( rData.maMenuBarHighlightTextColor ),
534  maMonoColor( rData.maMonoColor ),
535  maRadioCheckTextColor( rData.maRadioCheckTextColor ),
536  maShadowColor( rData.maShadowColor ),
537  maVisitedLinkColor( rData.maVisitedLinkColor ),
538  maToolTextColor( rData.maToolTextColor ),
539  maWindowColor( rData.maWindowColor ),
540  maWindowTextColor( rData.maWindowTextColor ),
541  maWorkspaceColor( rData.maWorkspaceColor ),
542  maActiveTabColor( rData.maActiveTabColor ),
543  maInactiveTabColor( rData.maInactiveTabColor ),
544  maTabTextColor( rData.maTabTextColor ),
545  maTabRolloverTextColor( rData.maTabRolloverTextColor ),
546  maTabHighlightTextColor( rData.maTabHighlightTextColor ),
547  maAppFont( rData.maAppFont ),
548  maHelpFont( rData.maAppFont ),
549  maTitleFont( rData.maTitleFont ),
550  maFloatTitleFont( rData.maFloatTitleFont ),
551  maMenuFont( rData.maMenuFont ),
552  maToolFont( rData.maToolFont ),
553  maLabelFont( rData.maLabelFont ),
554  maRadioCheckFont( rData.maRadioCheckFont ),
555  maPushButtonFont( rData.maPushButtonFont ),
556  maFieldFont( rData.maFieldFont ),
557  maIconFont( rData.maIconFont ),
558  maTabFont( rData.maTabFont ),
559  maGroupFont( rData.maGroupFont ),
560  mnTitleHeight(rData.mnTitleHeight),
561  mnFloatTitleHeight(rData.mnFloatTitleHeight),
562  mnScrollBarSize(rData.mnScrollBarSize),
563  mnSpinSize(rData.mnSpinSize),
564  mnCursorSize(rData.mnCursorSize),
565  mnAntialiasedMin(rData.mnAntialiasedMin),
566  mnCursorBlinkTime(rData.mnCursorBlinkTime),
567  mnDragFullOptions(rData.mnDragFullOptions),
568  mnSelectionOptions(rData.mnSelectionOptions),
569  mnDisplayOptions(rData.mnDisplayOptions),
570  mnToolbarIconSize(rData.mnToolbarIconSize),
571  mnUseFlatMenus(rData.mnUseFlatMenus),
572  mnOptions(rData.mnOptions),
573  mbHighContrast(rData.mbHighContrast),
574  mbUseSystemUIFonts(rData.mbUseSystemUIFonts),
575  mbUseFontAAFromSystem(rData.mbUseFontAAFromSystem),
576  mbAutoMnemonic(rData.mbAutoMnemonic),
577  meUseImagesInMenus(rData.meUseImagesInMenus),
578  mnUseFlatBorders(rData.mnUseFlatBorders),
579  mbPreferredUseImagesInMenus(rData.mbPreferredUseImagesInMenus),
580  mnMinThumbSize(rData.mnMinThumbSize),
581  mIconThemeScanner(rData.mIconThemeScanner?new vcl::IconThemeScanner(*rData.mIconThemeScanner):nullptr),
582  mIconThemeSelector(new vcl::IconThemeSelector(*rData.mIconThemeSelector)),
583  mIconTheme(rData.mIconTheme),
584  mbSkipDisabledInMenus(rData.mbSkipDisabledInMenus),
585  mbHideDisabledMenuItems(rData.mbHideDisabledMenuItems),
586  mbPreferredContextMenuShortcuts(rData.mbPreferredContextMenuShortcuts),
587  meContextMenuShortcuts(rData.meContextMenuShortcuts),
588  mbPrimaryButtonWarpsSlider(rData.mbPrimaryButtonWarpsSlider),
589  maDialogStyle( rData.maDialogStyle ),
590  mnEdgeBlending(rData.mnEdgeBlending),
591  maEdgeBlendingTopLeftColor(rData.maEdgeBlendingTopLeftColor),
592  maEdgeBlendingBottomRightColor(rData.maEdgeBlendingBottomRightColor),
593  mnListBoxMaximumLineCount(rData.mnListBoxMaximumLineCount),
594  mnColorValueSetColumnCount(rData.mnColorValueSetColumnCount),
595  maListBoxPreviewDefaultLogicSize(rData.maListBoxPreviewDefaultLogicSize),
596  maListBoxPreviewDefaultPixelSize(rData.maListBoxPreviewDefaultPixelSize),
597  mbPreviewUsesCheckeredBackground(rData.mbPreviewUsesCheckeredBackground),
598  maPersonaHeaderFooter( rData.maPersonaHeaderFooter ),
599  maPersonaHeaderBitmap( rData.maPersonaHeaderBitmap ),
600  maPersonaFooterBitmap( rData.maPersonaFooterBitmap ),
601  maPersonaMenuBarTextColor( rData.maPersonaMenuBarTextColor )
602 {
603 }
604 
606 {
607  vcl::Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) );
608  aStdFont.SetCharSet( osl_getThreadTextEncoding() );
609  aStdFont.SetWeight( WEIGHT_NORMAL );
611  aStdFont.SetFamilyName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag("en")));
612  else
613  aStdFont.SetFamilyName("Liberation Sans");
614  maAppFont = aStdFont;
615  maHelpFont = aStdFont;
616  maMenuFont = aStdFont;
617  maToolFont = aStdFont;
618  maGroupFont = aStdFont;
619  maLabelFont = aStdFont;
620  maRadioCheckFont = aStdFont;
621  maPushButtonFont = aStdFont;
622  maFieldFont = aStdFont;
623  maIconFont = aStdFont;
624  maTabFont = aStdFont;
625  aStdFont.SetWeight( WEIGHT_BOLD );
626  maFloatTitleFont = aStdFont;
627  maTitleFont = aStdFont;
628 
630  maCheckedColor = Color( 0xCC, 0xCC, 0xCC );
648  maWorkspaceColor = Color( 0xDF, 0xDF, 0xDE );
677  maHelpColor = Color( 0xFF, 0xFF, 0xE0 );
680  maVisitedLinkColor = Color( 0x00, 0x00, 0xCC );
684  maAlternatingRowColor = Color( 0xEE, 0xEE, 0xEE );
685 
686  mnTitleHeight = 18;
687  mnFloatTitleHeight = 13;
688  mbHighContrast = false;
689  mbUseSystemUIFonts = true;
690  mbUseFontAAFromSystem = true;
691  mnUseFlatBorders = false;
692  mnUseFlatMenus = false;
694  mbSkipDisabledInMenus = false;
695  mbHideDisabledMenuItems = false;
698 }
699 
701  : mxData(std::make_shared<ImplStyleData>())
702 {
703 }
704 
705 void
707 {
708  CopyData();
709  mxData->maFaceColor = rColor;
710 }
711 
712 const Color&
714 {
715  return mxData->maFaceColor;
716 }
717 
718 void
720 {
721  CopyData();
722  mxData->maCheckedColor = rColor;
723 }
724 
725 const Color&
727 {
728  return mxData->maCheckedColor;
729 }
730 
731 void
733 {
734  CopyData();
735  mxData->maLightColor = rColor;
736 }
737 
738 const Color&
740 {
741  return mxData->maLightColor;
742 }
743 
744 void
746 {
747  CopyData();
748  mxData->maLightBorderColor = rColor;
749 }
750 
751 const Color&
753 {
754  return mxData->maLightBorderColor;
755 }
756 
757 void
759 {
760  CopyData();
761  mxData->maShadowColor = rColor;
762 }
763 
764 const Color&
766 {
767  return mxData->maShadowColor;
768 }
769 
770 void
772 {
773  CopyData();
774  mxData->maDarkShadowColor = rColor;
775 }
776 
777 const Color&
779 {
780  return mxData->maDarkShadowColor;
781 }
782 
783 void
785 {
786  CopyData();
787  mxData->maButtonTextColor = rColor;
788 }
789 
790 const Color&
792 {
793  return mxData->maButtonTextColor;
794 }
795 
796 void
798 {
799  CopyData();
800  mxData->maDefaultActionButtonTextColor = rColor;
801 }
802 
803 const Color&
805 {
806  return mxData->maDefaultActionButtonTextColor;
807 }
808 
809 void
811 {
812  CopyData();
813  mxData->maActionButtonTextColor = rColor;
814 }
815 
816 const Color&
818 {
819  return mxData->maActionButtonTextColor;
820 }
821 
822 void
824 {
825  CopyData();
826  mxData->maActionButtonRolloverTextColor = rColor;
827 }
828 
829 const Color&
831 {
832  return mxData->maActionButtonRolloverTextColor;
833 }
834 
835 void
837 {
838  CopyData();
839  mxData->maButtonRolloverTextColor = rColor;
840 }
841 
842 const Color&
844 {
845  return mxData->maButtonRolloverTextColor;
846 }
847 
848 void
850 {
851  CopyData();
852  mxData->maButtonPressedRolloverTextColor = rColor;
853 }
854 
855 const Color&
857 {
858  return mxData->maButtonPressedRolloverTextColor;
859 }
860 
861 void
863 {
864  CopyData();
865  mxData->maRadioCheckTextColor = rColor;
866 }
867 
868 const Color&
870 {
871  return mxData->maRadioCheckTextColor;
872 }
873 
874 void
876 {
877  CopyData();
878  mxData->maGroupTextColor = rColor;
879 }
880 
881 const Color&
883 {
884  return mxData->maGroupTextColor;
885 }
886 
887 void
889 {
890  CopyData();
891  mxData->maLabelTextColor = rColor;
892 }
893 
894 const Color&
896 {
897  return mxData->maLabelTextColor;
898 }
899 
900 void
902 {
903  CopyData();
904  mxData->maWindowColor = rColor;
905 }
906 
907 const Color&
909 {
910  return mxData->maWindowColor;
911 }
912 
913 void
915 {
916  CopyData();
917  mxData->maWindowTextColor = rColor;
918 }
919 
920 const Color&
922 {
923  return mxData->maWindowTextColor;
924 }
925 
926 void
928 {
929  CopyData();
930  mxData->maDialogColor = rColor;
931 }
932 
933 const Color&
935 {
936  return mxData->maDialogColor;
937 }
938 
939 void
941 {
942  CopyData();
943  mxData->maDialogTextColor = rColor;
944 }
945 
946 const Color&
948 {
949  return mxData->maDialogTextColor;
950 }
951 
952 void
954 {
955  CopyData();
956  mxData->maWorkspaceColor = rColor;
957 }
958 
959 const Color&
961 {
962  return mxData->maWorkspaceColor;
963 }
964 
965 void
967 {
968  CopyData();
969  mxData->maFieldColor = rColor;
970 }
971 
972 const Color&
974 {
975  return mxData->maFieldColor;
976 }
977 
978 void
980 {
981  CopyData();
982  mxData->maFieldTextColor = rColor;
983 }
984 
985 const Color&
987 {
988  return mxData->maFieldTextColor;
989 }
990 
991 void
993 {
994  CopyData();
995  mxData->maFieldRolloverTextColor = rColor;
996 }
997 
998 const Color&
1000 {
1001  return mxData->maFieldRolloverTextColor;
1002 }
1003 
1004 void
1006 {
1007  CopyData();
1008  mxData->maActiveColor = rColor;
1009 }
1010 
1011 const Color&
1013 {
1014  return mxData->maActiveColor;
1015 }
1016 
1017 void
1019 {
1020  CopyData();
1021  mxData->maActiveTextColor = rColor;
1022 }
1023 
1024 const Color&
1026 {
1027  return mxData->maActiveTextColor;
1028 }
1029 
1030 void
1032 {
1033  CopyData();
1034  mxData->maActiveBorderColor = rColor;
1035 }
1036 
1037 const Color&
1039 {
1040  return mxData->maActiveBorderColor;
1041 }
1042 
1043 void
1045 {
1046  CopyData();
1047  mxData->maDeactiveColor = rColor;
1048 }
1049 
1050 const Color&
1052 {
1053  return mxData->maDeactiveColor;
1054 }
1055 
1056 void
1058 {
1059  CopyData();
1060  mxData->maDeactiveTextColor = rColor;
1061 }
1062 
1063 const Color&
1065 {
1066  return mxData->maDeactiveTextColor;
1067 }
1068 
1069 void
1071 {
1072  CopyData();
1073  mxData->maDeactiveBorderColor = rColor;
1074 }
1075 
1076 const Color&
1078 {
1079  return mxData->maDeactiveBorderColor;
1080 }
1081 
1082 void
1084 {
1085  CopyData();
1086  mxData->maHighlightColor = rColor;
1087 }
1088 
1089 const Color&
1091 {
1092  return mxData->maHighlightColor;
1093 }
1094 
1095 void
1097 {
1098  CopyData();
1099  mxData->maHighlightTextColor = rColor;
1100 }
1101 
1102 const Color&
1104 {
1105  return mxData->maHighlightTextColor;
1106 }
1107 
1108 void
1110 {
1111  CopyData();
1112  mxData->maDisableColor = rColor;
1113 }
1114 
1115 const Color&
1117 {
1118  return mxData->maDisableColor;
1119 }
1120 
1121 void
1123 {
1124  CopyData();
1125  mxData->maHelpColor = rColor;
1126 }
1127 
1128 const Color&
1130 {
1131  return mxData->maHelpColor;
1132 }
1133 
1134 void
1136 {
1137  CopyData();
1138  mxData->maHelpTextColor = rColor;
1139 }
1140 
1141 const Color&
1143 {
1144  return mxData->maHelpTextColor;
1145 }
1146 
1147 void
1149 {
1150  CopyData();
1151  mxData->maMenuColor = rColor;
1152 }
1153 
1154 const Color&
1156 {
1157  return mxData->maMenuColor;
1158 }
1159 
1160 void
1162 {
1163  CopyData();
1164  mxData->maMenuBarColor = rColor;
1165 }
1166 
1167 const Color&
1169 {
1170  return mxData->maMenuBarColor;
1171 }
1172 
1173 void
1175 {
1176  CopyData();
1177  mxData->maMenuBarRolloverColor = rColor;
1178 }
1179 
1180 const Color&
1182 {
1183  return mxData->maMenuBarRolloverColor;
1184 }
1185 
1186 void
1188 {
1189  CopyData();
1190  mxData->maMenuBorderColor = rColor;
1191 }
1192 
1193 const Color&
1195 {
1196  return mxData->maMenuBorderColor;
1197 }
1198 
1199 void
1201 {
1202  CopyData();
1203  mxData->maMenuTextColor = rColor;
1204 }
1205 
1206 const Color&
1208 {
1209  return mxData->maMenuTextColor;
1210 }
1211 
1212 void
1214 {
1215  CopyData();
1216  mxData->maMenuBarTextColor = rColor;
1217 }
1218 
1219 const Color&
1221 {
1222  return mxData->maMenuBarTextColor;
1223 }
1224 
1225 void
1227 {
1228  CopyData();
1229  mxData->maMenuBarRolloverTextColor = rColor;
1230 }
1231 
1232 const Color&
1234 {
1235  return mxData->maMenuBarRolloverTextColor;
1236 }
1237 
1238 void
1240 {
1241  CopyData();
1242  mxData->maMenuBarHighlightTextColor = rColor;
1243 }
1244 
1245 const Color&
1247 {
1248  return mxData->maMenuBarHighlightTextColor;
1249 }
1250 
1251 void
1253 {
1254  CopyData();
1255  mxData->maMenuHighlightColor = rColor;
1256 }
1257 
1258 const Color&
1260 {
1261  return mxData->maMenuHighlightColor;
1262 }
1263 
1264 void
1266 {
1267  CopyData();
1268  mxData->maMenuHighlightTextColor = rColor;
1269 }
1270 
1271 const Color&
1273 {
1274  return mxData->maMenuHighlightTextColor;
1275 }
1276 
1277 void
1279 {
1280  CopyData();
1281  mxData->maTabTextColor = rColor;
1282 }
1283 
1284 const Color&
1286 {
1287  return mxData->maTabTextColor;
1288 }
1289 
1290 void
1292 {
1293  CopyData();
1294  mxData->maTabRolloverTextColor = rColor;
1295 }
1296 
1297 const Color&
1299 {
1300  return mxData->maTabRolloverTextColor;
1301 }
1302 
1303 void
1305 {
1306  CopyData();
1307  mxData->maTabHighlightTextColor = rColor;
1308 }
1309 
1310 const Color&
1312 {
1313  return mxData->maTabHighlightTextColor;
1314 }
1315 
1316 void
1318 {
1319  CopyData();
1320  mxData->maLinkColor = rColor;
1321 }
1322 
1323 const Color&
1325 {
1326  return mxData->maLinkColor;
1327 }
1328 
1329 void
1331 {
1332  CopyData();
1333  mxData->maVisitedLinkColor = rColor;
1334 }
1335 
1336 const Color&
1338 {
1339  return mxData->maVisitedLinkColor;
1340 }
1341 
1342 void
1344 {
1345  CopyData();
1346  mxData->maToolTextColor = rColor;
1347 }
1348 
1349 const Color&
1351 {
1352  return mxData->maToolTextColor;
1353 }
1354 
1355 const Color&
1357 {
1358  return mxData->maHighlightLinkColor;
1359 }
1360 
1361 void
1363 {
1364  CopyData();
1365  mxData->maMonoColor = rColor;
1366 }
1367 
1368 const Color&
1370 {
1371  return mxData->maMonoColor;
1372 }
1373 
1374 void
1376 {
1377  CopyData();
1378  mxData->maActiveTabColor = rColor;
1379 }
1380 
1381 const Color&
1383 {
1384  return mxData->maActiveTabColor;
1385 }
1386 
1387 void
1389 {
1390  CopyData();
1391  mxData->maInactiveTabColor = rColor;
1392 }
1393 
1394 const Color&
1396 {
1397  return mxData->maInactiveTabColor;
1398 }
1399 
1400 const Color&
1402 {
1403  return mxData->maAlternatingRowColor;
1404 }
1405 
1406 void
1407 StyleSettings::SetUseSystemUIFonts( bool bUseSystemUIFonts )
1408 {
1409  CopyData();
1410  mxData->mbUseSystemUIFonts = bUseSystemUIFonts;
1411 }
1412 
1413 bool
1415 {
1416  return mxData->mbUseSystemUIFonts;
1417 }
1418 
1419 void StyleSettings::SetUseFontAAFromSystem(bool bUseFontAAFromSystem)
1420 {
1421  CopyData();
1422  mxData->mbUseFontAAFromSystem = bUseFontAAFromSystem;
1423 }
1424 
1426 {
1427  return mxData->mbUseFontAAFromSystem;
1428 }
1429 
1430 void
1431 StyleSettings::SetUseFlatBorders( bool bUseFlatBorders )
1432 {
1433  CopyData();
1434  mxData->mnUseFlatBorders = bUseFlatBorders;
1435 }
1436 
1437 bool
1439 {
1440  return mxData->mnUseFlatBorders;
1441 }
1442 
1443 void
1444 StyleSettings::SetUseFlatMenus( bool bUseFlatMenus )
1445 {
1446  CopyData();
1447  mxData->mnUseFlatMenus = bUseFlatMenus;
1448 }
1449 
1450 bool
1452 {
1453  return mxData->mnUseFlatMenus;
1454 }
1455 
1456 void
1458 {
1459  CopyData();
1460  mxData->meUseImagesInMenus = eUseImagesInMenus;
1461 }
1462 
1463 void
1464 StyleSettings::SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus )
1465 {
1466  CopyData();
1467  mxData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus;
1468 }
1469 
1470 bool
1472 {
1473  return mxData->mbPreferredUseImagesInMenus;
1474 }
1475 
1476 void
1477 StyleSettings::SetSkipDisabledInMenus( bool bSkipDisabledInMenus )
1478 {
1479  CopyData();
1480  mxData->mbSkipDisabledInMenus = bSkipDisabledInMenus;
1481 }
1482 
1483 bool
1485 {
1486  return mxData->mbSkipDisabledInMenus;
1487 }
1488 
1489 void
1490 StyleSettings::SetHideDisabledMenuItems( bool bHideDisabledMenuItems )
1491 {
1492  CopyData();
1493  mxData->mbHideDisabledMenuItems = bHideDisabledMenuItems;
1494 }
1495 
1496 bool
1498 {
1499  return mxData->mbHideDisabledMenuItems;
1500 }
1501 
1502 void
1504 {
1505  CopyData();
1506  mxData->meContextMenuShortcuts = eContextMenuShortcuts;
1507 }
1508 
1509 bool
1511 {
1512  switch (mxData->meContextMenuShortcuts)
1513  {
1514  case TRISTATE_FALSE:
1515  return false;
1516  case TRISTATE_TRUE:
1517  return true;
1518  default: // TRISTATE_INDET:
1520  }
1521 }
1522 
1523 void
1525 {
1526  CopyData();
1527  mxData->mbPreferredContextMenuShortcuts = bContextMenuShortcuts;
1528 }
1529 
1530 bool
1532 {
1533  return mxData->mbPreferredContextMenuShortcuts;
1534 }
1535 
1536 void
1537 StyleSettings::SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider )
1538 {
1539  CopyData();
1540  mxData->mbPrimaryButtonWarpsSlider = bPrimaryButtonWarpsSlider;
1541 }
1542 
1543 bool
1545 {
1546  return mxData->mbPrimaryButtonWarpsSlider;
1547 }
1548 
1549 void
1551 {
1552  CopyData();
1553  mxData->maAppFont = rFont;
1554 }
1555 
1556 const vcl::Font&
1558 {
1559  return mxData->maAppFont;
1560 }
1561 
1562 void
1564 {
1565  CopyData();
1566  mxData->maHelpFont = rFont;
1567 }
1568 
1569 const vcl::Font&
1571 {
1572  return mxData->maHelpFont;
1573 }
1574 
1575 void
1577 {
1578  CopyData();
1579  mxData->maTitleFont = rFont;
1580 }
1581 
1582 const vcl::Font&
1584 {
1585  return mxData->maTitleFont;
1586 }
1587 
1588 void
1590 {
1591  CopyData();
1592  mxData->maFloatTitleFont = rFont;
1593 }
1594 
1595 const vcl::Font&
1597 {
1598  return mxData->maFloatTitleFont;
1599 }
1600 
1601 void
1603 {
1604  CopyData();
1605  mxData->maMenuFont = rFont;
1606 }
1607 
1608 const vcl::Font&
1610 {
1611  return mxData->maMenuFont;
1612 }
1613 
1614 void
1616 {
1617  CopyData();
1618  mxData->maToolFont = rFont;
1619 }
1620 
1621 const vcl::Font&
1623 {
1624  return mxData->maToolFont;
1625 }
1626 
1627 void
1629 {
1630  CopyData();
1631  mxData->maGroupFont = rFont;
1632 }
1633 
1634 const vcl::Font&
1636 {
1637  return mxData->maGroupFont;
1638 }
1639 
1640 void
1642 {
1643  CopyData();
1644  mxData->maLabelFont = rFont;
1645 }
1646 
1647 const vcl::Font&
1649 {
1650  return mxData->maLabelFont;
1651 }
1652 
1653 void
1655 {
1656  CopyData();
1657  mxData->maRadioCheckFont = rFont;
1658 }
1659 
1660 const vcl::Font&
1662 {
1663  return mxData->maRadioCheckFont;
1664 }
1665 
1666 void
1668 {
1669  CopyData();
1670  mxData->maPushButtonFont = rFont;
1671 }
1672 
1673 const vcl::Font&
1675 {
1676  return mxData->maPushButtonFont;
1677 }
1678 
1679 void
1681 {
1682  CopyData();
1683  mxData->maFieldFont = rFont;
1684 }
1685 
1686 const vcl::Font&
1688 {
1689  return mxData->maFieldFont;
1690 }
1691 
1692 void
1694 {
1695  CopyData();
1696  mxData->maIconFont = rFont;
1697 }
1698 
1699 const vcl::Font&
1701 {
1702  return mxData->maIconFont;
1703 }
1704 
1705 void
1707 {
1708  CopyData();
1709  mxData->maTabFont = rFont;
1710 }
1711 
1712 const vcl::Font&
1714 {
1715  return mxData->maTabFont;
1716 }
1717 
1718 long
1720 {
1721  return 1;
1722 }
1723 
1724 void
1726 {
1727  CopyData();
1728  mxData->mnTitleHeight = nSize;
1729 }
1730 
1731 long
1733 {
1734  return mxData->mnTitleHeight;
1735 }
1736 
1737 void
1739 {
1740  CopyData();
1741  mxData->mnFloatTitleHeight = nSize;
1742 }
1743 
1744 long
1746 {
1747  return mxData->mnFloatTitleHeight;
1748 }
1749 
1750 void
1752 {
1753  CopyData();
1754  mxData->mnScrollBarSize = nSize;
1755 }
1756 
1757 long
1759 {
1760  return mxData->mnScrollBarSize;
1761 }
1762 
1763 void
1765 {
1766  CopyData();
1767  mxData->mnMinThumbSize = nSize;
1768 }
1769 
1770 long
1772 {
1773  return mxData->mnMinThumbSize;
1774 }
1775 
1776 void
1778 {
1779  CopyData();
1780  mxData->mnSpinSize = nSize;
1781 }
1782 
1783 long
1785 {
1786  return mxData->mnSpinSize;
1787 }
1788 
1789 long
1791 {
1792  return 3;
1793 }
1794 
1795 void
1797 {
1798  CopyData();
1799  mxData->mnCursorSize = nSize;
1800 }
1801 
1802 long
1804 {
1805  return mxData->mnCursorSize;
1806 }
1807 
1808 void
1809 StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime )
1810 {
1811  CopyData();
1812  mxData->mnCursorBlinkTime = nBlinkTime;
1813 }
1814 
1815 sal_uInt64
1817 {
1818  return static_cast<long>(mxData->mnCursorBlinkTime);
1819 }
1820 
1821 void
1823 {
1824  CopyData();
1825  mxData->mnDragFullOptions = nOptions;
1826 }
1827 
1830 {
1831  return mxData->mnDragFullOptions;
1832 }
1833 
1834 void
1836 {
1837  CopyData();
1838  mxData->mnSelectionOptions = nOptions;
1839 }
1840 
1843 {
1844  return mxData->mnSelectionOptions;
1845 }
1846 
1847 void
1849 {
1850  CopyData();
1851  mxData->mnDisplayOptions = nOptions;
1852 }
1853 
1856 {
1857  return mxData->mnDisplayOptions;
1858 }
1859 
1860 void
1862 {
1863  CopyData();
1864  mxData->mnAntialiasedMin = nMinPixel;
1865 }
1866 
1867 sal_uLong
1869 {
1870  return mxData->mnAntialiasedMin;
1871 }
1872 
1873 void
1875 {
1876  CopyData();
1877  mxData->mnOptions = nOptions;
1878 }
1879 
1880 void
1881 StyleSettings::SetAutoMnemonic( bool bAutoMnemonic )
1882 {
1883  CopyData();
1884  mxData->mbAutoMnemonic = bAutoMnemonic;
1885 }
1886 
1887 bool
1889 {
1890  return mxData->mbAutoMnemonic;
1891 }
1892 
1893 bool
1895 {
1896  ImplSVData* pSVData = ImplGetSVData();
1897  return pSVData->maNWFData.mbCanDetermineWindowPosition;
1898 }
1899 
1900 void
1902 {
1903  CopyData();
1904  mxData->maFontColor = rColor;
1905 }
1906 
1907 const Color&
1909 {
1910  return mxData->maFontColor;
1911 }
1912 
1913 void
1915 {
1916  CopyData();
1917  mxData->mnToolbarIconSize = nSize;
1918 }
1919 
1922 {
1923  return mxData->mnToolbarIconSize;
1924 }
1925 
1926 const DialogStyle&
1928 {
1929  return mxData->maDialogStyle;
1930 }
1931 
1932 void
1934 {
1935  CopyData();
1936  mxData->mnEdgeBlending = nCount;
1937 }
1938 
1939 sal_uInt16
1941 {
1942  return mxData->mnEdgeBlending;
1943 }
1944 
1945 const Color&
1947 {
1948  return mxData->maEdgeBlendingTopLeftColor;
1949 }
1950 
1951 const Color&
1953 {
1954  return mxData->maEdgeBlendingBottomRightColor;
1955 }
1956 
1957 void
1959 {
1960  CopyData();
1961  mxData->mnListBoxMaximumLineCount = nCount;
1962 }
1963 
1964 sal_uInt16
1966 {
1967  return mxData->mnListBoxMaximumLineCount;
1968 }
1969 
1970 void
1972 {
1973  CopyData();
1974  mxData->mnColorValueSetColumnCount = nCount;
1975 }
1976 
1977 sal_uInt16
1979 {
1980  return mxData->mnColorValueSetColumnCount;
1981 }
1982 
1983 sal_uInt16
1985 {
1986  return 10;
1987 }
1988 
1989 sal_uInt16
1991 {
1992  return 1;
1993 }
1994 
1995 void
1997 {
1998  CopyData();
1999  mxData->mbPreviewUsesCheckeredBackground = bNew;
2000 }
2001 
2002 bool
2004 {
2005  return mxData->mbPreviewUsesCheckeredBackground;
2006 }
2007 
2008 bool
2010 {
2011  return !(*this == rSet);
2012 }
2013 
2015 {
2016  mxData->maListBoxPreviewDefaultLogicSize = rSize;
2017 }
2018 
2020 {
2021  if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height())
2022  {
2023  const_cast< StyleSettings* >(this)->mxData->maListBoxPreviewDefaultPixelSize =
2024  Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapMode(MapUnit::MapAppFont));
2025  }
2026 
2027  return mxData->maListBoxPreviewDefaultPixelSize;
2028 }
2029 
2030 void StyleSettings::Set3DColors( const Color& rColor )
2031 {
2032  CopyData();
2033  mxData->maFaceColor = rColor;
2034  mxData->maLightBorderColor = rColor;
2035  mxData->maMenuBorderColor = rColor;
2036  mxData->maDarkShadowColor = COL_BLACK;
2037  if ( rColor != COL_LIGHTGRAY )
2038  {
2039  mxData->maLightColor = rColor;
2040  mxData->maShadowColor = rColor;
2041  mxData->maDarkShadowColor=rColor;
2042  mxData->maLightColor.IncreaseLuminance( 64 );
2043  mxData->maShadowColor.DecreaseLuminance( 64 );
2044  mxData->maDarkShadowColor.DecreaseLuminance( 100 );
2045  sal_uLong nRed = mxData->maLightColor.GetRed();
2046  sal_uLong nGreen = mxData->maLightColor.GetGreen();
2047  sal_uLong nBlue = mxData->maLightColor.GetBlue();
2048  nRed += static_cast<sal_uLong>(mxData->maShadowColor.GetRed());
2049  nGreen += static_cast<sal_uLong>(mxData->maShadowColor.GetGreen());
2050  nBlue += static_cast<sal_uLong>(mxData->maShadowColor.GetBlue());
2051  mxData->maCheckedColor = Color( static_cast<sal_uInt8>(nRed/2), static_cast<sal_uInt8>(nGreen/2), static_cast<sal_uInt8>(nBlue/2) );
2052  }
2053  else
2054  {
2055  mxData->maCheckedColor = Color( 0x99, 0x99, 0x99 );
2056  mxData->maLightColor = COL_WHITE;
2057  mxData->maShadowColor = COL_GRAY;
2058  }
2059 }
2060 
2062 {
2063  CopyData();
2064  // Light gray checked color special case
2065  if ( GetFaceColor() == COL_LIGHTGRAY )
2066  mxData->maCheckedColor = Color( 0xCC, 0xCC, 0xCC );
2067  else
2068  {
2069  sal_uInt8 nRed = static_cast<sal_uInt8>((static_cast<sal_uInt16>(mxData->maFaceColor.GetRed()) + static_cast<sal_uInt16>(mxData->maLightColor.GetRed()))/2);
2070  sal_uInt8 nGreen = static_cast<sal_uInt8>((static_cast<sal_uInt16>(mxData->maFaceColor.GetGreen()) + static_cast<sal_uInt16>(mxData->maLightColor.GetGreen()))/2);
2071  sal_uInt8 nBlue = static_cast<sal_uInt8>((static_cast<sal_uInt16>(mxData->maFaceColor.GetBlue()) + static_cast<sal_uInt16>(mxData->maLightColor.GetBlue()))/2);
2072  mxData->maCheckedColor = Color( nRed, nGreen, nBlue );
2073  }
2074 }
2075 
2077 {
2078  // icon mode selected in Tools -> Options... -> OpenOffice.org -> View
2079  switch (mxData->meUseImagesInMenus) {
2080  case TRISTATE_FALSE:
2081  return false;
2082  case TRISTATE_TRUE:
2083  return true;
2084  default: // TRISTATE_INDET:
2086  }
2087 }
2088 
2089 static BitmapEx readBitmapEx( const OUString& rPath )
2090 {
2091  OUString aPath( rPath );
2092  rtl::Bootstrap::expandMacros( aPath );
2093 
2094  // import the image
2095  Graphic aGraphic;
2096  if ( GraphicFilter::LoadGraphic( aPath, OUString(), aGraphic ) != ERRCODE_NONE )
2097  return BitmapEx();
2098  return aGraphic.GetBitmapEx();
2099 }
2100 
2101 namespace {
2102 
2103 enum WhichPersona { PERSONA_HEADER, PERSONA_FOOTER };
2104 
2105 }
2106 
2108 static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, o3tl::optional<Color>& rMenuBarTextColor )
2109 {
2110  uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
2111  if ( !xContext.is() )
2112  return;
2113 
2114  // don't burn time loading images we don't need.
2116  return;
2117 
2118  // read from the configuration
2119  OUString aPersona( officecfg::Office::Common::Misc::Persona::get( xContext ) );
2120  OUString aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get( xContext ) );
2121 
2122  // have the settings changed? marks if header /footer prepared before
2123  //should maybe extended to a flag that marks if header /footer /both are loaded
2124  OUString aOldValue= eWhich==PERSONA_HEADER?OUString(aPersona + ";" + aPersonaSettings+";h" ):OUString(aPersona + ";" + aPersonaSettings+";f" );
2125  if ( rHeaderFooter == aOldValue )
2126  return;
2127 
2128  rHeaderFooter = aOldValue;
2129  rHeaderFooterBitmap = BitmapEx();
2130  rMenuBarTextColor.reset();
2131 
2132  // now read the new values and setup bitmaps
2133  OUString aHeader, aFooter;
2134  if ( aPersona == "own" || aPersona == "default" )
2135  {
2136  sal_Int32 nIndex = 0;
2137 
2138  // Skip the persona slug, name, and preview
2139  aHeader = aPersonaSettings.getToken( 3, ';', nIndex );
2140 
2141  if ( nIndex > 0 )
2142  aFooter = aPersonaSettings.getToken( 0, ';', nIndex );
2143 
2144  // change menu text color, advance nIndex to skip the '#'
2145  if ( nIndex > 0 )
2146  {
2147  OUString aColor = aPersonaSettings.getToken( 0, ';', ++nIndex );
2148  rMenuBarTextColor = Color( aColor.toUInt32( 16 ) );
2149  }
2150  }
2151 
2152  OUString aName;
2153  switch ( eWhich ) {
2154  case PERSONA_HEADER: aName = aHeader; break;
2155  case PERSONA_FOOTER: aName = aFooter; break;
2156  }
2157 
2158  if ( !aName.isEmpty() )
2159  {
2160  OUString gallery("");
2161  // try the gallery first, then the program path:
2162  if ( aPersona == "own" && !aPersonaSettings.startsWith( "vnd.sun.star.expand" ) )
2163  {
2164  gallery = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap") "::UserInstallation}";
2165  rtl::Bootstrap::expandMacros( gallery );
2166  gallery += "/user/gallery/personas/";
2167  }
2168  else if ( aPersona == "default" )
2169  {
2170  gallery = "$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/gallery/personas/";
2171  }
2172  rHeaderFooterBitmap = readBitmapEx( gallery + aName );
2173 
2174  if ( rHeaderFooterBitmap.IsEmpty() )
2175  rHeaderFooterBitmap = readBitmapEx( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" + aName );
2176  }
2177 
2178  // Something went wrong. Probably, the images are missing. Clear the persona properties in the registry.
2179 
2180  if( rHeaderFooterBitmap.IsEmpty() )
2181  {
2182  std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
2183  officecfg::Office::Common::Misc::Persona::set( "no", batch );
2184  officecfg::Office::Common::Misc::PersonaSettings::set( "", batch );
2185  batch->commit();
2186  }
2187 }
2188 
2190 {
2191  setupPersonaHeaderFooter( PERSONA_HEADER, mxData->maPersonaHeaderFooter, mxData->maPersonaHeaderBitmap, mxData->maPersonaMenuBarTextColor );
2192  return mxData->maPersonaHeaderBitmap;
2193 }
2194 
2196 {
2197  setupPersonaHeaderFooter( PERSONA_FOOTER, mxData->maPersonaHeaderFooter, mxData->maPersonaFooterBitmap, mxData->maPersonaMenuBarTextColor );
2198  return mxData->maPersonaFooterBitmap;
2199 }
2200 
2201 const o3tl::optional<Color>& StyleSettings::GetPersonaMenuBarTextColor() const
2202 {
2203  GetPersonaHeader();
2204  return mxData->maPersonaMenuBarTextColor;
2205 }
2206 
2208 {
2209  CopyData();
2210  mxData->SetStandardStyles();
2211 }
2212 
2214 {
2215  // compute a brighter face color that can be used in gradients
2216  // for a convex look (eg toolbars)
2217 
2218  sal_uInt16 h, s, b;
2219  GetFaceColor().RGBtoHSB( h, s, b );
2220  if( s > 1) s=1;
2221  if( b < 98) b=98;
2222  return Color::HSBtoRGB( h, s, b );
2223 }
2224 
2226 {
2227  // compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP)
2228  sal_uInt16 h, s, b;
2229  GetShadowColor().RGBtoHSB( h, s, b );
2230  b += b/4;
2231  s -= s/4;
2232  return Color::HSBtoRGB( h, s, b );
2233 }
2234 
2236 {
2237  // copy if other references exist
2238  if (mxData.use_count() > 1)
2239  {
2240  mxData = std::make_shared<ImplStyleData>(*mxData);
2241  }
2242 }
2243 
2245 {
2246  if ( mxData == rSet.mxData )
2247  return true;
2248 
2249  if (mxData->mIconTheme != rSet.mxData->mIconTheme) {
2250  return false;
2251  }
2252 
2253  if (*mxData->mIconThemeSelector != *rSet.mxData->mIconThemeSelector) {
2254  return false;
2255  }
2256 
2257  return (mxData->mnOptions == rSet.mxData->mnOptions) &&
2258  (mxData->mbAutoMnemonic == rSet.mxData->mbAutoMnemonic) &&
2259  (mxData->mnDragFullOptions == rSet.mxData->mnDragFullOptions) &&
2260  (mxData->mnSelectionOptions == rSet.mxData->mnSelectionOptions) &&
2261  (mxData->mnDisplayOptions == rSet.mxData->mnDisplayOptions) &&
2262  (mxData->mnCursorSize == rSet.mxData->mnCursorSize) &&
2263  (mxData->mnCursorBlinkTime == rSet.mxData->mnCursorBlinkTime) &&
2264  (mxData->mnTitleHeight == rSet.mxData->mnTitleHeight) &&
2265  (mxData->mnFloatTitleHeight == rSet.mxData->mnFloatTitleHeight) &&
2266  (mxData->mnScrollBarSize == rSet.mxData->mnScrollBarSize) &&
2267  (mxData->mnMinThumbSize == rSet.mxData->mnMinThumbSize) &&
2268  (mxData->mnSpinSize == rSet.mxData->mnSpinSize) &&
2269  (mxData->mnAntialiasedMin == rSet.mxData->mnAntialiasedMin) &&
2270  (mxData->mbHighContrast == rSet.mxData->mbHighContrast) &&
2271  (mxData->mbUseSystemUIFonts == rSet.mxData->mbUseSystemUIFonts) &&
2272  (mxData->mbUseFontAAFromSystem == rSet.mxData->mbUseFontAAFromSystem) &&
2273  (mxData->mnUseFlatBorders == rSet.mxData->mnUseFlatBorders) &&
2274  (mxData->mnUseFlatMenus == rSet.mxData->mnUseFlatMenus) &&
2275  (mxData->maFaceColor == rSet.mxData->maFaceColor) &&
2276  (mxData->maCheckedColor == rSet.mxData->maCheckedColor) &&
2277  (mxData->maLightColor == rSet.mxData->maLightColor) &&
2278  (mxData->maLightBorderColor == rSet.mxData->maLightBorderColor) &&
2279  (mxData->maShadowColor == rSet.mxData->maShadowColor) &&
2280  (mxData->maDarkShadowColor == rSet.mxData->maDarkShadowColor) &&
2281  (mxData->maButtonTextColor == rSet.mxData->maButtonTextColor) &&
2282  (mxData->maDefaultActionButtonTextColor == rSet.mxData->maDefaultActionButtonTextColor) &&
2283  (mxData->maActionButtonTextColor == rSet.mxData->maActionButtonTextColor) &&
2284  (mxData->maButtonRolloverTextColor == rSet.mxData->maButtonRolloverTextColor) &&
2285  (mxData->maActionButtonRolloverTextColor == rSet.mxData->maActionButtonRolloverTextColor) &&
2286  (mxData->maRadioCheckTextColor == rSet.mxData->maRadioCheckTextColor) &&
2287  (mxData->maGroupTextColor == rSet.mxData->maGroupTextColor) &&
2288  (mxData->maLabelTextColor == rSet.mxData->maLabelTextColor) &&
2289  (mxData->maWindowColor == rSet.mxData->maWindowColor) &&
2290  (mxData->maWindowTextColor == rSet.mxData->maWindowTextColor) &&
2291  (mxData->maDialogColor == rSet.mxData->maDialogColor) &&
2292  (mxData->maDialogTextColor == rSet.mxData->maDialogTextColor) &&
2293  (mxData->maWorkspaceColor == rSet.mxData->maWorkspaceColor) &&
2294  (mxData->maMonoColor == rSet.mxData->maMonoColor) &&
2295  (mxData->maFieldColor == rSet.mxData->maFieldColor) &&
2296  (mxData->maFieldTextColor == rSet.mxData->maFieldTextColor) &&
2297  (mxData->maActiveColor == rSet.mxData->maActiveColor) &&
2298  (mxData->maActiveTextColor == rSet.mxData->maActiveTextColor) &&
2299  (mxData->maActiveBorderColor == rSet.mxData->maActiveBorderColor) &&
2300  (mxData->maDeactiveColor == rSet.mxData->maDeactiveColor) &&
2301  (mxData->maDeactiveTextColor == rSet.mxData->maDeactiveTextColor) &&
2302  (mxData->maDeactiveBorderColor == rSet.mxData->maDeactiveBorderColor) &&
2303  (mxData->maMenuColor == rSet.mxData->maMenuColor) &&
2304  (mxData->maMenuBarColor == rSet.mxData->maMenuBarColor) &&
2305  (mxData->maMenuBarRolloverColor == rSet.mxData->maMenuBarRolloverColor) &&
2306  (mxData->maMenuBorderColor == rSet.mxData->maMenuBorderColor) &&
2307  (mxData->maMenuTextColor == rSet.mxData->maMenuTextColor) &&
2308  (mxData->maMenuBarTextColor == rSet.mxData->maMenuBarTextColor) &&
2309  (mxData->maMenuBarRolloverTextColor == rSet.mxData->maMenuBarRolloverTextColor) &&
2310  (mxData->maMenuHighlightColor == rSet.mxData->maMenuHighlightColor) &&
2311  (mxData->maMenuHighlightTextColor == rSet.mxData->maMenuHighlightTextColor) &&
2312  (mxData->maHighlightColor == rSet.mxData->maHighlightColor) &&
2313  (mxData->maHighlightTextColor == rSet.mxData->maHighlightTextColor) &&
2314  (mxData->maTabTextColor == rSet.mxData->maTabTextColor) &&
2315  (mxData->maTabRolloverTextColor == rSet.mxData->maTabRolloverTextColor) &&
2316  (mxData->maTabHighlightTextColor == rSet.mxData->maTabHighlightTextColor) &&
2317  (mxData->maActiveTabColor == rSet.mxData->maActiveTabColor) &&
2318  (mxData->maInactiveTabColor == rSet.mxData->maInactiveTabColor) &&
2319  (mxData->maDisableColor == rSet.mxData->maDisableColor) &&
2320  (mxData->maHelpColor == rSet.mxData->maHelpColor) &&
2321  (mxData->maHelpTextColor == rSet.mxData->maHelpTextColor) &&
2322  (mxData->maLinkColor == rSet.mxData->maLinkColor) &&
2323  (mxData->maVisitedLinkColor == rSet.mxData->maVisitedLinkColor) &&
2324  (mxData->maToolTextColor == rSet.mxData->maToolTextColor) &&
2325  (mxData->maHighlightLinkColor == rSet.mxData->maHighlightLinkColor) &&
2326  (mxData->maAppFont == rSet.mxData->maAppFont) &&
2327  (mxData->maHelpFont == rSet.mxData->maHelpFont) &&
2328  (mxData->maTitleFont == rSet.mxData->maTitleFont) &&
2329  (mxData->maFloatTitleFont == rSet.mxData->maFloatTitleFont) &&
2330  (mxData->maMenuFont == rSet.mxData->maMenuFont) &&
2331  (mxData->maToolFont == rSet.mxData->maToolFont) &&
2332  (mxData->maGroupFont == rSet.mxData->maGroupFont) &&
2333  (mxData->maLabelFont == rSet.mxData->maLabelFont) &&
2334  (mxData->maRadioCheckFont == rSet.mxData->maRadioCheckFont) &&
2335  (mxData->maPushButtonFont == rSet.mxData->maPushButtonFont) &&
2336  (mxData->maFieldFont == rSet.mxData->maFieldFont) &&
2337  (mxData->maIconFont == rSet.mxData->maIconFont) &&
2338  (mxData->maTabFont == rSet.mxData->maTabFont) &&
2339  (mxData->meUseImagesInMenus == rSet.mxData->meUseImagesInMenus) &&
2340  (mxData->mbPreferredUseImagesInMenus == rSet.mxData->mbPreferredUseImagesInMenus) &&
2341  (mxData->mbSkipDisabledInMenus == rSet.mxData->mbSkipDisabledInMenus) &&
2342  (mxData->mbHideDisabledMenuItems == rSet.mxData->mbHideDisabledMenuItems) &&
2343  (mxData->mbPreferredContextMenuShortcuts == rSet.mxData->mbPreferredContextMenuShortcuts)&&
2344  (mxData->meContextMenuShortcuts == rSet.mxData->meContextMenuShortcuts) &&
2345  (mxData->mbPrimaryButtonWarpsSlider == rSet.mxData->mbPrimaryButtonWarpsSlider) &&
2346  (mxData->maFontColor == rSet.mxData->maFontColor) &&
2347  (mxData->mnEdgeBlending == rSet.mxData->mnEdgeBlending) &&
2348  (mxData->maEdgeBlendingTopLeftColor == rSet.mxData->maEdgeBlendingTopLeftColor) &&
2349  (mxData->maEdgeBlendingBottomRightColor == rSet.mxData->maEdgeBlendingBottomRightColor) &&
2350  (mxData->mnListBoxMaximumLineCount == rSet.mxData->mnListBoxMaximumLineCount) &&
2351  (mxData->mnColorValueSetColumnCount == rSet.mxData->mnColorValueSetColumnCount) &&
2352  (mxData->maListBoxPreviewDefaultLogicSize == rSet.mxData->maListBoxPreviewDefaultLogicSize) &&
2353  (mxData->maListBoxPreviewDefaultPixelSize == rSet.mxData->maListBoxPreviewDefaultPixelSize) &&
2354  (mxData->mbPreviewUsesCheckeredBackground == rSet.mxData->mbPreviewUsesCheckeredBackground);
2355 }
2356 
2358  mnEnableATT(TRISTATE_INDET),
2359  mnDisablePrinting(TRISTATE_INDET)
2360 {
2361  static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
2362  mbEnableLocalizedDecimalSep = (pEnv != nullptr);
2363 }
2364 
2366  : mxData(std::make_shared<ImplMiscData>())
2367 {
2368 }
2369 
2370 bool MiscSettings::operator ==( const MiscSettings& rSet ) const
2371 {
2372  if ( mxData == rSet.mxData )
2373  return true;
2374 
2375  return (mxData->mnEnableATT == rSet.mxData->mnEnableATT ) &&
2376  (mxData->mnDisablePrinting == rSet.mxData->mnDisablePrinting ) &&
2377  (mxData->mbEnableLocalizedDecimalSep == rSet.mxData->mbEnableLocalizedDecimalSep );
2378 }
2379 
2380 bool
2382 {
2383  return !(*this == rSet);
2384 }
2385 
2387 {
2388  if( mxData->mnDisablePrinting == TRISTATE_INDET )
2389  {
2390  OUString aEnable =
2392  getValue( "DesktopManagement",
2393  "DisablePrinting" );
2394  mxData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE : TRISTATE_FALSE;
2395  }
2396 
2397  return mxData->mnDisablePrinting != TRISTATE_FALSE;
2398 }
2399 
2401 {
2402 
2403 #ifdef _WIN32
2404  if( mxData->mnEnableATT == TRISTATE_INDET )
2405  {
2406  // Check in the Windows registry if an AT tool wants Accessibility support to
2407  // be activated ..
2408  HKEY hkey;
2409 
2410  if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER,
2411  L"Software\\LibreOffice\\Accessibility\\AtToolSupport",
2412  &hkey) )
2413  {
2414  DWORD dwType;
2415  wchar_t Data[6]; // possible values: "true", "false", "1", "0", DWORD
2416  DWORD cbData = sizeof(Data);
2417 
2418  if( ERROR_SUCCESS == RegQueryValueExW(hkey, L"SupportAssistiveTechnology",
2419  nullptr, &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
2420  {
2421  switch (dwType)
2422  {
2423  case REG_SZ:
2424  mxData->mnEnableATT = ((0 == wcsicmp(Data, L"1")) || (0 == wcsicmp(Data, L"true"))) ? TRISTATE_TRUE : TRISTATE_FALSE;
2425  break;
2426  case REG_DWORD:
2427  switch (reinterpret_cast<DWORD *>(Data)[0]) {
2428  case 0:
2429  mxData->mnEnableATT = TRISTATE_FALSE;
2430  break;
2431  case 1:
2432  mxData->mnEnableATT = TRISTATE_TRUE;
2433  break;
2434  default:
2435  mxData->mnEnableATT = TRISTATE_INDET;
2436  //TODO: or TRISTATE_TRUE?
2437  break;
2438  }
2439  break;
2440  default:
2441  // Unsupported registry type
2442  break;
2443  }
2444  }
2445 
2446  RegCloseKey(hkey);
2447  }
2448  }
2449 #endif
2450 
2451  if( mxData->mnEnableATT == TRISTATE_INDET )
2452  {
2453  static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
2454  if( !pEnv || !*pEnv )
2455  {
2456  OUString aEnable =
2458  getValue( "Accessibility",
2459  "EnableATToolSupport" );
2460  mxData->mnEnableATT = aEnable.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE : TRISTATE_FALSE;
2461  }
2462  else
2463  {
2464  mxData->mnEnableATT = TRISTATE_TRUE;
2465  }
2466  }
2467 
2468  return mxData->mnEnableATT != TRISTATE_FALSE;
2469 }
2470 
2471 #ifdef _WIN32
2472 void MiscSettings::SetEnableATToolSupport( bool bEnable )
2473 {
2474  if ( (bEnable ? TRISTATE_TRUE : TRISTATE_FALSE) != mxData->mnEnableATT )
2475  {
2476  if( bEnable && !ImplInitAccessBridge() )
2477  return;
2478 
2479  HKEY hkey;
2480 
2481  // If the accessibility key in the Windows registry exists, change it synchronously
2482  if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER,
2483  L"Software\\LibreOffice\\Accessibility\\AtToolSupport",
2484  &hkey) )
2485  {
2486  DWORD dwType;
2487  wchar_t Data[6]; // possible values: "true", "false", 1, 0
2488  DWORD cbData = sizeof(Data);
2489 
2490  if( ERROR_SUCCESS == RegQueryValueExW(hkey, L"SupportAssistiveTechnology",
2491  nullptr, &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
2492  {
2493  switch (dwType)
2494  {
2495  case REG_SZ:
2496  RegSetValueExW(hkey, L"SupportAssistiveTechnology",
2497  0, dwType,
2498  reinterpret_cast<const BYTE*>(bEnable ? L"true" : L"false"),
2499  bEnable ? sizeof(L"true") : sizeof(L"false"));
2500  break;
2501  case REG_DWORD:
2502  reinterpret_cast<DWORD *>(Data)[0] = bEnable ? 1 : 0;
2503  RegSetValueExW(hkey, L"SupportAssistiveTechnology",
2504  0, dwType, reinterpret_cast<const BYTE*>(Data), sizeof(DWORD));
2505  break;
2506  default:
2507  // Unsupported registry type
2508  break;
2509  }
2510  }
2511 
2512  RegCloseKey(hkey);
2513  }
2514 
2516  setValue( "Accessibility",
2517  "EnableATToolSupport",
2518  bEnable ? OUString("true") : OUString("false" ) );
2519  mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE;
2520  }
2521 }
2522 #endif
2523 
2525 {
2526  // copy if other references exist
2527  if (mxData.use_count() > 1)
2528  {
2529  mxData = std::make_shared<ImplMiscData>(*mxData);
2530  }
2531  mxData->mbEnableLocalizedDecimalSep = bEnable;
2532 }
2533 
2535 {
2536  return mxData->mbEnableLocalizedDecimalSep;
2537 }
2538 
2540  : mxData(std::make_shared<ImplHelpData>())
2541 {
2542 }
2543 
2544 bool HelpSettings::operator ==( const HelpSettings& rSet ) const
2545 {
2546  if ( mxData == rSet.mxData )
2547  return true;
2548 
2549  return (mxData->mnTipTimeout == rSet.mxData->mnTipTimeout );
2550 }
2551 
2552 sal_uLong
2554 {
2555  return 500;
2556 }
2557 
2558 void
2560 {
2561  // copy if other references exist
2562  if (mxData.use_count() > 1)
2563  {
2564  mxData = std::make_shared<ImplHelpData>(*mxData);
2565  }
2566  mxData->mnTipTimeout = nTipTimeout;
2567 }
2568 
2569 sal_uLong
2571 {
2572  return mxData->mnTipTimeout;
2573 }
2574 
2575 sal_uLong
2577 {
2578  return 1500;
2579 }
2580 
2581 bool
2583 {
2584  return !(*this == rSet);
2585 }
2586 
2588  :
2589  maLocale( LANGUAGE_SYSTEM ),
2590  maUILocale( LANGUAGE_SYSTEM )
2591 {
2594 }
2595 
2597  maMouseSettings( rData.maMouseSettings ),
2598  maStyleSettings( rData.maStyleSettings ),
2599  maMiscSettings( rData.maMiscSettings ),
2600  maHelpSettings( rData.maHelpSettings ),
2601  maLocale( rData.maLocale ),
2602  maUILocale( rData.maUILocale )
2603 {
2604  // Create the cache objects new when their getter is called.
2605 }
2606 
2608 {
2609  mpLocaleDataWrapper.reset();
2610  mpUILocaleDataWrapper.reset();
2611  mpI18nHelper.reset();
2612  mpUII18nHelper.reset();
2613 }
2614 
2616  : mxData(std::make_shared<ImplAllSettingsData>())
2617 {
2618 }
2619 
2621 {
2622  // copy if other references exist
2623  if (mxData.use_count() > 1)
2624  {
2625  mxData = std::make_shared<ImplAllSettingsData>(*mxData);
2626  }
2627 
2628 }
2629 
2631 {
2632 
2634 
2635  if ( nFlags & AllSettingsFlags::MOUSE )
2636  {
2637  if ( mxData->maMouseSettings != rSet.mxData->maMouseSettings )
2638  {
2639  CopyData();
2640  mxData->maMouseSettings = rSet.mxData->maMouseSettings;
2641  nChangeFlags |= AllSettingsFlags::MOUSE;
2642  }
2643  }
2644 
2645  if ( nFlags & AllSettingsFlags::STYLE )
2646  {
2647  if ( mxData->maStyleSettings != rSet.mxData->maStyleSettings )
2648  {
2649  CopyData();
2650  mxData->maStyleSettings = rSet.mxData->maStyleSettings;
2651  nChangeFlags |= AllSettingsFlags::STYLE;
2652  }
2653  }
2654 
2655  if ( nFlags & AllSettingsFlags::MISC )
2656  {
2657  if ( mxData->maMiscSettings != rSet.mxData->maMiscSettings )
2658  {
2659  CopyData();
2660  mxData->maMiscSettings = rSet.mxData->maMiscSettings;
2661  nChangeFlags |= AllSettingsFlags::MISC;
2662  }
2663  }
2664 
2665  if ( nFlags & AllSettingsFlags::LOCALE )
2666  {
2667  if ( mxData->maLocale != rSet.mxData->maLocale )
2668  {
2669  SetLanguageTag( rSet.mxData->maLocale );
2670  nChangeFlags |= AllSettingsFlags::LOCALE;
2671  }
2672  }
2673 
2674  return nChangeFlags;
2675 }
2676 
2678 {
2679 
2681 
2682  if ( mxData->maStyleSettings != rSet.mxData->maStyleSettings )
2683  nChangeFlags |= AllSettingsFlags::STYLE;
2684 
2685  if ( mxData->maMiscSettings != rSet.mxData->maMiscSettings )
2686  nChangeFlags |= AllSettingsFlags::MISC;
2687 
2688  if ( mxData->maLocale != rSet.mxData->maLocale )
2689  nChangeFlags |= AllSettingsFlags::LOCALE;
2690 
2691  return nChangeFlags;
2692 }
2693 
2694 bool AllSettings::operator ==( const AllSettings& rSet ) const
2695 {
2696  if ( mxData == rSet.mxData )
2697  return true;
2698 
2699  if ( (mxData->maMouseSettings == rSet.mxData->maMouseSettings) &&
2700  (mxData->maStyleSettings == rSet.mxData->maStyleSettings) &&
2701  (mxData->maMiscSettings == rSet.mxData->maMiscSettings) &&
2702  (mxData->maHelpSettings == rSet.mxData->maHelpSettings) &&
2703  (mxData->maLocale == rSet.mxData->maLocale) )
2704  {
2705  return true;
2706  }
2707 
2708  return false;
2709 }
2710 
2711 void AllSettings::SetLanguageTag(const OUString& rLanguage, bool bCanonicalize)
2712 {
2713  SetLanguageTag(LanguageTag(rLanguage, bCanonicalize));
2714 }
2715 
2716 void AllSettings::SetLanguageTag( const LanguageTag& rLanguageTag )
2717 {
2718  if (mxData->maLocale != rLanguageTag)
2719  {
2720  CopyData();
2721 
2722  mxData->maLocale = rLanguageTag;
2723 
2724  if ( mxData->mpLocaleDataWrapper )
2725  {
2726  mxData->mpLocaleDataWrapper.reset();
2727  }
2728  if ( mxData->mpI18nHelper )
2729  {
2730  mxData->mpI18nHelper.reset();
2731  }
2732  }
2733 }
2734 
2735 namespace
2736 {
2737  bool GetConfigLayoutRTL(bool bMath)
2738  {
2739  static const char* pEnv = getenv("SAL_RTL_ENABLED" );
2740  static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off
2741 
2742  // environment always overrides
2743  if( pEnv )
2744  return true;
2745 
2746  bool bRTL = false;
2747 
2748  if( nUIMirroring == -1 )
2749  {
2750  nUIMirroring = 0; // ask configuration only once
2753  "org.openoffice.Office.Common/I18N/CTL" ); // note: case sensitive !
2754  if ( aNode.isValid() )
2755  {
2756  bool bTmp = bool();
2757  css::uno::Any aValue = aNode.getNodeValue( "UIMirroring" );
2758  if( aValue >>= bTmp )
2759  {
2760  // found true or false; if it was nil, nothing is changed
2761  nUIMirroring = bTmp ? 1 : 2;
2762  }
2763  }
2764  }
2765 
2766  if( nUIMirroring == 0 ) // no config found (eg, setup) or default (nil) was set: check language
2767  {
2769  if (bMath)
2770  bRTL = MsLangId::isRightToLeftMath( aLang );
2771  else
2772  bRTL = MsLangId::isRightToLeft( aLang );
2773  }
2774  else
2775  bRTL = (nUIMirroring == 1);
2776 
2777  return bRTL;
2778  }
2779 }
2780 
2782 {
2784  return false;
2785  return GetConfigLayoutRTL(false);
2786 }
2787 
2789 {
2791  return false;
2792  return GetConfigLayoutRTL(true);
2793 }
2794 
2796 {
2798  {
2799  static LanguageTag aRet("en-US");
2800  return aRet;
2801  }
2802 
2805 
2806  // SYSTEM locale means: use settings from SvtSysLocale that is resolved
2807  if ( mxData->maLocale.isSystemLocale() )
2808  mxData->maLocale = mxData->maSysLocale.GetLanguageTag();
2809 
2810  return mxData->maLocale;
2811 }
2812 
2814 {
2816  {
2817  static LanguageTag aRet("en-US");
2818  return aRet;
2819  }
2820 
2823 
2824  // the UILocale is never changed
2825  if ( mxData->maUILocale.isSystemLocale() )
2826  mxData->maUILocale = mxData->maSysLocale.GetUILanguageTag();
2827 
2828  return mxData->maUILocale;
2829 }
2830 
2832 {
2833  if ( !mxData->mpLocaleDataWrapper )
2834  const_cast<AllSettings*>(this)->mxData->mpLocaleDataWrapper.reset( new LocaleDataWrapper(
2836  return *mxData->mpLocaleDataWrapper;
2837 }
2838 
2840 {
2841  if ( !mxData->mpUILocaleDataWrapper )
2842  const_cast<AllSettings*>(this)->mxData->mpUILocaleDataWrapper.reset( new LocaleDataWrapper(
2844  return *mxData->mpUILocaleDataWrapper;
2845 }
2846 
2848 {
2849  if ( !mxData->mpI18nHelper ) {
2850  const_cast<AllSettings*>(this)->mxData->mpI18nHelper.reset( new vcl::I18nHelper(
2852  }
2853  return *mxData->mpI18nHelper;
2854 }
2855 
2857 {
2858  if ( !mxData->mpUII18nHelper ) {
2859  const_cast<AllSettings*>(this)->mxData->mpUII18nHelper.reset( new vcl::I18nHelper(
2861  }
2862  return *mxData->mpUII18nHelper;
2863 }
2864 
2866 {
2867  AllSettings aAllSettings( Application::GetSettings() );
2868  if ( nHint & ConfigurationHints::DecSep )
2869  {
2870  MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
2871  bool bIsDecSepAsLocale = aAllSettings.mxData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
2872  if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale )
2873  {
2874  aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale );
2875  aAllSettings.SetMiscSettings( aMiscSettings );
2876  }
2877  }
2878 
2879  if ( nHint & ConfigurationHints::Locale )
2880  aAllSettings.SetLanguageTag( aAllSettings.mxData->maSysLocale.GetOptions().GetLanguageTag() );
2881 
2882  Application::SetSettings( aAllSettings );
2883 }
2884 
2885 const StyleSettings&
2887 {
2888  return mxData->maStyleSettings;
2889 }
2890 
2893 {
2894  return mxData->mnOptions;
2895 }
2896 
2897 std::vector<vcl::IconThemeInfo> const &
2899 {
2900  if (!mxData->mIconThemeScanner) {
2902  }
2903  return mxData->mIconThemeScanner->GetFoundIconThemes();
2904 }
2905 
2906 /*static*/ OUString
2908 {
2909  OUString desktopEnvironment = Application::GetDesktopEnvironment();
2910  if (!mxData->mIconThemeScanner) {
2912  }
2913  OUString themeName = mxData->mIconThemeSelector->SelectIconThemeForDesktopEnvironment(
2914  mxData->mIconThemeScanner->GetFoundIconThemes(),
2915  desktopEnvironment
2916  );
2917  return themeName;
2918 }
2919 
2920 void
2921 StyleSettings::SetIconTheme(const OUString& theme)
2922 {
2923  CopyData();
2924  mxData->mIconTheme = theme;
2925 }
2926 
2927 OUString
2929 {
2930  OUString sTheme(mxData->mIconTheme);
2931  if (sTheme.isEmpty())
2932  {
2934  sTheme = "colibre";
2935  else
2936  {
2937  // read from the configuration, or fallback to what the desktop wants
2938  uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
2939  if (xContext.is())
2940  {
2941  sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
2942 
2943  if (sTheme.isEmpty() || sTheme == "auto")
2945  }
2946  }
2947  }
2948 
2949  if (!mxData->mIconThemeScanner) {
2951  }
2952  OUString r = mxData->mIconThemeSelector->SelectIconTheme(
2953  mxData->mIconThemeScanner->GetFoundIconThemes(),
2954  sTheme);
2955  return r;
2956 }
2957 
2958 void
2960 {
2961  if (mxData->mbHighContrast == bHighContrast) {
2962  return;
2963  }
2964 
2965  CopyData();
2966  mxData->mbHighContrast = bHighContrast;
2967  mxData->mIconThemeSelector->SetUseHighContrastTheme(bHighContrast);
2968 }
2969 
2970 bool
2972 {
2973  return mxData->mbHighContrast;
2974 }
2975 
2976 void
2977 StyleSettings::SetPreferredIconTheme(const OUString& theme, bool bDarkIconTheme)
2978 {
2979  mxData->mIconThemeSelector->SetPreferredIconTheme(theme, bDarkIconTheme);
2980 }
2981 
2982 void
2984 {
2985  CopyData();
2986  mxData->maMouseSettings = rSet;
2987 }
2988 
2989 const MouseSettings&
2991 {
2992  return mxData->maMouseSettings;
2993 }
2994 
2995 void
2997 {
2998  CopyData();
2999  mxData->maStyleSettings = rSet;
3000 }
3001 
3002 void
3004 {
3005  CopyData();
3006  mxData->maMiscSettings = rSet;
3007 }
3008 
3009 const MiscSettings&
3011 {
3012  return mxData->maMiscSettings;
3013 }
3014 
3015 void
3017 {
3018  CopyData();
3019  mxData->maHelpSettings = rSet;
3020 }
3021 
3022 const HelpSettings&
3024 {
3025  return mxData->maHelpSettings;
3026 }
3027 
3028 bool
3030 {
3031  return !(*this == rSet);
3032 }
3033 
3034 SvtSysLocale&
3036 {
3037  return mxData->maSysLocale;
3038 }
3039 
3040 
3042  bool bCheckedColorSpecialCase )
3043 {
3044  Set3DColors( aBackColor );
3045  SetFaceColor( aBackColor );
3046  SetDialogColor( aBackColor );
3047  SetWorkspaceColor( aBackColor );
3048 
3049  if (bCheckedColorSpecialCase)
3051 }
3052 
3054  const vcl::Font& aLabelFont )
3055 {
3056  SetAppFont( aAppFont );
3057  SetPushButtonFont( aAppFont );
3058  SetToolFont( aAppFont );
3059  SetHelpFont( aAppFont );
3060 
3061  SetMenuFont( aLabelFont );
3062  SetTabFont( aLabelFont );
3063  SetLabelFont( aLabelFont );
3064  SetRadioCheckFont( aLabelFont );
3065  SetFieldFont( aLabelFont );
3066  SetGroupFont( aLabelFont );
3067  SetIconFont( aLabelFont );
3068 }
3069 
3070 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetEnableLocalizedDecimalSep() const
void SetCheckedColor(const Color &rColor)
void SetMenuFont(const vcl::Font &rFont)
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
bool mbPreferredUseImagesInMenus
MouseWheelBehaviour mnWheelBehavior
const Color & GetActiveColor() const
void SetTabRolloverTextColor(const Color &rColor)
const Color & GetShadowColor() const
ConfigurationHints
const Color & GetToolTextColor() const
vcl::Font maMenuFont
void SetHighlightColor(const Color &rColor)
bool mbSkipDisabledInMenus
vcl::Font maFieldFont
Color maEdgeBlendingBottomRightColor
Color maActiveTabColor
void SetHelpFont(const vcl::Font &rFont)
std::shared_ptr< ImplMouseData > mxData
Definition: settings.hxx:89
const LocaleDataWrapper & GetLocaleDataWrapper() const
bool GetContextMenuShortcuts() const
sal_Int32 nIndex
Color maHighlightTextColor
bool GetAutoMnemonic() const
const Color & GetDeactiveColor() const
const Color & GetDialogColor() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
void SetCheckedColorSpecialCase()
bool mbPreferredContextMenuShortcuts
const Color & GetActionButtonTextColor() const
static long GetBorderSize()
void SetHideDisabledMenuItems(bool bHideDisabledMenuItems)
sal_uInt64 GetDoubleClickTime() const
void SetOptions(MouseSettingsOptions nOptions)
const Color & GetMenuBarRolloverColor() const
const Color & GetMenuBarTextColor() const
Color maDeactiveTextColor
OUString DetermineIconTheme() const
Determine which icon theme should be used.
sal_uLong mnTipTimeout
void SetFontColor(const Color &rColor)
bool operator==(const HelpSettings &rSet) const
void SetDragFullOptions(DragFullOptions nOptions)
long GetTitleHeight() const
void SetFieldFont(const vcl::Font &rFont)
void SetMenuBorderColor(const Color &rColor)
Color maDisableColor
const vcl::Font & GetMenuFont() const
const Color & GetHighlightTextColor() const
const LanguageTag & GetUILanguageTag() const
void SetMenuTextColor(const Color &rColor)
bool IsDecimalSeparatorAsLocale() const
void SetStyleSettings(const StyleSettings &rSet)
void SetPreviewUsesCheckeredBackground(bool bNew)
Color maActionButtonTextColor
TriState mnEnableATT
void SetMonoColor(const Color &rColor)
LanguageType getLanguageType(bool bResolveSystem=true) const
static void setupPersonaHeaderFooter(WhichPersona eWhich, OUString &rHeaderFooter, BitmapEx &rHeaderFooterBitmap, o3tl::optional< Color > &rMenuBarTextColor)
Update the setting of the Persona header / footer in ImplStyleData.
StyleSettingsOptions
Definition: settings.hxx:155
void SetLightColor(const Color &rColor)
void SetMenuBarRolloverTextColor(const Color &rColor)
SelectionOptions GetSelectionOptions() const
void SetActionButtonTextColor(const Color &rColor)
bool operator==(const MouseSettings &rSet) const
const Color & GetInactiveTabColor() const
Color maWindowTextColor
SelectionOptions
Definition: settings.hxx:181
long GetDoubleClickWidth() const
void SetIconFont(const vcl::Font &rFont)
sal_uInt16 mnListBoxMaximumLineCount
sal_uIntPtr sal_uLong
void SetMiscSettings(const MiscSettings &rSet)
void SetRadioCheckFont(const vcl::Font &rFont)
void SetFieldRolloverTextColor(const Color &rColor)
bool GetPreferredUseImagesInMenus() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:705
Color maWorkspaceColor
void SetDoubleClickHeight(long nDoubleClkHeight)
const Color & GetFaceColor() const
std::vector< vcl::IconThemeInfo > const & GetInstalledIconThemes() const
Obtain the list of icon themes which were found in the config folder.
vcl::Font maRadioCheckFont
BitmapEx const & GetPersonaHeader() const
const vcl::Font & GetRadioCheckFont() const
ImplSVNWFData maNWFData
Definition: svdata.hxx:361
bool mbHideDisabledMenuItems
const Color & GetGroupTextColor() const
StyleSettingsOptions mnOptions
css::beans::Optional< css::uno::Any > getValue(OUString const &id)
void SetUseFlatBorders(bool bUseFlatBorders)
void SetWindowColor(const Color &rColor)
const Color & GetWorkspaceColor() const
void SetWeight(FontWeight)
Definition: font/font.cxx:215
Color GetSeparatorColor() const
void SetStartDragWidth(long nDragWidth)
const ContentProperties & rData
const Color & GetActiveBorderColor() const
Color maTabHighlightTextColor
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
const Color & GetFieldRolloverTextColor() const
bool GetPreviewUsesCheckeredBackground() const
bool operator!=(const StyleSettings &rSet) const
void SetHighContrastMode(bool bHighContrast)
const Color & GetLabelTextColor() const
void SetCharSet(rtl_TextEncoding)
Definition: font/font.cxx:129
void SetDoubleClickTime(sal_uInt64 nDoubleClkTime)
void SetMinThumbSize(long nSize)
std::shared_ptr< vcl::IconThemeSelector > mIconThemeSelector
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
void SetMenuHighlightColor(const Color &rColor)
const Color & GetDeactiveTextColor() const
static BitmapEx readBitmapEx(const OUString &rPath)
DragFullOptions mnDragFullOptions
static std::shared_ptr< IconThemeScanner > Create(const OUString &path)
Factory method to create the object.
ToolbarIconSize mnToolbarIconSize
const Color & GetMenuHighlightColor() const
void SetDefaultActionButtonTextColor(const Color &rColor)
void SetPrimaryButtonWarpsSlider(bool bPrimaryButtonWarpsSlider)
const Color & GetHelpTextColor() const
Color maDarkShadowColor
void SetButtonTextColor(const Color &rColor)
const Size & GetListBoxPreviewDefaultPixelSize() const
TRISTATE_TRUE
const ::Color maShadowColor
const vcl::I18nHelper & GetUILocaleI18nHelper() const
const vcl::Font & GetFieldFont() const
void SetDialogColor(const Color &rColor)
void SetActiveTabColor(const Color &rColor)
static sal_uLong GetTipDelay()
const Color & GetFieldTextColor() const
const Color & GetLightBorderColor() const
Unknown
sal_uLong GetMenuDelay() const
static const OUString & GetDesktopEnvironment()
Get the desktop environment the process is currently running in.
Definition: svapp.cxx:1565
const Color & GetHighlightColor() const
MouseFollowFlags GetFollow() const
bool GetPreferredContextMenuShortcuts() const
void SetLinkColor(const Color &rColor)
const Color & GetActiveTabColor() const
NONE
const Color & GetMenuHighlightTextColor() const
void SetDeactiveBorderColor(const Color &rColor)
void SetDeactiveColor(const Color &rColor)
AllSettingsFlags
Definition: settings.hxx:641
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1050
WEIGHT_BOLD
std::unique_ptr< LocaleDataWrapper > mpUILocaleDataWrapper
const Color & GetRadioCheckTextColor() const
sal_uInt16 GetEdgeBlending() const
sal_uInt16 GetColorValueSetColumnCount() const
Color maLightBorderColor
void SetEnableLocalizedDecimalSep(bool bEnable)
long GetMinThumbSize() const
Color maActionButtonRolloverTextColor
Color maActiveBorderColor
const vcl::Font & GetLabelFont() const
MouseFollowFlags mnFollow
void SetMenuBarRolloverColor(const Color &rColor)
sal_uLong GetButtonRepeat() const
bool mbPrimaryButtonWarpsSlider
bool GetUseFlatMenus() const
void SetMenuHighlightTextColor(const Color &rColor)
static bool IsFuzzing()
MouseSettingsOptions GetOptions() const
SvtSysLocale & GetSysLocale()
void SetDialogTextColor(const Color &rColor)
const Color & GetLightColor() const
void SetOptions(StyleSettingsOptions nOptions)
bool GetHighContrastMode() const
void SetMenuColor(const Color &rColor)
const Color & GetActiveTextColor() const
void SetToolbarIconSize(ToolbarIconSize nSize)
const LocaleDataWrapper & GetUILocaleDataWrapper() const
static OUString GetStandardIconThemePath()
This method will return the standard path where icon themes are located.
MiscSettings maMiscSettings
void SetMenuBarTextColor(const Color &rColor)
long GetFloatTitleHeight() const
SvtSysLocale maSysLocale
vcl::Font maFloatTitleFont
static std::shared_ptr< ConfigurationChanges > create(css::uno::Reference< css::uno::XComponentContext > const &context=comphelper::getProcessComponentContext())
DragFullOptions GetDragFullOptions() const
long mnStartDragHeight
OUString GetAutomaticallyChosenIconTheme() const
Obtain the name of the icon theme which will be chosen automatically for the desktop environment...
Color maButtonPressedRolloverTextColor
#define STYLE_CURSOR_NOBLINKTIME
Definition: settings.hxx:211
Color maMenuBarTextColor
static sal_uInt16 GetStartDragCode()
static Color HSBtoRGB(sal_uInt16 nHue, sal_uInt16 nSaturation, sal_uInt16 nBrightness)
vcl::Font maHelpFont
void SetTitleHeight(long nSize)
const HelpSettings & GetHelpSettings() const
long GetStartDragHeight() const
MouseSettingsOptions
Definition: settings.hxx:53
const Color & GetMenuTextColor() const
TRISTATE_INDET
const Color & GetEdgeBlendingBottomRightColor() const
sal_uLong mnMenuDelay
BitmapEx const & GetPersonaFooter() const
bool mbUseFontAAFromSystem
Disabling AA doesn't actually disable AA of fonts, instead it is taken from system settings...
#define MOUSE_LEFT
Definition: event.hxx:98
std::unique_ptr< LocaleDataWrapper > mpLocaleDataWrapper
ToolbarIconSize GetToolbarIconSize() const
bool operator!=(const MouseSettings &rSet) const
const Color & GetMenuColor() const
sal_uLong mnButtonRepeat
const LanguageTag & GetLanguageTag() const
vcl::Font maPushButtonFont
OUString maPersonaHeaderFooter
Cache the settings to detect changes.
Color maDefaultActionButtonTextColor
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
MouseFollowFlags
Definition: settings.hxx:65
void SetCursorBlinkTime(sal_uInt64 nBlinkTime)
Color maFieldTextColor
bool mbEnableLocalizedDecimalSep
void SetPreferredUseImagesInMenus(bool bPreferredUseImagesInMenus)
const Color & GetDarkShadowColor() const
const DialogStyle & GetDialogStyle() const
bool IsEmpty() const
Definition: bitmapex.cxx:203
MouseWheelBehaviour GetWheelBehavior() const
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
#define SAL_CONFIGFILE(name)
Color maAlternatingRowColor
const Color & GetActionButtonRolloverTextColor() const
const vcl::Font & GetPushButtonFont() const
vcl::Font maGroupFont
void SetActionButtonRolloverTextColor(const Color &rColor)
const Color & GetDisableColor() const
void SetSpinSize(long nSize)
static bool isRightToLeft(LanguageType nLang)
void SetFamilyName(const OUString &rFamilyName)
Definition: font/font.cxx:107
const vcl::Font & GetGroupFont() const
void SetIconTheme(const OUString &)
Set the icon theme to use.
std::shared_ptr< ImplStyleData > mxData
Definition: settings.hxx:218
long GetCursorSize() const
bool GetUseSystemUIFonts() const
const Color & GetMenuBarColor() const
MouseMiddleButtonAction GetMiddleButtonAction() const
const vcl::Font & GetToolFont() const
void SetListBoxMaximumLineCount(sal_uInt16 nCount)
void SetEdgeBlending(sal_uInt16 nCount)
#define LANGUAGE_SYSTEM
DialogStyle maDialogStyle
static void SetSettings(const AllSettings &rSettings)
Sets the application's settings and notifies all windows of the change.
Definition: svapp.cxx:611
Color maCheckedColor
DisplayOptions GetDisplayOptions() const
void SetLanguageTag(const OUString &rLanguage, bool bCanonicalize)
void SetMenuBarColor(const Color &rColor)
const vcl::Font & GetTabFont() const
void SetMouseSettings(const MouseSettings &rSet)
sal_uInt16 mnColorValueSetColumnCount
Color maMenuHighlightTextColor
void SetButtonRolloverTextColor(const Color &rColor)
long GetDoubleClickHeight() const
TRISTATE_FALSE
const Color & GetMenuBarHighlightTextColor() const
void SetGroupTextColor(const Color &rColor)
void SetMenuBarHighlightTextColor(const Color &rColor)
vcl::Font maTitleFont
void SetDisableColor(const Color &rColor)
const Color & GetFontColor() const
const Color & GetFieldColor() const
WEIGHT_NORMAL
bool GetHideDisabledMenuItems() const
sal_uLong GetTipTimeout() const
BitmapEx maPersonaFooterBitmap
Cache the footer bitmap.
const vcl::Font & GetHelpFont() const
void SetContextMenuShortcuts(TriState eContextMenuShortcuts)
void SetSkipDisabledInMenus(bool bSkipDisabledInMenus)
void SetStandardStyles()
static bool GetLayoutRTL()
bool mbCanDetermineWindowPosition
Definition: svdata.hxx:300
static OConfigurationTreeRoot tryCreateWithComponentContext(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &_rPath, sal_Int32 _nDepth=-1, CREATION_MODE _eMode=CM_UPDATABLE)
o3tl::optional< Color > maPersonaMenuBarTextColor
Cache the menubar color.
void SetFieldColor(const Color &rColor)
static void LocaleSettingsChanged(ConfigurationHints nHint)
Color maInactiveTabColor
void SetAppFont(const vcl::Font &rFont)
const Color & GetAlternatingRowColor() const
const LanguageTag & getLanguageTag()
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:349
void SetRadioCheckTextColor(const Color &rColor)
void SetUseSystemUIFonts(bool bUseSystemUIFonts)
static long GetSplitSize()
void SetCursorSize(long nSize)
void SetVisitedLinkColor(const Color &rColor)
std::shared_ptr< ImplAllSettingsData > mxData
Definition: settings.hxx:658
void SetLabelTextColor(const Color &rColor)
const Color & GetCheckedColor() const
LanguageTag maUILocale
Color maMenuBarHighlightTextColor
void SetUseImagesInMenus(TriState eUseImagesInMenus)
MouseSettingsOptions mnOptions
Color maHighlightColor
void SetInactiveTabColor(const Color &rColor)
void SetToolFont(const vcl::Font &rFont)
const Color & GetLinkColor() const
WhichPersona
void SetPreferredContextMenuShortcuts(bool bContextMenuShortcuts)
void SetFloatTitleFont(const vcl::Font &rFont)
const Color & GetButtonRolloverTextColor() const
static sal_uInt16 GetColorValueSetMaximumRowCount()
StyleSettingsOptions GetOptions() const
void SetDoubleClickWidth(long nDoubleClkWidth)
Color maDeactiveColor
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:934
static sal_uLong GetActionDelay()
static DefaultFontConfiguration & get()
SelectionOptions mnSelectionOptions
const vcl::I18nHelper & GetLocaleI18nHelper() const
static bool GetMathLayoutRTL()
long GetStartDragWidth() const
Color maHighlightLinkColor
bool GetUseFontAAFromSystem() const
void SetTabTextColor(const Color &rColor)
void SetStartDragHeight(long nDragHeight)
void SetScrollBarSize(long nSize)
vcl::Font maToolFont
const Color & GetVisitedLinkColor() const
static sal_uInt16 GetContextMenuCode()
const Color & GetMenuBorderColor() const
sal_uInt16 mnEdgeBlending
Color maMenuHighlightColor
void SetToolTextColor(const Color &rColor)
void SetSelectionOptions(SelectionOptions nOptions)
void SetPreferredIconTheme(const OUString &, bool bDarkIconTheme=false)
Set a preferred icon theme.
TriState meUseImagesInMenus
TriState mnDisablePrinting
void SetGroupFont(const vcl::Font &rFont)
void SetPushButtonFont(const vcl::Font &rFont)
Color maDeactiveBorderColor
Color maMenuBarRolloverColor
void SetFaceColor(const Color &rColor)
StyleSettings maStyleSettings
Color maButtonTextColor
bool operator==(const MiscSettings &rSet) const
void SetLightBorderColor(const Color &rColor)
void SetTitleFont(const vcl::Font &rFont)
std::shared_ptr< vcl::IconThemeScanner > mIconThemeScanner
Color GetFaceGradientColor() const
vcl::Font maTabFont
static bool IsHeadlessModeEnabled()
Determines if headless mode is enabled.
Definition: svapp.cxx:1509
sal_uInt64 GetCursorBlinkTime() const
static bool GetDockingFloatsSupported()
DisplayOptions mnDisplayOptions
Color maActiveTextColor
const vcl::Font & GetTitleFont() const
const Color & GetButtonTextColor() const
bool GetUseImagesInMenus() const
#define ERRCODE_NONE
Definition: errcode.hxx:198
void SetLabelFont(const vcl::Font &rFont)
unsigned char sal_uInt8
long mnDoubleClkHeight
MouseMiddleButtonAction mnMiddleButtonAction
const Color & GetDefaultActionButtonTextColor() const
Color maGroupTextColor
void SetWorkspaceColor(const Color &rColor)
void SetDisplayOptions(DisplayOptions nOptions)
void BatchSetFonts(const vcl::Font &aAppFont, const vcl::Font &aLabelFont)
void SetAutoMnemonic(bool bAutoMnemonic)
OUString mIconTheme
OUString aName
FAMILY_SWISS
const vcl::Font & GetIconFont() const
ToolbarIconSize
Definition: settings.hxx:203
const Color & GetTabHighlightTextColor() const
Size maListBoxPreviewDefaultPixelSize
bool GetPrimaryButtonWarpsSlider() const
sal_uInt16 GetListBoxMaximumLineCount() const
void SetButtonPressedRolloverTextColor(const Color &rColor)
const Color & GetHelpColor() const
bool mbPreviewUsesCheckeredBackground
void SetWheelBehavior(MouseWheelBehaviour nBehavior)
void SetFollow(MouseFollowFlags nFollow)
css::uno::Any getNodeValue(const OUString &_rPath) const
Reference< XComponentContext > getProcessComponentContext()
const MouseSettings & GetMouseSettings() const
const vcl::Font & GetFloatTitleFont() const
long GetSpinSize() const
Size maListBoxPreviewDefaultLogicSize
const Color & GetWindowColor() const
bool GetSkipDisabledInMenus() const
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
Color maFieldRolloverTextColor
void SetHelpColor(const Color &rColor)
static sal_uLong GetBalloonDelay()
const o3tl::optional< Color > & GetPersonaMenuBarTextColor() const
void SetActiveBorderColor(const Color &rColor)
vcl::Font maLabelFont
Color maLabelTextColor
const vcl::Font & GetAppFont() const
constexpr::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
void Set3DColors(const Color &rColor)
AllSettingsFlags Update(AllSettingsFlags nFlags, const AllSettings &rSettings)
void SetHelpSettings(const HelpSettings &rSet)
void SetListBoxPreviewDefaultLogicSize(Size const &rSize)
TriState meContextMenuShortcuts
static sal_uInt16 GetListBoxPreviewDefaultLineWidth()
void SetMenuDelay(sal_uLong nDelay)
DisplayOptions
Definition: settings.hxx:193
void SetTabFont(const vcl::Font &rFont)
const MiscSettings & GetMiscSettings() const
Color maDialogTextColor
BitmapEx maPersonaHeaderBitmap
Cache the header bitmap.
const Color & GetButtonPressedRolloverTextColor() const
bool operator==(const AllSettings &rSet) const
const Color & GetTabRolloverTextColor() const
MouseWheelBehaviour
Definition: settings.hxx:80
void SetDeactiveTextColor(const Color &rColor)
void SetFieldTextColor(const Color &rColor)
constexpr::Color COL_BLUE(0x00, 0x00, 0x80)
bool operator!=(const HelpSettings &rSet) const
void SetStandardStyles()
void SetShadowColor(const Color &rColor)
void RGBtoHSB(sal_uInt16 &nHue, sal_uInt16 &nSaturation, sal_uInt16 &nBrightness) const
const Color & GetDeactiveBorderColor() const
void SetColorValueSetColumnCount(sal_uInt16 nCount)
Color maRadioCheckTextColor
bool GetEnableATToolSupport() const
std::unique_ptr< vcl::I18nHelper > mpI18nHelper
const Color & GetHighlightLinkColor() const
std::shared_ptr< ImplHelpData > mxData
Definition: settings.hxx:626
DragFullOptions
Definition: settings.hxx:166
const LanguageTag & GetRealUILanguageTag() const
void SetActiveTextColor(const Color &rColor)
bool GetDisablePrinting() const
void SetTabHighlightTextColor(const Color &rColor)
long GetScrollBarSize() const
Color maButtonRolloverTextColor
static SettingsConfigItem * get()
Color maMenuBarRolloverTextColor
void SetUseFontAAFromSystem(bool bUseFontAAFromSystem)
sal_uInt64 mnDoubleClkTime
static bool isRightToLeftMath(LanguageType nLang)
bool operator!=(const AllSettings &rSet) const
HelpSettings maHelpSettings
const Color & GetMenuBarRolloverTextColor() const
void SetHelpTextColor(const Color &rColor)
void SetButtonRepeat(sal_uLong nRepeat)
sal_uInt64 mnCursorBlinkTime
void SetWindowTextColor(const Color &rColor)
void SetUseFlatMenus(bool bUseFlatMenus)
static sal_uInt16 GetContextMenuClicks()
const Color & GetDialogTextColor() const
TriState
static sal_uLong GetScrollRepeat()
void SetHighlightTextColor(const Color &rColor)
const Color & GetEdgeBlendingTopLeftColor() const
MouseSettings maMouseSettings
SvtSysLocaleOptions & GetOptions() const
#define MOUSE_RIGHT
Definition: event.hxx:100
AllSettingsFlags GetChangeFlags(const AllSettings &rSettings) const
void SetAntialiasingMinPixelHeight(long nMinPixel)
sal_Int32 h
const Color & GetTabTextColor() const
void SetTipTimeout(sal_uLong nTipTimeout)
bool operator!=(const MiscSettings &rSet) const
void BatchSetBackgrounds(const Color &aBackColor, bool bCheckedColorSpecialCase=true)
sal_uLong GetAntialiasingMinPixelHeight() const
const Color & GetWindowTextColor() const
vcl::Font maIconFont
void SetDarkShadowColor(const Color &rColor)
Color maTabRolloverTextColor
const Color & GetMonoColor() const
bool operator==(const StyleSettings &rSet) const
void SetMiddleButtonAction(MouseMiddleButtonAction nAction)
void SetFloatTitleHeight(long nSize)
Color maMenuBorderColor
std::shared_ptr< ImplMiscData > mxData
Definition: settings.hxx:606
bool GetUseFlatBorders() const
MouseMiddleButtonAction
Definition: settings.hxx:75
Color maVisitedLinkColor
std::unique_ptr< vcl::I18nHelper > mpUII18nHelper
static sal_uLong GetButtonStartRepeat()
vcl::Font maAppFont
void SetActiveColor(const Color &rColor)
Color maEdgeBlendingTopLeftColor