LCOV - code coverage report
Current view: top level - vcl/source/app - settings.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 997 1429 69.8 %
Date: 2014-04-11 Functions: 197 310 63.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <config_folders.h>
      21             : 
      22             : #include <officecfg/Office/Common.hxx>
      23             : 
      24             : #include <svsys.h>
      25             : #include "comphelper/processfactory.hxx"
      26             : #include <rtl/bootstrap.hxx>
      27             : #include "tools/debug.hxx"
      28             : 
      29             : #include "i18nlangtag/mslangid.hxx"
      30             : #include "i18nlangtag/languagetag.hxx"
      31             : 
      32             : #include <vcl/graphicfilter.hxx>
      33             : #include <vcl/IconThemeScanner.hxx>
      34             : #include <vcl/IconThemeSelector.hxx>
      35             : #include <vcl/IconThemeInfo.hxx>
      36             : #include "vcl/svapp.hxx"
      37             : #include "vcl/event.hxx"
      38             : #include "vcl/settings.hxx"
      39             : #include "vcl/i18nhelp.hxx"
      40             : #include "vcl/configsettings.hxx"
      41             : #include "vcl/gradient.hxx"
      42             : #include "vcl/outdev.hxx"
      43             : 
      44             : #include "unotools/fontcfg.hxx"
      45             : #include "unotools/localedatawrapper.hxx"
      46             : #include "unotools/collatorwrapper.hxx"
      47             : #include "unotools/confignode.hxx"
      48             : #include "unotools/syslocaleoptions.hxx"
      49             : 
      50             : using namespace ::com::sun::star;
      51             : 
      52             : #include "svdata.hxx"
      53             : #include "impimagetree.hxx"
      54             : 
      55             : #include <boost/make_shared.hpp>
      56             : 
      57             : struct ImplMouseData
      58             : {
      59             :                                     ImplMouseData();
      60             :                                     ImplMouseData( const ImplMouseData& rData );
      61             : 
      62             :     sal_uLong                           mnOptions;
      63             :     sal_uLong                           mnDoubleClkTime;
      64             :     long                            mnDoubleClkWidth;
      65             :     long                            mnDoubleClkHeight;
      66             :     long                            mnStartDragWidth;
      67             :     long                            mnStartDragHeight;
      68             :     sal_uInt16                          mnStartDragCode;
      69             :     sal_uInt16                          mnContextMenuCode;
      70             :     sal_uInt16                          mnContextMenuClicks;
      71             :     sal_uLong                           mnScrollRepeat;
      72             :     sal_uLong                           mnButtonStartRepeat;
      73             :     sal_uLong                           mnButtonRepeat;
      74             :     sal_uLong                           mnActionDelay;
      75             :     sal_uLong                           mnMenuDelay;
      76             :     sal_uLong                           mnFollow;
      77             :     sal_uInt16                          mnMiddleButtonAction;
      78             :     sal_uInt16                          mnWheelBehavior;
      79             : };
      80             : 
      81       29401 : struct ImplStyleData
      82             : {
      83             :                                     ImplStyleData();
      84             :                                     ImplStyleData( const ImplStyleData& rData );
      85             : 
      86             :     void                            SetStandardStyles();
      87             : 
      88             :     Color                           maActiveBorderColor;
      89             :     Color                           maActiveColor;
      90             :     Color                           maActiveColor2;
      91             :     Color                           maActiveTextColor;
      92             :     Color                           maButtonTextColor;
      93             :     Color                           maButtonRolloverTextColor;
      94             :     Color                           maCheckedColor;
      95             :     Color                           maDarkShadowColor;
      96             :     Color                           maDeactiveBorderColor;
      97             :     Color                           maDeactiveColor;
      98             :     Color                           maDeactiveColor2;
      99             :     Color                           maDeactiveTextColor;
     100             :     Color                           maDialogColor;
     101             :     Color                           maDialogTextColor;
     102             :     Color                           maDisableColor;
     103             :     Color                           maFaceColor;
     104             :     Color                           maFieldColor;
     105             :     Color                           maFieldTextColor;
     106             :     Color                           maFieldRolloverTextColor;
     107             :     Color                           maFontColor;
     108             :     Color                           maGroupTextColor;
     109             :     Color                           maHelpColor;
     110             :     Color                           maHelpTextColor;
     111             :     Color                           maHighlightColor;
     112             :     Color                           maHighlightLinkColor;
     113             :     Color                           maHighlightTextColor;
     114             :     Color                           maInfoTextColor;
     115             :     Color                           maLabelTextColor;
     116             :     Color                           maLightBorderColor;
     117             :     Color                           maLightColor;
     118             :     Color                           maLinkColor;
     119             :     Color                           maMenuBarColor;
     120             :     Color                           maMenuBarRolloverColor;
     121             :     Color                           maMenuBorderColor;
     122             :     Color                           maMenuColor;
     123             :     Color                           maMenuHighlightColor;
     124             :     Color                           maMenuHighlightTextColor;
     125             :     Color                           maMenuTextColor;
     126             :     Color                           maMenuBarTextColor;
     127             :     Color                           maMenuBarRolloverTextColor;
     128             :     Color                           maMonoColor;
     129             :     Color                           maRadioCheckTextColor;
     130             :     Color                           maShadowColor;
     131             :     Color                           maVisitedLinkColor;
     132             :     Color                           maWindowColor;
     133             :     Color                           maWindowTextColor;
     134             :     Color                           maWorkspaceColor;
     135             :     Color                           maActiveTabColor;
     136             :     Color                           maInactiveTabColor;
     137             :     Font                            maAppFont;
     138             :     Font                            maHelpFont;
     139             :     Font                            maTitleFont;
     140             :     Font                            maFloatTitleFont;
     141             :     Font                            maMenuFont;
     142             :     Font                            maToolFont;
     143             :     Font                            maLabelFont;
     144             :     Font                            maInfoFont;
     145             :     Font                            maRadioCheckFont;
     146             :     Font                            maPushButtonFont;
     147             :     Font                            maFieldFont;
     148             :     Font                            maIconFont;
     149             :     Font                            maGroupFont;
     150             :     long                            mnBorderSize;
     151             :     long                            mnTitleHeight;
     152             :     long                            mnFloatTitleHeight;
     153             :     long                            mnTearOffTitleHeight;
     154             :     long                            mnScrollBarSize;
     155             :     long                            mnSplitSize;
     156             :     long                            mnSpinSize;
     157             :     long                            mnCursorSize;
     158             :     long                            mnAntialiasedMin;
     159             :     sal_uLong                       mnCursorBlinkTime;
     160             :     sal_uLong                       mnDragFullOptions;
     161             :     sal_uLong                       mnSelectionOptions;
     162             :     sal_uLong                       mnDisplayOptions;
     163             :     sal_uLong                       mnToolbarIconSize;
     164             :     bool                            mnUseFlatMenus;
     165             :     sal_uLong                       mnOptions;
     166             :     sal_uInt16                      mnScreenZoom;
     167             :     sal_uInt16                      mnScreenFontZoom;
     168             :     bool                            mbHighContrast;
     169             :     bool                            mbUseSystemUIFonts;
     170             :     bool                            mbAutoMnemonic;
     171             :     TriState                        meUseImagesInMenus;
     172             :     bool                            mnUseFlatBorders;
     173             :     bool                            mbPreferredUseImagesInMenus;
     174             :     long                            mnMinThumbSize;
     175             :     boost::shared_ptr<vcl::IconThemeScanner>
     176             :                                     mIconThemeScanner;
     177             :     boost::shared_ptr<vcl::IconThemeSelector>
     178             :                                     mIconThemeSelector;
     179             : 
     180             :     rtl::OUString                   mIconTheme;
     181             :     bool                            mbSkipDisabledInMenus;
     182             :     bool                            mbHideDisabledMenuItems;
     183             :     bool                            mbAcceleratorsInContextMenus;
     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
     186             :     bool                            mbPrimaryButtonWarpsSlider;
     187             :     DialogStyle                     maDialogStyle;
     188             :     FrameStyle                      maFrameStyle;
     189             :     const void*                     mpFontOptions;
     190             : 
     191             :     sal_uInt16                      mnEdgeBlending;
     192             :     Color                           maEdgeBlendingTopLeftColor;
     193             :     Color                           maEdgeBlendingBottomRightColor;
     194             :     sal_uInt16                      mnListBoxMaximumLineCount;
     195             :     sal_uInt16                      mnColorValueSetColumnCount;
     196             :     sal_uInt16                      mnColorValueSetMaximumRowCount;
     197             :     Size                            maListBoxPreviewDefaultLogicSize;
     198             :     Size                            maListBoxPreviewDefaultPixelSize;
     199             :     sal_uInt16                      mnListBoxPreviewDefaultLineWidth;
     200             :     bool                            mbPreviewUsesCheckeredBackground;
     201             : 
     202             :     OUString                        maPersonaHeaderFooter; ///< Cache the settings to detect changes.
     203             : 
     204             :     BitmapEx                        maPersonaHeaderBitmap; ///< Cache the header bitmap.
     205             :     BitmapEx                        maPersonaFooterBitmap; ///< Cache the footer bitmap.
     206             :     boost::optional<Color>          maPersonaMenuBarTextColor; ///< Cache the menubar color.
     207             : };
     208             : 
     209             : struct ImplMiscData
     210             : {
     211             :                                     ImplMiscData();
     212             :                                     ImplMiscData( const ImplMiscData& rData );
     213             :     TriState                        mnEnableATT;
     214             :     bool                            mbEnableLocalizedDecimalSep;
     215             :     TriState                        mnDisablePrinting;
     216             : };
     217             : 
     218             : struct ImplHelpData
     219             : {
     220             :     ImplHelpData();
     221             :     ImplHelpData( const ImplHelpData& rData );
     222             : 
     223             :     sal_uLong                           mnTipDelay;
     224             :     sal_uLong                           mnTipTimeout;
     225             :     sal_uLong                           mnBalloonDelay;
     226             : };
     227             : 
     228             : struct ImplAllSettingsData
     229             : {
     230             :     ImplAllSettingsData();
     231             :     ImplAllSettingsData( const ImplAllSettingsData& rData );
     232             :     ~ImplAllSettingsData();
     233             : 
     234             :     MouseSettings                           maMouseSettings;
     235             :     StyleSettings                           maStyleSettings;
     236             :     MiscSettings                            maMiscSettings;
     237             :     HelpSettings                            maHelpSettings;
     238             :     LanguageTag                             maLocale;
     239             :     sal_uLong                               mnWindowUpdate;
     240             :     LanguageTag                             maUILocale;
     241             :     LocaleDataWrapper*                      mpLocaleDataWrapper;
     242             :     LocaleDataWrapper*                      mpUILocaleDataWrapper;
     243             :     vcl::I18nHelper*                        mpI18nHelper;
     244             :     vcl::I18nHelper*                        mpUII18nHelper;
     245             :     SvtSysLocale                            maSysLocale;
     246             : };
     247             : 
     248         290 : ImplMouseData::ImplMouseData()
     249             : {
     250         290 :     mnOptions                   = 0;
     251         290 :     mnDoubleClkTime             = 500;
     252         290 :     mnDoubleClkWidth            = 2;
     253         290 :     mnDoubleClkHeight           = 2;
     254         290 :     mnStartDragWidth            = 2;
     255         290 :     mnStartDragHeight           = 2;
     256         290 :     mnStartDragCode             = MOUSE_LEFT;
     257         290 :     mnContextMenuCode           = MOUSE_RIGHT;
     258         290 :     mnContextMenuClicks         = 1;
     259         290 :     mnMiddleButtonAction        = MOUSE_MIDDLE_AUTOSCROLL;
     260         290 :     mnScrollRepeat              = 100;
     261         290 :     mnButtonStartRepeat         = 370;
     262         290 :     mnButtonRepeat              = 90;
     263         290 :     mnActionDelay               = 250;
     264         290 :     mnMenuDelay                 = 150;
     265         290 :     mnFollow                    = MOUSE_FOLLOW_MENU | MOUSE_FOLLOW_DDLIST;
     266         290 :     mnWheelBehavior             = MOUSE_WHEEL_ALWAYS;
     267         290 : }
     268             : 
     269        2603 : ImplMouseData::ImplMouseData( const ImplMouseData& rData )
     270             : {
     271        2603 :     mnOptions                   = rData.mnOptions;
     272        2603 :     mnDoubleClkTime             = rData.mnDoubleClkTime;
     273        2603 :     mnDoubleClkWidth            = rData.mnDoubleClkWidth;
     274        2603 :     mnDoubleClkHeight           = rData.mnDoubleClkHeight;
     275        2603 :     mnStartDragWidth            = rData.mnStartDragWidth;
     276        2603 :     mnStartDragHeight           = rData.mnStartDragHeight;
     277        2603 :     mnStartDragCode             = rData.mnStartDragCode;
     278        2603 :     mnContextMenuCode           = rData.mnContextMenuCode;
     279        2603 :     mnContextMenuClicks         = rData.mnContextMenuClicks;
     280        2603 :     mnMiddleButtonAction        = rData.mnMiddleButtonAction;
     281        2603 :     mnScrollRepeat              = rData.mnScrollRepeat;
     282        2603 :     mnButtonStartRepeat         = rData.mnButtonStartRepeat;
     283        2603 :     mnButtonRepeat              = rData.mnButtonRepeat;
     284        2603 :     mnActionDelay               = rData.mnActionDelay;
     285        2603 :     mnMenuDelay                 = rData.mnMenuDelay;
     286        2603 :     mnFollow                    = rData.mnFollow;
     287        2603 :     mnWheelBehavior             = rData.mnWheelBehavior;
     288        2603 : }
     289             : 
     290             : void
     291          80 : MouseSettings::SetOptions(sal_uLong nOptions)
     292             : {
     293          80 :     CopyData();
     294          80 :     mpData->mnOptions = nOptions;
     295          80 : }
     296             : 
     297             : sal_uLong
     298          83 : MouseSettings::GetOptions() const
     299             : {
     300          83 :     return mpData->mnOptions;
     301             : }
     302             : 
     303             : void
     304           0 : MouseSettings::SetDoubleClickTime( sal_uLong nDoubleClkTime )
     305             : {
     306           0 :     CopyData();
     307           0 :     mpData->mnDoubleClkTime = nDoubleClkTime;
     308           0 : }
     309             : 
     310             : sal_uLong
     311         641 : MouseSettings::GetDoubleClickTime() const
     312             : {
     313         641 :     return mpData->mnDoubleClkTime;
     314             : }
     315             : 
     316             : void
     317           0 : MouseSettings::SetDoubleClickWidth( long nDoubleClkWidth )
     318             : {
     319           0 :     CopyData();
     320           0 :     mpData->mnDoubleClkWidth = nDoubleClkWidth;
     321           0 : }
     322             : 
     323             : long
     324           0 : MouseSettings::GetDoubleClickWidth() const
     325             : {
     326           0 :     return mpData->mnDoubleClkWidth;
     327             : }
     328             : 
     329             : void
     330           0 : MouseSettings::SetDoubleClickHeight( long nDoubleClkHeight )
     331             : {
     332           0 :     CopyData();
     333           0 :     mpData->mnDoubleClkHeight = nDoubleClkHeight;
     334           0 : }
     335             : 
     336             : long
     337           0 : MouseSettings::GetDoubleClickHeight() const
     338             : {
     339           0 :     return mpData->mnDoubleClkHeight;
     340             : }
     341             : 
     342             : void
     343           0 : MouseSettings::SetStartDragWidth( long nDragWidth )
     344             : {
     345           0 :     CopyData();
     346           0 :     mpData->mnStartDragWidth = nDragWidth;
     347           0 : }
     348             : 
     349             : long
     350           0 : MouseSettings::GetStartDragWidth() const
     351             : {
     352           0 :     return mpData->mnStartDragWidth;
     353             : }
     354             : 
     355             : void
     356           0 : MouseSettings::SetStartDragHeight( long nDragHeight )
     357             : {
     358           0 :     CopyData();
     359           0 :     mpData->mnStartDragHeight = nDragHeight;
     360           0 : }
     361             : 
     362             : long
     363           0 : MouseSettings::GetStartDragHeight() const
     364             : {
     365           0 :     return mpData->mnStartDragHeight;
     366             : }
     367             : 
     368             : sal_uInt16
     369           0 : MouseSettings::GetStartDragCode() const
     370             : {
     371           0 :     return mpData->mnStartDragCode;
     372             : }
     373             : 
     374             : sal_uInt16
     375           0 : MouseSettings::GetContextMenuCode() const
     376             : {
     377           0 :     return mpData->mnContextMenuCode;
     378             : }
     379             : 
     380             : sal_uInt16
     381           0 : MouseSettings::GetContextMenuClicks() const
     382             : {
     383           0 :     return mpData->mnContextMenuClicks;
     384             : }
     385             : 
     386             : sal_uLong
     387           0 : MouseSettings::GetScrollRepeat() const
     388             : {
     389           0 :     return mpData->mnScrollRepeat;
     390             : }
     391             : 
     392             : sal_uLong
     393          95 : MouseSettings::GetButtonStartRepeat() const
     394             : {
     395          95 :     return mpData->mnButtonStartRepeat;
     396             : }
     397             : 
     398             : void
     399         231 : MouseSettings::SetButtonRepeat( sal_uLong nRepeat )
     400             : {
     401         231 :     CopyData();
     402         231 :     mpData->mnButtonRepeat = nRepeat;
     403         231 : }
     404             : 
     405             : sal_uLong
     406          20 : MouseSettings::GetButtonRepeat() const
     407             : {
     408          20 :     return mpData->mnButtonRepeat;
     409             : }
     410             : 
     411             : sal_uLong
     412           0 : MouseSettings::GetActionDelay() const
     413             : {
     414           0 :     return mpData->mnActionDelay;
     415             : }
     416             : 
     417             : void
     418          16 : MouseSettings::SetMenuDelay( sal_uLong nDelay )
     419             : {
     420          16 :     CopyData();
     421          16 :     mpData->mnMenuDelay = nDelay;
     422          16 : }
     423             : 
     424             : sal_uLong
     425          24 : MouseSettings::GetMenuDelay() const
     426             : {
     427          24 :     return mpData->mnMenuDelay;
     428             : }
     429             : 
     430             : void
     431         160 : MouseSettings::SetFollow( sal_uLong nFollow )
     432             : {
     433         160 :     CopyData();
     434         160 :     mpData->mnFollow = nFollow;
     435         160 : }
     436             : 
     437             : sal_uLong
     438         160 : MouseSettings::GetFollow() const
     439             : {
     440         160 :     return mpData->mnFollow;
     441             : }
     442             : 
     443             : void
     444          80 : MouseSettings::SetMiddleButtonAction( sal_uInt16 nAction )
     445             : {
     446          80 :     CopyData();
     447          80 :     mpData->mnMiddleButtonAction = nAction;
     448          80 : }
     449             : 
     450             : sal_uInt16
     451           0 : MouseSettings::GetMiddleButtonAction() const
     452             : {
     453           0 :     return mpData->mnMiddleButtonAction;
     454             : }
     455             : 
     456             : void
     457        2196 : MouseSettings::SetWheelBehavior( sal_uInt16 nBehavior )
     458             : {
     459        2196 :     CopyData();
     460        2196 :     mpData->mnWheelBehavior = nBehavior;
     461        2196 : }
     462             : 
     463             : sal_uInt16
     464        2000 : MouseSettings::GetWheelBehavior() const
     465             : {
     466        2000 :     return mpData->mnWheelBehavior;
     467             : }
     468             : 
     469             : bool
     470       33295 : MouseSettings::operator !=( const MouseSettings& rSet ) const
     471             : {
     472       33295 :     return !(*this == rSet);
     473             : }
     474             : 
     475         290 : MouseSettings::MouseSettings()
     476         290 : : mpData(boost::make_shared<ImplMouseData>())
     477             : {
     478         290 : }
     479             : 
     480       33778 : MouseSettings::~MouseSettings()
     481             : {
     482       33778 : }
     483             : 
     484        2763 : void MouseSettings::CopyData()
     485             : {
     486             :     // copy if other references exist
     487        2763 :     if ( ! mpData.unique() ) {
     488        2603 :         mpData = boost::make_shared<ImplMouseData>(*mpData);
     489             :     }
     490        2763 : }
     491             : 
     492       33295 : bool MouseSettings::operator ==( const MouseSettings& rSet ) const
     493             : {
     494       33295 :     if ( mpData == rSet.mpData )
     495       31408 :         return true;
     496             : 
     497        5661 :     if ( (mpData->mnOptions             == rSet.mpData->mnOptions)              &&
     498        3774 :          (mpData->mnDoubleClkTime       == rSet.mpData->mnDoubleClkTime)        &&
     499        3774 :          (mpData->mnDoubleClkWidth      == rSet.mpData->mnDoubleClkWidth)       &&
     500        3774 :          (mpData->mnDoubleClkHeight     == rSet.mpData->mnDoubleClkHeight)      &&
     501        3774 :          (mpData->mnStartDragWidth      == rSet.mpData->mnStartDragWidth)       &&
     502        3774 :          (mpData->mnStartDragHeight     == rSet.mpData->mnStartDragHeight)      &&
     503        3774 :          (mpData->mnStartDragCode       == rSet.mpData->mnStartDragCode)        &&
     504        3774 :          (mpData->mnContextMenuCode     == rSet.mpData->mnContextMenuCode)      &&
     505        3774 :          (mpData->mnContextMenuClicks   == rSet.mpData->mnContextMenuClicks)    &&
     506        3534 :          (mpData->mnMiddleButtonAction  == rSet.mpData->mnMiddleButtonAction)   &&
     507        3294 :          (mpData->mnScrollRepeat        == rSet.mpData->mnScrollRepeat)         &&
     508        3294 :          (mpData->mnButtonStartRepeat   == rSet.mpData->mnButtonStartRepeat)    &&
     509        2550 :          (mpData->mnButtonRepeat        == rSet.mpData->mnButtonRepeat)         &&
     510        1806 :          (mpData->mnActionDelay         == rSet.mpData->mnActionDelay)          &&
     511        1790 :          (mpData->mnMenuDelay           == rSet.mpData->mnMenuDelay)            &&
     512        3661 :          (mpData->mnFollow              == rSet.mpData->mnFollow)               &&
     513         887 :          (mpData->mnWheelBehavior       == rSet.mpData->mnWheelBehavior ) )
     514         378 :         return true;
     515             :     else
     516        1509 :         return false;
     517             : }
     518             : 
     519         290 : ImplStyleData::ImplStyleData() :
     520             :     mIconThemeScanner(vcl::IconThemeScanner::Create(vcl::IconThemeScanner::GetStandardIconThemePath())),
     521           0 :     mIconThemeSelector(new vcl::IconThemeSelector()),
     522             :     maPersonaHeaderFooter(),
     523             :     maPersonaHeaderBitmap(),
     524             :     maPersonaFooterBitmap(),
     525         290 :     maPersonaMenuBarTextColor()
     526             : {
     527         290 :     mnScrollBarSize             = 16;
     528         290 :     mnMinThumbSize              = 16;
     529         290 :     mnSplitSize                 = 3;
     530         290 :     mnSpinSize                  = 16;
     531         290 :     mnAntialiasedMin            = 0;
     532         290 :     mnCursorSize                = 2;
     533         290 :     mnCursorBlinkTime           = STYLE_CURSOR_NOBLINKTIME;
     534         290 :     mnScreenZoom                = 100;
     535         290 :     mnScreenFontZoom            = 100;
     536         290 :     mnDragFullOptions           = DRAGFULL_OPTION_ALL;
     537         290 :     mnSelectionOptions          = 0;
     538         290 :     mnDisplayOptions            = 0;
     539         290 :     mnOptions                   = 0;
     540         290 :     mbAutoMnemonic              = true;
     541         290 :     mnToolbarIconSize           = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
     542         290 :     meUseImagesInMenus          = TRISTATE_INDET;
     543         290 :     mpFontOptions              = NULL;
     544         290 :     mnEdgeBlending = 35;
     545         290 :     maEdgeBlendingTopLeftColor = RGB_COLORDATA(0xC0, 0xC0, 0xC0);
     546         290 :     maEdgeBlendingBottomRightColor = RGB_COLORDATA(0x40, 0x40, 0x40);
     547         290 :     mnListBoxMaximumLineCount = 25;
     548         290 :     mnColorValueSetColumnCount = 12;
     549         290 :     mnColorValueSetMaximumRowCount = 40;
     550         290 :     maListBoxPreviewDefaultLogicSize = Size(15, 7);
     551         290 :     maListBoxPreviewDefaultPixelSize = Size(0, 0); // on-demand calculated in GetListBoxPreviewDefaultPixelSize()
     552         290 :     mnListBoxPreviewDefaultLineWidth = 1;
     553         290 :     mbPreviewUsesCheckeredBackground = true;
     554             : 
     555         290 :     SetStandardStyles();
     556         290 : }
     557             : 
     558       29248 : ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
     559             :     maActiveBorderColor( rData.maActiveBorderColor ),
     560             :     maActiveColor( rData.maActiveColor ),
     561             :     maActiveColor2( rData.maActiveColor2 ),
     562             :     maActiveTextColor( rData.maActiveTextColor ),
     563             :     maButtonTextColor( rData.maButtonTextColor ),
     564             :     maButtonRolloverTextColor( rData.maButtonRolloverTextColor ),
     565             :     maCheckedColor( rData.maCheckedColor ),
     566             :     maDarkShadowColor( rData.maDarkShadowColor ),
     567             :     maDeactiveBorderColor( rData.maDeactiveBorderColor ),
     568             :     maDeactiveColor( rData.maDeactiveColor ),
     569             :     maDeactiveColor2( rData.maDeactiveColor2 ),
     570             :     maDeactiveTextColor( rData.maDeactiveTextColor ),
     571             :     maDialogColor( rData.maDialogColor ),
     572             :     maDialogTextColor( rData.maDialogTextColor ),
     573             :     maDisableColor( rData.maDisableColor ),
     574             :     maFaceColor( rData.maFaceColor ),
     575             :     maFieldColor( rData.maFieldColor ),
     576             :     maFieldTextColor( rData.maFieldTextColor ),
     577             :     maFieldRolloverTextColor( rData.maFieldRolloverTextColor ),
     578             :     maFontColor( rData.maFontColor ),
     579             :     maGroupTextColor( rData.maGroupTextColor ),
     580             :     maHelpColor( rData.maHelpColor ),
     581             :     maHelpTextColor( rData.maHelpTextColor ),
     582             :     maHighlightColor( rData.maHighlightColor ),
     583             :     maHighlightLinkColor( rData.maHighlightLinkColor ),
     584             :     maHighlightTextColor( rData.maHighlightTextColor ),
     585             :     maInfoTextColor( rData.maInfoTextColor ),
     586             :     maLabelTextColor( rData.maLabelTextColor ),
     587             :     maLightBorderColor( rData.maLightBorderColor ),
     588             :     maLightColor( rData.maLightColor ),
     589             :     maLinkColor( rData.maLinkColor ),
     590             :     maMenuBarColor( rData.maMenuBarColor ),
     591             :     maMenuBarRolloverColor( rData.maMenuBarRolloverColor ),
     592             :     maMenuBorderColor( rData.maMenuBorderColor ),
     593             :     maMenuColor( rData.maMenuColor ),
     594             :     maMenuHighlightColor( rData.maMenuHighlightColor ),
     595             :     maMenuHighlightTextColor( rData.maMenuHighlightTextColor ),
     596             :     maMenuTextColor( rData.maMenuTextColor ),
     597             :     maMenuBarTextColor( rData.maMenuBarTextColor ),
     598             :     maMenuBarRolloverTextColor( rData.maMenuBarRolloverTextColor ),
     599             :     maMonoColor( rData.maMonoColor ),
     600             :     maRadioCheckTextColor( rData.maRadioCheckTextColor ),
     601             :     maShadowColor( rData.maShadowColor ),
     602             :     maVisitedLinkColor( rData.maVisitedLinkColor ),
     603             :     maWindowColor( rData.maWindowColor ),
     604             :     maWindowTextColor( rData.maWindowTextColor ),
     605             :     maWorkspaceColor( rData.maWorkspaceColor ),
     606             :     maActiveTabColor( rData.maActiveTabColor ),
     607             :     maInactiveTabColor( rData.maInactiveTabColor ),
     608             :     maAppFont( rData.maAppFont ),
     609             :     maHelpFont( rData.maAppFont ),
     610             :     maTitleFont( rData.maTitleFont ),
     611             :     maFloatTitleFont( rData.maFloatTitleFont ),
     612             :     maMenuFont( rData.maMenuFont ),
     613             :     maToolFont( rData.maToolFont ),
     614             :     maLabelFont( rData.maLabelFont ),
     615             :     maInfoFont( rData.maInfoFont ),
     616             :     maRadioCheckFont( rData.maRadioCheckFont ),
     617             :     maPushButtonFont( rData.maPushButtonFont ),
     618             :     maFieldFont( rData.maFieldFont ),
     619             :     maIconFont( rData.maIconFont ),
     620             :     maGroupFont( rData.maGroupFont ),
     621             :     mIconTheme(rData.mIconTheme),
     622             :     maDialogStyle( rData.maDialogStyle ),
     623             :     maFrameStyle( rData.maFrameStyle ),
     624             :     maPersonaHeaderFooter( rData.maPersonaHeaderFooter ),
     625             :     maPersonaHeaderBitmap( rData.maPersonaHeaderBitmap ),
     626             :     maPersonaFooterBitmap( rData.maPersonaFooterBitmap ),
     627       29248 :     maPersonaMenuBarTextColor( rData.maPersonaMenuBarTextColor )
     628             : {
     629       29248 :     mnBorderSize                = rData.mnBorderSize;
     630       29248 :     mnTitleHeight               = rData.mnTitleHeight;
     631       29248 :     mnFloatTitleHeight          = rData.mnFloatTitleHeight;
     632       29248 :     mnTearOffTitleHeight        = rData.mnTearOffTitleHeight;
     633       29248 :     mnScrollBarSize             = rData.mnScrollBarSize;
     634       29248 :     mnMinThumbSize              = rData.mnMinThumbSize;
     635       29248 :     mnSplitSize                 = rData.mnSplitSize;
     636       29248 :     mnSpinSize                  = rData.mnSpinSize;
     637       29248 :     mnAntialiasedMin            = rData.mnAntialiasedMin;
     638       29248 :     mnCursorSize                = rData.mnCursorSize;
     639       29248 :     mnCursorBlinkTime           = rData.mnCursorBlinkTime;
     640       29248 :     mnScreenZoom                = rData.mnScreenZoom;
     641       29248 :     mnScreenFontZoom            = rData.mnScreenFontZoom;
     642       29248 :     mnDragFullOptions           = rData.mnDragFullOptions;
     643       29248 :     mnSelectionOptions          = rData.mnSelectionOptions;
     644       29248 :     mnDisplayOptions            = rData.mnDisplayOptions;
     645       29248 :     mnOptions                   = rData.mnOptions;
     646       29248 :     mbHighContrast              = rData.mbHighContrast;
     647       29248 :     mbUseSystemUIFonts          = rData.mbUseSystemUIFonts;
     648       29248 :     mnUseFlatBorders            = rData.mnUseFlatBorders;
     649       29248 :     mnUseFlatMenus              = rData.mnUseFlatMenus;
     650       29248 :     mbAutoMnemonic              = rData.mbAutoMnemonic;
     651       29248 :     meUseImagesInMenus          = rData.meUseImagesInMenus;
     652       29248 :     mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
     653       29248 :     mbSkipDisabledInMenus       = rData.mbSkipDisabledInMenus;
     654       29248 :     mbHideDisabledMenuItems     = rData.mbHideDisabledMenuItems;
     655       29248 :     mbAcceleratorsInContextMenus = rData.mbAcceleratorsInContextMenus;
     656       29248 :     mbPrimaryButtonWarpsSlider  = rData.mbPrimaryButtonWarpsSlider;
     657       29248 :     mnToolbarIconSize           = rData.mnToolbarIconSize;
     658       29248 :     mIconThemeScanner.reset(new vcl::IconThemeScanner(*rData.mIconThemeScanner));
     659       29248 :     mIconThemeSelector.reset(new vcl::IconThemeSelector(*rData.mIconThemeSelector));
     660       29248 :     mpFontOptions               = rData.mpFontOptions;
     661       29248 :     mnEdgeBlending              = rData.mnEdgeBlending;
     662       29248 :     maEdgeBlendingTopLeftColor  = rData.maEdgeBlendingTopLeftColor;
     663       29248 :     maEdgeBlendingBottomRightColor = rData.maEdgeBlendingBottomRightColor;
     664       29248 :     mnListBoxMaximumLineCount   = rData.mnListBoxMaximumLineCount;
     665       29248 :     mnColorValueSetColumnCount  = rData.mnColorValueSetColumnCount;
     666       29248 :     mnColorValueSetMaximumRowCount = rData.mnColorValueSetMaximumRowCount;
     667       29248 :     maListBoxPreviewDefaultLogicSize = rData.maListBoxPreviewDefaultLogicSize;
     668       29248 :     maListBoxPreviewDefaultPixelSize = rData.maListBoxPreviewDefaultPixelSize;
     669       29248 :     mnListBoxPreviewDefaultLineWidth = rData.mnListBoxPreviewDefaultLineWidth;
     670       29248 :     mbPreviewUsesCheckeredBackground = rData.mbPreviewUsesCheckeredBackground;
     671       29248 : }
     672             : 
     673         370 : void ImplStyleData::SetStandardStyles()
     674             : {
     675         370 :     Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) );
     676         370 :     aStdFont.SetCharSet( osl_getThreadTextEncoding() );
     677         370 :     aStdFont.SetWeight( WEIGHT_NORMAL );
     678         370 :     aStdFont.SetName( utl::DefaultFontConfiguration::get().getUserInterfaceFont( LanguageTag("en")) );
     679         370 :     maAppFont                   = aStdFont;
     680         370 :     maHelpFont                  = aStdFont;
     681         370 :     maMenuFont                  = aStdFont;
     682         370 :     maToolFont                  = aStdFont;
     683         370 :     maGroupFont                 = aStdFont;
     684         370 :     maLabelFont                 = aStdFont;
     685         370 :     maInfoFont                  = aStdFont;
     686         370 :     maRadioCheckFont            = aStdFont;
     687         370 :     maPushButtonFont            = aStdFont;
     688         370 :     maFieldFont                 = aStdFont;
     689         370 :     maIconFont                  = aStdFont;
     690         370 :     aStdFont.SetWeight( WEIGHT_BOLD );
     691         370 :     maFloatTitleFont            = aStdFont;
     692         370 :     maTitleFont                 = aStdFont;
     693             : 
     694         370 :     maFaceColor                 = Color( COL_LIGHTGRAY );
     695         370 :     maCheckedColor              = Color( 0xCC, 0xCC, 0xCC );
     696         370 :     maLightColor                = Color( COL_WHITE );
     697         370 :     maLightBorderColor          = Color( COL_LIGHTGRAY );
     698         370 :     maShadowColor               = Color( COL_GRAY );
     699         370 :     maDarkShadowColor           = Color( COL_BLACK );
     700         370 :     maButtonTextColor           = Color( COL_BLACK );
     701         370 :     maButtonRolloverTextColor   = Color( COL_BLACK );
     702         370 :     maRadioCheckTextColor       = Color( COL_BLACK );
     703         370 :     maGroupTextColor            = Color( COL_BLACK );
     704         370 :     maLabelTextColor            = Color( COL_BLACK );
     705         370 :     maInfoTextColor             = Color( COL_BLACK );
     706         370 :     maWindowColor               = Color( COL_WHITE );
     707         370 :     maWindowTextColor           = Color( COL_BLACK );
     708         370 :     maDialogColor               = Color( COL_LIGHTGRAY );
     709         370 :     maDialogTextColor           = Color( COL_BLACK );
     710         370 :     maWorkspaceColor            = Color( 0xF0, 0xF0, 0xF0 );
     711         370 :     maMonoColor                 = Color( COL_BLACK );
     712         370 :     maFieldColor                = Color( COL_WHITE );
     713         370 :     maFieldTextColor            = Color( COL_BLACK );
     714         370 :     maFieldRolloverTextColor    = Color( COL_BLACK );
     715         370 :     maActiveColor               = Color( COL_BLUE );
     716         370 :     maActiveColor2              = Color( COL_BLACK );
     717         370 :     maActiveTextColor           = Color( COL_WHITE );
     718         370 :     maActiveBorderColor         = Color( COL_LIGHTGRAY );
     719         370 :     maDeactiveColor             = Color( COL_GRAY );
     720         370 :     maDeactiveColor2            = Color( COL_BLACK );
     721         370 :     maDeactiveTextColor         = Color( COL_LIGHTGRAY );
     722         370 :     maDeactiveBorderColor       = Color( COL_LIGHTGRAY );
     723         370 :     maMenuColor                 = Color( COL_LIGHTGRAY );
     724         370 :     maMenuBarColor              = Color( COL_LIGHTGRAY );
     725         370 :     maMenuBarRolloverColor      = Color( COL_BLUE );
     726         370 :     maMenuBorderColor           = Color( COL_LIGHTGRAY );
     727         370 :     maMenuTextColor             = Color( COL_BLACK );
     728         370 :     maMenuBarTextColor          = Color( COL_BLACK );
     729         370 :     maMenuBarRolloverTextColor  = Color( COL_WHITE );
     730         370 :     maMenuHighlightColor        = Color( COL_BLUE );
     731         370 :     maMenuHighlightTextColor    = Color( COL_WHITE );
     732         370 :     maHighlightColor            = Color( COL_BLUE );
     733         370 :     maHighlightTextColor        = Color( COL_WHITE );
     734         370 :     maActiveTabColor            = Color( COL_WHITE );
     735         370 :     maInactiveTabColor          = Color( COL_LIGHTGRAY );
     736         370 :     maDisableColor              = Color( COL_GRAY );
     737         370 :     maHelpColor                 = Color( 0xFF, 0xFF, 0xE0 );
     738         370 :     maHelpTextColor             = Color( COL_BLACK );
     739         370 :     maLinkColor                 = Color( COL_BLUE );
     740         370 :     maVisitedLinkColor          = Color( 0x00, 0x00, 0xCC );
     741         370 :     maHighlightLinkColor        = Color( COL_LIGHTBLUE );
     742         370 :     maFontColor                 = Color( COL_BLACK );
     743             : 
     744         370 :     mnBorderSize                = 1;
     745         370 :     mnTitleHeight               = 18;
     746         370 :     mnFloatTitleHeight          = 13;
     747         370 :     mnTearOffTitleHeight        = 8;
     748         370 :     mbHighContrast              = false;
     749         370 :     mbUseSystemUIFonts          = true;
     750         370 :     mnUseFlatBorders            = false;
     751         370 :     mnUseFlatMenus              = false;
     752         370 :     mbPreferredUseImagesInMenus = true;
     753         370 :     mbSkipDisabledInMenus       = false;
     754         370 :     mbHideDisabledMenuItems     = false;
     755         370 :     mbAcceleratorsInContextMenus = true;
     756         370 :     mbPrimaryButtonWarpsSlider = false;
     757         370 : }
     758             : 
     759         290 : StyleSettings::StyleSettings()
     760         290 : : mpData(boost::make_shared<ImplStyleData>())
     761             : {
     762         290 : }
     763             : 
     764       63329 : StyleSettings::~StyleSettings()
     765             : {
     766       63329 : }
     767             : 
     768             : void
     769          50 : StyleSettings::SetFaceColor( const Color& rColor )
     770             : {
     771          50 :     CopyData();
     772          50 :     mpData->maFaceColor = rColor;
     773          50 : }
     774             : 
     775             : const Color&
     776      616457 : StyleSettings::GetFaceColor() const
     777             : {
     778      616457 :     return mpData->maFaceColor;
     779             : }
     780             : 
     781             : void
     782          50 : StyleSettings::SetCheckedColor( const Color& rColor )
     783             : {
     784          50 :     CopyData();
     785          50 :     mpData->maCheckedColor = rColor;
     786          50 : }
     787             : 
     788             : const Color&
     789       16371 : StyleSettings::GetCheckedColor() const
     790             : {
     791       16371 :     return mpData->maCheckedColor;
     792             : }
     793             : 
     794             : void
     795           2 : StyleSettings::SetLightColor( const Color& rColor )
     796             : {
     797           2 :     CopyData();
     798           2 :     mpData->maLightColor = rColor;
     799           2 : }
     800             : 
     801             : const Color&
     802       72459 : StyleSettings::GetLightColor() const
     803             : {
     804       72459 :     return mpData->maLightColor;
     805             : }
     806             : 
     807             : void
     808           2 : StyleSettings::SetLightBorderColor( const Color& rColor )
     809             : {
     810           2 :     CopyData();
     811           2 :     mpData->maLightBorderColor = rColor;
     812           2 : }
     813             : 
     814             : const Color&
     815       36582 : StyleSettings::GetLightBorderColor() const
     816             : {
     817       36582 :     return mpData->maLightBorderColor;
     818             : }
     819             : 
     820             : void
     821          50 : StyleSettings::SetShadowColor( const Color& rColor )
     822             : {
     823          50 :     CopyData();
     824          50 :     mpData->maShadowColor = rColor;
     825          50 : }
     826             : 
     827             : const Color&
     828      292111 : StyleSettings::GetShadowColor() const
     829             : {
     830      292111 :     return mpData->maShadowColor;
     831             : }
     832             : 
     833             : void
     834           2 : StyleSettings::SetDarkShadowColor( const Color& rColor )
     835             : {
     836           2 :     CopyData();
     837           2 :     mpData->maDarkShadowColor = rColor;
     838           2 : }
     839             : 
     840             : const Color&
     841      100673 : StyleSettings::GetDarkShadowColor() const
     842             : {
     843      100673 :     return mpData->maDarkShadowColor;
     844             : }
     845             : 
     846             : void
     847          50 : StyleSettings::SetButtonTextColor( const Color& rColor )
     848             : {
     849          50 :     CopyData();
     850          50 :     mpData->maButtonTextColor = rColor;
     851          50 : }
     852             : 
     853             : const Color&
     854      127577 : StyleSettings::GetButtonTextColor() const
     855             : {
     856      127577 :     return mpData->maButtonTextColor;
     857             : }
     858             : 
     859             : void
     860           0 : StyleSettings::SetButtonRolloverTextColor( const Color& rColor )
     861             : {
     862           0 :     CopyData();
     863           0 :     mpData->maButtonRolloverTextColor = rColor;
     864           0 : }
     865             : 
     866             : const Color&
     867           0 : StyleSettings::GetButtonRolloverTextColor() const
     868             : {
     869           0 :     return mpData->maButtonRolloverTextColor;
     870             : }
     871             : 
     872             : void
     873           0 : StyleSettings::SetRadioCheckTextColor( const Color& rColor )
     874             : {
     875           0 :     CopyData();
     876           0 :     mpData->maRadioCheckTextColor = rColor;
     877           0 : }
     878             : 
     879             : const Color&
     880         707 : StyleSettings::GetRadioCheckTextColor() const
     881             : {
     882         707 :     return mpData->maRadioCheckTextColor;
     883             : }
     884             : 
     885             : void
     886           0 : StyleSettings::SetGroupTextColor( const Color& rColor )
     887             : {
     888           0 :     CopyData();
     889           0 :     mpData->maGroupTextColor = rColor;
     890           0 : }
     891             : 
     892             : const Color&
     893         383 : StyleSettings::GetGroupTextColor() const
     894             : {
     895         383 :     return mpData->maGroupTextColor;
     896             : }
     897             : 
     898             : void
     899           0 : StyleSettings::SetLabelTextColor( const Color& rColor )
     900             : {
     901           0 :     CopyData();
     902           0 :     mpData->maLabelTextColor = rColor;
     903           0 : }
     904             : 
     905             : const Color&
     906         837 : StyleSettings::GetLabelTextColor() const
     907             : {
     908         837 :     return mpData->maLabelTextColor;
     909             : }
     910             : 
     911             : void
     912           0 : StyleSettings::SetInfoTextColor( const Color& rColor )
     913             : {
     914           0 :     CopyData();
     915           0 :     mpData->maInfoTextColor = rColor;
     916           0 : }
     917             : 
     918             : const Color&
     919           0 : StyleSettings::GetInfoTextColor() const
     920             : {
     921           0 :     return mpData->maInfoTextColor;
     922             : }
     923             : 
     924             : void
     925           0 : StyleSettings::SetWindowColor( const Color& rColor )
     926             : {
     927           0 :     CopyData();
     928           0 :     mpData->maWindowColor = rColor;
     929           0 : }
     930             : 
     931             : const Color&
     932       53863 : StyleSettings::GetWindowColor() const
     933             : {
     934       53863 :     return mpData->maWindowColor;
     935             : }
     936             : 
     937             : void
     938           0 : StyleSettings::SetWindowTextColor( const Color& rColor )
     939             : {
     940           0 :     CopyData();
     941           0 :     mpData->maWindowTextColor = rColor;
     942           0 : }
     943             : 
     944             : const Color&
     945       38645 : StyleSettings::GetWindowTextColor() const
     946             : {
     947       38645 :     return mpData->maWindowTextColor;
     948             : }
     949             : 
     950             : void
     951           0 : StyleSettings::SetDialogColor( const Color& rColor )
     952             : {
     953           0 :     CopyData();
     954           0 :     mpData->maDialogColor = rColor;
     955           0 : }
     956             : 
     957             : const Color&
     958         296 : StyleSettings::GetDialogColor() const
     959             : {
     960         296 :     return mpData->maDialogColor;
     961             : }
     962             : 
     963             : void
     964           0 : StyleSettings::SetDialogTextColor( const Color& rColor )
     965             : {
     966           0 :     CopyData();
     967           0 :     mpData->maDialogTextColor = rColor;
     968           0 : }
     969             : 
     970             : const Color&
     971           0 : StyleSettings::GetDialogTextColor() const
     972             : {
     973           0 :     return mpData->maDialogTextColor;
     974             : }
     975             : 
     976             : void
     977           0 : StyleSettings::SetWorkspaceColor( const Color& rColor )
     978             : {
     979           0 :     CopyData();
     980           0 :     mpData->maWorkspaceColor = rColor;
     981           0 : }
     982             : 
     983             : const Color&
     984       15129 : StyleSettings::GetWorkspaceColor() const
     985             : {
     986       15129 :     return mpData->maWorkspaceColor;
     987             : }
     988             : 
     989             : void
     990           0 : StyleSettings::SetFieldColor( const Color& rColor )
     991             : {
     992           0 :     CopyData();
     993           0 :     mpData->maFieldColor = rColor;
     994           0 : }
     995             : 
     996             : const Color&
     997       35257 : StyleSettings::GetFieldColor() const
     998             : {
     999       35257 :     return mpData->maFieldColor;
    1000             : }
    1001             : 
    1002             : void
    1003          96 : StyleSettings::SetFieldTextColor( const Color& rColor )
    1004             : {
    1005          96 :     CopyData();
    1006          96 :     mpData->maFieldTextColor = rColor;
    1007          96 : }
    1008             : 
    1009             : const Color&
    1010       19579 : StyleSettings::GetFieldTextColor() const
    1011             : {
    1012       19579 :     return mpData->maFieldTextColor;
    1013             : }
    1014             : 
    1015             : void
    1016           0 : StyleSettings::SetFieldRolloverTextColor( const Color& rColor )
    1017             : {
    1018           0 :     CopyData();
    1019           0 :     mpData->maFieldRolloverTextColor = rColor;
    1020           0 : }
    1021             : 
    1022             : const Color&
    1023           0 : StyleSettings::GetFieldRolloverTextColor() const
    1024             : {
    1025           0 :     return mpData->maFieldRolloverTextColor;
    1026             : }
    1027             : 
    1028             : void
    1029           0 : StyleSettings::SetActiveColor( const Color& rColor )
    1030             : {
    1031           0 :     CopyData();
    1032           0 :     mpData->maActiveColor = rColor;
    1033           0 : }
    1034             : 
    1035             : const Color&
    1036           0 : StyleSettings::GetActiveColor() const
    1037             : {
    1038           0 :     return mpData->maActiveColor;
    1039             : }
    1040             : 
    1041             : void
    1042           0 : StyleSettings::SetActiveColor2( const Color& rColor )
    1043             : {
    1044           0 :     CopyData();
    1045           0 :     mpData->maActiveColor2 = rColor;
    1046           0 : }
    1047             : 
    1048             : const Color&
    1049           0 : StyleSettings::GetActiveColor2() const
    1050             : {
    1051           0 :     return mpData->maActiveColor2;
    1052             : }
    1053             : 
    1054             : void
    1055           0 : StyleSettings::SetActiveTextColor( const Color& rColor )
    1056             : {
    1057           0 :     CopyData();
    1058           0 :     mpData->maActiveTextColor = rColor;
    1059           0 : }
    1060             : 
    1061             : const Color&
    1062         184 : StyleSettings::GetActiveTextColor() const
    1063             : {
    1064         184 :     return mpData->maActiveTextColor;
    1065             : }
    1066             : 
    1067             : void
    1068           0 : StyleSettings::SetActiveBorderColor( const Color& rColor )
    1069             : {
    1070           0 :     CopyData();
    1071           0 :     mpData->maActiveBorderColor = rColor;
    1072           0 : }
    1073             : 
    1074             : const Color&
    1075          40 : StyleSettings::GetActiveBorderColor() const
    1076             : {
    1077          40 :     return mpData->maActiveBorderColor;
    1078             : }
    1079             : 
    1080             : void
    1081           0 : StyleSettings::SetDeactiveColor( const Color& rColor )
    1082             : {
    1083           0 :     CopyData();
    1084           0 :     mpData->maDeactiveColor = rColor;
    1085           0 : }
    1086             : 
    1087             : const Color&
    1088         513 : StyleSettings::GetDeactiveColor() const
    1089             : {
    1090         513 :     return mpData->maDeactiveColor;
    1091             : }
    1092             : 
    1093             : void
    1094           0 : StyleSettings::SetDeactiveColor2( const Color& rColor )
    1095             : {
    1096           0 :     CopyData();
    1097           0 :     mpData->maDeactiveColor2 = rColor;
    1098           0 : }
    1099             : 
    1100             : const Color&
    1101           0 : StyleSettings::GetDeactiveColor2() const
    1102             : {
    1103           0 :     return mpData->maDeactiveColor2;
    1104             : }
    1105             : 
    1106             : void
    1107           0 : StyleSettings::SetDeactiveTextColor( const Color& rColor )
    1108             : {
    1109           0 :     CopyData();
    1110           0 :     mpData->maDeactiveTextColor = rColor;
    1111           0 : }
    1112             : 
    1113             : const Color&
    1114           0 : StyleSettings::GetDeactiveTextColor() const
    1115             : {
    1116           0 :     return mpData->maDeactiveTextColor;
    1117             : }
    1118             : 
    1119             : void
    1120           0 : StyleSettings::SetDeactiveBorderColor( const Color& rColor )
    1121             : {
    1122           0 :     CopyData();
    1123           0 :     mpData->maDeactiveBorderColor = rColor;
    1124           0 : }
    1125             : 
    1126             : const Color&
    1127           0 : StyleSettings::GetDeactiveBorderColor() const
    1128             : {
    1129           0 :     return mpData->maDeactiveBorderColor;
    1130             : }
    1131             : 
    1132             : void
    1133           0 : StyleSettings::SetHighlightColor( const Color& rColor )
    1134             : {
    1135           0 :     CopyData();
    1136           0 :     mpData->maHighlightColor = rColor;
    1137           0 : }
    1138             : 
    1139             : const Color&
    1140       11218 : StyleSettings::GetHighlightColor() const
    1141             : {
    1142       11218 :     return mpData->maHighlightColor;
    1143             : }
    1144             : 
    1145             : void
    1146           0 : StyleSettings::SetHighlightTextColor( const Color& rColor )
    1147             : {
    1148           0 :     CopyData();
    1149           0 :     mpData->maHighlightTextColor = rColor;
    1150           0 : }
    1151             : 
    1152             : const Color&
    1153        4838 : StyleSettings::GetHighlightTextColor() const
    1154             : {
    1155        4838 :     return mpData->maHighlightTextColor;
    1156             : }
    1157             : 
    1158             : void
    1159           0 : StyleSettings::SetDisableColor( const Color& rColor )
    1160             : {
    1161           0 :     CopyData();
    1162           0 :     mpData->maDisableColor = rColor;
    1163           0 : }
    1164             : 
    1165             : const Color&
    1166        2208 : StyleSettings::GetDisableColor() const
    1167             : {
    1168        2208 :     return mpData->maDisableColor;
    1169             : }
    1170             : 
    1171             : void
    1172           0 : StyleSettings::SetHelpColor( const Color& rColor )
    1173             : {
    1174           0 :     CopyData();
    1175           0 :     mpData->maHelpColor = rColor;
    1176           0 : }
    1177             : 
    1178             : const Color&
    1179           3 : StyleSettings::GetHelpColor() const
    1180             : {
    1181           3 :     return mpData->maHelpColor;
    1182             : }
    1183             : 
    1184             : void
    1185           0 : StyleSettings::SetHelpTextColor( const Color& rColor )
    1186             : {
    1187           0 :     CopyData();
    1188           0 :     mpData->maHelpTextColor = rColor;
    1189           0 : }
    1190             : 
    1191             : const Color&
    1192           0 : StyleSettings::GetHelpTextColor() const
    1193             : {
    1194           0 :     return mpData->maHelpTextColor;
    1195             : }
    1196             : 
    1197             : void
    1198           0 : StyleSettings::SetMenuColor( const Color& rColor )
    1199             : {
    1200           0 :     CopyData();
    1201           0 :     mpData->maMenuColor = rColor;
    1202           0 : }
    1203             : 
    1204             : const Color&
    1205        1028 : StyleSettings::GetMenuColor() const
    1206             : {
    1207        1028 :     return mpData->maMenuColor;
    1208             : }
    1209             : 
    1210             : void
    1211           0 : StyleSettings::SetMenuBarColor( const Color& rColor )
    1212             : {
    1213           0 :     CopyData();
    1214           0 :     mpData->maMenuBarColor = rColor;
    1215           0 : }
    1216             : 
    1217             : const Color&
    1218           1 : StyleSettings::GetMenuBarColor() const
    1219             : {
    1220           1 :     return mpData->maMenuBarColor;
    1221             : }
    1222             : 
    1223             : void
    1224           0 : StyleSettings::SetMenuBarRolloverColor( const Color& rColor )
    1225             : {
    1226           0 :     CopyData();
    1227           0 :     mpData->maMenuBarRolloverColor = rColor;
    1228           0 : }
    1229             : 
    1230             : const Color&
    1231           0 : StyleSettings::GetMenuBarRolloverColor() const
    1232             : {
    1233           0 :     return mpData->maMenuBarRolloverColor;
    1234             : }
    1235             : 
    1236             : void
    1237           0 : StyleSettings::SetMenuBorderColor( const Color& rColor )
    1238             : {
    1239           0 :     CopyData();
    1240           0 :     mpData->maMenuBorderColor = rColor;
    1241           0 : }
    1242             : 
    1243             : const Color&
    1244           7 : StyleSettings::GetMenuBorderColor() const
    1245             : {
    1246           7 :     return mpData->maMenuBorderColor;
    1247             : }
    1248             : 
    1249             : void
    1250           0 : StyleSettings::SetMenuTextColor( const Color& rColor )
    1251             : {
    1252           0 :     CopyData();
    1253           0 :     mpData->maMenuTextColor = rColor;
    1254           0 : }
    1255             : 
    1256             : const Color&
    1257           9 : StyleSettings::GetMenuTextColor() const
    1258             : {
    1259           9 :     return mpData->maMenuTextColor;
    1260             : }
    1261             : 
    1262             : void
    1263           0 : StyleSettings::SetMenuBarTextColor( const Color& rColor )
    1264             : {
    1265           0 :     CopyData();
    1266           0 :     mpData->maMenuBarTextColor = rColor;
    1267           0 : }
    1268             : 
    1269             : const Color&
    1270        2059 : StyleSettings::GetMenuBarTextColor() const
    1271             : {
    1272        2059 :     return mpData->maMenuBarTextColor;
    1273             : }
    1274             : 
    1275             : void
    1276           0 : StyleSettings::SetMenuBarRolloverTextColor( const Color& rColor )
    1277             : {
    1278           0 :     CopyData();
    1279           0 :     mpData->maMenuBarRolloverTextColor = rColor;
    1280           0 : }
    1281             : 
    1282             : const Color&
    1283           0 : StyleSettings::GetMenuBarRolloverTextColor() const
    1284             : {
    1285           0 :     return mpData->maMenuBarRolloverTextColor;
    1286             : }
    1287             : 
    1288             : void
    1289           0 : StyleSettings::SetMenuHighlightColor( const Color& rColor )
    1290             : {
    1291           0 :     CopyData();
    1292           0 :     mpData->maMenuHighlightColor = rColor;
    1293           0 : }
    1294             : 
    1295             : const Color&
    1296         205 : StyleSettings::GetMenuHighlightColor() const
    1297             : {
    1298         205 :     return mpData->maMenuHighlightColor;
    1299             : }
    1300             : 
    1301             : void
    1302           0 : StyleSettings::SetMenuHighlightTextColor( const Color& rColor )
    1303             : {
    1304           0 :     CopyData();
    1305           0 :     mpData->maMenuHighlightTextColor = rColor;
    1306           0 : }
    1307             : 
    1308             : const Color&
    1309          16 : StyleSettings::GetMenuHighlightTextColor() const
    1310             : {
    1311          16 :     return mpData->maMenuHighlightTextColor;
    1312             : }
    1313             : 
    1314             : void
    1315           0 : StyleSettings::SetLinkColor( const Color& rColor )
    1316             : {
    1317           0 :     CopyData();
    1318           0 :     mpData->maLinkColor = rColor;
    1319           0 : }
    1320             : 
    1321             : const Color&
    1322         107 : StyleSettings::GetLinkColor() const
    1323             : {
    1324         107 :     return mpData->maLinkColor;
    1325             : }
    1326             : 
    1327             : void
    1328           0 : StyleSettings::SetVisitedLinkColor( const Color& rColor )
    1329             : {
    1330           0 :     CopyData();
    1331           0 :     mpData->maVisitedLinkColor = rColor;
    1332           0 : }
    1333             : 
    1334             : const Color&
    1335          77 : StyleSettings::GetVisitedLinkColor() const
    1336             : {
    1337          77 :     return mpData->maVisitedLinkColor;
    1338             : }
    1339             : 
    1340             : const Color&
    1341           4 : StyleSettings::GetHighlightLinkColor() const
    1342             : {
    1343           4 :     return mpData->maHighlightLinkColor;
    1344             : }
    1345             : 
    1346             : void
    1347         285 : StyleSettings::SetMonoColor( const Color& rColor )
    1348             : {
    1349         285 :     CopyData();
    1350         285 :     mpData->maMonoColor = rColor;
    1351         285 : }
    1352             : 
    1353             : const Color&
    1354        1133 : StyleSettings::GetMonoColor() const
    1355             : {
    1356        1133 :     return mpData->maMonoColor;
    1357             : }
    1358             : 
    1359             : void
    1360           0 : StyleSettings::SetActiveTabColor( const Color& rColor )
    1361             : {
    1362           0 :     CopyData();
    1363           0 :     mpData->maActiveTabColor = rColor;
    1364           0 : }
    1365             : 
    1366             : const Color&
    1367         349 : StyleSettings::GetActiveTabColor() const
    1368             : {
    1369         349 :     return mpData->maActiveTabColor;
    1370             : }
    1371             : 
    1372             : void
    1373           0 : StyleSettings::SetInactiveTabColor( const Color& rColor )
    1374             : {
    1375           0 :     CopyData();
    1376           0 :     mpData->maInactiveTabColor = rColor;
    1377           0 : }
    1378             : 
    1379             : const Color&
    1380         344 : StyleSettings::GetInactiveTabColor() const
    1381             : {
    1382         344 :     return mpData->maInactiveTabColor;
    1383             : }
    1384             : 
    1385             : void
    1386          80 : StyleSettings::SetUseSystemUIFonts( bool bUseSystemUIFonts )
    1387             : {
    1388          80 :     CopyData();
    1389          80 :     mpData->mbUseSystemUIFonts = bUseSystemUIFonts;
    1390          80 : }
    1391             : 
    1392             : bool
    1393         694 : StyleSettings::GetUseSystemUIFonts() const
    1394             : {
    1395         694 :     return mpData->mbUseSystemUIFonts;
    1396             : }
    1397             : 
    1398             : void
    1399           0 : StyleSettings::SetUseFlatBorders( bool bUseFlatBorders )
    1400             : {
    1401           0 :     CopyData();
    1402           0 :     mpData->mnUseFlatBorders = bUseFlatBorders;
    1403           0 : }
    1404             : 
    1405             : bool
    1406       28717 : StyleSettings::GetUseFlatBorders() const
    1407             : {
    1408       28717 :     return (bool) mpData->mnUseFlatBorders;
    1409             : }
    1410             : 
    1411             : void
    1412           0 : StyleSettings::SetUseFlatMenus( bool bUseFlatMenus )
    1413             : {
    1414           0 :     CopyData();
    1415           0 :     mpData->mnUseFlatMenus = bUseFlatMenus;
    1416           0 : }
    1417             : 
    1418             : bool
    1419           7 : StyleSettings::GetUseFlatMenus() const
    1420             : {
    1421           7 :     return (bool) mpData->mnUseFlatMenus;
    1422             : }
    1423             : 
    1424             : void
    1425          80 : StyleSettings::SetUseImagesInMenus( TriState eUseImagesInMenus )
    1426             : {
    1427          80 :     CopyData();
    1428          80 :     mpData->meUseImagesInMenus = eUseImagesInMenus;
    1429          80 : }
    1430             : 
    1431             : void
    1432           0 : StyleSettings::SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus )
    1433             : {
    1434           0 :     CopyData();
    1435           0 :     mpData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus;
    1436           0 : }
    1437             : 
    1438             : bool
    1439       30563 : StyleSettings::GetPreferredUseImagesInMenus() const
    1440             : {
    1441       30563 :     return mpData->mbPreferredUseImagesInMenus;
    1442             : }
    1443             : 
    1444             : void
    1445           0 : StyleSettings::SetSkipDisabledInMenus( bool bSkipDisabledInMenus )
    1446             : {
    1447           0 :     CopyData();
    1448           0 :     mpData->mbSkipDisabledInMenus = bSkipDisabledInMenus;
    1449           0 : }
    1450             : 
    1451             : bool
    1452           0 : StyleSettings::GetSkipDisabledInMenus() const
    1453             : {
    1454           0 :     return mpData->mbSkipDisabledInMenus;
    1455             : }
    1456             : 
    1457             : void
    1458           0 : StyleSettings::SetHideDisabledMenuItems( bool bHideDisabledMenuItems )
    1459             : {
    1460           0 :     CopyData();
    1461           0 :     mpData->mbHideDisabledMenuItems = bHideDisabledMenuItems;
    1462           0 : }
    1463             : 
    1464             : bool
    1465           0 : StyleSettings::GetHideDisabledMenuItems() const
    1466             : {
    1467           0 :     return mpData->mbHideDisabledMenuItems;
    1468             : }
    1469             : 
    1470             : void
    1471           0 : StyleSettings::SetAcceleratorsInContextMenus( bool bAcceleratorsInContextMenus )
    1472             : {
    1473           0 :     CopyData();
    1474           0 :     mpData->mbAcceleratorsInContextMenus = bAcceleratorsInContextMenus;
    1475           0 : }
    1476             : 
    1477             : bool
    1478           0 : StyleSettings::GetAcceleratorsInContextMenus() const
    1479             : {
    1480           0 :     return mpData->mbAcceleratorsInContextMenus;
    1481             : }
    1482             : 
    1483             : void
    1484           0 : StyleSettings::SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider )
    1485             : {
    1486           0 :     CopyData();
    1487           0 :     mpData->mbPrimaryButtonWarpsSlider = bPrimaryButtonWarpsSlider;
    1488           0 : }
    1489             : 
    1490             : bool
    1491           0 : StyleSettings::GetPrimaryButtonWarpsSlider() const
    1492             : {
    1493           0 :     return mpData->mbPrimaryButtonWarpsSlider;
    1494             : }
    1495             : 
    1496             : void
    1497           0 : StyleSettings::SetCairoFontOptions( const void *pOptions )
    1498             : {
    1499           0 :     CopyData();
    1500           0 :     mpData->mpFontOptions = pOptions;
    1501           0 : }
    1502             : 
    1503             : const void*
    1504           0 : StyleSettings::GetCairoFontOptions() const
    1505             : {
    1506           0 :     return mpData->mpFontOptions;
    1507             : }
    1508             : 
    1509             : void
    1510         534 : StyleSettings::SetAppFont( const Font& rFont )
    1511             : {
    1512         534 :     CopyData();
    1513         534 :     mpData->maAppFont = rFont;
    1514         534 : }
    1515             : 
    1516             : const Font&
    1517      120783 : StyleSettings::GetAppFont() const
    1518             : {
    1519      120783 :     return mpData->maAppFont;
    1520             : }
    1521             : 
    1522             : void
    1523           0 : StyleSettings::SetHelpFont( const Font& rFont )
    1524             : {
    1525           0 :     CopyData();
    1526           0 :     mpData->maHelpFont = rFont;
    1527           0 : }
    1528             : 
    1529             : const Font&
    1530           0 : StyleSettings::GetHelpFont() const
    1531             : {
    1532           0 :     return mpData->maHelpFont;
    1533             : }
    1534             : 
    1535             : void
    1536         534 : StyleSettings::SetTitleFont( const Font& rFont )
    1537             : {
    1538         534 :     CopyData();
    1539         534 :     mpData->maTitleFont = rFont;
    1540         534 : }
    1541             : 
    1542             : const Font&
    1543         534 : StyleSettings::GetTitleFont() const
    1544             : {
    1545         534 :     return mpData->maTitleFont;
    1546             : }
    1547             : 
    1548             : void
    1549         534 : StyleSettings::SetFloatTitleFont( const Font& rFont )
    1550             : {
    1551         534 :     CopyData();
    1552         534 :     mpData->maFloatTitleFont = rFont;
    1553         534 : }
    1554             : 
    1555             : const Font&
    1556         534 : StyleSettings::GetFloatTitleFont() const
    1557             : {
    1558         534 :     return mpData->maFloatTitleFont;
    1559             : }
    1560             : 
    1561             : void
    1562           0 : StyleSettings::SetMenuFont( const Font& rFont )
    1563             : {
    1564           0 :     CopyData();
    1565           0 :     mpData->maMenuFont = rFont;
    1566           0 : }
    1567             : 
    1568             : const Font&
    1569        2588 : StyleSettings::GetMenuFont() const
    1570             : {
    1571        2588 :     return mpData->maMenuFont;
    1572             : }
    1573             : 
    1574             : void
    1575         534 : StyleSettings::SetToolFont( const Font& rFont )
    1576             : {
    1577         534 :     CopyData();
    1578         534 :     mpData->maToolFont = rFont;
    1579         534 : }
    1580             : 
    1581             : const Font&
    1582       20970 : StyleSettings::GetToolFont() const
    1583             : {
    1584       20970 :     return mpData->maToolFont;
    1585             : }
    1586             : 
    1587             : void
    1588         534 : StyleSettings::SetGroupFont( const Font& rFont )
    1589             : {
    1590         534 :     CopyData();
    1591         534 :     mpData->maGroupFont = rFont;
    1592         534 : }
    1593             : 
    1594             : const Font&
    1595         917 : StyleSettings::GetGroupFont() const
    1596             : {
    1597         917 :     return mpData->maGroupFont;
    1598             : }
    1599             : 
    1600             : void
    1601         534 : StyleSettings::SetLabelFont( const Font& rFont )
    1602             : {
    1603         534 :     CopyData();
    1604         534 :     mpData->maLabelFont = rFont;
    1605         534 : }
    1606             : 
    1607             : const Font&
    1608        1377 : StyleSettings::GetLabelFont() const
    1609             : {
    1610        1377 :     return mpData->maLabelFont;
    1611             : }
    1612             : 
    1613             : void
    1614         534 : StyleSettings::SetInfoFont( const Font& rFont )
    1615             : {
    1616         534 :     CopyData();
    1617         534 :     mpData->maInfoFont = rFont;
    1618         534 : }
    1619             : 
    1620             : const Font&
    1621         534 : StyleSettings::GetInfoFont() const
    1622             : {
    1623         534 :     return mpData->maInfoFont;
    1624             : }
    1625             : 
    1626             : void
    1627         534 : StyleSettings::SetRadioCheckFont( const Font& rFont )
    1628             : {
    1629         534 :     CopyData();
    1630         534 :     mpData->maRadioCheckFont = rFont;
    1631         534 : }
    1632             : 
    1633             : const Font&
    1634        1485 : StyleSettings::GetRadioCheckFont() const
    1635             : {
    1636        1485 :     return mpData->maRadioCheckFont;
    1637             : }
    1638             : 
    1639             : void
    1640         534 : StyleSettings::SetPushButtonFont( const Font& rFont )
    1641             : {
    1642         534 :     CopyData();
    1643         534 :     mpData->maPushButtonFont = rFont;
    1644         534 : }
    1645             : 
    1646             : const Font&
    1647        9401 : StyleSettings::GetPushButtonFont() const
    1648             : {
    1649        9401 :     return mpData->maPushButtonFont;
    1650             : }
    1651             : 
    1652             : void
    1653         630 : StyleSettings::SetFieldFont( const Font& rFont )
    1654             : {
    1655         630 :     CopyData();
    1656         630 :     mpData->maFieldFont = rFont;
    1657         630 : }
    1658             : 
    1659             : const Font&
    1660       14233 : StyleSettings::GetFieldFont() const
    1661             : {
    1662       14233 :     return mpData->maFieldFont;
    1663             : }
    1664             : 
    1665             : void
    1666         534 : StyleSettings::SetIconFont( const Font& rFont )
    1667             : {
    1668         534 :     CopyData();
    1669         534 :     mpData->maIconFont = rFont;
    1670         534 : }
    1671             : 
    1672             : const Font&
    1673         534 : StyleSettings::GetIconFont() const
    1674             : {
    1675         534 :     return mpData->maIconFont;
    1676             : }
    1677             : 
    1678             : long
    1679           0 : StyleSettings::GetBorderSize() const
    1680             : {
    1681           0 :     return mpData->mnBorderSize;
    1682             : }
    1683             : 
    1684             : void
    1685           0 : StyleSettings::SetTitleHeight( long nSize )
    1686             : {
    1687           0 :     CopyData();
    1688           0 :     mpData->mnTitleHeight = nSize;
    1689           0 : }
    1690             : 
    1691             : long
    1692          72 : StyleSettings::GetTitleHeight() const
    1693             : {
    1694          72 :     return mpData->mnTitleHeight;
    1695             : }
    1696             : 
    1697             : void
    1698           0 : StyleSettings::SetFloatTitleHeight( long nSize )
    1699             : {
    1700           0 :     CopyData();
    1701           0 :     mpData->mnFloatTitleHeight = nSize;
    1702           0 : }
    1703             : 
    1704             : long
    1705           0 : StyleSettings::GetFloatTitleHeight() const
    1706             : {
    1707           0 :     return mpData->mnFloatTitleHeight;
    1708             : }
    1709             : 
    1710             : long
    1711           0 : StyleSettings::GetTearOffTitleHeight() const
    1712             : {
    1713           0 :     return mpData->mnTearOffTitleHeight;
    1714             : }
    1715             : 
    1716             : void
    1717           0 : StyleSettings::SetScrollBarSize( long nSize )
    1718             : {
    1719           0 :     CopyData();
    1720           0 :     mpData->mnScrollBarSize = nSize;
    1721           0 : }
    1722             : 
    1723             : long
    1724       43080 : StyleSettings::GetScrollBarSize() const
    1725             : {
    1726       43080 :     return mpData->mnScrollBarSize;
    1727             : }
    1728             : 
    1729             : void
    1730           0 : StyleSettings::SetMinThumbSize( long nSize )
    1731             : {
    1732           0 :     CopyData();
    1733           0 :     mpData->mnMinThumbSize = nSize;
    1734           0 : }
    1735             : 
    1736             : long
    1737       13498 : StyleSettings::GetMinThumbSize() const
    1738             : {
    1739       13498 :     return mpData->mnMinThumbSize;
    1740             : }
    1741             : 
    1742             : void
    1743           0 : StyleSettings::SetSpinSize( long nSize )
    1744             : {
    1745           0 :     CopyData();
    1746           0 :     mpData->mnSpinSize = nSize;
    1747           0 : }
    1748             : 
    1749             : long
    1750         577 : StyleSettings::GetSpinSize() const
    1751             : {
    1752         577 :     return mpData->mnSpinSize;
    1753             : }
    1754             : 
    1755             : long
    1756         450 : StyleSettings::GetSplitSize() const
    1757             : {
    1758         450 :     return mpData->mnSplitSize;
    1759             : }
    1760             : 
    1761             : void
    1762           0 : StyleSettings::SetCursorSize( long nSize )
    1763             : {
    1764           0 :     CopyData();
    1765           0 :     mpData->mnCursorSize = nSize;
    1766           0 : }
    1767             : 
    1768             : long
    1769       24167 : StyleSettings::GetCursorSize() const
    1770             : {
    1771       24167 :     return mpData->mnCursorSize;
    1772             : }
    1773             : 
    1774             : void
    1775       27344 : StyleSettings::SetCursorBlinkTime( long nBlinkTime )
    1776             : {
    1777       27344 :     CopyData();
    1778       27344 :     mpData->mnCursorBlinkTime = nBlinkTime;
    1779       27344 : }
    1780             : 
    1781             : long
    1782       76877 : StyleSettings::GetCursorBlinkTime() const
    1783             : {
    1784       76877 :     return (long) mpData->mnCursorBlinkTime;
    1785             : }
    1786             : 
    1787             : void
    1788          80 : StyleSettings::SetScreenZoom( sal_uInt16 nPercent )
    1789             : {
    1790          80 :     CopyData();
    1791          80 :     mpData->mnScreenZoom = nPercent;
    1792          80 : }
    1793             : 
    1794             : sal_uInt16
    1795      117327 : StyleSettings::GetScreenZoom() const
    1796             : {
    1797      117327 :     return mpData->mnScreenZoom;
    1798             : }
    1799             : 
    1800             : void
    1801          80 : StyleSettings::SetScreenFontZoom( sal_uInt16 nPercent )
    1802             : {
    1803          80 :     CopyData();
    1804          80 :     mpData->mnScreenFontZoom = nPercent;
    1805          80 : }
    1806             : 
    1807             : sal_uInt16
    1808      163766 : StyleSettings::GetScreenFontZoom() const
    1809             : {
    1810      163766 :     return mpData->mnScreenFontZoom;
    1811             : }
    1812             : 
    1813             : void
    1814          81 : StyleSettings::SetDragFullOptions( sal_uLong nOptions )
    1815             : {
    1816          81 :     CopyData();
    1817          81 :     mpData->mnDragFullOptions = nOptions;
    1818          81 : }
    1819             : 
    1820             : sal_uLong
    1821        3704 : StyleSettings::GetDragFullOptions() const
    1822             : {
    1823        3704 :     return mpData->mnDragFullOptions;
    1824             : }
    1825             : 
    1826             : void
    1827          31 : StyleSettings::SetSelectionOptions( sal_uLong nOptions )
    1828             : {
    1829          31 :     CopyData();
    1830          31 :     mpData->mnSelectionOptions = nOptions;
    1831          31 : }
    1832             : 
    1833             : sal_uLong
    1834          98 : StyleSettings::GetSelectionOptions() const
    1835             : {
    1836          98 :     return mpData->mnSelectionOptions;
    1837             : }
    1838             : 
    1839             : void
    1840          80 : StyleSettings::SetDisplayOptions( sal_uLong nOptions )
    1841             : {
    1842          80 :     CopyData();
    1843          80 :     mpData->mnDisplayOptions = nOptions;
    1844          80 : }
    1845             : 
    1846             : sal_uLong
    1847      190543 : StyleSettings::GetDisplayOptions() const
    1848             : {
    1849      190543 :     return mpData->mnDisplayOptions;
    1850             : }
    1851             : 
    1852             : void
    1853          80 : StyleSettings::SetAntialiasingMinPixelHeight( long nMinPixel )
    1854             : {
    1855          80 :     CopyData();
    1856          80 :     mpData->mnAntialiasedMin = nMinPixel;
    1857          80 : }
    1858             : 
    1859             : sal_uLong
    1860      190543 : StyleSettings::GetAntialiasingMinPixelHeight() const
    1861             : {
    1862      190543 :     return mpData->mnAntialiasedMin;
    1863             : }
    1864             : 
    1865             : void
    1866          54 : StyleSettings::SetOptions( sal_uLong nOptions )
    1867             : {
    1868          54 :     CopyData();
    1869          54 :     mpData->mnOptions = nOptions;
    1870          54 : }
    1871             : 
    1872             : void
    1873         143 : StyleSettings::SetAutoMnemonic( bool bAutoMnemonic )
    1874             : {
    1875         143 :     CopyData();
    1876         143 :     mpData->mbAutoMnemonic = bAutoMnemonic;
    1877         143 : }
    1878             : 
    1879             : bool
    1880          19 : StyleSettings::GetAutoMnemonic() const
    1881             : {
    1882          19 :     return mpData->mbAutoMnemonic;
    1883             : }
    1884             : 
    1885             : void
    1886           0 : StyleSettings::SetFontColor( const Color& rColor )
    1887             : {
    1888           0 :     CopyData();
    1889           0 :     mpData->maFontColor = rColor;
    1890           0 : }
    1891             : 
    1892             : const Color&
    1893         138 : StyleSettings::GetFontColor() const
    1894             : {
    1895         138 :     return mpData->maFontColor;
    1896             : }
    1897             : 
    1898             : void
    1899           0 : StyleSettings::SetToolbarIconSize( sal_uLong nSize )
    1900             : {
    1901           0 :     CopyData();
    1902           0 :     mpData->mnToolbarIconSize = nSize;
    1903           0 : }
    1904             : 
    1905             : sal_uLong
    1906       10666 : StyleSettings::GetToolbarIconSize() const
    1907             : {
    1908       10666 :     return mpData->mnToolbarIconSize;
    1909             : }
    1910             : 
    1911             : const DialogStyle&
    1912           0 : StyleSettings::GetDialogStyle() const
    1913             : {
    1914           0 :     return mpData->maDialogStyle;
    1915             : }
    1916             : 
    1917             : void
    1918           0 : StyleSettings::SetDialogStyle( const DialogStyle& rStyle )
    1919             : {
    1920           0 :     CopyData();
    1921           0 :     mpData->maDialogStyle = rStyle;
    1922           0 : }
    1923             : 
    1924             : const FrameStyle&
    1925           0 : StyleSettings::GetFrameStyle() const
    1926             : {
    1927           0 :     return mpData->maFrameStyle;
    1928             : }
    1929             : 
    1930             : void
    1931           0 : StyleSettings::SetFrameStyle( const FrameStyle& rStyle )
    1932             : {
    1933           0 :     CopyData();
    1934           0 :     mpData->maFrameStyle = rStyle;
    1935           0 : }
    1936             : 
    1937             : void
    1938           0 : StyleSettings::SetEdgeBlending(sal_uInt16 nCount)
    1939             : {
    1940           0 :     CopyData();
    1941           0 :     mpData->mnEdgeBlending = nCount;
    1942           0 : }
    1943             : 
    1944             : sal_uInt16
    1945         281 : StyleSettings::GetEdgeBlending() const
    1946             : {
    1947         281 :     return mpData->mnEdgeBlending;
    1948             : }
    1949             : 
    1950             : const Color&
    1951         201 : StyleSettings::GetEdgeBlendingTopLeftColor() const
    1952             : {
    1953         201 :     return mpData->maEdgeBlendingTopLeftColor;
    1954             : }
    1955             : 
    1956             : const Color&
    1957         201 : StyleSettings::GetEdgeBlendingBottomRightColor() const
    1958             : {
    1959         201 :     return mpData->maEdgeBlendingBottomRightColor;
    1960             : }
    1961             : 
    1962             : void
    1963           0 : StyleSettings::SetListBoxMaximumLineCount(sal_uInt16 nCount)
    1964             : {
    1965           0 :     CopyData();
    1966           0 :     mpData->mnListBoxMaximumLineCount = nCount;
    1967           0 : }
    1968             : 
    1969             : sal_uInt16
    1970         329 : StyleSettings::GetListBoxMaximumLineCount() const
    1971             : {
    1972         329 :     return mpData->mnListBoxMaximumLineCount;
    1973             : }
    1974             : 
    1975             : void
    1976           0 : StyleSettings::SetColorValueSetColumnCount(sal_uInt16 nCount)
    1977             : {
    1978           0 :     CopyData();
    1979           0 :     mpData->mnColorValueSetColumnCount = nCount;
    1980           0 : }
    1981             : 
    1982             : sal_uInt16
    1983          80 : StyleSettings::GetColorValueSetColumnCount() const
    1984             : {
    1985          80 :     return mpData->mnColorValueSetColumnCount;
    1986             : }
    1987             : 
    1988             : sal_uInt16
    1989           0 : StyleSettings::GetColorValueSetMaximumRowCount() const
    1990             : {
    1991           0 :     return mpData->mnColorValueSetMaximumRowCount;
    1992             : }
    1993             : 
    1994             : sal_uInt16
    1995         682 : StyleSettings::GetListBoxPreviewDefaultLineWidth() const
    1996             : {
    1997         682 :     return mpData->mnListBoxPreviewDefaultLineWidth;
    1998             : }
    1999             : 
    2000             : void
    2001          80 : StyleSettings::SetPreviewUsesCheckeredBackground(bool bNew)
    2002             : {
    2003          80 :     CopyData();
    2004          80 :     mpData->mbPreviewUsesCheckeredBackground = bNew;
    2005          80 : }
    2006             : 
    2007             : bool
    2008         762 : StyleSettings::GetPreviewUsesCheckeredBackground() const
    2009             : {
    2010         762 :     return mpData->mbPreviewUsesCheckeredBackground;
    2011             : }
    2012             : 
    2013             : bool
    2014       33295 : StyleSettings::operator !=( const StyleSettings& rSet ) const
    2015             : {
    2016       33295 :     return !(*this == rSet);
    2017             : }
    2018             : 
    2019         808 : const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const
    2020             : {
    2021         808 :     if(0 == mpData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mpData->maListBoxPreviewDefaultPixelSize.Height())
    2022             :     {
    2023           8 :         const_cast< StyleSettings* >(this)->mpData->maListBoxPreviewDefaultPixelSize =
    2024           8 :             Application::GetDefaultDevice()->LogicToPixel(mpData->maListBoxPreviewDefaultLogicSize, MAP_APPFONT);
    2025             :     }
    2026             : 
    2027         808 :     return mpData->maListBoxPreviewDefaultPixelSize;
    2028             : }
    2029             : 
    2030         126 : void StyleSettings::Set3DColors( const Color& rColor )
    2031             : {
    2032         126 :     CopyData();
    2033         126 :     mpData->maFaceColor         = rColor;
    2034         126 :     mpData->maLightBorderColor  = rColor;
    2035         126 :     mpData->maMenuBorderColor   = rColor;
    2036         126 :     mpData->maDarkShadowColor   = Color( COL_BLACK );
    2037         126 :     if ( rColor != Color( COL_LIGHTGRAY ) )
    2038             :     {
    2039         126 :         mpData->maLightColor    = rColor;
    2040         126 :         mpData->maShadowColor   = rColor;
    2041         126 :         mpData->maDarkShadowColor=rColor;
    2042         126 :         mpData->maLightColor.IncreaseLuminance( 64 );
    2043         126 :         mpData->maShadowColor.DecreaseLuminance( 64 );
    2044         126 :         mpData->maDarkShadowColor.DecreaseLuminance( 100 );
    2045         126 :         sal_uLong   nRed    = mpData->maLightColor.GetRed();
    2046         126 :         sal_uLong   nGreen  = mpData->maLightColor.GetGreen();
    2047         126 :         sal_uLong   nBlue   = mpData->maLightColor.GetBlue();
    2048         126 :         nRed   += (sal_uLong)(mpData->maShadowColor.GetRed());
    2049         126 :         nGreen += (sal_uLong)(mpData->maShadowColor.GetGreen());
    2050         126 :         nBlue  += (sal_uLong)(mpData->maShadowColor.GetBlue());
    2051         126 :         mpData->maCheckedColor = Color( (sal_uInt8)(nRed/2), (sal_uInt8)(nGreen/2), (sal_uInt8)(nBlue/2) );
    2052             :     }
    2053             :     else
    2054             :     {
    2055           0 :         mpData->maCheckedColor  = Color( 0x99, 0x99, 0x99 );
    2056           0 :         mpData->maLightColor    = Color( COL_WHITE );
    2057           0 :         mpData->maShadowColor   = Color( COL_GRAY );
    2058             :     }
    2059         126 : }
    2060             : 
    2061           0 : void StyleSettings::SetCheckedColorSpecialCase( )
    2062             : {
    2063           0 :     CopyData();
    2064             :     // Light gray checked color special case
    2065           0 :     if ( GetFaceColor() == COL_LIGHTGRAY )
    2066           0 :         mpData->maCheckedColor = Color( 0xCC, 0xCC, 0xCC );
    2067             :     else
    2068             :     {
    2069           0 :         sal_uInt8 nRed   = (sal_uInt8)(((sal_uInt16)mpData->maFaceColor.GetRed()   + (sal_uInt16)mpData->maLightColor.GetRed())/2);
    2070           0 :         sal_uInt8 nGreen = (sal_uInt8)(((sal_uInt16)mpData->maFaceColor.GetGreen() + (sal_uInt16)mpData->maLightColor.GetGreen())/2);
    2071           0 :         sal_uInt8 nBlue  = (sal_uInt8)(((sal_uInt16)mpData->maFaceColor.GetBlue()  + (sal_uInt16)mpData->maLightColor.GetBlue())/2);
    2072           0 :         mpData->maCheckedColor = Color( nRed, nGreen, nBlue );
    2073             :     }
    2074           0 : }
    2075             : 
    2076       30483 : bool StyleSettings::GetUseImagesInMenus() const
    2077             : {
    2078             :     // icon mode selected in Tools -> Options... -> OpenOffice.org -> View
    2079       30483 :     switch (mpData->meUseImagesInMenus) {
    2080             :     case TRISTATE_FALSE:
    2081           0 :         return false;
    2082             :     case TRISTATE_TRUE:
    2083           0 :         return true;
    2084             :     default: // TRISTATE_INDET:
    2085       30483 :         return GetPreferredUseImagesInMenus();
    2086             :     }
    2087             : }
    2088             : 
    2089         140 : static BitmapEx readBitmapEx( const OUString& rPath )
    2090             : {
    2091         140 :     OUString aPath( rPath );
    2092         140 :     rtl::Bootstrap::expandMacros( aPath );
    2093             : 
    2094             :     // import the image
    2095         280 :     Graphic aGraphic;
    2096         140 :     if ( GraphicFilter::LoadGraphic( aPath, OUString(), aGraphic ) != GRFILTER_OK )
    2097         140 :         return BitmapEx();
    2098             : 
    2099         140 :     return aGraphic.GetBitmapEx();
    2100             : }
    2101             : 
    2102             : enum WhichPersona { PERSONA_HEADER, PERSONA_FOOTER };
    2103             : 
    2104             : /** Update the setting of the Persona header / footer in ImplStyleData */
    2105      143782 : static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, boost::optional<Color>& rMenuBarTextColor )
    2106             : {
    2107      143782 :     uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
    2108      143782 :     if ( !xContext.is() )
    2109           0 :         return;
    2110             : 
    2111             :     // read from the configuration
    2112      143852 :     OUString aPersona( officecfg::Office::Common::Misc::Persona::get( xContext ) );
    2113      143852 :     OUString aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get( xContext ) );
    2114             : 
    2115             :     // have the settings changed?
    2116      143852 :     OUString aOldValue( aPersona + ";" + aPersonaSettings );
    2117      143782 :     if ( rHeaderFooter == aOldValue )
    2118      143712 :         return;
    2119             : 
    2120          70 :     rHeaderFooter = aOldValue;
    2121          70 :     rHeaderFooterBitmap = BitmapEx();
    2122          70 :     rMenuBarTextColor = boost::none;
    2123             : 
    2124             :     // now read the new values and setup bitmaps
    2125         140 :     OUString aHeader, aFooter;
    2126          70 :     if ( aPersona == "own" )
    2127             :     {
    2128           0 :         sal_Int32 nIndex = 0;
    2129           0 :         aHeader = aPersonaSettings.getToken( 0, ';', nIndex );
    2130           0 :         if ( nIndex > 0 )
    2131           0 :             aFooter = aPersonaSettings.getToken( 0, ';', nIndex );
    2132             : 
    2133             :         // change menu text color, advance nIndex to skip the '#'
    2134           0 :         if ( nIndex > 0 )
    2135             :         {
    2136           0 :             OUString aColor = aPersonaSettings.getToken( 0, ';', ++nIndex );
    2137           0 :             rMenuBarTextColor = Color( aColor.toUInt64( 16 ) );
    2138             :         }
    2139             :     }
    2140          70 :     else if ( aPersona == "default" )
    2141             :     {
    2142          70 :         aHeader = "header.jpg";
    2143          70 :         aFooter = "footer.jpg";
    2144             :     }
    2145             : 
    2146         140 :     OUString aName;
    2147          70 :     switch ( eWhich ) {
    2148          70 :         case PERSONA_HEADER: aName = aHeader; break;
    2149           0 :         case PERSONA_FOOTER: aName = aFooter; break;
    2150             :     }
    2151             : 
    2152          70 :     if ( !aName.isEmpty() )
    2153             :     {
    2154          70 :         OUString gallery("");
    2155             :         // try the gallery first, then the program path:
    2156          70 :         if ( aPersona == "own")
    2157             :         {
    2158           0 :             gallery = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap") "::UserInstallation}";
    2159           0 :             rtl::Bootstrap::expandMacros( gallery );
    2160           0 :             gallery += "/user/gallery/personas/";
    2161             :         }
    2162          70 :         else if (aPersona == "default")
    2163             :         {
    2164          70 :             gallery = "$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER;
    2165          70 :             gallery += "/gallery/personas/";
    2166             :         }
    2167          70 :         rHeaderFooterBitmap = readBitmapEx( gallery + aName );
    2168             : 
    2169          70 :         if ( rHeaderFooterBitmap.IsEmpty() )
    2170          70 :             rHeaderFooterBitmap = readBitmapEx( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" + aName );
    2171          70 :     }
    2172             : }
    2173             : 
    2174      143782 : const BitmapEx StyleSettings::GetPersonaHeader() const
    2175             : {
    2176      143782 :     setupPersonaHeaderFooter( PERSONA_HEADER, mpData->maPersonaHeaderFooter, mpData->maPersonaHeaderBitmap, mpData->maPersonaMenuBarTextColor );
    2177      143782 :     return mpData->maPersonaHeaderBitmap;
    2178             : }
    2179             : 
    2180           0 : const boost::optional<Color>& StyleSettings::GetPersonaMenuBarTextColor() const
    2181             : {
    2182           0 :     GetPersonaHeader();
    2183           0 :     return mpData->maPersonaMenuBarTextColor;
    2184             : }
    2185             : 
    2186          80 : void StyleSettings::SetStandardStyles()
    2187             : {
    2188          80 :     CopyData();
    2189          80 :     mpData->SetStandardStyles();
    2190          80 : }
    2191             : 
    2192      142254 : Color StyleSettings::GetFaceGradientColor() const
    2193             : {
    2194             :     // compute a brighter face color that can be used in gradients
    2195             :     // for a convex look (eg toolbars)
    2196             : 
    2197             :     sal_uInt16 h, s, b;
    2198      142254 :     GetFaceColor().RGBtoHSB( h, s, b );
    2199      142254 :     if( s > 1) s=1;
    2200      142254 :     if( b < 98) b=98;
    2201      142254 :     return Color( Color::HSBtoRGB( h, s, b ) );
    2202             : }
    2203             : 
    2204       17634 : Color StyleSettings::GetSeparatorColor() const
    2205             : {
    2206             :     // compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP)
    2207             :     sal_uInt16 h, s, b;
    2208       17634 :     GetShadowColor().RGBtoHSB( h, s, b );
    2209       17634 :     b += b/4;
    2210       17634 :     s -= s/4;
    2211       17634 :     return Color( Color::HSBtoRGB( h, s, b ) );
    2212             : }
    2213             : 
    2214       35224 : void StyleSettings::CopyData()
    2215             : {
    2216             :     // copy if other references exist
    2217       35224 :     if ( ! mpData.unique() ) {
    2218       29248 :         mpData = boost::make_shared<ImplStyleData>(*mpData);
    2219             :     }
    2220       35224 : }
    2221             : 
    2222       33295 : bool StyleSettings::operator ==( const StyleSettings& rSet ) const
    2223             : {
    2224       33295 :     if ( mpData == rSet.mpData )
    2225        1996 :         return true;
    2226             : 
    2227       31299 :     if (mpData->mIconTheme != rSet.mpData->mIconTheme) {
    2228        1677 :         return false;
    2229             :     }
    2230             : 
    2231       29622 :     if (*mpData->mIconThemeSelector != *rSet.mpData->mIconThemeSelector) {
    2232           0 :         return false;
    2233             :     }
    2234             : 
    2235       88828 :     if ( (mpData->mnOptions                 == rSet.mpData->mnOptions)                  &&
    2236       59168 :          (mpData->mbAutoMnemonic            == rSet.mpData->mbAutoMnemonic)             &&
    2237       59166 :          (mpData->mnDragFullOptions         == rSet.mpData->mnDragFullOptions)          &&
    2238       59133 :          (mpData->mnSelectionOptions        == rSet.mpData->mnSelectionOptions)         &&
    2239       59102 :          (mpData->mnDisplayOptions          == rSet.mpData->mnDisplayOptions)           &&
    2240       59102 :          (mpData->mnCursorSize              == rSet.mpData->mnCursorSize)               &&
    2241       59102 :          (mpData->mnCursorBlinkTime         == rSet.mpData->mnCursorBlinkTime)          &&
    2242       59102 :          (mpData->mnBorderSize              == rSet.mpData->mnBorderSize)               &&
    2243       59102 :          (mpData->mnTitleHeight             == rSet.mpData->mnTitleHeight)              &&
    2244       59102 :          (mpData->mnFloatTitleHeight        == rSet.mpData->mnFloatTitleHeight)         &&
    2245       59102 :          (mpData->mnTearOffTitleHeight      == rSet.mpData->mnTearOffTitleHeight)       &&
    2246       59102 :          (mpData->mnScrollBarSize           == rSet.mpData->mnScrollBarSize)            &&
    2247       59102 :          (mpData->mnMinThumbSize            == rSet.mpData->mnMinThumbSize)             &&
    2248       59102 :          (mpData->mnSplitSize               == rSet.mpData->mnSplitSize)                &&
    2249       59102 :          (mpData->mnSpinSize                == rSet.mpData->mnSpinSize)                 &&
    2250       58862 :          (mpData->mnAntialiasedMin          == rSet.mpData->mnAntialiasedMin)           &&
    2251       58622 :          (mpData->mnScreenZoom              == rSet.mpData->mnScreenZoom)               &&
    2252       58622 :          (mpData->mnScreenFontZoom          == rSet.mpData->mnScreenFontZoom)           &&
    2253       58622 :          (mpData->mbHighContrast            == rSet.mpData->mbHighContrast)             &&
    2254       58622 :          (mpData->mbUseSystemUIFonts        == rSet.mpData->mbUseSystemUIFonts)         &&
    2255       58622 :          (mpData->mnUseFlatBorders          == rSet.mpData->mnUseFlatBorders)           &&
    2256       58622 :          (mpData->mnUseFlatMenus            == rSet.mpData->mnUseFlatMenus)             &&
    2257       58574 :          (mpData->maFaceColor               == rSet.mpData->maFaceColor)                &&
    2258       58526 :          (mpData->maCheckedColor            == rSet.mpData->maCheckedColor)             &&
    2259       58526 :          (mpData->maLightColor              == rSet.mpData->maLightColor)               &&
    2260       58526 :          (mpData->maLightBorderColor        == rSet.mpData->maLightBorderColor)         &&
    2261       58526 :          (mpData->maShadowColor             == rSet.mpData->maShadowColor)              &&
    2262       58526 :          (mpData->maDarkShadowColor         == rSet.mpData->maDarkShadowColor)          &&
    2263       58526 :          (mpData->maButtonTextColor         == rSet.mpData->maButtonTextColor)          &&
    2264       58526 :          (mpData->maRadioCheckTextColor     == rSet.mpData->maRadioCheckTextColor)      &&
    2265       58526 :          (mpData->maGroupTextColor          == rSet.mpData->maGroupTextColor)           &&
    2266       58526 :          (mpData->maLabelTextColor          == rSet.mpData->maLabelTextColor)           &&
    2267       58526 :          (mpData->maInfoTextColor           == rSet.mpData->maInfoTextColor)            &&
    2268       58526 :          (mpData->maWindowColor             == rSet.mpData->maWindowColor)              &&
    2269       58526 :          (mpData->maWindowTextColor         == rSet.mpData->maWindowTextColor)          &&
    2270       58526 :          (mpData->maDialogColor             == rSet.mpData->maDialogColor)              &&
    2271       58526 :          (mpData->maDialogTextColor         == rSet.mpData->maDialogTextColor)          &&
    2272       58526 :          (mpData->maWorkspaceColor          == rSet.mpData->maWorkspaceColor)           &&
    2273       58496 :          (mpData->maMonoColor               == rSet.mpData->maMonoColor)                &&
    2274       58466 :          (mpData->maFieldColor              == rSet.mpData->maFieldColor)               &&
    2275       58370 :          (mpData->maFieldTextColor          == rSet.mpData->maFieldTextColor)           &&
    2276       58274 :          (mpData->maActiveColor             == rSet.mpData->maActiveColor)              &&
    2277       58274 :          (mpData->maActiveColor2            == rSet.mpData->maActiveColor2)             &&
    2278       58274 :          (mpData->maActiveTextColor         == rSet.mpData->maActiveTextColor)          &&
    2279       58274 :          (mpData->maActiveBorderColor       == rSet.mpData->maActiveBorderColor)        &&
    2280       58274 :          (mpData->maDeactiveColor           == rSet.mpData->maDeactiveColor)            &&
    2281       58274 :          (mpData->maDeactiveColor2          == rSet.mpData->maDeactiveColor2)           &&
    2282       58274 :          (mpData->maDeactiveTextColor       == rSet.mpData->maDeactiveTextColor)        &&
    2283       58274 :          (mpData->maDeactiveBorderColor     == rSet.mpData->maDeactiveBorderColor)      &&
    2284       58274 :          (mpData->maMenuColor               == rSet.mpData->maMenuColor)                &&
    2285       58274 :          (mpData->maMenuBarColor            == rSet.mpData->maMenuBarColor)             &&
    2286       58274 :          (mpData->maMenuBarRolloverColor    == rSet.mpData->maMenuBarRolloverColor)     &&
    2287       58274 :          (mpData->maMenuBorderColor         == rSet.mpData->maMenuBorderColor)          &&
    2288       58274 :          (mpData->maMenuTextColor           == rSet.mpData->maMenuTextColor)            &&
    2289       58274 :          (mpData->maMenuBarTextColor        == rSet.mpData->maMenuBarTextColor)         &&
    2290       58274 :          (mpData->maMenuBarRolloverTextColor == rSet.mpData->maMenuBarRolloverTextColor) &&
    2291       58274 :          (mpData->maMenuHighlightColor      == rSet.mpData->maMenuHighlightColor)       &&
    2292       58274 :          (mpData->maMenuHighlightTextColor  == rSet.mpData->maMenuHighlightTextColor)   &&
    2293       58274 :          (mpData->maHighlightColor          == rSet.mpData->maHighlightColor)           &&
    2294       58274 :          (mpData->maHighlightTextColor      == rSet.mpData->maHighlightTextColor)       &&
    2295       58274 :          (mpData->maActiveTabColor          == rSet.mpData->maActiveTabColor)           &&
    2296       58274 :          (mpData->maInactiveTabColor        == rSet.mpData->maInactiveTabColor)         &&
    2297       58274 :          (mpData->maDisableColor            == rSet.mpData->maDisableColor)             &&
    2298       58274 :          (mpData->maHelpColor               == rSet.mpData->maHelpColor)                &&
    2299       58274 :          (mpData->maHelpTextColor           == rSet.mpData->maHelpTextColor)            &&
    2300       58274 :          (mpData->maLinkColor               == rSet.mpData->maLinkColor)                &&
    2301       58274 :          (mpData->maVisitedLinkColor        == rSet.mpData->maVisitedLinkColor)         &&
    2302       58274 :          (mpData->maHighlightLinkColor      == rSet.mpData->maHighlightLinkColor)       &&
    2303       58274 :          (mpData->maAppFont                 == rSet.mpData->maAppFont)                  &&
    2304       58274 :          (mpData->maHelpFont                == rSet.mpData->maHelpFont)                 &&
    2305       58274 :          (mpData->maTitleFont               == rSet.mpData->maTitleFont)                &&
    2306       58274 :          (mpData->maFloatTitleFont          == rSet.mpData->maFloatTitleFont)           &&
    2307       58274 :          (mpData->maMenuFont                == rSet.mpData->maMenuFont)                 &&
    2308       58274 :          (mpData->maToolFont                == rSet.mpData->maToolFont)                 &&
    2309       58274 :          (mpData->maGroupFont               == rSet.mpData->maGroupFont)                &&
    2310       58274 :          (mpData->maLabelFont               == rSet.mpData->maLabelFont)                &&
    2311       58274 :          (mpData->maInfoFont                == rSet.mpData->maInfoFont)                 &&
    2312       58274 :          (mpData->maRadioCheckFont          == rSet.mpData->maRadioCheckFont)           &&
    2313       58274 :          (mpData->maPushButtonFont          == rSet.mpData->maPushButtonFont)           &&
    2314       58274 :          (mpData->maFieldFont               == rSet.mpData->maFieldFont)                &&
    2315       58274 :          (mpData->maIconFont                == rSet.mpData->maIconFont)                 &&
    2316       58274 :          (mpData->meUseImagesInMenus        == rSet.mpData->meUseImagesInMenus)         &&
    2317       58274 :          (mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
    2318       58274 :          (mpData->mbSkipDisabledInMenus     == rSet.mpData->mbSkipDisabledInMenus)      &&
    2319       58274 :          (mpData->mbHideDisabledMenuItems   == rSet.mpData->mbHideDisabledMenuItems)    &&
    2320       58274 :          (mpData->mbAcceleratorsInContextMenus  == rSet.mpData->mbAcceleratorsInContextMenus)&&
    2321       58274 :          (mpData->mbPrimaryButtonWarpsSlider == rSet.mpData->mbPrimaryButtonWarpsSlider) &&
    2322       58274 :          (mpData->maFontColor               == rSet.mpData->maFontColor)                &&
    2323       58274 :          (mpData->mnEdgeBlending                    == rSet.mpData->mnEdgeBlending)                     &&
    2324       58274 :          (mpData->maEdgeBlendingTopLeftColor        == rSet.mpData->maEdgeBlendingTopLeftColor)         &&
    2325       58274 :          (mpData->maEdgeBlendingBottomRightColor    == rSet.mpData->maEdgeBlendingBottomRightColor)     &&
    2326       58274 :          (mpData->mnListBoxMaximumLineCount         == rSet.mpData->mnListBoxMaximumLineCount)          &&
    2327       58274 :          (mpData->mnColorValueSetColumnCount        == rSet.mpData->mnColorValueSetColumnCount)         &&
    2328       58274 :          (mpData->mnColorValueSetMaximumRowCount    == rSet.mpData->mnColorValueSetMaximumRowCount)     &&
    2329       58274 :          (mpData->maListBoxPreviewDefaultLogicSize  == rSet.mpData->maListBoxPreviewDefaultLogicSize)   &&
    2330       58274 :          (mpData->maListBoxPreviewDefaultPixelSize  == rSet.mpData->maListBoxPreviewDefaultPixelSize)   &&
    2331       87896 :          (mpData->mnListBoxPreviewDefaultLineWidth  == rSet.mpData->mnListBoxPreviewDefaultLineWidth)   &&
    2332       29137 :          (mpData->mbPreviewUsesCheckeredBackground == rSet.mpData->mbPreviewUsesCheckeredBackground))
    2333       28897 :         return true;
    2334             :     else
    2335         725 :         return false;
    2336             : }
    2337             : 
    2338         290 : ImplMiscData::ImplMiscData()
    2339             : {
    2340         290 :     mnEnableATT                 = TRISTATE_INDET;
    2341         290 :     mnDisablePrinting           = TRISTATE_INDET;
    2342         290 :     static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
    2343         290 :     mbEnableLocalizedDecimalSep = (pEnv != NULL) ? true : false;
    2344         290 : }
    2345             : 
    2346           0 : ImplMiscData::ImplMiscData( const ImplMiscData& rData )
    2347             : {
    2348           0 :     mnEnableATT                 = rData.mnEnableATT;
    2349           0 :     mnDisablePrinting           = rData.mnDisablePrinting;
    2350           0 :     mbEnableLocalizedDecimalSep = rData.mbEnableLocalizedDecimalSep;
    2351           0 : }
    2352             : 
    2353         290 : MiscSettings::MiscSettings()
    2354         290 : : mpData(boost::make_shared<ImplMiscData>())
    2355             : {
    2356         290 : }
    2357             : 
    2358       31183 : MiscSettings::~MiscSettings()
    2359             : {
    2360       31183 : }
    2361             : 
    2362         290 : void MiscSettings::CopyData()
    2363             : {
    2364             :     // copy if other references exist
    2365         290 :     if ( ! mpData.unique() ) {
    2366           0 :         mpData = boost::make_shared<ImplMiscData>(*mpData);
    2367             :     }
    2368         290 : }
    2369             : 
    2370       33295 : bool MiscSettings::operator ==( const MiscSettings& rSet ) const
    2371             : {
    2372       33295 :     if ( mpData == rSet.mpData )
    2373       33295 :         return true;
    2374             : 
    2375           0 :     if ( (mpData->mnEnableATT           == rSet.mpData->mnEnableATT ) &&
    2376           0 :          (mpData->mnDisablePrinting     == rSet.mpData->mnDisablePrinting ) &&
    2377           0 :          (mpData->mbEnableLocalizedDecimalSep == rSet.mpData->mbEnableLocalizedDecimalSep ) )
    2378           0 :         return true;
    2379             :     else
    2380           0 :         return false;
    2381             : }
    2382             : 
    2383             : bool
    2384       33295 : MiscSettings::operator !=( const MiscSettings& rSet ) const
    2385             : {
    2386       33295 :     return !(*this == rSet);
    2387             : }
    2388             : 
    2389        3013 : bool MiscSettings::GetDisablePrinting() const
    2390             : {
    2391        3013 :     if( mpData->mnDisablePrinting == TRISTATE_INDET )
    2392             :     {
    2393             :         OUString aEnable =
    2394             :             vcl::SettingsConfigItem::get()->
    2395             :             getValue( OUString( "DesktopManagement"  ),
    2396          27 :                       OUString( "DisablePrinting"  ) );
    2397          27 :         mpData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE : TRISTATE_FALSE;
    2398             :     }
    2399             : 
    2400        3013 :     return mpData->mnDisablePrinting != TRISTATE_FALSE;
    2401             : }
    2402             : 
    2403       26970 : bool MiscSettings::GetEnableATToolSupport() const
    2404             : {
    2405             : 
    2406             : #ifdef WNT
    2407             :     if( mpData->mnEnableATT == TRISTATE_INDET )
    2408             :     {
    2409             :         // Check in the Windows registry if an AT tool wants Accessibility support to
    2410             :         // be activated ..
    2411             :         HKEY hkey;
    2412             : 
    2413             :         if( ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,
    2414             :             "Software\\LibreOffice\\Accessibility\\AtToolSupport",
    2415             :             &hkey) )
    2416             :         {
    2417             :             DWORD dwType;
    2418             :             sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD
    2419             :             DWORD cbData = sizeof(Data);
    2420             : 
    2421             :             if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
    2422             :                 NULL, &dwType, Data, &cbData) )
    2423             :             {
    2424             :                 switch (dwType)
    2425             :                 {
    2426             :                     case REG_SZ:
    2427             :                         mpData->mnEnableATT = ((0 == stricmp((const char *) Data, "1")) || (0 == stricmp((const char *) Data, "true"))) ? TRISTATE_TRUE : TRISTATE_FALSE;
    2428             :                         break;
    2429             :                     case REG_DWORD:
    2430             :                         switch (((DWORD *) Data)[0]) {
    2431             :                         case 0:
    2432             :                             mpData->mnEnableATT = TRISTATE_FALSE;
    2433             :                             break;
    2434             :                         case 1:
    2435             :                             mpData->mnEnableATT = TRISTATE_TRUE;
    2436             :                             break;
    2437             :                         default:
    2438             :                             mpData->mnEnableATT = TRISTATE_INDET;
    2439             :                                 //TODO: or TRISTATE_TRUE?
    2440             :                             break;
    2441             :                         }
    2442             :                         break;
    2443             :                     default:
    2444             :                         // Unsupported registry type
    2445             :                         break;
    2446             :                 }
    2447             :             }
    2448             : 
    2449             :             RegCloseKey(hkey);
    2450             :         }
    2451             :     }
    2452             : #endif
    2453             : 
    2454       26970 :     if( mpData->mnEnableATT == TRISTATE_INDET )
    2455             :     {
    2456         118 :         static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
    2457         118 :         if( !pEnv || !*pEnv )
    2458             :         {
    2459             :             OUString aEnable =
    2460             :                 vcl::SettingsConfigItem::get()->
    2461             :                 getValue( OUString( "Accessibility"  ),
    2462         118 :                           OUString( "EnableATToolSupport"  ) );
    2463         118 :             mpData->mnEnableATT = aEnable.equalsIgnoreAsciiCase("true") ? TRISTATE_TRUE : TRISTATE_FALSE;
    2464             :         }
    2465             :         else
    2466             :         {
    2467           0 :             mpData->mnEnableATT = TRISTATE_TRUE;
    2468             :         }
    2469             :     }
    2470             : 
    2471       26970 :     return mpData->mnEnableATT != TRISTATE_FALSE;
    2472             : }
    2473             : 
    2474             : #ifdef WNT
    2475             : void MiscSettings::SetEnableATToolSupport( bool bEnable )
    2476             : {
    2477             :     if ( (bEnable ? TRISTATE_TRUE : TRISTATE_FALSE) != mpData->mnEnableATT )
    2478             :     {
    2479             :         if( bEnable && !ImplInitAccessBridge() )
    2480             :             return;
    2481             : 
    2482             :         HKEY hkey;
    2483             : 
    2484             :         // If the accessibility key in the Windows registry exists, change it synchronously
    2485             :         if( ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,
    2486             :             "Software\\LibreOffice\\Accessibility\\AtToolSupport",
    2487             :             &hkey) )
    2488             :         {
    2489             :             DWORD dwType;
    2490             :             sal_uInt8 Data[6]; // possible values: "true", "false", 1, 0
    2491             :             DWORD cbData = sizeof(Data);
    2492             : 
    2493             :             if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
    2494             :                 NULL,   &dwType, Data, &cbData) )
    2495             :             {
    2496             :                 switch (dwType)
    2497             :                 {
    2498             :                     case REG_SZ:
    2499             :                         RegSetValueEx(hkey, "SupportAssistiveTechnology",
    2500             :                             0, dwType,
    2501             :                             bEnable ? (sal_uInt8 *) "true" : (sal_uInt8 *) "false",
    2502             :                             bEnable ? sizeof("true") : sizeof("false"));
    2503             :                         break;
    2504             :                     case REG_DWORD:
    2505             :                         ((DWORD *) Data)[0] = bEnable ? 1 : 0;
    2506             :                         RegSetValueEx(hkey, "SupportAssistiveTechnology",
    2507             :                             0, dwType, Data, sizeof(DWORD));
    2508             :                         break;
    2509             :                     default:
    2510             :                         // Unsupported registry type
    2511             :                         break;
    2512             :                 }
    2513             :             }
    2514             : 
    2515             :             RegCloseKey(hkey);
    2516             :         }
    2517             : 
    2518             :         vcl::SettingsConfigItem::get()->
    2519             :             setValue( OUString( "Accessibility"  ),
    2520             :                       OUString( "EnableATToolSupport"  ),
    2521             :                       bEnable ? OUString("true") : OUString("false" ) );
    2522             :         mpData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE;
    2523             :     }
    2524             : }
    2525             : #endif
    2526             : 
    2527         290 : void MiscSettings::SetEnableLocalizedDecimalSep( bool bEnable )
    2528             : {
    2529         290 :     CopyData();
    2530         290 :     mpData->mbEnableLocalizedDecimalSep = bEnable;
    2531         290 : }
    2532             : 
    2533           0 : bool MiscSettings::GetEnableLocalizedDecimalSep() const
    2534             : {
    2535           0 :     return mpData->mbEnableLocalizedDecimalSep;
    2536             : }
    2537             : 
    2538         290 : ImplHelpData::ImplHelpData()
    2539             : {
    2540         290 :     mnTipDelay                  = 500;
    2541         290 :     mnTipTimeout                = 3000;
    2542         290 :     mnBalloonDelay              = 1500;
    2543         290 : }
    2544             : 
    2545          80 : ImplHelpData::ImplHelpData( const ImplHelpData& rData )
    2546             : {
    2547          80 :     mnTipDelay                  = rData.mnTipDelay;
    2548          80 :     mnTipTimeout                = rData.mnTipTimeout;
    2549          80 :     mnBalloonDelay              = rData.mnBalloonDelay;
    2550          80 : }
    2551             : 
    2552         290 : HelpSettings::HelpSettings()
    2553         290 : : mpData(boost::make_shared<ImplHelpData>())
    2554             : {
    2555         290 : }
    2556             : 
    2557       31263 : HelpSettings::~HelpSettings()
    2558             : {
    2559       31263 : }
    2560             : 
    2561          80 : void HelpSettings::CopyData()
    2562             : {
    2563             :     // copy if other references exist
    2564          80 :     if ( ! mpData.unique() ) {
    2565          80 :         mpData = boost::make_shared<ImplHelpData>(*mpData);
    2566             :     }
    2567          80 : }
    2568             : 
    2569       33295 : bool HelpSettings::operator ==( const HelpSettings& rSet ) const
    2570             : {
    2571       33295 :     if ( mpData == rSet.mpData )
    2572       33055 :         return true;
    2573             : 
    2574         720 :     if ( (mpData->mnTipDelay        == rSet.mpData->mnTipDelay ) &&
    2575         240 :          (mpData->mnTipTimeout      == rSet.mpData->mnTipTimeout ) &&
    2576           0 :          (mpData->mnBalloonDelay    == rSet.mpData->mnBalloonDelay ) )
    2577           0 :         return true;
    2578             :     else
    2579         240 :         return false;
    2580             : }
    2581             : 
    2582             : sal_uLong
    2583         126 : HelpSettings::GetTipDelay() const
    2584             : {
    2585         126 :     return mpData->mnTipDelay;
    2586             : }
    2587             : 
    2588             : void
    2589          80 : HelpSettings::SetTipTimeout( sal_uLong nTipTimeout )
    2590             : {
    2591          80 :     CopyData();
    2592          80 :     mpData->mnTipTimeout = nTipTimeout;
    2593          80 : }
    2594             : 
    2595             : sal_uLong
    2596           0 : HelpSettings::GetTipTimeout() const
    2597             : {
    2598           0 :     return mpData->mnTipTimeout;
    2599             : }
    2600             : 
    2601             : sal_uLong
    2602           0 : HelpSettings::GetBalloonDelay() const
    2603             : {
    2604           0 :     return mpData->mnBalloonDelay;
    2605             : }
    2606             : 
    2607             : bool
    2608       33295 : HelpSettings::operator !=( const HelpSettings& rSet ) const
    2609             : {
    2610       33295 :     return !(*this == rSet);
    2611             : }
    2612             : 
    2613         290 : ImplAllSettingsData::ImplAllSettingsData()
    2614             :     :
    2615             :         maLocale( LANGUAGE_SYSTEM ),
    2616         290 :         maUILocale( LANGUAGE_SYSTEM )
    2617             : {
    2618         290 :     mnWindowUpdate              = SETTINGS_ALLSETTINGS;
    2619         290 :     mpLocaleDataWrapper         = NULL;
    2620         290 :     mpUILocaleDataWrapper       = NULL;
    2621         290 :     mpI18nHelper                = NULL;
    2622         290 :     mpUII18nHelper              = NULL;
    2623         290 :     maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() );
    2624         290 : }
    2625             : 
    2626       31144 : ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
    2627             :     maMouseSettings( rData.maMouseSettings ),
    2628             :     maStyleSettings( rData.maStyleSettings ),
    2629             :     maMiscSettings( rData.maMiscSettings ),
    2630             :     maHelpSettings( rData.maHelpSettings ),
    2631             :     maLocale( rData.maLocale ),
    2632       31144 :     maUILocale( rData.maUILocale )
    2633             : {
    2634       31144 :     mnWindowUpdate              = rData.mnWindowUpdate;
    2635             :     // Pointer couldn't shared and objects haven't a copy ctor
    2636             :     // So we create the cache objects new, if the GetFunction is
    2637             :     // called
    2638       31144 :     mpLocaleDataWrapper         = NULL;
    2639       31144 :     mpUILocaleDataWrapper       = NULL;
    2640       31144 :     mpI18nHelper                = NULL;
    2641       31144 :     mpUII18nHelper              = NULL;
    2642       31144 : }
    2643             : 
    2644       62366 : ImplAllSettingsData::~ImplAllSettingsData()
    2645             : {
    2646       31183 :     delete mpLocaleDataWrapper;
    2647       31183 :     delete mpUILocaleDataWrapper;
    2648       31183 :     if ( mpI18nHelper )
    2649          40 :         delete mpI18nHelper;
    2650       31183 :     if ( mpUII18nHelper )
    2651          15 :         delete mpUII18nHelper;
    2652       31183 : }
    2653             : 
    2654         290 : AllSettings::AllSettings()
    2655         290 : : mpData(boost::make_shared<ImplAllSettingsData>())
    2656             : {
    2657         290 : }
    2658             : 
    2659      287504 : AllSettings::AllSettings( const AllSettings& rSet )
    2660             : {
    2661      287504 :     mpData = rSet.mpData;
    2662      287504 : }
    2663             : 
    2664      285392 : AllSettings::~AllSettings()
    2665             : {
    2666      285392 : }
    2667             : 
    2668       34709 : void AllSettings::CopyData()
    2669             : {
    2670             :     // copy if other references exist
    2671       34709 :     if ( ! mpData.unique() ) {
    2672       31144 :         mpData = boost::make_shared<ImplAllSettingsData>(*mpData);
    2673             :     }
    2674             : 
    2675       34709 : }
    2676             : 
    2677        2000 : sal_uLong AllSettings::Update( sal_uLong nFlags, const AllSettings& rSet )
    2678             : {
    2679             : 
    2680        2000 :     sal_uLong nChangeFlags = 0;
    2681             : 
    2682        2000 :     if ( nFlags & SETTINGS_MOUSE )
    2683             :     {
    2684        2000 :         if ( mpData->maMouseSettings != rSet.mpData->maMouseSettings )
    2685             :         {
    2686         160 :             CopyData();
    2687         160 :             mpData->maMouseSettings = rSet.mpData->maMouseSettings;
    2688         160 :             nChangeFlags |= SETTINGS_MOUSE;
    2689             :         }
    2690             :     }
    2691             : 
    2692        2000 :     if ( nFlags & SETTINGS_STYLE )
    2693             :     {
    2694        2000 :         if ( mpData->maStyleSettings != rSet.mpData->maStyleSettings )
    2695             :         {
    2696        1873 :             CopyData();
    2697        1873 :             mpData->maStyleSettings = rSet.mpData->maStyleSettings;
    2698        1873 :             nChangeFlags |= SETTINGS_STYLE;
    2699             :         }
    2700             :     }
    2701             : 
    2702        2000 :     if ( nFlags & SETTINGS_MISC )
    2703             :     {
    2704        2000 :         if ( mpData->maMiscSettings != rSet.mpData->maMiscSettings )
    2705             :         {
    2706           0 :             CopyData();
    2707           0 :             mpData->maMiscSettings = rSet.mpData->maMiscSettings;
    2708           0 :             nChangeFlags |= SETTINGS_MISC;
    2709             :         }
    2710             :     }
    2711             : 
    2712        2000 :     if ( nFlags & SETTINGS_HELP )
    2713             :     {
    2714        2000 :         if ( mpData->maHelpSettings != rSet.mpData->maHelpSettings )
    2715             :         {
    2716         160 :             CopyData();
    2717         160 :             mpData->maHelpSettings = rSet.mpData->maHelpSettings;
    2718         160 :             nChangeFlags |= SETTINGS_HELP;
    2719             :         }
    2720             :     }
    2721             : 
    2722        2000 :     if ( nFlags & SETTINGS_LOCALE )
    2723             :     {
    2724        2000 :         if ( mpData->maLocale != rSet.mpData->maLocale )
    2725             :         {
    2726         110 :             SetLanguageTag( rSet.mpData->maLocale );
    2727         110 :             nChangeFlags |= SETTINGS_LOCALE;
    2728             :         }
    2729             :     }
    2730             : 
    2731        2000 :     if ( nFlags & SETTINGS_UILOCALE )
    2732             :     {
    2733             :         // UILocale can't be changed
    2734             :     }
    2735             : 
    2736        2000 :     return nChangeFlags;
    2737             : }
    2738             : 
    2739       31295 : sal_uLong AllSettings::GetChangeFlags( const AllSettings& rSet ) const
    2740             : {
    2741             : 
    2742       31295 :     sal_uLong nChangeFlags = 0;
    2743             : 
    2744       31295 :     if ( mpData->maMouseSettings != rSet.mpData->maMouseSettings )
    2745        1349 :         nChangeFlags |= SETTINGS_MOUSE;
    2746             : 
    2747       31295 :     if ( mpData->maStyleSettings != rSet.mpData->maStyleSettings )
    2748         529 :         nChangeFlags |= SETTINGS_STYLE;
    2749             : 
    2750       31295 :     if ( mpData->maMiscSettings != rSet.mpData->maMiscSettings )
    2751           0 :         nChangeFlags |= SETTINGS_MISC;
    2752             : 
    2753       31295 :     if ( mpData->maHelpSettings != rSet.mpData->maHelpSettings )
    2754          80 :         nChangeFlags |= SETTINGS_HELP;
    2755             : 
    2756       31295 :     if ( mpData->maLocale != rSet.mpData->maLocale )
    2757           6 :         nChangeFlags |= SETTINGS_LOCALE;
    2758             : 
    2759       31295 :     return nChangeFlags;
    2760             : }
    2761             : 
    2762           0 : bool AllSettings::operator ==( const AllSettings& rSet ) const
    2763             : {
    2764             : 
    2765           0 :     if ( mpData == rSet.mpData )
    2766           0 :         return true;
    2767             : 
    2768           0 :     if ( (mpData->maMouseSettings           == rSet.mpData->maMouseSettings)        &&
    2769           0 :          (mpData->maStyleSettings           == rSet.mpData->maStyleSettings)        &&
    2770           0 :          (mpData->maMiscSettings            == rSet.mpData->maMiscSettings)         &&
    2771           0 :          (mpData->maHelpSettings            == rSet.mpData->maHelpSettings)         &&
    2772           0 :          (mpData->maLocale                  == rSet.mpData->maLocale)               &&
    2773           0 :          (mpData->mnWindowUpdate            == rSet.mpData->mnWindowUpdate) )
    2774             :     {
    2775           0 :         return true;
    2776             :     }
    2777             :     else
    2778           0 :         return false;
    2779             : }
    2780             : 
    2781         114 : void AllSettings::SetLanguageTag( const LanguageTag& rLanguageTag )
    2782             : {
    2783         114 :     if (mpData->maLocale != rLanguageTag)
    2784             :     {
    2785         114 :         CopyData();
    2786             : 
    2787         114 :         mpData->maLocale = rLanguageTag;
    2788             : 
    2789         114 :         if ( mpData->mpLocaleDataWrapper )
    2790             :         {
    2791           0 :             delete mpData->mpLocaleDataWrapper;
    2792           0 :             mpData->mpLocaleDataWrapper = NULL;
    2793             :         }
    2794         114 :         if ( mpData->mpI18nHelper )
    2795             :         {
    2796           0 :             delete mpData->mpI18nHelper;
    2797           0 :             mpData->mpI18nHelper = NULL;
    2798             :         }
    2799             :     }
    2800         114 : }
    2801             : 
    2802           0 : void AllSettings::SetUILanguageTag( const LanguageTag& )
    2803             : {
    2804             :     // there is only one UILocale per process
    2805           0 : }
    2806             : 
    2807             : namespace
    2808             : {
    2809      721598 :     bool GetConfigLayoutRTL(bool bMath)
    2810             :     {
    2811      721598 :         static const char* pEnv = getenv("SAL_RTL_ENABLED" );
    2812             :         static int  nUIMirroring = -1;   // -1: undef, 0: auto, 1: on 2: off
    2813             : 
    2814             :         // environment always overrides
    2815      721598 :         if( pEnv )
    2816           0 :             return true;
    2817             : 
    2818      721598 :         bool bRTL = false;
    2819             : 
    2820      721598 :         if( nUIMirroring == -1 )
    2821             :         {
    2822         142 :             nUIMirroring = 0; // ask configuration only once
    2823             :             utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
    2824             :                 comphelper::getProcessComponentContext(),
    2825         142 :                 OUString("org.openoffice.Office.Common/I18N/CTL") );    // note: case sensitive !
    2826         142 :             if ( aNode.isValid() )
    2827             :             {
    2828         142 :                 bool bTmp = bool();
    2829         142 :                 ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString("UIMirroring") );
    2830         142 :                 if( aValue >>= bTmp )
    2831             :                 {
    2832             :                     // found true or false; if it was nil, nothing is changed
    2833           0 :                     nUIMirroring = bTmp ? 1 : 2;
    2834         142 :                 }
    2835         142 :             }
    2836             :         }
    2837             : 
    2838      721598 :         if( nUIMirroring == 0 )  // no config found (eg, setup) or default (nil) was set: check language
    2839             :         {
    2840      721598 :             LanguageType aLang = LANGUAGE_DONTKNOW;
    2841      721598 :             ImplSVData* pSVData = ImplGetSVData();
    2842      721598 :             if ( pSVData->maAppData.mpSettings )
    2843      721598 :                 aLang = pSVData->maAppData.mpSettings->GetUILanguageTag().getLanguageType();
    2844      721598 :             if (bMath)
    2845         147 :                 bRTL = MsLangId::isRightToLeftMath( aLang );
    2846             :             else
    2847      721451 :                 bRTL = MsLangId::isRightToLeft( aLang );
    2848             :         }
    2849             :         else
    2850           0 :             bRTL = (nUIMirroring == 1);
    2851             : 
    2852      721598 :         return bRTL;
    2853             :     }
    2854             : }
    2855             : 
    2856      721451 : bool AllSettings::GetLayoutRTL() const
    2857             : {
    2858      721451 :     return GetConfigLayoutRTL(false);
    2859             : }
    2860             : 
    2861         147 : bool AllSettings::GetMathLayoutRTL() const
    2862             : {
    2863         147 :     return GetConfigLayoutRTL(true);
    2864             : }
    2865             : 
    2866     1842529 : const LanguageTag& AllSettings::GetLanguageTag() const
    2867             : {
    2868             :     // SYSTEM locale means: use settings from SvtSysLocale that is resolved
    2869     1842529 :     if ( mpData->maLocale.isSystemLocale() )
    2870          82 :         mpData->maLocale = mpData->maSysLocale.GetLanguageTag();
    2871             : 
    2872     1842529 :     return mpData->maLocale;
    2873             : }
    2874             : 
    2875      779245 : const LanguageTag& AllSettings::GetUILanguageTag() const
    2876             : {
    2877             :     // the UILocale is never changed
    2878      779245 :     if ( mpData->maUILocale.isSystemLocale() )
    2879         156 :         mpData->maUILocale = mpData->maSysLocale.GetUILanguageTag();
    2880             : 
    2881      779245 :     return mpData->maUILocale;
    2882             : }
    2883             : 
    2884        2906 : const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
    2885             : {
    2886        2906 :     if ( !mpData->mpLocaleDataWrapper )
    2887          17 :         ((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper(
    2888          34 :             comphelper::getProcessComponentContext(), GetLanguageTag() );
    2889        2906 :     return *mpData->mpLocaleDataWrapper;
    2890             : }
    2891             : 
    2892           0 : const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
    2893             : {
    2894           0 :     if ( !mpData->mpUILocaleDataWrapper )
    2895           0 :         ((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper(
    2896           0 :             comphelper::getProcessComponentContext(), GetUILanguageTag() );
    2897           0 :     return *mpData->mpUILocaleDataWrapper;
    2898             : }
    2899             : 
    2900        6414 : const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
    2901             : {
    2902        6414 :     if ( !mpData->mpI18nHelper ) {
    2903          66 :         ((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper(
    2904         132 :             comphelper::getProcessComponentContext(), GetLanguageTag() );
    2905             :     }
    2906        6414 :     return *mpData->mpI18nHelper;
    2907             : }
    2908             : 
    2909        1731 : const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
    2910             : {
    2911        1731 :     if ( !mpData->mpUII18nHelper ) {
    2912          37 :         ((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper(
    2913          74 :             comphelper::getProcessComponentContext(), GetUILanguageTag() );
    2914             :     }
    2915        1731 :     return *mpData->mpUII18nHelper;
    2916             : }
    2917             : 
    2918           1 : void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
    2919             : {
    2920           1 :     AllSettings aAllSettings( Application::GetSettings() );
    2921           1 :     if ( nHint & SYSLOCALEOPTIONS_HINT_DECSEP )
    2922             :     {
    2923           0 :         MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
    2924           0 :         bool bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
    2925           0 :         if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale )
    2926             :         {
    2927           0 :             aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale );
    2928           0 :             aAllSettings.SetMiscSettings( aMiscSettings );
    2929           0 :         }
    2930             :     }
    2931             : 
    2932           1 :     if ( (nHint & SYSLOCALEOPTIONS_HINT_LOCALE) )
    2933           1 :         aAllSettings.SetLanguageTag( aAllSettings.mpData->maSysLocale.GetOptions().GetLanguageTag() );
    2934             : 
    2935           1 :     Application::SetSettings( aAllSettings );
    2936           1 : }
    2937             : 
    2938             : const StyleSettings&
    2939     2001681 : AllSettings::GetStyleSettings() const
    2940             : {
    2941     2001681 :     return mpData->maStyleSettings;
    2942             : }
    2943             : 
    2944             : sal_uLong
    2945      152267 : StyleSettings::GetOptions() const
    2946             : {
    2947      152267 :     return mpData->mnOptions;
    2948             : }
    2949             : 
    2950             : std::vector<vcl::IconThemeInfo>
    2951           0 : StyleSettings::GetInstalledIconThemes() const
    2952             : {
    2953           0 :     return mpData->mIconThemeScanner->GetFoundIconThemes();
    2954             : }
    2955             : 
    2956             : /*static*/ OUString
    2957         248 : StyleSettings::GetAutomaticallyChosenIconTheme() const
    2958             : {
    2959         248 :     OUString desktopEnvironment = Application::GetDesktopEnvironment();
    2960         248 :     OUString themeName = mpData->mIconThemeSelector->SelectIconThemeForDesktopEnvironment(
    2961         248 :             mpData->mIconThemeScanner->GetFoundIconThemes(),
    2962             :             desktopEnvironment
    2963         248 :             );
    2964         248 :     return themeName;
    2965             : }
    2966             : 
    2967             : void
    2968         248 : StyleSettings::SetIconTheme(const OUString& theme)
    2969             : {
    2970         248 :     CopyData();
    2971         248 :     mpData->mIconTheme = theme;
    2972         248 : }
    2973             : 
    2974             : OUString
    2975      118954 : StyleSettings::DetermineIconTheme() const
    2976             : {
    2977      118954 :     OUString r = mpData->mIconThemeSelector->SelectIconTheme(
    2978      118954 :                         mpData->mIconThemeScanner->GetFoundIconThemes(),
    2979      118954 :                         mpData->mIconTheme
    2980      237908 :                         );
    2981      118954 :     return r;
    2982             : }
    2983             : 
    2984             : void
    2985         534 : StyleSettings::SetHighContrastMode(bool bHighContrast )
    2986             : {
    2987         534 :     if (mpData->mbHighContrast == bHighContrast) {
    2988        1068 :         return;
    2989             :     }
    2990             : 
    2991           0 :     CopyData();
    2992           0 :     mpData->mbHighContrast = bHighContrast;
    2993           0 :     mpData->mIconThemeSelector->SetUseHighContrastTheme(bHighContrast);
    2994             : }
    2995             : 
    2996             : bool
    2997      194757 : StyleSettings::GetHighContrastMode() const
    2998             : {
    2999      194757 :     return mpData->mbHighContrast;
    3000             : }
    3001             : 
    3002             : void
    3003           0 : StyleSettings::SetPreferredIconTheme(const OUString& theme)
    3004             : {
    3005           0 :     mpData->mIconThemeSelector->SetPreferredIconTheme(theme);
    3006           0 : }
    3007             : 
    3008             : void
    3009        2603 : AllSettings::SetMouseSettings( const MouseSettings& rSet )
    3010             : {
    3011        2603 :     CopyData();
    3012        2603 :     mpData->maMouseSettings = rSet;
    3013        2603 : }
    3014             : 
    3015             : const MouseSettings&
    3016        5358 : AllSettings::GetMouseSettings() const
    3017             : {
    3018        5358 :     return mpData->maMouseSettings;
    3019             : }
    3020             : 
    3021             : void
    3022       29719 : AllSettings::SetStyleSettings( const StyleSettings& rSet )
    3023             : {
    3024       29719 :     CopyData();
    3025       29719 :     mpData->maStyleSettings = rSet;
    3026       29719 : }
    3027             : 
    3028             : void
    3029           0 : AllSettings::SetMiscSettings( const MiscSettings& rSet )
    3030             : {
    3031           0 :     CopyData();
    3032           0 :     mpData->maMiscSettings = rSet;
    3033           0 : }
    3034             : 
    3035             : const MiscSettings&
    3036       29983 : AllSettings::GetMiscSettings() const
    3037             : {
    3038       29983 :     return mpData->maMiscSettings;
    3039             : }
    3040             : 
    3041             : void
    3042          80 : AllSettings::SetHelpSettings( const HelpSettings& rSet )
    3043             : {
    3044          80 :     CopyData();
    3045          80 :     mpData->maHelpSettings = rSet;
    3046          80 : }
    3047             : 
    3048             : const HelpSettings&
    3049         143 : AllSettings::GetHelpSettings() const
    3050             : {
    3051         143 :     return mpData->maHelpSettings;
    3052             : }
    3053             : 
    3054             : sal_uLong
    3055        2000 : AllSettings::GetWindowUpdate() const
    3056             : {
    3057        2000 :     return mpData->mnWindowUpdate;
    3058             : }
    3059             : 
    3060             : bool
    3061           0 : AllSettings::operator !=( const AllSettings& rSet ) const
    3062             : {
    3063           0 :     return !(*this == rSet);
    3064             : }
    3065             : 
    3066             : SvtSysLocale&
    3067         246 : AllSettings::GetSysLocale()
    3068             : {
    3069         246 :     return mpData->maSysLocale;
    3070             : }
    3071             : 
    3072             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10