Coverage Report

Created: 2026-05-16 09:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/settings.hxx
Line
Count
Source
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
#ifndef INCLUDED_VCL_SETTINGS_HXX
21
#define INCLUDED_VCL_SETTINGS_HXX
22
23
#include <config_options.h>
24
25
#include <vcl/dllapi.h>
26
#include <rtl/ustring.hxx>
27
#include <tools/gen.hxx>
28
#include <o3tl/cow_wrapper.hxx>
29
#include <o3tl/typed_flags_set.hxx>
30
31
#include <memory>
32
#include <vector>
33
34
class Bitmap;
35
class Color;
36
class LanguageTag;
37
class SvtSysLocale;
38
39
class LocaleDataWrapper;
40
struct ImplMouseData;
41
struct ImplMiscData;
42
struct ImplHelpData;
43
struct ImplStyleData;
44
struct ImplAllSettingsData;
45
enum class ConfigurationHints;
46
enum class AppearanceMode;
47
48
namespace vcl {
49
    class Font;
50
    class I18nHelper;
51
    class IconThemeInfo;
52
}
53
54
55
enum class MouseSettingsOptions
56
{
57
    NONE           = 0x00,
58
    AutoCenterPos  = 0x02,
59
    AutoDefBtnPos  = 0x04,
60
};
61
namespace o3tl
62
{
63
    template<> struct typed_flags<MouseSettingsOptions> : is_typed_flags<MouseSettingsOptions, 0x06> {};
64
}
65
66
enum class MouseFollowFlags
67
{
68
    Menu           = 0x0001,
69
};
70
namespace o3tl
71
{
72
    template<> struct typed_flags<MouseFollowFlags> : is_typed_flags<MouseFollowFlags, 0x01> {};
73
}
74
75
enum class MouseMiddleButtonAction
76
{
77
    Nothing, AutoScroll, PasteSelection
78
};
79
80
enum class MouseWheelBehaviour
81
{
82
    Disable, FocusOnly, ALWAYS
83
};
84
85
class VCL_DLLPUBLIC MouseSettings
86
{
87
private:
88
    o3tl::cow_wrapper<ImplMouseData>  mxData;
89
90
public:
91
                                    MouseSettings();
92
                                    MouseSettings(const MouseSettings&);
93
                                    ~MouseSettings();
94
    MouseSettings&                  operator=(const MouseSettings&);
95
96
    void                            SetOptions( MouseSettingsOptions nOptions );
97
    MouseSettingsOptions            GetOptions() const;
98
99
    void                            SetDoubleClickTime( sal_uInt64 nDoubleClkTime );
100
    sal_uInt64                      GetDoubleClickTime() const;
101
102
    void                            SetDoubleClickWidth( sal_Int32 nDoubleClkWidth );
103
    SAL_DLLPRIVATE sal_Int32                       GetDoubleClickWidth() const;
104
105
    void                            SetDoubleClickHeight( sal_Int32 nDoubleClkHeight );
106
    SAL_DLLPRIVATE sal_Int32                       GetDoubleClickHeight() const;
107
108
    void                            SetStartDragWidth( sal_Int32 nDragWidth );
109
    SAL_DLLPRIVATE sal_Int32                       GetStartDragWidth() const;
110
111
    void                            SetStartDragHeight( sal_Int32 nDragHeight );
112
    SAL_DLLPRIVATE sal_Int32                       GetStartDragHeight() const;
113
114
    SAL_DLLPRIVATE static sal_uInt16               GetStartDragCode();
115
116
    SAL_DLLPRIVATE static sal_uInt16               GetContextMenuCode();
117
118
    SAL_DLLPRIVATE static sal_uInt16               GetContextMenuClicks();
119
120
    SAL_DLLPRIVATE static sal_Int32                GetScrollRepeat();
121
122
    SAL_DLLPRIVATE static sal_Int32                GetButtonStartRepeat();
123
124
    void                            SetButtonRepeat( sal_Int32 nRepeat );
125
    sal_Int32                       GetButtonRepeat() const;
126
127
    void                            SetMenuDelay( sal_Int32 nDelay );
128
    sal_Int32                       GetMenuDelay() const;
129
130
    void                            SetFollow( MouseFollowFlags nFollow );
131
    MouseFollowFlags                GetFollow() const;
132
133
    void                            SetMiddleButtonAction( MouseMiddleButtonAction nAction );
134
    MouseMiddleButtonAction         GetMiddleButtonAction() const;
135
136
    void                            SetWheelBehavior( MouseWheelBehaviour nBehavior );
137
    MouseWheelBehaviour             GetWheelBehavior() const;
138
139
    bool                            operator ==( const MouseSettings& rSet ) const;
140
};
141
142
struct DialogStyle
143
{
144
    int content_area_border;
145
    int button_spacing;
146
    int action_area_border;
147
    DialogStyle()
148
665
        : content_area_border(2)
149
665
        , button_spacing(6)
150
665
        , action_area_border(5)
151
665
    {}
152
};
153
154
enum class StyleSettingsOptions
155
{
156
    NONE           = 0x0000,
157
    Mono           = 0x0001,
158
    NoMnemonics    = 0x0002,
159
};
160
namespace o3tl
161
{
162
    template<> struct typed_flags<StyleSettingsOptions> : is_typed_flags<StyleSettingsOptions, 0x0003> {};
163
}
164
165
enum class DragFullOptions
166
{
167
    NONE        = 0x0000,
168
    WindowMove  = 0x0001,
169
    WindowSize  = 0x0002,
170
    Docking     = 0x0010,
171
    Split       = 0x0020,
172
    Scroll      = 0x0040,
173
    All         = WindowMove | WindowSize | Docking | Split | Scroll,
174
};
175
namespace o3tl
176
{
177
    template<> struct typed_flags<DragFullOptions> : is_typed_flags<DragFullOptions, 0x0073> {};
178
}
179
180
enum class SelectionOptions
181
{
182
    NONE       = 0x0000,
183
    ShowFirst  = 0x0004,
184
};
185
namespace o3tl
186
{
187
    template<> struct typed_flags<SelectionOptions> : is_typed_flags<SelectionOptions, 0x0004> {};
188
}
189
190
enum class DisplayOptions
191
{
192
    NONE        = 0x0000,
193
    AADisable   = 0x0001,
194
};
195
namespace o3tl
196
{
197
    template<> struct typed_flags<DisplayOptions> : is_typed_flags<DisplayOptions, 0x0001> {};
198
}
199
200
enum class ToolbarIconSize
201
{
202
    Unknown      = 0,
203
    Small        = 1, // unused
204
    Large        = 2,
205
    Size32       = 3,
206
};
207
208
/** Text selection behavior when selecting an entry in an editable combobox. */
209
enum class ComboBoxTextSelectionMode
210
{
211
    SelectText, // select the whole text of the new entry
212
    CursorToStart, // don't select text, put text cursor to start of text
213
    CursorToEnd // don't select text, put text cursor to end of text
214
};
215
216
78.8k
#define STYLE_CURSOR_NOBLINKTIME    SAL_MAX_UINT64
217
218
class VCL_DLLPUBLIC StyleSettings
219
{
220
private:
221
    o3tl::cow_wrapper<ImplStyleData> mxData;
222
223
public:
224
                                    StyleSettings();
225
                                    StyleSettings(const StyleSettings&);
226
                                    ~StyleSettings();
227
    StyleSettings&                  operator=(const StyleSettings&);
228
229
    SAL_DLLPRIVATE void             Set3DColors( const Color& rColor );
230
231
    void                            SetSystemColorsLoaded( bool bLoaded );
232
    bool                            GetSystemColorsLoaded() const;
233
234
    void                            SetFaceColor( const Color& rColor );
235
    const Color&                    GetFaceColor() const;
236
237
    Color                           GetFaceGradientColor() const;
238
239
    Color                           GetSeparatorColor() const;
240
241
    void                            SetCheckedColor( const Color& rColor );
242
    SAL_DLLPRIVATE void             SetCheckedColorSpecialCase( );
243
    const Color&                    GetCheckedColor() const;
244
245
    void                            SetLightColor( const Color& rColor );
246
    const Color&                    GetLightColor() const;
247
248
    void                            SetLightBorderColor( const Color& rColor );
249
    const Color&                    GetLightBorderColor() const;
250
251
    void                            SetShadowColor( const Color& rColor );
252
    const Color&                    GetShadowColor() const;
253
254
    void                            SetDarkShadowColor( const Color& rColor );
255
    const Color&                    GetDarkShadowColor() const;
256
257
    void                            SetDefaultButtonTextColor( const Color& rColor );
258
    const Color&                    GetDefaultButtonTextColor() const;
259
260
    void                            SetButtonTextColor( const Color& rColor );
261
    const Color&                    GetButtonTextColor() const;
262
263
    void                            SetDefaultActionButtonTextColor( const Color& rColor );
264
    SAL_DLLPRIVATE const Color&     GetDefaultActionButtonTextColor() const;
265
266
    void                            SetActionButtonTextColor( const Color& rColor );
267
    SAL_DLLPRIVATE const Color&     GetActionButtonTextColor() const;
268
269
    void                            SetFlatButtonTextColor( const Color& rColor );
270
    SAL_DLLPRIVATE const Color&     GetFlatButtonTextColor() const;
271
272
    void                            SetDefaultButtonRolloverTextColor( const Color& rColor );
273
    SAL_DLLPRIVATE const Color&     GetDefaultButtonRolloverTextColor() const;
274
275
    void                            SetButtonRolloverTextColor( const Color& rColor );
276
    const Color&                    GetButtonRolloverTextColor() const;
277
278
    void                            SetDefaultActionButtonRolloverTextColor( const Color& rColor );
279
    SAL_DLLPRIVATE const Color&     GetDefaultActionButtonRolloverTextColor() const;
280
281
    void                            SetActionButtonRolloverTextColor( const Color& rColor );
282
    SAL_DLLPRIVATE const Color&     GetActionButtonRolloverTextColor() const;
283
284
    void                            SetFlatButtonRolloverTextColor( const Color& rColor );
285
    SAL_DLLPRIVATE const Color&     GetFlatButtonRolloverTextColor() const;
286
287
    void                            SetDefaultButtonPressedRolloverTextColor( const Color& rColor );
288
    SAL_DLLPRIVATE const Color&     GetDefaultButtonPressedRolloverTextColor() const;
289
290
    void                            SetButtonPressedRolloverTextColor( const Color& rColor );
291
    SAL_DLLPRIVATE const Color&     GetButtonPressedRolloverTextColor() const;
292
293
    void                            SetDefaultActionButtonPressedRolloverTextColor( const Color& rColor );
294
    SAL_DLLPRIVATE const Color&     GetDefaultActionButtonPressedRolloverTextColor() const;
295
296
    void                            SetActionButtonPressedRolloverTextColor( const Color& rColor );
297
    SAL_DLLPRIVATE const Color&     GetActionButtonPressedRolloverTextColor() const;
298
299
    void                            SetFlatButtonPressedRolloverTextColor( const Color& rColor );
300
    SAL_DLLPRIVATE const Color&     GetFlatButtonPressedRolloverTextColor() const;
301
302
    void                            SetRadioCheckTextColor( const Color& rColor );
303
    const Color&                    GetRadioCheckTextColor() const;
304
305
    void                            SetGroupTextColor( const Color& rColor );
306
    const Color&                    GetGroupTextColor() const;
307
308
    void                            SetLabelTextColor( const Color& rColor );
309
    const Color&                    GetLabelTextColor() const;
310
311
    void                            SetWindowColor( const Color& rColor );
312
    const Color&                    GetWindowColor() const;
313
314
    void                            SetWindowTextColor( const Color& rColor );
315
    const Color&                    GetWindowTextColor() const;
316
317
    void                            SetDialogColor( const Color& rColor );
318
    const Color&                    GetDialogColor() const;
319
320
    void                            SetDialogTextColor( const Color& rColor );
321
    const Color&                    GetDialogTextColor() const;
322
323
    void                            SetWorkspaceColor( const Color& rColor );
324
    const Color&                    GetWorkspaceColor() const;
325
326
    void                            SetFieldColor( const Color& rColor );
327
    const Color&                    GetFieldColor() const;
328
329
    void                            SetFieldTextColor( const Color& rColor );
330
    const Color&                    GetFieldTextColor() const;
331
332
    void                            SetFieldRolloverTextColor( const Color& rColor );
333
    const Color&                    GetFieldRolloverTextColor() const;
334
335
    void                            SetActiveColor( const Color& rColor );
336
    const Color&                    GetActiveColor() const;
337
338
    void                            SetActiveTextColor( const Color& rColor );
339
    const Color&                    GetActiveTextColor() const;
340
341
    void                            SetActiveBorderColor( const Color& rColor );
342
    const Color&                    GetActiveBorderColor() const;
343
344
    void                            SetDeactiveColor( const Color& rColor );
345
    const Color&                    GetDeactiveColor() const;
346
347
    void                            SetDeactiveTextColor( const Color& rColor );
348
    const Color&                    GetDeactiveTextColor() const;
349
350
    void                            SetDeactiveBorderColor( const Color& rColor );
351
    const Color&                    GetDeactiveBorderColor() const;
352
353
    void                            SetAccentColor( const Color& rColor );
354
    const Color&                    GetAccentColor() const;
355
356
    void                            SetHighlightColor( const Color& rColor );
357
    const Color&                    GetHighlightColor() const;
358
359
    void                            SetHighlightTextColor( const Color& rColor );
360
    const Color&                    GetHighlightTextColor() const;
361
362
    void                            SetDisableColor( const Color& rColor );
363
    const Color&                    GetDisableColor() const;
364
365
    void                            SetWarningColor( const Color& rColor );
366
    const Color&                    GetWarningColor() const;
367
368
    const Color&                    GetWarningTextColor() const;
369
370
    const Color&                    GetErrorColor() const;
371
372
    const Color&                    GetErrorTextColor() const;
373
374
    void                            SetHelpColor( const Color& rColor );
375
    const Color&                    GetHelpColor() const;
376
377
    void                            SetHelpTextColor( const Color& rColor );
378
    const Color&                    GetHelpTextColor() const;
379
380
    void                            SetMenuColor( const Color& rColor );
381
    const Color&                    GetMenuColor() const;
382
383
    void                            SetMenuBarColor( const Color& rColor );
384
    const Color&                    GetMenuBarColor() const;
385
386
    void                            SetMenuBarRolloverColor( const Color& rColor );
387
    const Color&                    GetMenuBarRolloverColor() const;
388
389
    void                            SetMenuBorderColor( const Color& rColor );
390
    const Color&                    GetMenuBorderColor() const;
391
392
    void                            SetMenuTextColor( const Color& rColor );
393
    const Color&                    GetMenuTextColor() const;
394
395
    void                            SetMenuBarTextColor( const Color& rColor );
396
    const Color&                    GetMenuBarTextColor() const;
397
398
    void                            SetMenuBarRolloverTextColor( const Color& rColor );
399
    const Color&                    GetMenuBarRolloverTextColor() const;
400
401
    void                            SetMenuBarHighlightTextColor( const Color& rColor );
402
    const Color&                    GetMenuBarHighlightTextColor() const;
403
404
    void                            SetMenuHighlightColor( const Color& rColor );
405
    const Color&                    GetMenuHighlightColor() const;
406
407
    void                            SetMenuHighlightTextColor( const Color& rColor );
408
    const Color&                    GetMenuHighlightTextColor() const;
409
410
    void                            SetListBoxWindowBackgroundColor( const Color& rColor );
411
    const Color&                    GetListBoxWindowBackgroundColor() const;
412
413
    void                            SetListBoxWindowTextColor( const Color& rColor );
414
    SAL_DLLPRIVATE const Color&     GetListBoxWindowTextColor() const;
415
416
    void                            SetListBoxWindowHighlightColor( const Color& rColor );
417
    SAL_DLLPRIVATE const Color&     GetListBoxWindowHighlightColor() const;
418
419
    void                            SetListBoxWindowHighlightTextColor( const Color& rColor );
420
    SAL_DLLPRIVATE const Color&     GetListBoxWindowHighlightTextColor() const;
421
422
    void                            SetTabTextColor( const Color& rColor );
423
    SAL_DLLPRIVATE const Color&     GetTabTextColor() const;
424
425
    void                            SetTabRolloverTextColor( const Color& rColor );
426
    SAL_DLLPRIVATE const Color&     GetTabRolloverTextColor() const;
427
428
    void                            SetTabHighlightTextColor( const Color& rColor );
429
    SAL_DLLPRIVATE const Color&     GetTabHighlightTextColor() const;
430
431
    void                            SetToolTextColor( const Color& rColor );
432
    SAL_DLLPRIVATE const Color&     GetToolTextColor() const;
433
434
    void                            SetLinkColor( const Color& rColor );
435
    const Color&                    GetLinkColor() const;
436
437
    void                            SetVisitedLinkColor( const Color& rColor );
438
    const Color&                    GetVisitedLinkColor() const;
439
440
    void                            SetMonoColor( const Color& rColor );
441
    const Color&                    GetMonoColor() const;
442
443
    void                            SetActiveTabColor( const Color& rColor );
444
    const Color&                    GetActiveTabColor() const;
445
446
    void                            SetInactiveTabColor( const Color& rColor );
447
    const Color&                    GetInactiveTabColor() const;
448
449
    void SetAlternatingRowColor(const Color& rColor);
450
451
    void                            SetHighContrastMode(bool bHighContrast );
452
    bool                            GetHighContrastMode() const;
453
454
    void                            SetUseSystemUIFonts( bool bUseSystemUIFonts );
455
    bool                            GetUseSystemUIFonts() const;
456
457
    void SetUseFontAAFromSystem(bool bUseFontAAFromSystem);
458
    bool GetUseFontAAFromSystem() const;
459
460
    // Using subpixel anti-aliasing is unwanted in some cases, like when saving to file,
461
    // even when the use of anti-aliasing itself is defined by system settings.
462
    void SetUseSubpixelAA(bool val);
463
    bool GetUseSubpixelAA() const;
464
465
    SAL_DLLPRIVATE void             SetUseFlatBorders( bool bUseFlatBorders );
466
    SAL_DLLPRIVATE bool             GetUseFlatBorders() const;
467
468
    SAL_DLLPRIVATE void             SetUseFlatMenus( bool bUseFlatMenus );
469
    SAL_DLLPRIVATE bool             GetUseFlatMenus() const;
470
471
    void                            SetUseImagesInMenus( TriState eUseImagesInMenus );
472
    bool                            GetUseImagesInMenus() const;
473
474
    void                            SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus );
475
    SAL_DLLPRIVATE bool             GetPreferredUseImagesInMenus() const;
476
477
    void                            SetSkipDisabledInMenus( bool bSkipDisabledInMenus );
478
    SAL_DLLPRIVATE bool             GetSkipDisabledInMenus() const;
479
480
    void                            SetHideDisabledMenuItems( bool bHideDisabledMenuItems );
481
    bool                            GetHideDisabledMenuItems() const;
482
483
    void                            SetContextMenuShortcuts( TriState eContextMenuShortcuts );
484
    bool                            GetContextMenuShortcuts() const;
485
486
    void                            SetPreferredContextMenuShortcuts( bool bContextMenuShortcuts );
487
    SAL_DLLPRIVATE bool             GetPreferredContextMenuShortcuts() const;
488
489
    void                            SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider );
490
    SAL_DLLPRIVATE bool             GetPrimaryButtonWarpsSlider() const;
491
492
    void                            SetAppFont( const vcl::Font& rFont );
493
    const vcl::Font&                GetAppFont() const;
494
495
    void                            SetHelpFont( const vcl::Font& rFont );
496
    const vcl::Font&                GetHelpFont() const;
497
498
    void                            SetTitleFont( const vcl::Font& rFont );
499
    const vcl::Font&                GetTitleFont() const;
