Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / svx / theme / ThemeColorPaletteManager.hxx
blobd575c1038750f08732ebee1a6558e47673c1c424
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 <svx/svxdllapi.h>
12 #include <rtl/ustring.hxx>
13 #include <array>
14 #include <memory>
15 #include <tools/color.hxx>
16 #include <docmodel/theme/ThemeColorType.hxx>
18 namespace model
20 class ColorSet;
23 namespace svx
25 struct SVXCORE_DLLPUBLIC ThemePaletteEffect
27 Color maColor;
28 OUString maColorName;
29 sal_Int16 mnLumOff = 0;
30 sal_Int16 mnLumMod = 10'000;
32 sal_Int16 getPercentage()
34 if (mnLumOff > 0)
35 return mnLumOff / 100;
36 else
37 return (-10'000 + mnLumMod) / 100;
41 struct SVXCORE_DLLPUBLIC ThemePaletteColorData
43 Color maBaseColor;
44 model::ThemeColorType meThemeColorType;
45 std::array<ThemePaletteEffect, 6> maEffects;
47 sal_Int16 getLumMod(sal_uInt16 nEffect) const { return maEffects[nEffect].mnLumMod; }
48 sal_Int16 getLumOff(sal_uInt16 nEffect) const { return maEffects[nEffect].mnLumOff; }
51 struct SVXCORE_DLLPUBLIC ThemePaletteCollection
53 std::array<ThemePaletteColorData, 12> maColors;
56 class SVXCORE_DLLPUBLIC ThemeColorPaletteManager final
58 std::shared_ptr<model::ColorSet> m_pColorSet;
60 public:
61 ThemeColorPaletteManager(std::shared_ptr<model::ColorSet> const& pColorSet);
62 ThemePaletteCollection generate();
63 OString generateJSON();
66 } // end svx namespace
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */