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>
34
35namespace com::sun::star {
36 namespace drawing { class XDrawPage; }
37 namespace xml::dom { class XDocument; }
38}
39namespace model {
40 class Theme;
41}
42
43namespace oox::drawingml
44{
45
46struct EffectProperties;
47struct FillProperties;
48struct LineProperties;
49struct TextCharacterProperties;
50
51const sal_Int32 THEMED_STYLE_SUBTLE = 1;
52const sal_Int32 THEMED_STYLE_MODERATE = 2;
53const sal_Int32 THEMED_STYLE_INTENSE = 3;
54
59
60class TextFont;
61
63{
64public:
65 void setThemeName(OUString const& rName) { maThemeName = rName; }
66 void setFormatSchemeName(OUString const& rName) { maFormatSchemeName = rName; }
67 void setFontSchemeName(OUString const& rName) { maFontSchemeName = rName; }
68
69 ClrScheme& getClrScheme() { return maClrScheme; }
70 const ClrScheme& getClrScheme() const { return maClrScheme; }
71
72 FillStyleList& getFillStyleList() { return maFillStyleList; }
73 const FillStyleList& getFillStyleList() const { return maFillStyleList; }
74 FillStyleList& getBgFillStyleList() { return maBgFillStyleList; }
75 const FillStyleList& getBgFillStyleList() const { return maBgFillStyleList; }
77 const FillProperties* getFillStyle( sal_Int32 nIndex ) const;
78
79 LineStyleList& getLineStyleList() { return maLineStyleList; }
80 const LineStyleList& getLineStyleList() const { return maLineStyleList; }
82 const LineProperties* getLineStyle( sal_Int32 nIndex ) const;
83
84 EffectStyleList& getEffectStyleList() { return maEffectStyleList; }
85 const EffectStyleList& getEffectStyleList() const { return maEffectStyleList; }
86 const EffectProperties* getEffectStyle( sal_Int32 nIndex ) const;
87
89 const FontScheme& getFontScheme() const { return maFontScheme; }
90
91 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>>& getSupplementalFontMap() { return maSupplementalFontMap; }
92 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>> const& getSupplementalFontMap() const { return maSupplementalFontMap; }
93
95 const TextCharacterProperties* getFontStyle( sal_Int32 nSchemeType ) const;
97 const TextFont* resolveFont( std::u16string_view rName ) const;
98
99 Shape& getSpDef() { return maSpDef; }
100 const Shape& getSpDef() const { return maSpDef; }
101
102 Shape& getLnDef() { return maLnDef; }
103 const Shape& getLnDef() const { return maLnDef; }
104
105 Shape& getTxDef() { return maTxDef; }
106 const Shape& getTxDef() const { return maTxDef; }
107
108 const css::uno::Reference<css::xml::dom::XDocument>& getFragment() const { return mxFragment; }
109 void setFragment( const css::uno::Reference< css::xml::dom::XDocument>& xRef ) { mxFragment=xRef; }
110
111 void addTheme(const css::uno::Reference<css::drawing::XDrawPage>& xDrawPage) const;
112
113 void setTheme(std::shared_ptr<model::Theme> const& pTheme)
114 {
115 mpTheme = pTheme;
116 }
117
118 std::shared_ptr<model::Theme> const& getTheme() const
119 {
120 return mpTheme;
121 }
122private:
123 OUString maThemeName;
132 std::map<sal_Int32, std::vector<std::pair<OUString, OUString>>> maSupplementalFontMap;
136 css::uno::Reference< css::xml::dom::XDocument> mxFragment;
137
138 std::shared_ptr<model::Theme> mpTheme;
139};
140
141
142} // namespace oox::drawingml
143
144#endif
145
146/* 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:109
const css::uno::Reference< css::xml::dom::XDocument > & getFragment() const
Definition: theme.hxx:108
void setFormatSchemeName(OUString const &rName)
Definition: theme.hxx:66
css::uno::Reference< css::xml::dom::XDocument > mxFragment
Definition: theme.hxx:136
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > & getSupplementalFontMap()
Definition: theme.hxx:91
FillStyleList & getFillStyleList()
Definition: theme.hxx:72
LineStyleList & getLineStyleList()
Definition: theme.hxx:79
EffectStyleList maEffectStyleList
Definition: theme.hxx:130
const FillStyleList & getFillStyleList() const
Definition: theme.hxx:73
const FontScheme & getFontScheme() const
Definition: theme.hxx:89
EffectStyleList & getEffectStyleList()
Definition: theme.hxx:84
const LineStyleList & getLineStyleList() const
Definition: theme.hxx:80
std::shared_ptr< model::Theme > mpTheme
Definition: theme.hxx:138
FontScheme maFontScheme
Definition: theme.hxx:131
const Shape & getLnDef() const
Definition: theme.hxx:103
FillStyleList maBgFillStyleList
Definition: theme.hxx:128
Shape & getLnDef()
Definition: theme.hxx:102
ClrScheme & getClrScheme()
Definition: theme.hxx:69
OUString maFormatSchemeName
Definition: theme.hxx:125
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > maSupplementalFontMap
Definition: theme.hxx:132
const ClrScheme & getClrScheme() const
Definition: theme.hxx:70
FillStyleList & getBgFillStyleList()
Definition: theme.hxx:74
std::shared_ptr< model::Theme > const & getTheme() const
Definition: theme.hxx:118
Shape & getSpDef()
Definition: theme.hxx:99
const Shape & getTxDef() const
Definition: theme.hxx:106
const EffectStyleList & getEffectStyleList() const
Definition: theme.hxx:85
OUString maThemeName
Definition: theme.hxx:123
Shape & getTxDef()
Definition: theme.hxx:105
LineStyleList maLineStyleList
Definition: theme.hxx:129
const FillStyleList & getBgFillStyleList() const
Definition: theme.hxx:75
FillStyleList maFillStyleList
Definition: theme.hxx:127
std::map< sal_Int32, std::vector< std::pair< OUString, OUString > > > const & getSupplementalFontMap() const
Definition: theme.hxx:92
OUString maFontSchemeName
Definition: theme.hxx:124
void setThemeName(OUString const &rName)
Definition: theme.hxx:65
FontScheme & getFontScheme()
Definition: theme.hxx:88
void setFontSchemeName(OUString const &rName)
Definition: theme.hxx:67
const Shape & getSpDef() const
Definition: theme.hxx:100
void setTheme(std::shared_ptr< model::Theme > const &pTheme)
Definition: theme.hxx:113
ClrScheme maClrScheme
Definition: theme.hxx:126
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
const sal_Int32 THEMED_STYLE_INTENSE
Definition: theme.hxx:53
const sal_Int32 THEMED_STYLE_SUBTLE
Definition: theme.hxx:51
RefVector< LineProperties > LineStyleList
Definition: theme.hxx:56
RefVector< FillProperties > FillStyleList
Definition: theme.hxx:55
RefMap< sal_Int32, TextCharacterProperties > FontScheme
Definition: theme.hxx:58
RefVector< EffectProperties > EffectStyleList
Definition: theme.hxx:57
const sal_Int32 THEMED_STYLE_MODERATE
Definition: theme.hxx:52
model::FontScheme maFontScheme