500
501
    void                            SetFloatTitleFont( const vcl::Font& rFont );
502
    const vcl::Font&                GetFloatTitleFont() const;
503
504
    void                            SetMenuFont( const vcl::Font& rFont );
505
    const vcl::Font&                GetMenuFont() const;
506
507
    void                            SetToolFont( const vcl::Font& rFont );
508
    const vcl::Font&                GetToolFont() const;
509
510
    void                            SetGroupFont( const vcl::Font& rFont );
511
    const vcl::Font&                GetGroupFont() const;
512
513
    void                            SetLabelFont( const vcl::Font& rFont );
514
    const vcl::Font&                GetLabelFont() const;
515
516
    void                            SetRadioCheckFont( const vcl::Font& rFont );
517
    const vcl::Font&                GetRadioCheckFont() const;
518
519
    void                            SetPushButtonFont( const vcl::Font& rFont );
520
    const vcl::Font&                GetPushButtonFont() const;
521
522
    void                            SetFieldFont( const vcl::Font& rFont );
523
    const vcl::Font&                GetFieldFont() const;
524
525
    SAL_DLLPRIVATE void             SetIconFont( const vcl::Font& rFont );
526
    SAL_DLLPRIVATE const vcl::Font& GetIconFont() const;
527
528
    void                            SetTabFont( const vcl::Font& rFont );
529
    const vcl::Font&                GetTabFont() const;
530
531
    SAL_DLLPRIVATE static sal_Int32 GetBorderSize();
532
533
    SAL_DLLPRIVATE void             SetTitleHeight( sal_Int32 nSize );
534
    sal_Int32                       GetTitleHeight() const;
535
536
    SAL_DLLPRIVATE void             SetFloatTitleHeight( sal_Int32 nSize );
537
    SAL_DLLPRIVATE sal_Int32        GetFloatTitleHeight() const;
538
539
    void                            SetScrollBarSize( sal_Int32 nSize );
540
    sal_Int32                       GetScrollBarSize() const;
541
542
    void                            SetMinThumbSize( sal_Int32 nSize );
543
    SAL_DLLPRIVATE sal_Int32        GetMinThumbSize() const;
544
545
    SAL_DLLPRIVATE void             SetSpinSize( sal_Int32 nSize );
546
    SAL_DLLPRIVATE sal_Int32        GetSpinSize() const;
547
548
    static sal_Int32                GetSplitSize();
549
550
    void                            SetCursorSize( sal_Int32 nSize );
551
    sal_Int32                       GetCursorSize() const;
552
553
    void                            SetCursorBlinkTime( sal_uInt64 nBlinkTime );
554
    sal_uInt64                      GetCursorBlinkTime() const;
555
556
    void                            SetDragFullOptions( DragFullOptions nOptions );
557
    DragFullOptions                 GetDragFullOptions() const;
558
559
    void                            SetSelectionOptions( SelectionOptions nOptions );
560
    SelectionOptions                GetSelectionOptions() const;
561
562
    void                            SetDisplayOptions( DisplayOptions nOptions );
563
    SAL_DLLPRIVATE DisplayOptions   GetDisplayOptions() const;
564
565
    void                            SetAntialiasingMinPixelHeight( sal_Int32 nMinPixel );
566
    SAL_DLLPRIVATE sal_Int32        GetAntialiasingMinPixelHeight() const;
567
568
    void                            SetOptions( StyleSettingsOptions nOptions );
569
    StyleSettingsOptions            GetOptions() const;
570
571
    void                            SetAutoMnemonic( bool bAutoMnemonic );
572
    bool                            GetAutoMnemonic() const;
573
574
    static bool                     GetDockingFloatsSupported();
575
576
    void                            SetToolbarIconSize( ToolbarIconSize nSize );
577
    ToolbarIconSize                 GetToolbarIconSize() const;
578
579
    /** Set the icon theme to use. */
580
    void                            SetIconTheme(const OUString&);
581
582
    /** Determine which icon theme should be used.
583
     *
584
     * This might not be the same as the one which has been set with SetIconTheme(),
585
     * e.g., if high contrast mode is enabled.
586
     *
587
     * (for the detailed logic @see vcl::IconThemeSelector)
588
     */
589
    OUString                        DetermineIconTheme() const;
590
591
    /** Obtain the list of icon themes which were found in the config folder
592
     * @see vcl::IconThemeScanner for more details.
593
     */
594
    std::vector<vcl::IconThemeInfo> const & GetInstalledIconThemes() const;
595
596
    /** Obtain the name of the icon theme which will be chosen automatically for the desktop environment.
597
     * This method will only return icon themes which were actually found on the system.
598
     */
599
    OUString                        GetAutomaticallyChosenIconTheme() const;
600
601
    /** Set a preferred icon theme.
602
     * This theme will be preferred in GetAutomaticallyChosenIconTheme()
603
     */
604
    void                            SetPreferredIconTheme(const OUString&, bool bDarkIconTheme = false);
605
606
    const DialogStyle&              GetDialogStyle() const;
607
    const Bitmap&                   GetAppBackgroundBitmap() const;
608
609
    // global switch to allow EdgeBlenging; currently possible for ValueSet and ListBox
610
    // when activated there using Get/SetEdgeBlending; default is true
611
    void                            SetEdgeBlending(sal_uInt16 nCount);
612
    sal_uInt16                      GetEdgeBlending() const;
613
614
    // TopLeft (default Color(0xC0, 0xC0, 0xC0)) and BottomRight (default Color(0x40, 0x40, 0x40))
615
    // default colors for EdgeBlending
616
    const Color&                    GetEdgeBlendingTopLeftColor() const;
617
    const Color&                    GetEdgeBlendingBottomRightColor() const;
618
619
    // maximum line count for ListBox control; to use this, call AdaptDropDownLineCountToMaximum() at the
620
    // ListBox after it's ItemCount has changed/got filled. Default is 25. If more Items exist, a scrollbar
621
    // will be used
622
    void                            SetListBoxMaximumLineCount(sal_uInt16 nCount);
623
    sal_uInt16                      GetListBoxMaximumLineCount() const;
624
625
    // maximum column count for the ColorValueSet control. Default is 12 and this is optimized for the
626
    // color scheme which has 12-color aligned layout for the part taken over from Symphony. Do
627
    // only change this if you know what you are doing.
628
    void                            SetColorValueSetColumnCount(sal_uInt16 nCount);
629
    sal_uInt16                      GetColorValueSetColumnCount() const;
630
631
    SAL_DLLPRIVATE void             SetListBoxPreviewDefaultLogicSize(Size const & rSize);
632
    const Size&                     GetListBoxPreviewDefaultPixelSize() const;
633
634
    // the default LineWidth for ListBox UI previews (LineStyle, LineDash, LineStartEnd). Default is 1.
635
    static sal_uInt16               GetListBoxPreviewDefaultLineWidth();
636
637
    void SetComboBoxTextSelectionMode(ComboBoxTextSelectionMode eMode);
638
    ComboBoxTextSelectionMode GetComboBoxTextSelectionMode() const;
639
640
    // defines if previews which contain potentially transparent objects (e.g. the dash/line/LineStartEnd previews and others)
641
    // use the default transparent visualization background (checkered background) as it has got standard in graphic programs nowadays
642
    void                            SetPreviewUsesCheckeredBackground(bool bNew);
643
    bool                            GetPreviewUsesCheckeredBackground() const;
644
645
    void                            SetStandardStyles();
646
647
    bool                            operator ==( const StyleSettings& rSet ) const;
648
649
    // Batch setters used by various backends
650
    void                            BatchSetBackgrounds( const Color &aBackColor,
651
                                                         bool bCheckedColorSpecialCase = true );
652
    void                            BatchSetFonts( const vcl::Font& aAppFont,
653
                                                   const vcl::Font& aLabelFont );
654
};
655
656
657
class VCL_DLLPUBLIC MiscSettings
658
{
659
    std::shared_ptr<ImplMiscData>   mxData;
660
661
public:
662
                                    MiscSettings();
663
664
    static bool                     GetEnableATToolSupport();
665
    bool                            GetDisablePrinting() const;
666
    void                            SetEnableLocalizedDecimalSep( bool bEnable );
667
    bool                            GetEnableLocalizedDecimalSep() const;
668
    // return if dark mode is active, resolving 'auto' to dark (true) or light (false)
669
    static bool                     GetUseDarkMode();
670
    static void                     SetAppColorMode(AppearanceMode nMode);
671
    static AppearanceMode           GetAppColorMode();
672
    // return true if system preferences are set to use reduced animation
673
    static bool                     GetUseReducedAnimation();
674
    static bool                     IsAnimatedGraphicAllowed();
675
    static bool                     IsAnimatedOthersAllowed();
676
    static bool                     IsAnimatedTextAllowed();
677
    bool                            operator ==( const MiscSettings& rSet ) const;
678
    bool                            operator !=( const MiscSettings& rSet ) const;
679
};
680
681
682
class VCL_DLLPUBLIC HelpSettings
683
{
684
    std::shared_ptr<ImplHelpData>   mxData;
685
686
public:
687
                                    HelpSettings();
688
689
    static sal_Int32                GetTipDelay();
690
    void                            SetTipTimeout( sal_Int32 nTipTimeout );
691
    sal_Int32                       GetTipTimeout() const;
692
    static sal_Int32                GetBalloonDelay();
693
694
    bool                            operator ==( const HelpSettings& rSet ) const;
695
    bool                            operator !=( const HelpSettings& rSet ) const;
696
};
697
698
699
enum class AllSettingsFlags {
700
    NONE     = 0x0000,
701
    MOUSE    = 0x0001,
702
    STYLE    = 0x0002,
703
    MISC     = 0x0004,
704
    LOCALE   = 0x0020,
705
};
706
namespace o3tl
707
{
708
    template<> struct typed_flags<AllSettingsFlags> : is_typed_flags<AllSettingsFlags, 0x0027> {};
709
}
710
711
class VCL_DLLPUBLIC AllSettings
712
{
713
private:
714
    o3tl::cow_wrapper<ImplAllSettingsData> mxData;
715
716
public:
717
                                            AllSettings();
718
                                            AllSettings(const AllSettings&);
719
                                            ~AllSettings();
720
    AllSettings&                            operator=(const AllSettings&);
721
722
    void                                    SetMouseSettings( const MouseSettings& rSet );
723
    const MouseSettings&                    GetMouseSettings() const;
724
725
    void                                    SetStyleSettings( const StyleSettings& rSet );
726
    const StyleSettings&                    GetStyleSettings() const;
727
728
    void                                    SetMiscSettings( const MiscSettings& rSet );
729
    const MiscSettings&                     GetMiscSettings() const;
730
731
    IF_MERGELIBS(SAL_DLLPRIVATE)
732
    void                                    SetHelpSettings( const HelpSettings& rSet );
733
    IF_MERGELIBS(SAL_DLLPRIVATE)
734
    const HelpSettings&                     GetHelpSettings() const;
735
736
    void                                    SetLanguageTag(const OUString& rLanguage, bool bCanonicalize);
737
    void                                    SetLanguageTag( const LanguageTag& rLanguageTag );
738
    const LanguageTag&                      GetLanguageTag() const;
739
    const LanguageTag&                      GetUILanguageTag() const;
740
    static bool                             GetLayoutRTL();   // returns true if UI language requires right-to-left Text Layout
741
    static bool                             GetMathLayoutRTL();   // returns true if UI language requires right-to-left Math Layout
742
    static OUString                         GetUIRootDir();
743
    const LocaleDataWrapper&                GetLocaleDataWrapper() const;
744
    const LocaleDataWrapper&                GetUILocaleDataWrapper() const;
745
    IF_MERGELIBS(SAL_DLLPRIVATE)
746
    const LocaleDataWrapper&                GetNeutralLocaleDataWrapper() const;
747
    const vcl::I18nHelper&                  GetLocaleI18nHelper() const;
748
    const vcl::I18nHelper&                  GetUILocaleI18nHelper() const;
749
750
    SAL_DLLPRIVATE static AllSettingsFlags GetWindowUpdate()
751
0
    { return AllSettingsFlags::MOUSE | AllSettingsFlags::STYLE | AllSettingsFlags::MISC | AllSettingsFlags::LOCALE; }
752
753
    SAL_DLLPRIVATE AllSettingsFlags         Update( AllSettingsFlags nFlags, const AllSettings& rSettings );
754
    SAL_DLLPRIVATE AllSettingsFlags         GetChangeFlags( const AllSettings& rSettings ) const;
755
756
    SAL_DLLPRIVATE bool                    operator ==( const AllSettings& rSet ) const;
757
    SAL_DLLPRIVATE static void             LocaleSettingsChanged( ConfigurationHints nHint );
758
    SAL_DLLPRIVATE const SvtSysLocale&     GetSysLocale() const;
759
};
760
761
#endif // INCLUDED_VCL_SETTINGS_HXX
762
763
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */