LibreOffice Module oox (master) 1
theme.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_OOX_DRAWINGML_THEME_HXX
21#define INCLUDED_OOX_DRAWINGML_THEME_HXX
22
23#include <functional>
24
25#include <com/sun/star/uno/Reference.hxx>
28#include <oox/dllapi.h>
29#include <oox/helper/refmap.hxx>
31#include <rtl/ustring.hxx>
32#include <sal/types.h>
33
34namespace com::sun::star {
35 namespace drawing { class XDrawPage; }
36 namespace xml::dom { class XDocument; }
37}
38namespace model {
39 class Theme;
40}
41
42namespace oox::drawingml
43{
44
45struct EffectProperties;
46struct FillProperties;
47struct LineProperties;
48struct TextCharacterProperties;
49
50const sal_Int32 THEMED_STYLE_SUBTLE = 1;
51const sal_Int32 THEMED_STYLE_MODERATE = 2;
52const sal_Int32 THEMED_STYLE_INTENSE = 3;
53
58
59class TextFont;
60
62{
63public:
64 void setThemeName(OUString const& rName) { maThemeName = rName; }
65 void setFormatSchemeName(OUString const& rName) { maFormatSchemeName = rName; }
66 void setFontSchemeName(OUString const& rName) { maFontSchemeName = rName; }
67
68 ClrScheme& getClrScheme() { return maClrScheme; }
69 const ClrScheme& getClrScheme() const { return maClrScheme; }
70
71 FillStyleList& getFillStyleList() { return maFillStyleList; }
72 const FillStyleList& getFillStyleList() const { return maFillStyleList; }
73 FillStyleList& getBgFillStyleList() { return maBgFillStyleList; }
74 const FillStyleList& getBgFillStyleList() const { return maBgFillStyleList; }
76 const FillProperties* getFillStyle( sal_Int32 nIndex ) const;
77
78 LineStyleList& getLineStyleList() { return maLineStyleList; }
79 const LineStyleList& getLineStyleList() const { return maLineStyleList; }
81 const LineProperties* getLineStyle( sal_Int32 nIndex ) const;
82
83 EffectStyleList& getEffectStyleList() { return maEffectStyleList; }
84 const EffectStyleList& getEffectStyleList() const { return maEffectStyleList; }
85 const EffectProperties* getEffectStyle( sal_Int32 nIndex ) const;
86
87 FontScheme& getFontScheme() { return maFontScheme; }
88 const FontScheme& getFontScheme() const { return maFontScheme; }
89
90 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>>& getSupplementalFontMap() { return maSupplementalFontMap; }
91 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>> const& getSupplementalFontMap() const { return maSupplementalFontMap; }
92
94 const TextCharacterProperties* getFontStyle( sal_Int32 nSchemeType ) const;
96 const TextFont* resolveFont( std::u16string_view rName ) const;
97
98 Shape& getSpDef() { return maSpDef; }
99 const Shape& getSpDef() const { return maSpDef; }
100
101 Shape& getLnDef() { return maLnDef; }
102 const Shape& getLnDef() const { return maLnDef; }
103
104 Shape& getTxDef() { return maTxDef; }
105 const Shape& getTxDef() const { return maTxDef; }
106
107 const css::uno::Reference<css::xml::dom::XDocument>& getFragment() const { return mxFragment; }
108 void setFragment( const css::uno::Reference< css::xml::dom::XDocument>& xRef ) { mxFragment=xRef; }
109
110 std::unique_ptr<model::Theme> createSvxTheme() const;
111 void addTheme(const css::uno::Reference<css::drawing::XDrawPage>& xDrawPage) const;
112
113private:
114 OUString maThemeName;
123 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>> maSupplementalFontMap;
127 css::uno::Reference< css::xml::dom::XDocument> mxFragment;
128};
129
130
131} // namespace oox::drawingml
132
133#endif
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
carries a CT_TextFont
Definition: textfont.hxx:34
void setFragment(const css::uno::Reference< css::xml::dom::XDocument > &xRef)
Definition: theme.hxx:108
const css::uno::Reference< css::xml::dom::XDocument > & getFragment() const
Definition: theme.hxx:107
void setFormatSchemeName(OUString const &rName)
Definition: theme.hxx:65
css::uno::Reference< css::xml::dom::XDocument > mxFragment
Definition: theme.hxx:127
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > & getSupplementalFontMap()
Definition: theme.hxx:90
FillStyleList & getFillStyleList()
Definition: theme.hxx:71
LineStyleList & getLineStyleList()
Definition: theme.hxx:78
EffectStyleList maEffectStyleList
Definition: theme.hxx:121
const FillStyleList & getFillStyleList() const
Definition: theme.hxx:72
const FontScheme & getFontScheme() const
Definition: theme.hxx:88
EffectStyleList & getEffectStyleList()
Definition: theme.hxx:83
const LineStyleList & getLineStyleList() const
Definition: theme.hxx:79
FontScheme maFontScheme
Definition: theme.hxx:122
const Shape & getLnDef() const
Definition: theme.hxx:102
FillStyleList maBgFillStyleList
Definition: theme.hxx:119
Shape & getLnDef()
Definition: theme.hxx:101
ClrScheme & getClrScheme()
Definition: theme.hxx:68
OUString maFormatSchemeName
Definition: theme.hxx:116
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > maSupplementalFontMap
Definition: theme.hxx:123
const ClrScheme & getClrScheme() const
Definition: theme.hxx:69
FillStyleList & getBgFillStyleList()
Definition: theme.hxx:73
Shape & getSpDef()
Definition: theme.hxx:98
const Shape & getTxDef() const
Definition: theme.hxx:105
const EffectStyleList & getEffectStyleList() const
Definition: theme.hxx:84
OUString maThemeName
Definition: theme.hxx:114
Shape & getTxDef()
Definition: theme.hxx:104
LineStyleList maLineStyleList
Definition: theme.hxx:120
const FillStyleList & getBgFillStyleList() const
Definition: theme.hxx:74
FillStyleList maFillStyleList
Definition: theme.hxx:118
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > const & getSupplementalFontMap() const
Definition: theme.hxx:91
OUString maFontSchemeName
Definition: theme.hxx:115
void setThemeName(OUString const &rName)
Definition: theme.hxx:64
FontScheme & getFontScheme()
Definition: theme.hxx:87
void setFontSchemeName(OUString const &rName)
Definition: theme.hxx:66
const Shape & getSpDef() const
Definition: theme.hxx:99
ClrScheme maClrScheme
Definition: theme.hxx:117
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
const sal_Int32 THEMED_STYLE_INTENSE
Definition: theme.hxx:52
const sal_Int32 THEMED_STYLE_SUBTLE
Definition: theme.hxx:50
RefVector< LineProperties > LineStyleList
Definition: theme.hxx:55
RefVector< FillProperties > FillStyleList
Definition: theme.hxx:54
RefMap< sal_Int32, TextCharacterProperties > FontScheme
Definition: theme.hxx:57
RefVector< EffectProperties > EffectStyleList
Definition: theme.hxx:56
const sal_Int32 THEMED_STYLE_MODERATE
Definition: theme.hxx:51