1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include <docmodel/uno/UnoTheme.hxx>
12 #include <docmodel/theme/ThemeColorType.hxx>
13 #include <cppuhelper/queryinterface.hxx>
14 #include <o3tl/enumrange.hxx>
15 #include <comphelper/sequence.hxx>
16 #include <docmodel/theme/Theme.hxx>
20 OUString
UnoTheme::getName() { return mpTheme
->GetName(); }
22 css::uno::Sequence
<sal_Int32
> UnoTheme::getColorSet()
24 std::vector
<sal_Int32
> aColorScheme(12);
25 auto pColorSet
= mpTheme
->getColorSet();
30 for (auto eThemeColorType
: o3tl::enumrange
<model::ThemeColorType
>())
32 if (eThemeColorType
== model::ThemeColorType::Unknown
)
34 Color aColor
= pColorSet
->getColor(eThemeColorType
);
35 aColorScheme
[i
] = sal_Int32(aColor
);
39 return comphelper::containerToSequence(aColorScheme
);
42 namespace model::theme
44 uno::Reference
<util::XTheme
> createXTheme(std::shared_ptr
<model::Theme
> const& pTheme
)
46 return new UnoTheme(pTheme
);
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */