LibreOffice Module svx (master) 1
ThemeColorPaletteManager.hxx
Go to the documentation of this file.
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#pragma once
10
11#include <svx/svxdllapi.h>
12#include <rtl/ustring.hxx>
13#include <array>
14#include <memory>
15#include <tools/color.hxx>
17
18namespace model
19{
20class ColorSet;
21}
22
23namespace svx
24{
26{
28 OUString maColorName;
29 sal_Int16 mnLumOff = 0;
30 sal_Int16 mnLumMod = 10'000;
31
32 sal_Int16 getPercentage()
33 {
34 if (mnLumOff > 0)
35 return mnLumOff / 100;
36 else
37 return (-10'000 + mnLumMod) / 100;
38 }
39};
40
42{
45 std::array<ThemePaletteEffect, 6> maEffects;
46
47 sal_Int16 getLumMod(sal_uInt16 nEffect) const { return maEffects[nEffect].mnLumMod; }
48 sal_Int16 getLumOff(sal_uInt16 nEffect) const { return maEffects[nEffect].mnLumOff; }
49};
50
52{
53 std::array<ThemePaletteColorData, 12> maColors;
54};
55
57{
58 std::shared_ptr<model::ColorSet> m_pColorSet;
59
60public:
61 ThemeColorPaletteManager(std::shared_ptr<model::ColorSet> const& pColorSet);
62 ThemePaletteCollection generate();
63 OString generateJSON();
64};
65
66} // end svx namespace
67
68/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< model::ColorSet > m_pColorSet
ThemeColorType
std::array< ThemePaletteColorData, 12 > maColors
std::array< ThemePaletteEffect, 6 > maEffects
sal_Int16 getLumMod(sal_uInt16 nEffect) const
sal_Int16 getLumOff(sal_uInt16 nEffect) const
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35