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/.
10 #include <xmloff/xmlictxt.hxx>
12 #include <com/sun/star/uno/XInterface.hpp>
13 #include <com/sun/star/util/Color.hpp>
15 #include <docmodel/theme/ColorSet.hxx>
23 class XMLThemeContext
: public SvXMLImportContext
25 // Any UNO object that has the "Theme" property - usually XPage (master page) or XModel
26 css::uno::Reference
<css::uno::XInterface
> m_xObjectWithThemeProperty
;
27 std::shared_ptr
<model::Theme
> mpTheme
;
30 XMLThemeContext(SvXMLImport
& rImport
,
31 css::uno::Reference
<css::xml::sax::XFastAttributeList
> const& xAttrList
,
32 css::uno::Reference
<css::uno::XInterface
> const& xObjectWithThemeProperty
);
35 css::uno::Reference
<css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
37 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& xAttribs
) override
;
40 /// Imports the theme colors of a theme
41 class XMLThemeColorsContext
: public SvXMLImportContext
43 model::Theme
& mrTheme
;
44 std::shared_ptr
<model::ColorSet
> m_pColorSet
;
45 std::vector
<css::util::Color
> m_aColorScheme
;
48 XMLThemeColorsContext(SvXMLImport
& rImport
,
49 css::uno::Reference
<css::xml::sax::XFastAttributeList
> const& xAttrList
,
50 model::Theme
& mrTheme
);
51 ~XMLThemeColorsContext();
53 css::uno::Reference
<css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
55 css::uno::Reference
<css::xml::sax::XFastAttributeList
> const& xAttribs
) override
;
58 /// Imports a color for a color table
59 class XMLColorContext
: public SvXMLImportContext
62 XMLColorContext(SvXMLImport
& rImport
,
63 css::uno::Reference
<css::xml::sax::XFastAttributeList
> const& xAttrList
,
64 std::shared_ptr
<model::ColorSet
>& rpColorSet
);
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */