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/.
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
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <oox/drawingml/clrscheme.hxx>
27 #include <oox/drawingml/shape.hxx>
28 #include <oox/dllapi.h>
29 #include <oox/helper/refmap.hxx>
30 #include <oox/helper/refvector.hxx>
31 #include <rtl/ustring.hxx>
32 #include <sal/types.h>
34 namespace com
{ namespace sun
{ namespace star
{
35 namespace xml
{ namespace dom
{ class XDocument
; } }
41 struct EffectProperties
;
42 struct FillProperties
;
43 struct LineProperties
;
44 struct TextCharacterProperties
;
46 const sal_Int32 THEMED_STYLE_SUBTLE
= 1;
47 const sal_Int32 THEMED_STYLE_MODERATE
= 2;
48 const sal_Int32 THEMED_STYLE_INTENSE
= 3;
50 typedef RefVector
< FillProperties
> FillStyleList
;
51 typedef RefVector
< LineProperties
> LineStyleList
;
52 typedef RefVector
< EffectProperties
> EffectStyleList
;
53 typedef RefMap
< sal_Int32
, TextCharacterProperties
> FontScheme
;
57 class OOX_DLLPUBLIC Theme
63 void setStyleName( const OUString
& rStyleName
) { maStyleName
= rStyleName
; }
65 ClrScheme
& getClrScheme() { return maClrScheme
; }
66 const ClrScheme
& getClrScheme() const { return maClrScheme
; }
68 FillStyleList
& getFillStyleList() { return maFillStyleList
; }
69 const FillStyleList
& getFillStyleList() const { return maFillStyleList
; }
70 FillStyleList
& getBgFillStyleList() { return maBgFillStyleList
; }
71 const FillStyleList
& getBgFillStyleList() const { return maBgFillStyleList
; }
72 /** Returns the fill properties of the passed one-based themed style index. */
73 const FillProperties
* getFillStyle( sal_Int32 nIndex
) const;
75 LineStyleList
& getLineStyleList() { return maLineStyleList
; }
76 const LineStyleList
& getLineStyleList() const { return maLineStyleList
; }
77 /** Returns the line properties of the passed one-based themed style index. */
78 const LineProperties
* getLineStyle( sal_Int32 nIndex
) const;
80 EffectStyleList
& getEffectStyleList() { return maEffectStyleList
; }
81 const EffectStyleList
& getEffectStyleList() const { return maEffectStyleList
; }
82 const EffectProperties
* getEffectStyle( sal_Int32 nIndex
) const;
84 FontScheme
& getFontScheme() { return maFontScheme
; }
85 const FontScheme
& getFontScheme() const { return maFontScheme
; }
86 /** Returns theme font properties by scheme type (major/minor). */
87 const TextCharacterProperties
* getFontStyle( sal_Int32 nSchemeType
) const;
88 /** Returns theme font by placeholder name, e.g. the major latin theme font for the font name '+mj-lt'. */
89 const TextFont
* resolveFont( const OUString
& rName
) const;
91 Shape
& getSpDef() { return maSpDef
; }
92 const Shape
& getSpDef() const { return maSpDef
; }
94 Shape
& getLnDef() { return maLnDef
; }
95 const Shape
& getLnDef() const { return maLnDef
; }
97 Shape
& getTxDef() { return maTxDef
; }
98 const Shape
& getTxDef() const { return maTxDef
; }
100 const css::uno::Reference
<css::xml::dom::XDocument
>& getFragment() const { return mxFragment
; }
101 void setFragment( const css::uno::Reference
< css::xml::dom::XDocument
>& xRef
) { mxFragment
=xRef
; }
104 OUString maStyleName
;
105 ClrScheme maClrScheme
;
106 FillStyleList maFillStyleList
;
107 FillStyleList maBgFillStyleList
;
108 LineStyleList maLineStyleList
;
109 EffectStyleList maEffectStyleList
;
110 FontScheme maFontScheme
;
114 css::uno::Reference
< css::xml::dom::XDocument
> mxFragment
;
118 } // namespace drawingml
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */