Update git submodules
[LibreOffice.git] / sd / source / ui / slidesorter / inc / view / SlsTheme.hxx
blobefb7b2a3eb9a8266ff3cfda156625276846a2795
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <vcl/bitmapex.hxx>
23 #include <tools/color.hxx>
25 #include <memory>
27 namespace vcl { class Font; }
29 namespace sd::slidesorter::controller { class Properties; }
31 namespace sd::slidesorter::view {
33 const int Theme_FocusIndicatorWidth = 3;
35 /** Collection of colors and styles that are used to paint the slide sorter
36 view.
38 class Theme
40 public:
41 Theme (const std::shared_ptr<controller::Properties>& rpProperties);
43 /** Call this method to update some colors as response to a change of
44 a system color change.
46 void Update (
47 const std::shared_ptr<controller::Properties>& rpProperties);
49 // BitmapEx GetInsertIndicatorIcon() const;
51 enum FontType {
52 Font_PageNumber,
53 Font_PageCount
55 static std::shared_ptr<vcl::Font> GetFont (
56 const FontType eType,
57 const OutputDevice& rDevice);
59 enum ColorType {
60 Color_Background,
61 Color_PageNumberDefault,
62 Color_PageNumberHover,
63 Color_PageNumberHighContrast,
64 Color_PageNumberBrightBackground,
65 Color_PageNumberDarkBackground,
66 Color_Selection,
67 Color_PreviewBorder,
68 Color_PageCountFontColor,
69 ColorType_Size_
71 Color GetColor (const ColorType eType);
73 enum GradientColorType {
74 Gradient_NormalPage,
75 Gradient_SelectedPage,
76 Gradient_SelectedAndFocusedPage,
77 Gradient_MouseOverPage,
78 Gradient_MouseOverSelected,
79 Gradient_MouseOverSelectedAndFocusedPage,
80 Gradient_FocusedPage,
81 GradientColorType_Size_
83 enum class GradientColorClass {
84 Border1,
85 Border2,
86 Fill1,
87 Fill2
89 Color GetGradientColor (
90 const GradientColorType eType,
91 const GradientColorClass eClass);
92 void SetGradient (
93 const GradientColorType eType,
94 const Color aBaseColor,
95 const sal_Int32 nSaturationOverride,
96 const sal_Int32 nBrightnessOverride,
97 const sal_Int32 nFillStartOffset,
98 const sal_Int32 nFillEndOffset,
99 const sal_Int32 nBorderStartOffset,
100 const sal_Int32 nBorderEndOffset);
102 enum IconType
104 Icon_RawShadow,
105 Icon_RawInsertShadow,
106 Icon_HideSlideOverlay,
107 Icon_FocusBorder,
108 IconType_Size_
110 const BitmapEx& GetIcon (const IconType eType);
112 private:
113 class GradientDescriptor
115 public:
116 Color maFillColor1;
117 Color maFillColor2;
118 Color maBorderColor1;
119 Color maBorderColor2;
121 Color maBackgroundColor;
122 ::std::vector<GradientDescriptor> maGradients;
123 ::std::vector<BitmapEx> maIcons;
124 ::std::vector<Color> maColor;
126 GradientDescriptor& GetGradient (const GradientColorType eType);
127 /** Guarded initialization of the specified icon in the maIcons
128 container.
130 void InitializeIcon(const IconType eType, const OUString& rResourceId);
133 } // end of namespace ::sd::slidesorter::view
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */