Branch data Line data Source code
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 OOX_DRAWINGML_THEME_HXX
21 : : #define OOX_DRAWINGML_THEME_HXX
22 : :
23 : : #include "oox/drawingml/clrscheme.hxx"
24 : : #include "oox/drawingml/shape.hxx"
25 : : #include "oox/drawingml/textfont.hxx"
26 : : #include <com/sun/star/xml/dom/XDocument.hpp>
27 : : #include "oox/dllapi.h"
28 : :
29 : : namespace oox {
30 : : namespace drawingml {
31 : :
32 : : // ============================================================================
33 : :
34 : : const sal_Int32 THEMED_STYLE_SUBTLE = 1;
35 : : const sal_Int32 THEMED_STYLE_MODERATE = 2;
36 : : const sal_Int32 THEMED_STYLE_INTENSE = 3;
37 : :
38 : : typedef RefVector< FillProperties > FillStyleList;
39 : : typedef RefVector< LineProperties > LineStyleList;
40 : : typedef RefVector< PropertyMap > EffectStyleList;
41 : : typedef RefMap< sal_Int32, TextCharacterProperties > FontScheme;
42 : :
43 : : // ============================================================================
44 : :
45 : : class OOX_DLLPUBLIC Theme
46 : : {
47 : : public:
48 : : explicit Theme();
49 : : ~Theme();
50 : :
51 : 18 : inline void setStyleName( const ::rtl::OUString& rStyleName ) { maStyleName = rStyleName; }
52 : : inline const ::rtl::OUString& getStyleName() const { return maStyleName; }
53 : :
54 : 156 : inline ClrScheme& getClrScheme() { return maClrScheme; }
55 : 12 : inline const ClrScheme& getClrScheme() const { return maClrScheme; }
56 : :
57 : 18 : inline FillStyleList& getFillStyleList() { return maFillStyleList; }
58 : : inline const FillStyleList& getFillStyleList() const { return maFillStyleList; }
59 : 18 : inline FillStyleList& getBgFillStyleList() { return maBgFillStyleList; }
60 : : inline 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;
63 : :
64 : 18 : inline LineStyleList& getLineStyleList() { return maLineStyleList; }
65 : : inline 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;
68 : :
69 : 18 : inline EffectStyleList& getEffectStyleList() { return maEffectStyleList; }
70 : : inline const EffectStyleList& getEffectStyleList() const { return maEffectStyleList; }
71 : :
72 : 18 : inline FontScheme& getFontScheme() { return maFontScheme; }
73 : : inline const FontScheme& getFontScheme() const { return maFontScheme; }
74 : : /** Returns theme font properties by scheme type (major/minor). */
75 : : const TextCharacterProperties* getFontStyle( sal_Int32 nSchemeType ) const;
76 : : /** Returns theme font by placeholder name, e.g. the major latin theme font for the font name '+mj-lt'. */
77 : : const TextFont* resolveFont( const ::rtl::OUString& rName ) const;
78 : :
79 : 0 : inline Shape& getSpDef() { return maSpDef; }
80 : : inline const Shape& getSpDef() const { return maSpDef; }
81 : :
82 : 0 : inline Shape& getLnDef() { return maLnDef; }
83 : : inline const Shape& getLnDef() const { return maLnDef; }
84 : :
85 : 0 : inline Shape& getTxDef() { return maTxDef; }
86 : : inline const Shape& getTxDef() const { return maTxDef; }
87 : :
88 : 9 : void setFragment( const ::com::sun::star::uno::Reference<
89 : 9 : ::com::sun::star::xml::dom::XDocument>& xRef ) { mxFragment=xRef; }
90 : : const ::com::sun::star::uno::Reference<
91 : : ::com::sun::star::xml::dom::XDocument>& getFragment() const { return mxFragment; }
92 : :
93 : : private:
94 : : ::rtl::OUString maStyleName;
95 : : ClrScheme maClrScheme;
96 : : FillStyleList maFillStyleList;
97 : : FillStyleList maBgFillStyleList;
98 : : LineStyleList maLineStyleList;
99 : : EffectStyleList maEffectStyleList;
100 : : FontScheme maFontScheme;
101 : : Shape maSpDef;
102 : : Shape maLnDef;
103 : : Shape maTxDef;
104 : : ::com::sun::star::uno::Reference<
105 : : ::com::sun::star::xml::dom::XDocument> mxFragment;
106 : : };
107 : :
108 : : // ============================================================================
109 : :
110 : : } // namespace drawingml
111 : : } // namespace oox
112 : :
113 : : #endif
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|