Branch libreoffice-5-0-4
[LibreOffice.git] / include / oox / drawingml / theme.hxx
blob965124cbcd78787682499f57e6dbf6783f3adcb4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_OOX_DRAWINGML_THEME_HXX
21 #define INCLUDED_OOX_DRAWINGML_THEME_HXX
23 #include <oox/drawingml/clrscheme.hxx>
24 #include <oox/drawingml/shape.hxx>
25 #include <oox/helper/refvector.hxx>
26 #include <com/sun/star/xml/dom/XDocument.hpp>
27 #include <oox/dllapi.h>
29 namespace oox {
30 namespace drawingml {
34 const sal_Int32 THEMED_STYLE_SUBTLE = 1;
35 const sal_Int32 THEMED_STYLE_MODERATE = 2;
36 const sal_Int32 THEMED_STYLE_INTENSE = 3;
38 typedef RefVector< FillProperties > FillStyleList;
39 typedef RefVector< LineProperties > LineStyleList;
40 typedef RefVector< EffectProperties > EffectStyleList;
41 typedef RefMap< sal_Int32, TextCharacterProperties > FontScheme;
43 class TextFont;
45 class OOX_DLLPUBLIC Theme
47 public:
48 Theme();
49 ~Theme();
51 void setStyleName( const OUString& rStyleName ) { maStyleName = rStyleName; }
52 const OUString& getStyleName() const { return maStyleName; }
54 ClrScheme& getClrScheme() { return maClrScheme; }
55 const ClrScheme& getClrScheme() const { return maClrScheme; }
57 FillStyleList& getFillStyleList() { return maFillStyleList; }
58 const FillStyleList& getFillStyleList() const { return maFillStyleList; }
59 FillStyleList& getBgFillStyleList() { return maBgFillStyleList; }
60 const FillStyleList& getBgFillStyleList() const { return maBgFillStyleList; }
61 /** Returns the fill properties of the passed one-based themed style index. */
62 const FillProperties* getFillStyle( sal_Int32 nIndex ) const;
64 LineStyleList& getLineStyleList() { return maLineStyleList; }
65 const LineStyleList& getLineStyleList() const { return maLineStyleList; }
66 /** Returns the line properties of the passed one-based themed style index. */
67 const LineProperties* getLineStyle( sal_Int32 nIndex ) const;
69 EffectStyleList& getEffectStyleList() { return maEffectStyleList; }
70 const EffectStyleList& getEffectStyleList() const { return maEffectStyleList; }
71 const EffectProperties* getEffectStyle( sal_Int32 nIndex ) const;
73 FontScheme& getFontScheme() { return maFontScheme; }
74 const FontScheme& getFontScheme() const { return maFontScheme; }
75 /** Returns theme font properties by scheme type (major/minor). */
76 const TextCharacterProperties* getFontStyle( sal_Int32 nSchemeType ) const;
77 /** Returns theme font by placeholder name, e.g. the major latin theme font for the font name '+mj-lt'. */
78 const TextFont* resolveFont( const OUString& rName ) const;
80 Shape& getSpDef() { return maSpDef; }
81 const Shape& getSpDef() const { return maSpDef; }
83 Shape& getLnDef() { return maLnDef; }
84 const Shape& getLnDef() const { return maLnDef; }
86 Shape& getTxDef() { return maTxDef; }
87 const Shape& getTxDef() const { return maTxDef; }
89 void setFragment( const ::com::sun::star::uno::Reference<
90 ::com::sun::star::xml::dom::XDocument>& xRef ) { mxFragment=xRef; }
91 const ::com::sun::star::uno::Reference<
92 ::com::sun::star::xml::dom::XDocument>& getFragment() const { return mxFragment; }
94 private:
95 OUString maStyleName;
96 ClrScheme maClrScheme;
97 FillStyleList maFillStyleList;
98 FillStyleList maBgFillStyleList;
99 LineStyleList maLineStyleList;
100 EffectStyleList maEffectStyleList;
101 FontScheme maFontScheme;
102 Shape maSpDef;
103 Shape maLnDef;
104 Shape maTxDef;
105 ::com::sun::star::uno::Reference<
106 ::com::sun::star::xml::dom::XDocument> mxFragment;
111 } // namespace drawingml
112 } // namespace oox
114 #endif
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */