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 <IconThemeScanner.hxx>
38 #include <IconThemeSelector.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 <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 
164  sal_uInt64 mnCursorBlinkTime;
183  std::shared_ptr<vcl::IconThemeScanner>
185  std::shared_ptr<vcl::IconThemeSelector>
187 
188  OUString mIconTheme;
193  //mbPrimaryButtonWarpsSlider == true for "jump to here" behavior for primary button, otherwise
194  //primary means scroll by single page. Secondary button takes the alternative behaviour
197 
198  sal_uInt16 mnEdgeBlending;
206 
208 
211  std::optional<Color> maPersonaMenuBarTextColor;
212 };
213 
215 {
216  ImplMiscData();
220 };
221 
223 {
225 };
226 
228 {
232 
239  std::unique_ptr<LocaleDataWrapper> mpLocaleDataWrapper;
240  std::unique_ptr<LocaleDataWrapper> mpUILocaleDataWrapper;
241  std::unique_ptr<LocaleDataWrapper> mpNeutralLocaleDataWrapper;
242  std::unique_ptr<vcl::I18nHelper> mpI18nHelper;
243  std::unique_ptr<vcl::I18nHelper> mpUII18nHelper;
245 };
246 
247 void
249 {
250  CopyData();
251  mxData->mnOptions = nOptions;
252 }
253 
256 {
257  return mxData->mnOptions;
258 }
259 
260 void
261 MouseSettings::SetDoubleClickTime( sal_uInt64 nDoubleClkTime )
262 {
263  CopyData();
264  mxData->mnDoubleClkTime = nDoubleClkTime;
265 }
266 
267 sal_uInt64
269 {
270  return mxData->mnDoubleClkTime;
271 }
272 
273 void
274 MouseSettings::SetDoubleClickWidth( long nDoubleClkWidth )
275 {
276  CopyData();
277  mxData->mnDoubleClkWidth = nDoubleClkWidth;
278 }
279 
280 long
282 {
283  return mxData->mnDoubleClkWidth;
284 }
285 
286 void
287 MouseSettings::SetDoubleClickHeight( long nDoubleClkHeight )
288 {
289  CopyData();
290  mxData->mnDoubleClkHeight = nDoubleClkHeight;
291 }
292 
293 long
295 {
296  return mxData->mnDoubleClkHeight;
297 }
298 
299 void
301 {
302  CopyData();
303  mxData->mnStartDragWidth = nDragWidth;
304 }
305 
306 long
308 {
309  return mxData->mnStartDragWidth;
310 }
311 
312 void
314 {
315  CopyData();
316  mxData->mnStartDragHeight = nDragHeight;
317 }
318 
319 long
321 {
322  return mxData->mnStartDragHeight;
323 }
324 
325 sal_uInt16
327 {
328  return MOUSE_LEFT;
329 }
330 
331 sal_uInt16
333 {
334  return MOUSE_RIGHT;
335 }
336 
337 sal_uInt16
339 {
340  return 1;
341 }
342 
343 sal_uLong
345 {
346  return 100;
347 }
348 
349 sal_uLong
351 {
352  return 370;
353 }
354 
355 void
357 {
358  CopyData();
359  mxData->mnButtonRepeat = nRepeat;
360 }
361 
362 sal_uLong
364 {
365  return mxData->mnButtonRepeat;
366 }
367 
368 sal_uLong
370 {
371  return 250;
372 }
373 
374 void
376 {
377  CopyData();
378  mxData->mnMenuDelay = nDelay;
379 }
380 
381 sal_uLong
383 {
384  return mxData->mnMenuDelay;
385 }
386 
387 void
389 {
390  CopyData();
391  mxData->mnFollow = nFollow;
392 }
393 
396 {
397  return mxData->mnFollow;
398 }
399 
400 void
402 {
403  CopyData();
404  mxData->mnMiddleButtonAction = nAction;
405 }
406 
409 {
410  return mxData->mnMiddleButtonAction;
411 }
412 
413 void
415 {
416  CopyData();
417  mxData->mnWheelBehavior = nBehavior;
418 }
419 
422 {
423  return mxData->mnWheelBehavior;
424 }
425 
426 bool
428 {
429  return !(*this == rSet);
430 }
431 
433  : mxData(std::make_shared<ImplMouseData>())
434 {
435 }
436 
438 {
439  // copy if other references exist
440  if (mxData.use_count() > 1)
441  {
442  mxData = std::make_shared<ImplMouseData>(*mxData);
443  }
444 }
445 
446 bool MouseSettings::operator ==( const MouseSettings& rSet ) const
447 {
448  if ( mxData == rSet.mxData )
449  return true;
450 
451  return
452  (mxData->mnOptions == rSet.mxData->mnOptions) &&
453  (mxData->mnDoubleClkTime == rSet.mxData->mnDoubleClkTime) &&
454  (mxData->mnDoubleClkWidth == rSet.mxData->mnDoubleClkWidth) &&
455  (mxData->mnDoubleClkHeight == rSet.mxData->mnDoubleClkHeight) &&
456  (mxData->mnStartDragWidth == rSet.mxData->mnStartDragWidth) &&
457  (mxData->mnStartDragHeight == rSet.mxData->mnStartDragHeight) &&
458  (mxData->mnMiddleButtonAction == rSet.mxData->mnMiddleButtonAction) &&
459  (mxData->mnButtonRepeat == rSet.mxData->mnButtonRepeat) &&
460  (mxData->mnMenuDelay == rSet.mxData->mnMenuDelay) &&
461  (mxData->mnFollow == rSet.mxData->mnFollow) &&
462  (mxData->mnWheelBehavior == rSet.mxData->mnWheelBehavior );
463 }
464 
466  mnScrollBarSize(16),
467  mnSpinSize(16),
468  mnCursorSize(2),
469  mnAntialiasedMin(0),
470  mnCursorBlinkTime(STYLE_CURSOR_NOBLINKTIME),
471  mnDragFullOptions(DragFullOptions::All),
472  mnSelectionOptions(SelectionOptions::NONE),
473  mnDisplayOptions(DisplayOptions::NONE),
474  mnToolbarIconSize(ToolbarIconSize::Unknown),
475  mnOptions(StyleSettingsOptions::NONE),
476  mbAutoMnemonic(true),
477  meUseImagesInMenus(TRISTATE_INDET),
478  mnMinThumbSize(16),
479  mIconThemeSelector(std::make_shared<vcl::IconThemeSelector>()),
480  meContextMenuShortcuts(TRISTATE_INDET),
481  mnEdgeBlending(35),
482  maEdgeBlendingTopLeftColor(Color(0xC0, 0xC0, 0xC0)),
483  maEdgeBlendingBottomRightColor(Color(0x40, 0x40, 0x40)),
484  mnListBoxMaximumLineCount(25),
485  // For some reason this isn't actually the column count that gets used, at least on iOS, but
486  // instead what SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() in
487  // svtools/source/config/accessibilityoptions.cxx returns.
488  mnColorValueSetColumnCount(12),
489 #ifdef IOS
490  maListBoxPreviewDefaultLogicSize(Size(30, 30)),
491 #else
492  maListBoxPreviewDefaultLogicSize(Size(15, 7)),
493 #endif
494  maListBoxPreviewDefaultPixelSize(Size(0, 0)), // on-demand calculated in GetListBoxPreviewDefaultPixelSize(),
495  mbPreviewUsesCheckeredBackground(true)
496 {
498 }
499 
501  maActiveBorderColor( rData.maActiveBorderColor ),
502  maActiveColor( rData.maActiveColor ),
503  maActiveTextColor( rData.maActiveTextColor ),
504  maAlternatingRowColor( rData.maAlternatingRowColor ),
505  maDefaultButtonTextColor( rData.maDefaultButtonTextColor ),
506  maButtonTextColor( rData.maButtonTextColor ),
507  maDefaultActionButtonTextColor( rData.maDefaultActionButtonTextColor ),
508  maActionButtonTextColor( rData.maActionButtonTextColor ),
509  maFlatButtonTextColor( rData.maFlatButtonTextColor ),
510  maDefaultButtonRolloverTextColor( rData.maDefaultButtonRolloverTextColor ),
511  maButtonRolloverTextColor( rData.maButtonRolloverTextColor ),
512  maDefaultActionButtonRolloverTextColor( rData.maDefaultActionButtonRolloverTextColor ),
513  maActionButtonRolloverTextColor( rData.maActionButtonRolloverTextColor ),
514  maFlatButtonRolloverTextColor( rData.maFlatButtonRolloverTextColor ),
515  maDefaultButtonPressedRolloverTextColor( rData.maDefaultButtonPressedRolloverTextColor ),
516  maButtonPressedRolloverTextColor( rData.maButtonPressedRolloverTextColor ),
517  maDefaultActionButtonPressedRolloverTextColor( rData.maDefaultActionButtonPressedRolloverTextColor ),
518  maActionButtonPressedRolloverTextColor( rData.maActionButtonPressedRolloverTextColor ),
519  maFlatButtonPressedRolloverTextColor( rData.maFlatButtonPressedRolloverTextColor ),
520  maCheckedColor( rData.maCheckedColor ),
521  maDarkShadowColor( rData.maDarkShadowColor ),
522  maDeactiveBorderColor( rData.maDeactiveBorderColor ),
523  maDeactiveColor( rData.maDeactiveColor ),
524  maDeactiveTextColor( rData.maDeactiveTextColor ),
525  maDialogColor( rData.maDialogColor ),
526  maDialogTextColor( rData.maDialogTextColor ),
527  maDisableColor( rData.maDisableColor ),
528  maFaceColor( rData.maFaceColor ),
529  maFieldColor( rData.maFieldColor ),
530  maFieldTextColor( rData.maFieldTextColor ),
531  maFieldRolloverTextColor( rData.maFieldRolloverTextColor ),
532  maFontColor( rData.maFontColor ),
533  maGroupTextColor( rData.maGroupTextColor ),
534  maHelpColor( rData.maHelpColor ),
535  maHelpTextColor( rData.maHelpTextColor ),
536  maHighlightColor( rData.maHighlightColor ),
537  maHighlightLinkColor( rData.maHighlightLinkColor ),
538  maHighlightTextColor( rData.maHighlightTextColor ),
539  maLabelTextColor( rData.maLabelTextColor ),
540  maLightBorderColor( rData.maLightBorderColor ),
541  maLightColor( rData.maLightColor ),
542  maLinkColor( rData.maLinkColor ),
543  maMenuBarColor( rData.maMenuBarColor ),
544  maMenuBarRolloverColor( rData.maMenuBarRolloverColor ),
545  maMenuBorderColor( rData.maMenuBorderColor ),
546  maMenuColor( rData.maMenuColor ),
547  maMenuHighlightColor( rData.maMenuHighlightColor ),
548  maMenuHighlightTextColor( rData.maMenuHighlightTextColor ),
549  maMenuTextColor( rData.maMenuTextColor ),
550  maMenuBarTextColor( rData.maMenuBarTextColor ),
551  maMenuBarRolloverTextColor( rData.maMenuBarRolloverTextColor ),
552  maMenuBarHighlightTextColor( rData.maMenuBarHighlightTextColor ),
553  maMonoColor( rData.maMonoColor ),
554  maRadioCheckTextColor( rData.maRadioCheckTextColor ),
555  maShadowColor( rData.maShadowColor ),
556  maVisitedLinkColor( rData.maVisitedLinkColor ),
557  maToolTextColor( rData.maToolTextColor ),
558  maWindowColor( rData.maWindowColor ),
559  maWindowTextColor( rData.maWindowTextColor ),
560  maWorkspaceColor( rData.maWorkspaceColor ),
561  maActiveTabColor( rData.maActiveTabColor ),
562  maInactiveTabColor( rData.maInactiveTabColor ),
563  maTabTextColor( rData.maTabTextColor ),
564  maTabRolloverTextColor( rData.maTabRolloverTextColor ),
565  maTabHighlightTextColor( rData.maTabHighlightTextColor ),
566  maAppFont( rData.maAppFont ),
567  maHelpFont( rData.maAppFont ),
568  maTitleFont( rData.maTitleFont ),
569  maFloatTitleFont( rData.maFloatTitleFont ),
570  maMenuFont( rData.maMenuFont ),
571  maToolFont( rData.maToolFont ),
572  maLabelFont( rData.maLabelFont ),
573  maRadioCheckFont( rData.maRadioCheckFont ),
574  maPushButtonFont( rData.maPushButtonFont ),
575  maFieldFont( rData.maFieldFont ),
576  maIconFont( rData.maIconFont ),
577  maTabFont( rData.maTabFont ),
578  maGroupFont( rData.maGroupFont ),
579  mnTitleHeight(rData.mnTitleHeight),
580  mnFloatTitleHeight(rData.mnFloatTitleHeight),
581  mnScrollBarSize(rData.mnScrollBarSize),
582  mnSpinSize(rData.mnSpinSize),
583  mnCursorSize(rData.mnCursorSize),
584  mnAntialiasedMin(rData.mnAntialiasedMin),
585  mnCursorBlinkTime(rData.mnCursorBlinkTime),
586  mnDragFullOptions(rData.mnDragFullOptions),
587  mnSelectionOptions(rData.mnSelectionOptions),
588  mnDisplayOptions(rData.mnDisplayOptions),
589  mnToolbarIconSize(rData.mnToolbarIconSize),
590  mnUseFlatMenus(rData.mnUseFlatMenus),
591  mnOptions(rData.mnOptions),
592  mbHighContrast(rData.mbHighContrast),
593  mbUseSystemUIFonts(rData.mbUseSystemUIFonts),
594  mbUseFontAAFromSystem(rData.mbUseFontAAFromSystem),
595  mbAutoMnemonic(rData.mbAutoMnemonic),
596  meUseImagesInMenus(rData.meUseImagesInMenus),
597  mnUseFlatBorders(rData.mnUseFlatBorders),
598  mbPreferredUseImagesInMenus(rData.mbPreferredUseImagesInMenus),
599  mnMinThumbSize(rData.mnMinThumbSize),
600  mIconThemeSelector(std::make_shared<vcl::IconThemeSelector>(*rData.mIconThemeSelector)),
601  mIconTheme(rData.mIconTheme),
602  mbSkipDisabledInMenus(rData.mbSkipDisabledInMenus),
603  mbHideDisabledMenuItems(rData.mbHideDisabledMenuItems),
604  mbPreferredContextMenuShortcuts(rData.mbPreferredContextMenuShortcuts),
605  meContextMenuShortcuts(rData.meContextMenuShortcuts),
606  mbPrimaryButtonWarpsSlider(rData.mbPrimaryButtonWarpsSlider),
607  maDialogStyle( rData.maDialogStyle ),
608  mnEdgeBlending(rData.mnEdgeBlending),
609  maEdgeBlendingTopLeftColor(rData.maEdgeBlendingTopLeftColor),
610  maEdgeBlendingBottomRightColor(rData.maEdgeBlendingBottomRightColor),
611  mnListBoxMaximumLineCount(rData.mnListBoxMaximumLineCount),
612  mnColorValueSetColumnCount(rData.mnColorValueSetColumnCount),
613  maListBoxPreviewDefaultLogicSize(rData.maListBoxPreviewDefaultLogicSize),
614  maListBoxPreviewDefaultPixelSize(rData.maListBoxPreviewDefaultPixelSize),
615  mbPreviewUsesCheckeredBackground(rData.mbPreviewUsesCheckeredBackground),
616  maPersonaHeaderFooter( rData.maPersonaHeaderFooter ),
617  maPersonaHeaderBitmap( rData.maPersonaHeaderBitmap ),
618  maPersonaFooterBitmap( rData.maPersonaFooterBitmap ),
619  maPersonaMenuBarTextColor( rData.maPersonaMenuBarTextColor )
620 {
621  if (rData.mIconThemeScanner)
622  mIconThemeScanner = std::make_shared<vcl::IconThemeScanner>(*rData.mIconThemeScanner);
623 }
624 
626 {
627  vcl::Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) );
628  aStdFont.SetCharSet( osl_getThreadTextEncoding() );
629  aStdFont.SetWeight( WEIGHT_NORMAL );
631  aStdFont.SetFamilyName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag("en")));
632  else
633  aStdFont.SetFamilyName("Liberation Sans");
634  maAppFont = aStdFont;
635  maHelpFont = aStdFont;
636  maMenuFont = aStdFont;
637  maToolFont = aStdFont;
638  maGroupFont = aStdFont;
639  maLabelFont = aStdFont;
640  maRadioCheckFont = aStdFont;
641  maPushButtonFont = aStdFont;
642  maFieldFont = aStdFont;
643  maIconFont = aStdFont;
644  maTabFont = aStdFont;
645  aStdFont.SetWeight( WEIGHT_BOLD );
646  maFloatTitleFont = aStdFont;
647  maTitleFont = aStdFont;
648 
650  maCheckedColor = Color( 0xCC, 0xCC, 0xCC );
655 
671 
679  maWorkspaceColor = Color( 0xDF, 0xDF, 0xDE );
708  maHelpColor = Color( 0xFF, 0xFF, 0xE0 );
711  maVisitedLinkColor = Color( 0x00, 0x00, 0xCC );
715  maAlternatingRowColor = Color( 0xEE, 0xEE, 0xEE );
716 
717  mnTitleHeight = 18;
718  mnFloatTitleHeight = 13;
719  mbHighContrast = false;
720  mbUseSystemUIFonts = true;
721  mbUseFontAAFromSystem = true;
722  mnUseFlatBorders = false;
723  mnUseFlatMenus = false;
725  mbSkipDisabledInMenus = false;
726  mbHideDisabledMenuItems = false;
729 }
730 
732  : mxData(std::make_shared<ImplStyleData>())
733 {
734 }
735 
736 void
738 {
739  CopyData();
740  mxData->maFaceColor = rColor;
741 }
742 
743 const Color&
745 {
746  return mxData->maFaceColor;
747 }
748 
749 void
751 {
752  CopyData();
753  mxData->maCheckedColor = rColor;
754 }
755 
756 const Color&
758 {
759  return mxData->maCheckedColor;
760 }
761 
762 void
764 {
765  CopyData();
766  mxData->maLightColor = rColor;
767 }
768 
769 const Color&
771 {
772  return mxData->maLightColor;
773 }
774 
775 void
777 {
778  CopyData();
779  mxData->maLightBorderColor = rColor;
780 }
781 
782 const Color&
784 {
785  return mxData->maLightBorderColor;
786 }
787 
788 void
790 {
791  CopyData();
792  mxData->maShadowColor = rColor;
793 }
794 
795 const Color&
797 {
798  return mxData->maShadowColor;
799 }
800 
801 void
803 {
804  CopyData();
805  mxData->maDarkShadowColor = rColor;
806 }
807 
808 const Color&
810 {
811  return mxData->maDarkShadowColor;
812 }
813 
814 void
816 {
817  CopyData();
818  mxData->maDefaultButtonTextColor = rColor;
819 }
820 
821 const Color&
823 {
824  return mxData->maDefaultButtonTextColor;
825 }
826 
827 void
829 {
830  CopyData();
831  mxData->maButtonTextColor = rColor;
832 }
833 
834 const Color&
836 {
837  return mxData->maButtonTextColor;
838 }
839 
840 void
842 {
843  CopyData();
844  mxData->maDefaultActionButtonTextColor = rColor;
845 }
846 
847 const Color&
849 {
850  return mxData->maDefaultActionButtonTextColor;
851 }
852 
853 void
855 {
856  CopyData();
857  mxData->maActionButtonTextColor = rColor;
858 }
859 
860 const Color&
862 {
863  return mxData->maActionButtonTextColor;
864 }
865 
866 void
868 {
869  CopyData();
870  mxData->maFlatButtonTextColor = rColor;
871 }
872 
873 const Color&
875 {
876  return mxData->maFlatButtonTextColor;
877 }
878 
879 void
881 {
882  CopyData();
883  mxData->maDefaultButtonRolloverTextColor = rColor;
884 }
885 
886 const Color&
888 {
889  return mxData->maDefaultButtonRolloverTextColor;
890 }
891 
892 void
894 {
895  CopyData();
896  mxData->maButtonRolloverTextColor = rColor;
897 }
898 
899 const Color&
901 {
902  return mxData->maButtonRolloverTextColor;
903 }
904 
905 void
907 {
908  CopyData();
909  mxData->maDefaultActionButtonRolloverTextColor = rColor;
910 }
911 
912 const Color&
914 {
915  return mxData->maDefaultActionButtonRolloverTextColor;
916 }
917 
918 void
920 {
921  CopyData();
922  mxData->maActionButtonRolloverTextColor = rColor;
923 }
924 
925 const Color&
927 {
928  return mxData->maActionButtonRolloverTextColor;
929 }
930 
931 void
933 {
934  CopyData();
935  mxData->maFlatButtonRolloverTextColor = rColor;
936 }
937 
938 const Color&
940 {
941  return mxData->maFlatButtonRolloverTextColor;
942 }
943 
944 void
946 {
947  CopyData();
948  mxData->maDefaultButtonPressedRolloverTextColor = rColor;
949 }
950 
951 const Color&
953 {
954  return mxData->maDefaultButtonPressedRolloverTextColor;
955 }
956 
957 void
959 {
960  CopyData();
961  mxData->maButtonPressedRolloverTextColor = rColor;
962 }
963 
964 const Color&
966 {
967  return mxData->maButtonPressedRolloverTextColor;
968 }
969 
970 void
972 {
973  CopyData();
974  mxData->maDefaultActionButtonPressedRolloverTextColor = rColor;
975 }
976 
977 const Color&
979 {
980  return mxData->maDefaultActionButtonPressedRolloverTextColor;
981 }
982 
983 void
985 {
986  CopyData();
987  mxData->maActionButtonPressedRolloverTextColor = rColor;
988 }
989 
990 const Color&
992 {
993  return mxData->maActionButtonPressedRolloverTextColor;
994 }
995 
996 void
998 {
999  CopyData();
1000  mxData->maFlatButtonPressedRolloverTextColor = rColor;
1001 }
1002 
1003 const Color&
1005 {
1006  return mxData->maFlatButtonPressedRolloverTextColor;
1007 }
1008 
1009 void
1011 {
1012  CopyData();
1013  mxData->maRadioCheckTextColor = rColor;
1014 }
1015 
1016 const Color&
1018 {
1019  return mxData->maRadioCheckTextColor;
1020 }
1021 
1022 void
1024 {
1025  CopyData();
1026  mxData->maGroupTextColor = rColor;
1027 }
1028 
1029 const Color&
1031 {
1032  return mxData->maGroupTextColor;
1033 }
1034 
1035 void
1037 {
1038  CopyData();
1039  mxData->maLabelTextColor = rColor;
1040 }
1041 
1042 const Color&
1044 {
1045  return mxData->maLabelTextColor;
1046 }
1047 
1048 void
1050 {
1051  CopyData();
1052  mxData->maWindowColor = rColor;
1053 }
1054 
1055 const Color&
1057 {
1058  return mxData->maWindowColor;
1059 }
1060 
1061 void
1063 {
1064  CopyData();
1065  mxData->maWindowTextColor = rColor;
1066 }
1067 
1068 const Color&
1070 {
1071  return mxData->maWindowTextColor;
1072 }
1073 
1074 void
1076 {
1077  CopyData();
1078  mxData->maDialogColor = rColor;
1079 }
1080 
1081 const Color&
1083 {
1084  return mxData->maDialogColor;
1085 }
1086 
1087 void
1089 {
1090  CopyData();
1091  mxData->maDialogTextColor = rColor;
1092 }
1093 
1094 const Color&
1096 {
1097  return mxData->maDialogTextColor;
1098 }
1099 
1100 void
1102 {
1103  CopyData();
1104  mxData->maWorkspaceColor = rColor;
1105 }
1106 
1107 const Color&
1109 {
1110  return mxData->maWorkspaceColor;
1111 }
1112 
1113 void
1115 {
1116  CopyData();
1117  mxData->maFieldColor = rColor;
1118 }
1119 
1120 const Color&
1122 {
1123  return mxData->maFieldColor;
1124 }
1125 
1126 void
1128 {
1129  CopyData();
1130  mxData->maFieldTextColor = rColor;
1131 }
1132 
1133 const Color&
1135 {
1136  return mxData->maFieldTextColor;
1137 }
1138 
1139 void
1141 {
1142  CopyData();
1143  mxData->maFieldRolloverTextColor = rColor;
1144 }
1145 
1146 const Color&
1148 {
1149  return mxData->maFieldRolloverTextColor;
1150 }
1151 
1152 void
1154 {
1155  CopyData();
1156  mxData->maActiveColor = rColor;
1157 }
1158 
1159 const Color&
1161 {
1162  return mxData->maActiveColor;
1163 }
1164 
1165 void
1167 {
1168  CopyData();
1169  mxData->maActiveTextColor = rColor;
1170 }
1171 
1172 const Color&
1174 {
1175  return mxData->maActiveTextColor;
1176 }
1177 
1178 void
1180 {
1181  CopyData();
1182  mxData->maActiveBorderColor = rColor;
1183 }
1184 
1185 const Color&
1187 {
1188  return mxData->maActiveBorderColor;
1189 }
1190 
1191 void
1193 {
1194  CopyData();
1195  mxData->maDeactiveColor = rColor;
1196 }
1197 
1198 const Color&
1200 {
1201  return mxData->maDeactiveColor;
1202 }
1203 
1204 void
1206 {
1207  CopyData();
1208  mxData->maDeactiveTextColor = rColor;
1209 }
1210 
1211 const Color&
1213 {
1214  return mxData->maDeactiveTextColor;
1215 }
1216 
1217 void
1219 {
1220  CopyData();
1221  mxData->maDeactiveBorderColor = rColor;
1222 }
1223 
1224 const Color&
1226 {
1227  return mxData->maDeactiveBorderColor;
1228 }
1229 
1230 void
1232 {
1233  CopyData();
1234  mxData->maHighlightColor = rColor;
1235 }
1236 
1237 const Color&
1239 {
1240  return mxData->maHighlightColor;
1241 }
1242 
1243 void
1245 {
1246  CopyData();
1247  mxData->maHighlightTextColor = rColor;
1248 }
1249 
1250 const Color&
1252 {
1253  return mxData->maHighlightTextColor;
1254 }
1255 
1256 void
1258 {
1259  CopyData();
1260  mxData->maDisableColor = rColor;
1261 }
1262 
1263 const Color&
1265 {
1266  return mxData->maDisableColor;
1267 }
1268 
1269 void
1271 {
1272  CopyData();
1273  mxData->maHelpColor = rColor;
1274 }
1275 
1276 const Color&
1278 {
1279  return mxData->maHelpColor;
1280 }
1281 
1282 void
1284 {
1285  CopyData();
1286  mxData->maHelpTextColor = rColor;
1287 }
1288 
1289 const Color&
1291 {
1292  return mxData->maHelpTextColor;
1293 }
1294 
1295 void
1297 {
1298  CopyData();
1299  mxData->maMenuColor = rColor;
1300 }
1301 
1302 const Color&
1304 {
1305  return mxData->maMenuColor;
1306 }
1307 
1308 void
1310 {
1311  CopyData();
1312  mxData->maMenuBarColor = rColor;
1313 }
1314 
1315 const Color&
1317 {
1318  return mxData->maMenuBarColor;
1319 }
1320 
1321 void
1323 {
1324  CopyData();
1325  mxData->maMenuBarRolloverColor = rColor;
1326 }
1327 
1328 const Color&
1330 {
1331  return mxData->maMenuBarRolloverColor;
1332 }
1333 
1334 void
1336 {
1337  CopyData();
1338  mxData->maMenuBorderColor = rColor;
1339 }
1340 
1341 const Color&
1343 {
1344  return mxData->maMenuBorderColor;
1345 }
1346 
1347 void
1349 {
1350  CopyData();
1351  mxData->maMenuTextColor = rColor;
1352 }
1353 
1354 const Color&
1356 {
1357  return mxData->maMenuTextColor;
1358 }
1359 
1360 void
1362 {
1363  CopyData();
1364  mxData->maMenuBarTextColor = rColor;
1365 }
1366 
1367 const Color&
1369 {
1370  return mxData->maMenuBarTextColor;
1371 }
1372 
1373 void
1375 {
1376  CopyData();
1377  mxData->maMenuBarRolloverTextColor = rColor;
1378 }
1379 
1380 const Color&
1382 {
1383  return mxData->maMenuBarRolloverTextColor;
1384 }
1385 
1386 void
1388 {
1389  CopyData();
1390  mxData->maMenuBarHighlightTextColor = rColor;
1391 }
1392 
1393 const Color&
1395 {
1396  return mxData->maMenuBarHighlightTextColor;
1397 }
1398 
1399 void
1401 {
1402  CopyData();
1403  mxData->maMenuHighlightColor = rColor;
1404 }
1405 
1406 const Color&
1408 {
1409  return mxData->maMenuHighlightColor;
1410 }
1411 
1412 void
1414 {
1415  CopyData();
1416  mxData->maMenuHighlightTextColor = rColor;
1417 }
1418 
1419 const Color&
1421 {
1422  return mxData->maMenuHighlightTextColor;
1423 }
1424 
1425 void
1427 {
1428  CopyData();
1429  mxData->maTabTextColor = rColor;
1430 }
1431 
1432 const Color&
1434 {
1435  return mxData->maTabTextColor;
1436 }
1437 
1438 void
1440 {
1441  CopyData();
1442  mxData->maTabRolloverTextColor = rColor;
1443 }
1444 
1445 const Color&
1447 {
1448  return mxData->maTabRolloverTextColor;
1449 }
1450 
1451 void
1453 {
1454  CopyData();
1455  mxData->maTabHighlightTextColor = rColor;
1456 }
1457 
1458 const Color&
1460 {
1461  return mxData->maTabHighlightTextColor;
1462 }
1463 
1464 void
1466 {
1467  CopyData();
1468  mxData->maLinkColor = rColor;
1469 }
1470 
1471 const Color&
1473 {
1474  return mxData->maLinkColor;
1475 }
1476 
1477 void
1479 {
1480  CopyData();
1481  mxData->maVisitedLinkColor = rColor;
1482 }
1483 
1484 const Color&
1486 {
1487  return mxData->maVisitedLinkColor;
1488 }
1489 
1490 void
1492 {
1493  CopyData();
1494  mxData->maToolTextColor = rColor;
1495 }
1496 
1497 const Color&
1499 {
1500  return mxData->maToolTextColor;
1501 }
1502 
1503 const Color&
1505 {
1506  return mxData->maHighlightLinkColor;
1507 }
1508 
1509 void
1511 {
1512  CopyData();
1513  mxData->maMonoColor = rColor;
1514 }
1515 
1516 const Color&
1518 {
1519  return mxData->maMonoColor;
1520 }
1521 
1522 void
1524 {
1525  CopyData();
1526  mxData->maActiveTabColor = rColor;
1527 }
1528 
1529 const Color&
1531 {
1532  return mxData->maActiveTabColor;
1533 }
1534 
1535 void
1537 {
1538  CopyData();
1539  mxData->maInactiveTabColor = rColor;
1540 }
1541 
1542 const Color&
1544 {
1545  return mxData->maInactiveTabColor;
1546 }
1547 
1548 const Color&
1550 {
1551  return mxData->maAlternatingRowColor;
1552 }
1553 
1554 void
1555 StyleSettings::SetUseSystemUIFonts( bool bUseSystemUIFonts )
1556 {
1557  CopyData();
1558  mxData->mbUseSystemUIFonts = bUseSystemUIFonts;
1559 }
1560 
1561 bool
1563 {
1564  return mxData->mbUseSystemUIFonts;
1565 }
1566 
1567 void StyleSettings::SetUseFontAAFromSystem(bool bUseFontAAFromSystem)
1568 {
1569  CopyData();
1570  mxData->mbUseFontAAFromSystem = bUseFontAAFromSystem;
1571 }
1572 
1574 {
1575  return mxData->mbUseFontAAFromSystem;
1576 }
1577 
1578 void
1579 StyleSettings::SetUseFlatBorders( bool bUseFlatBorders )
1580 {
1581  CopyData();
1582  mxData->mnUseFlatBorders = bUseFlatBorders;
1583 }
1584 
1585 bool
1587 {
1588  return mxData->mnUseFlatBorders;
1589 }
1590 
1591 void
1592 StyleSettings::SetUseFlatMenus( bool bUseFlatMenus )
1593 {
1594  CopyData();
1595  mxData->mnUseFlatMenus = bUseFlatMenus;
1596 }
1597 
1598 bool
1600 {
1601  return mxData->mnUseFlatMenus;
1602 }
1603 
1604 void
1606 {
1607  CopyData();
1608  mxData->meUseImagesInMenus = eUseImagesInMenus;
1609 }
1610 
1611 void
1612 StyleSettings::SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus )
1613 {
1614  CopyData();
1615  mxData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus;
1616 }
1617 
1618 bool
1620 {
1621  return mxData->mbPreferredUseImagesInMenus;
1622 }
1623 
1624 void
1625 StyleSettings::SetSkipDisabledInMenus( bool bSkipDisabledInMenus )
1626 {
1627  CopyData();
1628  mxData->mbSkipDisabledInMenus = bSkipDisabledInMenus;
1629 }
1630 
1631 bool
1633 {
1634  return mxData->mbSkipDisabledInMenus;
1635 }
1636 
1637 void
1638 StyleSettings::SetHideDisabledMenuItems( bool bHideDisabledMenuItems )
1639 {
1640  CopyData();
1641  mxData->mbHideDisabledMenuItems = bHideDisabledMenuItems;
1642 }
1643 
1644 bool
1646 {
1647  return mxData->mbHideDisabledMenuItems;
1648 }
1649 
1650 void
1652 {
1653  CopyData();
1654  mxData->meContextMenuShortcuts = eContextMenuShortcuts;
1655 }
1656 
1657 bool
1659 {
1660  switch (mxData->meContextMenuShortcuts)
1661  {
1662  case TRISTATE_FALSE:
1663  return false;
1664  case TRISTATE_TRUE:
1665  return true;
1666  default: // TRISTATE_INDET:
1668  }
1669 }
1670 
1671 void
1673 {
1674  CopyData();
1675  mxData->mbPreferredContextMenuShortcuts = bContextMenuShortcuts;
1676 }
1677 
1678 bool
1680 {
1681  return mxData->mbPreferredContextMenuShortcuts;
1682 }
1683 
1684 void
1685 StyleSettings::SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider )
1686 {
1687  CopyData();
1688  mxData->mbPrimaryButtonWarpsSlider = bPrimaryButtonWarpsSlider;
1689 }
1690 
1691 bool
1693 {
1694  return mxData->mbPrimaryButtonWarpsSlider;
1695 }
1696 
1697 void
1699 {
1700  CopyData();
1701  mxData->maAppFont = rFont;
1702 }
1703 
1704 const vcl::Font&
1706 {
1707  return mxData->maAppFont;
1708 }
1709 
1710 void
1712 {
1713  CopyData();
1714  mxData->maHelpFont = rFont;
1715 }
1716 
1717 const vcl::Font&
1719 {
1720  return mxData->maHelpFont;
1721 }
1722 
1723 void
1725 {
1726  CopyData();
1727  mxData->maTitleFont = rFont;
1728 }
1729 
1730 const vcl::Font&
1732 {
1733  return mxData->maTitleFont;
1734 }
1735 
1736 void
1738 {
1739  CopyData();
1740  mxData->maFloatTitleFont = rFont;
1741 }
1742 
1743 const vcl::Font&
1745 {
1746  return mxData->maFloatTitleFont;
1747 }
1748 
1749 void
1751 {
1752  CopyData();
1753  mxData->maMenuFont = rFont;
1754 }
1755 
1756 const vcl::Font&
1758 {
1759  return mxData->maMenuFont;
1760 }
1761 
1762 void
1764 {
1765  CopyData();
1766  mxData->maToolFont = rFont;
1767 }
1768 
1769 const vcl::Font&
1771 {
1772  return mxData->maToolFont;
1773 }
1774 
1775 void
1777 {
1778  CopyData();
1779  mxData->maGroupFont = rFont;
1780 }
1781 
1782 const vcl::Font&
1784 {
1785  return mxData->maGroupFont;
1786 }
1787 
1788 void
1790 {
1791  CopyData();
1792  mxData->maLabelFont = rFont;
1793 }
1794 
1795 const vcl::Font&
1797 {
1798  return mxData->maLabelFont;
1799 }
1800 
1801 void
1803 {
1804  CopyData();
1805  mxData->maRadioCheckFont = rFont;
1806 }
1807 
1808 const vcl::Font&
1810 {
1811  return mxData->maRadioCheckFont;
1812 }
1813 
1814 void
1816 {
1817  CopyData();
1818  mxData->maPushButtonFont = rFont;
1819 }
1820 
1821 const vcl::Font&
1823 {
1824  return mxData->maPushButtonFont;
1825 }
1826 
1827 void
1829 {
1830  CopyData();
1831  mxData->maFieldFont = rFont;
1832 }
1833 
1834 const vcl::Font&
1836 {
1837  return mxData->maFieldFont;
1838 }
1839 
1840 void
1842 {
1843  CopyData();
1844  mxData->maIconFont = rFont;
1845 }
1846 
1847 const vcl::Font&
1849 {
1850  return mxData->maIconFont;
1851 }
1852 
1853 void
1855 {
1856  CopyData();
1857  mxData->maTabFont = rFont;
1858 }
1859 
1860 const vcl::Font&
1862 {
1863  return mxData->maTabFont;
1864 }
1865 
1866 long
1868 {
1869  return 1;
1870 }
1871 
1872 void
1874 {
1875  CopyData();
1876  mxData->mnTitleHeight = nSize;
1877 }
1878 
1879 long
1881 {
1882  return mxData->mnTitleHeight;
1883 }
1884 
1885 void
1887 {
1888  CopyData();
1889  mxData->mnFloatTitleHeight = nSize;
1890 }
1891 
1892 long
1894 {
1895  return mxData->mnFloatTitleHeight;
1896 }
1897 
1898 void
1900 {
1901  CopyData();
1902  mxData->mnScrollBarSize = nSize;
1903 }
1904 
1905 long
1907 {
1908  return mxData->mnScrollBarSize;
1909 }
1910 
1911 void
1913 {
1914  CopyData();
1915  mxData->mnMinThumbSize = nSize;
1916 }
1917 
1918 long
1920 {
1921  return mxData->mnMinThumbSize;
1922 }
1923 
1924 void
1926 {
1927  CopyData();
1928  mxData->mnSpinSize = nSize;
1929 }
1930 
1931 long
1933 {
1934  return mxData->mnSpinSize;
1935 }
1936 
1937 long
1939 {
1940  return 3;
1941 }
1942 
1943 void
1945 {
1946  CopyData();
1947  mxData->mnCursorSize = nSize;
1948 }
1949 
1950 long
1952 {
1953  return mxData->mnCursorSize;
1954 }
1955 
1956 void
1957 StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime )
1958 {
1959  CopyData();
1960  mxData->mnCursorBlinkTime = nBlinkTime;
1961 }
1962 
1963 sal_uInt64
1965 {
1966  return static_cast<long>(mxData->mnCursorBlinkTime);
1967 }
1968 
1969 void
1971 {
1972  CopyData();
1973  mxData->mnDragFullOptions = nOptions;
1974 }
1975 
1978 {
1979  return mxData->mnDragFullOptions;
1980 }
1981 
1982 void
1984 {
1985  CopyData();
1986  mxData->mnSelectionOptions = nOptions;
1987 }
1988 
1991 {
1992  return mxData->mnSelectionOptions;
1993 }
1994 
1995 void
1997 {
1998  CopyData();
1999  mxData->mnDisplayOptions = nOptions;
2000 }
2001 
2004 {
2005  return mxData->mnDisplayOptions;
2006 }
2007 
2008 void
2010 {
2011  CopyData();
2012  mxData->mnAntialiasedMin = nMinPixel;
2013 }
2014 
2015 sal_uLong
2017 {
2018  return mxData->mnAntialiasedMin;
2019 }
2020 
2021 void
2023 {
2024  CopyData();
2025  mxData->mnOptions = nOptions;
2026 }
2027 
2028 void
2029 StyleSettings::SetAutoMnemonic( bool bAutoMnemonic )
2030 {
2031  CopyData();
2032  mxData->mbAutoMnemonic = bAutoMnemonic;
2033 }
2034 
2035 bool
2037 {
2038  return mxData->mbAutoMnemonic;
2039 }
2040 
2041 bool
2043 {
2044  ImplSVData* pSVData = ImplGetSVData();
2045  return pSVData->maNWFData.mbCanDetermineWindowPosition;
2046 }
2047 
2048 void
2050 {
2051  CopyData();
2052  mxData->maFontColor = rColor;
2053 }
2054 
2055 const Color&
2057 {
2058  return mxData->maFontColor;
2059 }
2060 
2061 void
2063 {
2064  CopyData();
2065  mxData->mnToolbarIconSize = nSize;
2066 }
2067 
2070 {
2071  return mxData->mnToolbarIconSize;
2072 }
2073 
2074 const DialogStyle&
2076 {
2077  return mxData->maDialogStyle;
2078 }
2079 
2080 void
2082 {
2083  CopyData();
2084  mxData->mnEdgeBlending = nCount;
2085 }
2086 
2087 sal_uInt16
2089 {
2090  return mxData->mnEdgeBlending;
2091 }
2092 
2093 const Color&
2095 {
2096  return mxData->maEdgeBlendingTopLeftColor;
2097 }
2098 
2099 const Color&
2101 {
2102  return mxData->maEdgeBlendingBottomRightColor;
2103 }
2104 
2105 void
2107 {
2108  CopyData();
2109  mxData->mnListBoxMaximumLineCount = nCount;
2110 }
2111 
2112 sal_uInt16
2114 {
2115  return mxData->mnListBoxMaximumLineCount;
2116 }
2117 
2118 void
2120 {
2121  CopyData();
2122  mxData->mnColorValueSetColumnCount = nCount;
2123 }
2124 
2125 sal_uInt16
2127 {
2128  return mxData->mnColorValueSetColumnCount;
2129 }
2130 
2131 sal_uInt16
2133 {
2134  return 10;
2135 }
2136 
2137 sal_uInt16
2139 {
2140  return 1;
2141 }
2142 
2143 void
2145 {
2146  CopyData();
2147  mxData->mbPreviewUsesCheckeredBackground = bNew;
2148 }
2149 
2150 bool
2152 {
2153  return mxData->mbPreviewUsesCheckeredBackground;
2154 }
2155 
2156 bool
2158 {
2159  return !(*this == rSet);
2160 }
2161 
2163 {
2164  mxData->maListBoxPreviewDefaultLogicSize = rSize;
2165 }
2166 
2168 {
2169  if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height())
2170  {
2171  const_cast< StyleSettings* >(this)->mxData->maListBoxPreviewDefaultPixelSize =
2172  Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapMode(MapUnit::MapAppFont));
2173  }
2174 
2175  return mxData->maListBoxPreviewDefaultPixelSize;
2176 }
2177 
2178 void StyleSettings::Set3DColors( const Color& rColor )
2179 {
2180  CopyData();
2181  mxData->maFaceColor = rColor;
2182  mxData->maLightBorderColor = rColor;
2183  mxData->maMenuBorderColor = rColor;
2184  mxData->maDarkShadowColor = COL_BLACK;
2185  if ( rColor != COL_LIGHTGRAY )
2186  {
2187  mxData->maLightColor = rColor;
2188  mxData->maShadowColor = rColor;
2189  mxData->maDarkShadowColor=rColor;
2190  mxData->maLightColor.IncreaseLuminance( 64 );
2191  mxData->maShadowColor.DecreaseLuminance( 64 );
2192  mxData->maDarkShadowColor.DecreaseLuminance( 100 );
2193  sal_uLong nRed = mxData->maLightColor.GetRed();
2194  sal_uLong nGreen = mxData->maLightColor.GetGreen();
2195  sal_uLong nBlue = mxData->maLightColor.GetBlue();
2196  nRed += static_cast<sal_uLong>(mxData->maShadowColor.GetRed());
2197  nGreen += static_cast<sal_uLong>(mxData->maShadowColor.GetGreen());
2198  nBlue += static_cast<sal_uLong>(mxData->maShadowColor.GetBlue());
2199  mxData->maCheckedColor = Color( static_cast<sal_uInt8>(nRed/2), static_cast<sal_uInt8>(nGreen/2), static_cast<sal_uInt8>(nBlue/2) );
2200  }
2201  else
2202  {
2203  mxData->maCheckedColor = Color( 0x99, 0x99, 0x99 );
2204  mxData->maLightColor = COL_WHITE;
2205  mxData->maShadowColor = COL_GRAY;
2206  }
2207 }
2208 
2210 {
2211  CopyData();
2212  // Light gray checked color special case
2213  if ( GetFaceColor() == COL_LIGHTGRAY )
2214  mxData->maCheckedColor = Color( 0xCC, 0xCC, 0xCC );
2215  else
2216  {
2217  sal_uInt8 nRed = static_cast<sal_uInt8>((static_cast<sal_uInt16>(mxData->maFaceColor.GetRed()) + static_cast<sal_uInt16>(mxData->maLightColor.GetRed()))/2);
2218  sal_uInt8 nGreen = static_cast<sal_uInt8>((static_cast<sal_uInt16>(mxData->maFaceColor.GetGreen()) + static_cast<sal_uInt16>(mxData->maLightColor.GetGreen()))/2);
2219  sal_uInt8 nBlue = static_cast<sal_uInt8>((static_cast<sal_uInt16>(mxData->maFaceColor.GetBlue()) + static_cast<sal_uInt16>(mxData->maLightColor.GetBlue()))/2);
2220  mxData->maCheckedColor = Color( nRed, nGreen, nBlue );
2221  }
2222 }
2223 
2225 {
2226  // icon mode selected in Tools -> Options... -> OpenOffice.org -> View
2227  switch (mxData->meUseImagesInMenus) {
2228  case TRISTATE_FALSE:
2229  return false;
2230  case TRISTATE_TRUE:
2231  return true;
2232  default: // TRISTATE_INDET:
2234  }
2235 }
2236 
2237 static BitmapEx readBitmapEx( const OUString& rPath )
2238 {
2239  OUString aPath( rPath );
2240  rtl::Bootstrap::expandMacros( aPath );
2241 
2242  // import the image
2243  Graphic aGraphic;
2244  if ( GraphicFilter::LoadGraphic( aPath, OUString(), aGraphic ) != ERRCODE_NONE )
2245  return BitmapEx();
2246  return aGraphic.GetBitmapEx();
2247 }
2248 
2249 namespace {
2250 
2251 enum WhichPersona { PERSONA_HEADER, PERSONA_FOOTER };
2252 
2253 }
2254 
2256 static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, std::optional<Color>& rMenuBarTextColor )
2257 {
2258  uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
2259  if ( !xContext.is() )
2260  return;
2261 
2262  // don't burn time loading images we don't need.
2264  return;
2265 
2266  // read from the configuration
2267  OUString aPersona( officecfg::Office::Common::Misc::Persona::get( xContext ) );
2268  OUString aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get( xContext ) );
2269 
2270  // have the settings changed? marks if header /footer prepared before
2271  //should maybe extended to a flag that marks if header /footer /both are loaded
2272  OUString aOldValue= eWhich==PERSONA_HEADER?OUString(aPersona + ";" + aPersonaSettings+";h" ):OUString(aPersona + ";" + aPersonaSettings+";f" );
2273  if ( rHeaderFooter == aOldValue )
2274  return;
2275 
2276  rHeaderFooter = aOldValue;
2277  rHeaderFooterBitmap = BitmapEx();
2278  rMenuBarTextColor.reset();
2279 
2280  // now read the new values and setup bitmaps
2281  OUString aHeader, aFooter;
2282  if ( aPersona == "own" || aPersona == "default" )
2283  {
2284  sal_Int32 nIndex = 0;
2285 
2286  // Skip the persona slug, name, and preview
2287  aHeader = aPersonaSettings.getToken( 3, ';', nIndex );
2288 
2289  if ( nIndex > 0 )
2290  aFooter = aPersonaSettings.getToken( 0, ';', nIndex );
2291 
2292  // change menu text color, advance nIndex to skip the '#'
2293  if ( nIndex > 0 )
2294  {
2295  OUString aColor = aPersonaSettings.getToken( 0, ';', ++nIndex );
2296  rMenuBarTextColor = Color( aColor.toUInt32( 16 ) );
2297  }
2298  }
2299 
2300  OUString aName;
2301  switch ( eWhich ) {
2302  case PERSONA_HEADER: aName = aHeader; break;
2303  case PERSONA_FOOTER: aName = aFooter; break;
2304  }
2305 
2306  if ( !aName.isEmpty() )
2307  {
2308  OUString gallery("");
2309  // try the gallery first, then the program path:
2310  if ( aPersona == "own" && !aPersonaSettings.startsWith( "vnd.sun.star.expand" ) )
2311  {
2312  gallery = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap") "::UserInstallation}";
2313  rtl::Bootstrap::expandMacros( gallery );
2314  gallery += "/user/gallery/personas/";
2315  }
2316  else if ( aPersona == "default" )
2317  {
2318  gallery = "$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/gallery/personas/";
2319  }
2320  rHeaderFooterBitmap = readBitmapEx( gallery + aName );
2321 
2322  if ( rHeaderFooterBitmap.IsEmpty() )
2323  rHeaderFooterBitmap = readBitmapEx( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" + aName );
2324  }
2325 
2326  // Something went wrong. Probably, the images are missing. Clear the persona properties in the registry.
2327 
2328  if( rHeaderFooterBitmap.IsEmpty() )
2329  {
2330  std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
2331  officecfg::Office::Common::Misc::Persona::set( "no", batch );
2332  officecfg::Office::Common::Misc::PersonaSettings::set( "", batch );
2333  batch->commit();
2334  }
2335 }
2336 
2338 {
2339  setupPersonaHeaderFooter( PERSONA_HEADER, mxData->maPersonaHeaderFooter, mxData->maPersonaHeaderBitmap, mxData->maPersonaMenuBarTextColor );
2340  return mxData->maPersonaHeaderBitmap;
2341 }
2342 
2344 {
2345  setupPersonaHeaderFooter( PERSONA_FOOTER, mxData->maPersonaHeaderFooter, mxData->maPersonaFooterBitmap, mxData->maPersonaMenuBarTextColor );
2346  return mxData->maPersonaFooterBitmap;
2347 }
2348 
2349 const std::optional<Color>& StyleSettings::GetPersonaMenuBarTextColor() const
2350 {
2351  GetPersonaHeader();
2352  return mxData->maPersonaMenuBarTextColor;
2353 }
2354 
2356 {
2357  CopyData();
2358  mxData->SetStandardStyles();
2359 }
2360 
2362 {
2363  // compute a brighter face color that can be used in gradients
2364  // for a convex look (eg toolbars)
2365 
2366  sal_uInt16 h, s, b;
2367  GetFaceColor().RGBtoHSB( h, s, b );
2368  if( s > 1) s=1;
2369  if( b < 98) b=98;
2370  return Color::HSBtoRGB( h, s, b );
2371 }
2372 
2374 {
2375  // compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP)
2376  sal_uInt16 h, s, b;
2377  GetShadowColor().RGBtoHSB( h, s, b );
2378  b += b/4;
2379  s -= s/4;
2380  return Color::HSBtoRGB( h, s, b );
2381 }
2382 
2384 {
2385  // copy if other references exist
2386  if (mxData.use_count() > 1)
2387  {
2388  mxData = std::make_shared<ImplStyleData>(*mxData);
2389  }
2390 }
2391 
2393 {
2394  if ( mxData == rSet.mxData )
2395  return true;
2396 
2397  if (mxData->mIconTheme != rSet.mxData->mIconTheme) {
2398  return false;
2399  }
2400 
2401  if (*mxData->mIconThemeSelector != *rSet.mxData->mIconThemeSelector) {
2402  return false;
2403  }
2404 
2405  return (mxData->mnOptions == rSet.mxData->mnOptions) &&
2406  (mxData->mbAutoMnemonic == rSet.mxData->mbAutoMnemonic) &&
2407  (mxData->mnDragFullOptions == rSet.mxData->mnDragFullOptions) &&
2408  (mxData->mnSelectionOptions == rSet.mxData->mnSelectionOptions) &&
2409  (mxData->mnDisplayOptions == rSet.mxData->mnDisplayOptions) &&
2410  (mxData->mnCursorSize == rSet.mxData->mnCursorSize) &&
2411  (mxData->mnCursorBlinkTime == rSet.mxData->mnCursorBlinkTime) &&
2412  (mxData->mnTitleHeight == rSet.mxData->mnTitleHeight) &&
2413  (mxData->mnFloatTitleHeight == rSet.mxData->mnFloatTitleHeight) &&
2414  (mxData->mnScrollBarSize == rSet.mxData->mnScrollBarSize) &&
2415  (mxData->mnMinThumbSize == rSet.mxData->mnMinThumbSize) &&
2416  (mxData->mnSpinSize == rSet.mxData->mnSpinSize) &&
2417  (mxData->mnAntialiasedMin == rSet.mxData->mnAntialiasedMin) &&
2418  (mxData->mbHighContrast == rSet.mxData->mbHighContrast) &&
2419  (mxData->mbUseSystemUIFonts == rSet.mxData->mbUseSystemUIFonts) &&
2420  (mxData->mbUseFontAAFromSystem == rSet.mxData->mbUseFontAAFromSystem) &&
2421  (mxData->mnUseFlatBorders == rSet.mxData->mnUseFlatBorders) &&
2422  (mxData->mnUseFlatMenus == rSet.mxData->mnUseFlatMenus) &&
2423  (mxData->maFaceColor == rSet.mxData->maFaceColor) &&
2424  (mxData->maCheckedColor == rSet.mxData->maCheckedColor) &&
2425  (mxData->maLightColor == rSet.mxData->maLightColor) &&
2426  (mxData->maLightBorderColor == rSet.mxData->maLightBorderColor) &&
2427  (mxData->maShadowColor == rSet.mxData->maShadowColor) &&
2428  (mxData->maDarkShadowColor == rSet.mxData->maDarkShadowColor) &&
2429  (mxData->maButtonTextColor == rSet.mxData->maButtonTextColor) &&
2430  (mxData->maDefaultActionButtonTextColor == rSet.mxData->maDefaultActionButtonTextColor) &&
2431  (mxData->maActionButtonTextColor == rSet.mxData->maActionButtonTextColor) &&
2432  (mxData->maButtonRolloverTextColor == rSet.mxData->maButtonRolloverTextColor) &&
2433  (mxData->maActionButtonRolloverTextColor == rSet.mxData->maActionButtonRolloverTextColor) &&
2434  (mxData->maRadioCheckTextColor == rSet.mxData->maRadioCheckTextColor) &&
2435  (mxData->maGroupTextColor == rSet.mxData->maGroupTextColor) &&
2436  (mxData->maLabelTextColor == rSet.mxData->maLabelTextColor) &&
2437  (mxData->maWindowColor == rSet.mxData->maWindowColor) &&
2438  (mxData->maWindowTextColor == rSet.mxData->maWindowTextColor) &&
2439  (mxData->maDialogColor == rSet.mxData->maDialogColor) &&
2440  (mxData->maDialogTextColor == rSet.mxData->maDialogTextColor) &&
2441  (mxData->maWorkspaceColor == rSet.mxData->maWorkspaceColor) &&
2442  (mxData->maMonoColor == rSet.mxData->maMonoColor) &&
2443  (mxData->maFieldColor == rSet.mxData->maFieldColor) &&
2444  (mxData->maFieldTextColor == rSet.mxData->maFieldTextColor) &&
2445  (mxData->maActiveColor == rSet.mxData->maActiveColor) &&
2446  (mxData->maActiveTextColor == rSet.mxData->maActiveTextColor) &&
2447  (mxData->maActiveBorderColor == rSet.mxData->maActiveBorderColor) &&
2448  (mxData->maDeactiveColor == rSet.mxData->maDeactiveColor) &&
2449  (mxData->maDeactiveTextColor == rSet.mxData->maDeactiveTextColor) &&
2450  (mxData->maDeactiveBorderColor == rSet.mxData->maDeactiveBorderColor) &&
2451  (mxData->maMenuColor == rSet.mxData->maMenuColor) &&
2452  (mxData->maMenuBarColor == rSet.mxData->maMenuBarColor) &&
2453  (mxData->maMenuBarRolloverColor == rSet.mxData->maMenuBarRolloverColor) &&
2454  (mxData->maMenuBorderColor == rSet.mxData->maMenuBorderColor) &&
2455  (mxData->maMenuTextColor == rSet.mxData->maMenuTextColor) &&
2456  (mxData->maMenuBarTextColor == rSet.mxData->maMenuBarTextColor) &&
2457  (mxData->maMenuBarRolloverTextColor == rSet.mxData->maMenuBarRolloverTextColor) &&
2458  (mxData->maMenuHighlightColor == rSet.mxData->maMenuHighlightColor) &&
2459  (mxData->maMenuHighlightTextColor == rSet.mxData->maMenuHighlightTextColor) &&
2460  (mxData->maHighlightColor == rSet.mxData->maHighlightColor) &&
2461  (mxData->maHighlightTextColor == rSet.mxData->maHighlightTextColor) &&
2462  (mxData->maTabTextColor == rSet.mxData->maTabTextColor) &&
2463  (mxData->maTabRolloverTextColor == rSet.mxData->maTabRolloverTextColor) &&
2464  (mxData->maTabHighlightTextColor == rSet.mxData->maTabHighlightTextColor) &&
2465  (mxData->maActiveTabColor == rSet.mxData->maActiveTabColor) &&
2466  (mxData->maInactiveTabColor == rSet.mxData->maInactiveTabColor) &&
2467  (mxData->maDisableColor == rSet.mxData->maDisableColor) &&
2468  (mxData->maHelpColor == rSet.mxData->maHelpColor) &&
2469  (mxData->maHelpTextColor == rSet.mxData->maHelpTextColor) &&
2470  (mxData->maLinkColor == rSet.mxData->maLinkColor) &&
2471  (mxData->maVisitedLinkColor == rSet.mxData->maVisitedLinkColor) &&
2472  (mxData->maToolTextColor == rSet.mxData->maToolTextColor) &&
2473  (mxData->maHighlightLinkColor == rSet.mxData->maHighlightLinkColor) &&
2474  (mxData->maAppFont == rSet.mxData->maAppFont) &&
2475  (mxData->maHelpFont == rSet.mxData->maHelpFont) &&
2476  (mxData->maTitleFont == rSet.mxData->maTitleFont) &&
2477  (mxData->maFloatTitleFont == rSet.mxData->maFloatTitleFont) &&
2478  (mxData->maMenuFont == rSet.mxData->maMenuFont) &&
2479  (mxData->maToolFont == rSet.mxData->maToolFont) &&
2480  (mxData->maGroupFont == rSet.mxData->maGroupFont) &&
2481  (mxData->maLabelFont == rSet.mxData->maLabelFont) &&
2482  (mxData->maRadioCheckFont == rSet.mxData->maRadioCheckFont) &&
2483  (mxData->maPushButtonFont == rSet.mxData->maPushButtonFont) &&
2484  (mxData->maFieldFont == rSet.mxData->maFieldFont) &&
2485  (mxData->maIconFont == rSet.mxData->maIconFont) &&
2486  (mxData->maTabFont == rSet.mxData->maTabFont) &&
2487  (mxData->meUseImagesInMenus == rSet.mxData->meUseImagesInMenus) &&
2488  (mxData->mbPreferredUseImagesInMenus == rSet.mxData->mbPreferredUseImagesInMenus) &&
2489  (mxData->mbSkipDisabledInMenus == rSet.mxData->mbSkipDisabledInMenus) &&
2490  (mxData->mbHideDisabledMenuItems == rSet.mxData->mbHideDisabledMenuItems) &&
2491  (mxData->mbPreferredContextMenuShortcuts == rSet.mxData->mbPreferredContextMenuShortcuts)&&
2492  (mxData->meContextMenuShortcuts == rSet.mxData->meContextMenuShortcuts) &&
2493  (mxData->mbPrimaryButtonWarpsSlider == rSet.mxData->mbPrimaryButtonWarpsSlider) &&
2494  (mxData->maFontColor == rSet.mxData->maFontColor) &&
2495  (mxData->mnEdgeBlending == rSet.mxData->mnEdgeBlending) &&
2496  (mxData->maEdgeBlendingTopLeftColor == rSet.mxData->maEdgeBlendingTopLeftColor) &&
2497  (mxData->maEdgeBlendingBottomRightColor == rSet.mxData->maEdgeBlendingBottomRightColor) &&
2498  (mxData->mnListBoxMaximumLineCount == rSet.mxData->mnListBoxMaximumLineCount) &&
2499  (mxData->mnColorValueSetColumnCount == rSet.mxData->mnColorValueSetColumnCount) &&
2500  (mxData->maListBoxPreviewDefaultLogicSize == rSet.mxData->maListBoxPreviewDefaultLogicSize) &&
2501  (mxData->maListBoxPreviewDefaultPixelSize == rSet.mxData->maListBoxPreviewDefaultPixelSize) &&
2502  (mxData->mbPreviewUsesCheckeredBackground == rSet.mxData->mbPreviewUsesCheckeredBackground);
2503 }
2504 
2506  mnEnableATT(TRISTATE_INDET),
2507  mnDisablePrinting(TRISTATE_INDET)
2508 {
2509  static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
2510  mbEnableLocalizedDecimalSep = (pEnv != nullptr);
2511 }
2512 
2514  : mxData(std::make_shared<ImplMiscData>())
2515 {
2516 }
2517 
2518 bool MiscSettings::operator ==( const MiscSettings& rSet ) const
2519 {
2520  if ( mxData == rSet.mxData )
2521  return true;
2522 
2523  return (mxData->mnEnableATT == rSet.mxData->mnEnableATT ) &&
2524  (mxData->mnDisablePrinting == rSet.mxData->mnDisablePrinting ) &&
2525  (mxData->mbEnableLocalizedDecimalSep == rSet.mxData->mbEnableLocalizedDecimalSep );
2526 }
2527 
2528 bool
2530 {
2531  return !(*this == rSet);
2532 }
2533 
2535 {
2536  if( mxData->mnDisablePrinting == TRISTATE_INDET )
2537  {
2538  OUString aEnable =
2540  getValue( "DesktopManagement",
2541  "DisablePrinting" );
2542  mxData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE : TRISTATE_FALSE;
2543  }
2544 
2545  return mxData->mnDisablePrinting != TRISTATE_FALSE;
2546 }
2547 
2549 {
2550 
2551 #ifdef _WIN32
2552  if( mxData->mnEnableATT == TRISTATE_INDET )
2553  {
2554  // Check in the Windows registry if an AT tool wants Accessibility support to
2555  // be activated ..
2556  HKEY hkey;
2557 
2558  if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER,
2559  L"Software\\LibreOffice\\Accessibility\\AtToolSupport",
2560  &hkey) )
2561  {
2562  DWORD dwType;
2563  wchar_t Data[6]; // possible values: "true", "false", "1", "0", DWORD
2564  DWORD cbData = sizeof(Data);
2565 
2566  if( ERROR_SUCCESS == RegQueryValueExW(hkey, L"SupportAssistiveTechnology",
2567  nullptr, &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
2568  {
2569  switch (dwType)
2570  {
2571  case REG_SZ:
2572  mxData->mnEnableATT = ((0 == wcsicmp(Data, L"1")) || (0 == wcsicmp(Data, L"true"))) ? TRISTATE_TRUE : TRISTATE_FALSE;
2573  break;
2574  case REG_DWORD:
2575  switch (reinterpret_cast<DWORD *>(Data)[0]) {
2576  case 0:
2577  mxData->mnEnableATT = TRISTATE_FALSE;
2578  break;
2579  case 1:
2580  mxData->mnEnableATT = TRISTATE_TRUE;
2581  break;
2582  default:
2583  mxData->mnEnableATT = TRISTATE_INDET;
2584  //TODO: or TRISTATE_TRUE?
2585  break;
2586  }
2587  break;
2588  default:
2589  // Unsupported registry type
2590  break;
2591  }
2592  }
2593 
2594  RegCloseKey(hkey);
2595  }
2596  }
2597 #endif
2598 
2599  if( mxData->mnEnableATT == TRISTATE_INDET )
2600  {
2601  static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
2602  if( !pEnv || !*pEnv )
2603  {
2604  OUString aEnable =
2606  getValue( "Accessibility",
2607  "EnableATToolSupport" );
2608  mxData->mnEnableATT = aEnable.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE : TRISTATE_FALSE;
2609  }
2610  else
2611  {
2612  mxData->mnEnableATT = TRISTATE_TRUE;
2613  }
2614  }
2615 
2616  return mxData->mnEnableATT != TRISTATE_FALSE;
2617 }
2618 
2619 #ifdef _WIN32
2620 void MiscSettings::SetEnableATToolSupport( bool bEnable )
2621 {
2622  if ( (bEnable ? TRISTATE_TRUE : TRISTATE_FALSE) != mxData->mnEnableATT )
2623  {
2624  if( bEnable && !ImplInitAccessBridge() )
2625  return;
2626 
2627  HKEY hkey;
2628 
2629  // If the accessibility key in the Windows registry exists, change it synchronously
2630  if( ERROR_SUCCESS == RegOpenKeyW(HKEY_CURRENT_USER,
2631  L"Software\\LibreOffice\\Accessibility\\AtToolSupport",
2632  &hkey) )
2633  {
2634  DWORD dwType;
2635  wchar_t Data[6]; // possible values: "true", "false", 1, 0
2636  DWORD cbData = sizeof(Data);
2637 
2638  if( ERROR_SUCCESS == RegQueryValueExW(hkey, L"SupportAssistiveTechnology",
2639  nullptr, &dwType, reinterpret_cast<LPBYTE>(Data), &cbData) )
2640  {
2641  switch (dwType)
2642  {
2643  case REG_SZ:
2644  RegSetValueExW(hkey, L"SupportAssistiveTechnology",
2645  0, dwType,
2646  reinterpret_cast<const BYTE*>(bEnable ? L"true" : L"false"),
2647  bEnable ? sizeof(L"true") : sizeof(L"false"));
2648  break;
2649  case REG_DWORD:
2650  reinterpret_cast<DWORD *>(Data)[0] = bEnable ? 1 : 0;
2651  RegSetValueExW(hkey, L"SupportAssistiveTechnology",
2652  0, dwType, reinterpret_cast<const BYTE*>(Data), sizeof(DWORD));
2653  break;
2654  default:
2655  // Unsupported registry type
2656  break;
2657  }
2658  }
2659 
2660  RegCloseKey(hkey);
2661  }
2662 
2664  setValue( "Accessibility",
2665  "EnableATToolSupport",
2666  bEnable ? OUString("true") : OUString("false" ) );
2667  mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE;
2668  }
2669 }
2670 #endif
2671 
2673 {
2674  // copy if other references exist
2675  if (mxData.use_count() > 1)
2676  {
2677  mxData = std::make_shared<ImplMiscData>(*mxData);
2678  }
2679  mxData->mbEnableLocalizedDecimalSep = bEnable;
2680 }
2681 
2683 {
2684  return mxData->mbEnableLocalizedDecimalSep;
2685 }
2686 
2688  : mxData(std::make_shared<ImplHelpData>())
2689 {
2690 }
2691 
2692 bool HelpSettings::operator ==( const HelpSettings& rSet ) const
2693 {
2694  if ( mxData == rSet.mxData )
2695  return true;
2696 
2697  return (mxData->mnTipTimeout == rSet.mxData->mnTipTimeout );
2698 }
2699 
2700 sal_uLong
2702 {
2703  return 500;
2704 }
2705 
2706 void
2708 {
2709  // copy if other references exist
2710  if (mxData.use_count() > 1)
2711  {
2712  mxData = std::make_shared<ImplHelpData>(*mxData);
2713  }
2714  mxData->mnTipTimeout = nTipTimeout;
2715 }
2716 
2717 sal_uLong
2719 {
2720  return mxData->mnTipTimeout;
2721 }
2722 
2723 sal_uLong
2725 {
2726  return 1500;
2727 }
2728 
2729 bool
2731 {
2732  return !(*this == rSet);
2733 }
2734 
2736  :
2737  maLocale( LANGUAGE_SYSTEM ),
2738  maUILocale( LANGUAGE_SYSTEM )
2739 {
2742 }
2743 
2745  maMouseSettings( rData.maMouseSettings ),
2746  maStyleSettings( rData.maStyleSettings ),
2747  maMiscSettings( rData.maMiscSettings ),
2748  maHelpSettings( rData.maHelpSettings ),
2749  maLocale( rData.maLocale ),
2750  maUILocale( rData.maUILocale )
2751 {
2752  // Create the cache objects new when their getter is called.
2753 }
2754 
2756 {
2757  mpLocaleDataWrapper.reset();
2758  mpUILocaleDataWrapper.reset();
2760  mpI18nHelper.reset();
2761  mpUII18nHelper.reset();
2762 }
2763 
2765  : mxData(std::make_shared<ImplAllSettingsData>())
2766 {
2767 }
2768 
2770 {
2771  // copy if other references exist
2772  if (mxData.use_count() > 1)
2773  {
2774  mxData = std::make_shared<ImplAllSettingsData>(*mxData);
2775  }
2776 
2777 }
2778 
2780 {
2781 
2783 
2784  if ( nFlags & AllSettingsFlags::MOUSE )
2785  {
2786  if ( mxData->maMouseSettings != rSet.mxData->maMouseSettings )
2787  {
2788  CopyData();
2789  mxData->maMouseSettings = rSet.mxData->maMouseSettings;
2790  nChangeFlags |= AllSettingsFlags::MOUSE;
2791  }
2792  }
2793 
2794  if ( nFlags & AllSettingsFlags::STYLE )
2795  {
2796  if ( mxData->maStyleSettings != rSet.mxData->maStyleSettings )
2797  {
2798  CopyData();
2799  mxData->maStyleSettings = rSet.mxData->maStyleSettings;
2800  nChangeFlags |= AllSettingsFlags::STYLE;
2801  }
2802  }
2803 
2804  if ( nFlags & AllSettingsFlags::MISC )
2805  {
2806  if ( mxData->maMiscSettings != rSet.mxData->maMiscSettings )
2807  {
2808  CopyData();
2809  mxData->maMiscSettings = rSet.mxData->maMiscSettings;
2810  nChangeFlags |= AllSettingsFlags::MISC;
2811  }
2812  }
2813 
2814  if ( nFlags & AllSettingsFlags::LOCALE )
2815  {
2816  if ( mxData->maLocale != rSet.mxData->maLocale )
2817  {
2818  SetLanguageTag( rSet.mxData->maLocale );
2819  nChangeFlags |= AllSettingsFlags::LOCALE;
2820  }
2821  }
2822 
2823  return nChangeFlags;
2824 }
2825 
2827 {
2828 
2830 
2831  if ( mxData->maStyleSettings != rSet.mxData->maStyleSettings )
2832  nChangeFlags |= AllSettingsFlags::STYLE;
2833 
2834  if ( mxData->maMiscSettings != rSet.mxData->maMiscSettings )
2835  nChangeFlags |= AllSettingsFlags::MISC;
2836 
2837  if ( mxData->maLocale != rSet.mxData->maLocale )
2838  nChangeFlags |= AllSettingsFlags::LOCALE;
2839 
2840  return nChangeFlags;
2841 }
2842 
2843 bool AllSettings::operator ==( const AllSettings& rSet ) const
2844 {
2845  if ( mxData == rSet.mxData )
2846  return true;
2847 
2848  if ( (mxData->maMouseSettings == rSet.mxData->maMouseSettings) &&
2849  (mxData->maStyleSettings == rSet.mxData->maStyleSettings) &&
2850  (mxData->maMiscSettings == rSet.mxData->maMiscSettings) &&
2851  (mxData->maHelpSettings == rSet.mxData->maHelpSettings) &&
2852  (mxData->maLocale == rSet.mxData->maLocale) )
2853  {
2854  return true;
2855  }
2856 
2857  return false;
2858 }
2859 
2860 void AllSettings::SetLanguageTag(const OUString& rLanguage, bool bCanonicalize)
2861 {
2862  SetLanguageTag(LanguageTag(rLanguage, bCanonicalize));
2863 }
2864 
2865 void AllSettings::SetLanguageTag( const LanguageTag& rLanguageTag )
2866 {
2867  if (mxData->maLocale != rLanguageTag)
2868  {
2869  CopyData();
2870 
2871  mxData->maLocale = rLanguageTag;
2872 
2873  if ( mxData->mpLocaleDataWrapper )
2874  {
2875  mxData->mpLocaleDataWrapper.reset();
2876  }
2877  if ( mxData->mpI18nHelper )
2878  {
2879  mxData->mpI18nHelper.reset();
2880  }
2881  }
2882 }
2883 
2884 namespace
2885 {
2886  bool GetConfigLayoutRTL(bool bMath)
2887  {
2888  static const char* pEnv = getenv("SAL_RTL_ENABLED" );
2889  static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off
2890 
2891  // environment always overrides
2892  if( pEnv )
2893  return true;
2894 
2895  bool bRTL = false;
2896 
2897  if( nUIMirroring == -1 )
2898  {
2899  nUIMirroring = 0; // ask configuration only once
2902  "org.openoffice.Office.Common/I18N/CTL" ); // note: case sensitive !
2903  if ( aNode.isValid() )
2904  {
2905  bool bTmp = bool();
2906  css::uno::Any aValue = aNode.getNodeValue( "UIMirroring" );
2907  if( aValue >>= bTmp )
2908  {
2909  // found true or false; if it was nil, nothing is changed
2910  nUIMirroring = bTmp ? 1 : 2;
2911  }
2912  }
2913  }
2914 
2915  if( nUIMirroring == 0 ) // no config found (eg, setup) or default (nil) was set: check language
2916  {
2918  if (bMath)
2919  bRTL = MsLangId::isRightToLeftMath( aLang );
2920  else
2921  bRTL = MsLangId::isRightToLeft( aLang );
2922  }
2923  else
2924  bRTL = (nUIMirroring == 1);
2925 
2926  return bRTL;
2927  }
2928 }
2929 
2931 {
2933  return false;
2934  return GetConfigLayoutRTL(false);
2935 }
2936 
2938 {
2940  return false;
2941  return GetConfigLayoutRTL(true);
2942 }
2943 
2945 {
2947  {
2948  static LanguageTag aRet("en-US");
2949  return aRet;
2950  }
2951 
2954 
2955  // SYSTEM locale means: use settings from SvtSysLocale that is resolved
2956  if ( mxData->maLocale.isSystemLocale() )
2957  mxData->maLocale = mxData->maSysLocale.GetLanguageTag();
2958 
2959  return mxData->maLocale;
2960 }
2961 
2963 {
2965  {
2966  static LanguageTag aRet("en-US");
2967  return aRet;
2968  }
2969 
2972 
2973  // the UILocale is never changed
2974  if ( mxData->maUILocale.isSystemLocale() )
2975  mxData->maUILocale = mxData->maSysLocale.GetUILanguageTag();
2976 
2977  return mxData->maUILocale;
2978 }
2979 
2981 {
2982  if ( !mxData->mpLocaleDataWrapper )
2983  const_cast<AllSettings*>(this)->mxData->mpLocaleDataWrapper.reset( new LocaleDataWrapper(
2985  return *mxData->mpLocaleDataWrapper;
2986 }
2987 
2989 {
2990  if ( !mxData->mpUILocaleDataWrapper )
2991  const_cast<AllSettings*>(this)->mxData->mpUILocaleDataWrapper.reset( new LocaleDataWrapper(
2993  return *mxData->mpUILocaleDataWrapper;
2994 }
2995 
2997 {
2998  if ( !mxData->mpNeutralLocaleDataWrapper )
2999  const_cast<AllSettings*>(this)->mxData->mpNeutralLocaleDataWrapper.reset( new LocaleDataWrapper(
3001  return *mxData->mpNeutralLocaleDataWrapper;
3002 }
3003 
3005 {
3006  if ( !mxData->mpI18nHelper ) {
3007  const_cast<AllSettings*>(this)->mxData->mpI18nHelper.reset( new vcl::I18nHelper(
3009  }
3010  return *mxData->mpI18nHelper;
3011 }
3012 
3014 {
3015  if ( !mxData->mpUII18nHelper ) {
3016  const_cast<AllSettings*>(this)->mxData->mpUII18nHelper.reset( new vcl::I18nHelper(
3018  }
3019  return *mxData->mpUII18nHelper;
3020 }
3021 
3023 {
3024  AllSettings aAllSettings( Application::GetSettings() );
3025  if ( nHint & ConfigurationHints::DecSep )
3026  {
3027  MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
3028  bool bIsDecSepAsLocale = aAllSettings.mxData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
3029  if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale )
3030  {
3031  aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale );
3032  aAllSettings.SetMiscSettings( aMiscSettings );
3033  }
3034  }
3035 
3036  if ( nHint & ConfigurationHints::Locale )
3037  aAllSettings.SetLanguageTag( aAllSettings.mxData->maSysLocale.GetOptions().GetLanguageTag() );
3038 
3039  Application::SetSettings( aAllSettings );
3040 }
3041 
3042 const StyleSettings&
3044 {
3045  return mxData->maStyleSettings;
3046 }
3047 
3050 {
3051  return mxData->mnOptions;
3052 }
3053 
3054 std::vector<vcl::IconThemeInfo> const &
3056 {
3057  if (!mxData->mIconThemeScanner) {
3059  }
3060  return mxData->mIconThemeScanner->GetFoundIconThemes();
3061 }
3062 
3063 /*static*/ OUString
3065 {
3066  OUString desktopEnvironment = Application::GetDesktopEnvironment();
3067  if (!mxData->mIconThemeScanner) {
3069  }
3070  OUString themeName = mxData->mIconThemeSelector->SelectIconThemeForDesktopEnvironment(
3071  mxData->mIconThemeScanner->GetFoundIconThemes(),
3072  desktopEnvironment
3073  );
3074  return themeName;
3075 }
3076 
3077 void
3078 StyleSettings::SetIconTheme(const OUString& theme)
3079 {
3080  CopyData();
3081  mxData->mIconTheme = theme;
3082 }
3083 
3084 OUString
3086 {
3087  OUString sTheme(mxData->mIconTheme);
3088  if (sTheme.isEmpty())
3089  {
3091  sTheme = "colibre";
3092  else
3093  {
3094  // read from the configuration, or fallback to what the desktop wants
3095  uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
3096  if (xContext.is())
3097  {
3098  sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
3099 
3100  if (sTheme.isEmpty() || sTheme == "auto")
3102  }
3103  }
3104  }
3105 
3106  if (!mxData->mIconThemeScanner) {
3108  }
3109  OUString r = mxData->mIconThemeSelector->SelectIconTheme(
3110  mxData->mIconThemeScanner->GetFoundIconThemes(),
3111  sTheme);
3112  return r;
3113 }
3114 
3115 void
3117 {
3118  if (mxData->mbHighContrast == bHighContrast) {
3119  return;
3120  }
3121 
3122  CopyData();
3123  mxData->mbHighContrast = bHighContrast;
3124  mxData->mIconThemeSelector->SetUseHighContrastTheme(bHighContrast);
3125 }
3126 
3127 bool
3129 {
3130  return mxData->mbHighContrast;
3131 }
3132 
3133 void
3134 StyleSettings::SetPreferredIconTheme(const OUString& theme, bool bDarkIconTheme)
3135 {
3136  mxData->mIconThemeSelector->SetPreferredIconTheme(theme, bDarkIconTheme);
3137 }
3138 
3139 void
3141 {
3142  CopyData();
3143  mxData->maMouseSettings = rSet;
3144 }
3145 
3146 const MouseSettings&
3148 {
3149  return mxData->maMouseSettings;
3150 }
3151 
3152 void
3154 {
3155  CopyData();
3156  mxData->maStyleSettings = rSet;
3157 }
3158 
3159 void
3161 {
3162  CopyData();
3163  mxData->maMiscSettings = rSet;
3164 }
3165 
3166 const MiscSettings&
3168 {
3169  return mxData->maMiscSettings;
3170 }
3171 
3172 void
3174 {
3175  CopyData();
3176  mxData->maHelpSettings = rSet;
3177 }
3178 
3179 const HelpSettings&
3181 {
3182  return mxData->maHelpSettings;
3183 }
3184 
3185 bool
3187 {
3188  return !(*this == rSet);
3189 }
3190 
3191 SvtSysLocale&
3193 {
3194  return mxData->maSysLocale;
3195 }
3196 
3197 
3199  bool bCheckedColorSpecialCase )
3200 {
3201  Set3DColors( aBackColor );
3202  SetFaceColor( aBackColor );
3203  SetDialogColor( aBackColor );
3204  SetWorkspaceColor( aBackColor );
3205 
3206  if (bCheckedColorSpecialCase)
3208 }
3209 
3211  const vcl::Font& aLabelFont )
3212 {
3213  SetAppFont( aAppFont );
3214  SetPushButtonFont( aAppFont );
3215  SetToolFont( aAppFont );
3216  SetHelpFont( aAppFont );
3217 
3218  SetMenuFont( aLabelFont );
3219  SetTabFont( aLabelFont );
3220  SetLabelFont( aLabelFont );
3221  SetRadioCheckFont( aLabelFont );
3222  SetFieldFont( aLabelFont );
3223  SetGroupFont( aLabelFont );
3224  SetIconFont( aLabelFont );
3225 }
3226 
3227 /* 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
Color maDefaultButtonRolloverTextColor
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)
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
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)
std::optional< Color > maPersonaMenuBarTextColor
Cache the menubar color.
sal_uInt16 mnListBoxMaximumLineCount
sal_uIntPtr sal_uLong
void SetMiscSettings(const MiscSettings &rSet)
void SetRadioCheckFont(const vcl::Font &rFont)
void SetFieldRolloverTextColor(const Color &rColor)
const Color & GetDefaultButtonTextColor() const
bool GetPreferredUseImagesInMenus() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:715
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:398
bool mbHideDisabledMenuItems
const Color & GetGroupTextColor() const
StyleSettingsOptions mnOptions
const Color & GetDefaultButtonPressedRolloverTextColor() const
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 maDefaultButtonPressedRolloverTextColor
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
std::shared_ptr< T > make_shared(Args &&...args)
static std::shared_ptr< IconThemeScanner > Create(const OUString &path)
Factory method to create the object.
ToolbarIconSize mnToolbarIconSize
const Color & GetMenuHighlightColor() const
void SetFlatButtonTextColor(const Color &rColor)
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:1590
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:668
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1060
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
const Color & GetDefaultButtonRolloverTextColor() const
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:99
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
void SetFlatButtonPressedRolloverTextColor(const Color &rColor)
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:199
MouseWheelBehaviour GetWheelBehavior() const
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
#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 & GetActionButtonPressedRolloverTextColor() const
const Color & GetMenuBarColor() const
MouseMiddleButtonAction GetMiddleButtonAction() const
const vcl::Font & GetToolFont() const
void SetListBoxMaximumLineCount(sal_uInt16 nCount)
void SetEdgeBlending(sal_uInt16 nCount)
const std::optional< Color > & GetPersonaMenuBarTextColor() const
#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:621
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
std::unique_ptr< LocaleDataWrapper > mpNeutralLocaleDataWrapper
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:337
exports com.sun.star. gallery
static OConfigurationTreeRoot tryCreateWithComponentContext(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &_rPath, sal_Int32 _nDepth=-1, CREATION_MODE _eMode=CM_UPDATABLE)
void SetFieldColor(const Color &rColor)
static void LocaleSettingsChanged(ConfigurationHints nHint)
Color maInactiveTabColor
void SetAppFont(const vcl::Font &rFont)
void SetActionButtonPressedRolloverTextColor(const Color &rColor)
void SetDefaultButtonPressedRolloverTextColor(const Color &rColor)
const Color & GetAlternatingRowColor() const
const LanguageTag & getLanguageTag()
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
Definition: graph.cxx:330
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:685
void SetLabelTextColor(const Color &rColor)
const Color & GetCheckedColor() const
Color maDefaultActionButtonPressedRolloverTextColor
LanguageTag maUILocale
void SetDefaultActionButtonPressedRolloverTextColor(const Color &rColor)
Color maMenuBarHighlightTextColor
const Color & GetDefaultActionButtonPressedRolloverTextColor() const
void SetDefaultButtonTextColor(const Color &rColor)
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
const Color & GetDefaultActionButtonRolloverTextColor() const
static sal_uInt16 GetColorValueSetMaximumRowCount()
StyleSettingsOptions GetOptions() const
void SetDoubleClickWidth(long nDoubleClkWidth)
Color maFlatButtonRolloverTextColor
Point LogicToPixel(const Point &rLogicPt) const
Definition: map.cxx:942
static sal_uLong GetActionDelay()
const LocaleDataWrapper & GetNeutralLocaleDataWrapper() const
static DefaultFontConfiguration & get()
SelectionOptions mnSelectionOptions
const vcl::I18nHelper & GetLocaleI18nHelper() const
static bool GetMathLayoutRTL()
Color maDefaultActionButtonRolloverTextColor
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)
Color maDefaultButtonTextColor
StyleSettings maStyleSettings
Color maFlatButtonTextColor
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
void SetFlatButtonRolloverTextColor(const Color &rColor)
Color GetFaceGradientColor() const
vcl::Font maTabFont
static bool IsHeadlessModeEnabled()
Determines if headless mode is enabled.
Definition: svapp.cxx:1534
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
const Color & GetFlatButtonRolloverTextColor() const
OUString aName
FAMILY_SWISS
const vcl::Font & GetIconFont() const
const Color & GetFlatButtonPressedRolloverTextColor() 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()
void SetActiveBorderColor(const Color &rColor)
vcl::Font maLabelFont
Color maLabelTextColor
const vcl::Font & GetAppFont() const
constexpr::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
Color maFlatButtonPressedRolloverTextColor
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:653
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
void SetDefaultButtonRolloverTextColor(const Color &rColor)
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 void setupPersonaHeaderFooter(WhichPersona eWhich, OUString &rHeaderFooter, BitmapEx &rHeaderFooterBitmap, std::optional< Color > &rMenuBarTextColor)
Update the setting of the Persona header / footer in ImplStyleData.
static sal_uInt16 GetContextMenuClicks()
const Color & GetDialogTextColor() const
TriState
static sal_uLong GetScrollRepeat()
void SetHighlightTextColor(const Color &rColor)
const Color & GetEdgeBlendingTopLeftColor() const
MouseSettings maMouseSettings
Color maActionButtonPressedRolloverTextColor
const Color & GetFlatButtonTextColor() const
SvtSysLocaleOptions & GetOptions() const
void SetDefaultActionButtonRolloverTextColor(const Color &rColor)
#define MOUSE_RIGHT
Definition: event.hxx:101
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:633
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