tdf#161411 - UI: Add Better wording for ASCII-only characters
[LibreOffice.git] / include / svx / theme / ThemeColorPaletteManager.hxx
bloba2d45c19f49210ec6fa1c86a5db65943351d253e
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/.
8 */
9 #pragma once
11 #include <config_options.h>
12 #include <svx/svxdllapi.h>
13 #include <rtl/ustring.hxx>
14 #include <array>
15 #include <memory>
16 #include <tools/color.hxx>
17 #include <docmodel/theme/ThemeColorType.hxx>
19 namespace model
21 class ColorSet;
23 namespace tools
25 class JsonWriter;
28 namespace svx
30 struct SVXCORE_DLLPUBLIC ThemePaletteEffect
32 Color maColor;
33 OUString maColorName;
34 sal_Int16 mnLumOff = 0;
35 sal_Int16 mnLumMod = 10'000;
37 sal_Int16 getPercentage()
39 if (mnLumOff > 0)
40 return mnLumOff / 100;
41 else
42 return (-10'000 + mnLumMod) / 100;
46 struct SVXCORE_DLLPUBLIC ThemePaletteColorData
48 Color maBaseColor;
49 model::ThemeColorType meThemeColorType = model::ThemeColorType::Unknown;
50 std::array<ThemePaletteEffect, 6> maEffects;
52 sal_Int16 getLumMod(sal_uInt16 nEffect) const { return maEffects[nEffect].mnLumMod; }
53 sal_Int16 getLumOff(sal_uInt16 nEffect) const { return maEffects[nEffect].mnLumOff; }
56 struct SVXCORE_DLLPUBLIC ThemePaletteCollection
58 std::array<ThemePaletteColorData, 12> maColors;
61 class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) ThemeColorPaletteManager final
63 std::shared_ptr<model::ColorSet> m_pColorSet;
65 public:
66 ThemeColorPaletteManager(std::shared_ptr<model::ColorSet> const& pColorSet);
67 ThemePaletteCollection generate();
68 void generateJSON(tools::JsonWriter& aTree);
71 } // end svx namespace
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */