xref: /aoo4110/main/oox/inc/oox/drawingml/theme.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef OOX_DRAWINGML_THEME_HXX
25 #define OOX_DRAWINGML_THEME_HXX
26 
27 #include "oox/drawingml/clrscheme.hxx"
28 #include "oox/drawingml/shape.hxx"
29 #include "oox/drawingml/textfont.hxx"
30 
31 namespace oox {
32 namespace drawingml {
33 
34 // ============================================================================
35 
36 const sal_Int32 THEMED_STYLE_SUBTLE     = 1;
37 const sal_Int32 THEMED_STYLE_MODERATE   = 2;
38 const sal_Int32 THEMED_STYLE_INTENSE    = 3;
39 
40 typedef RefVector< FillProperties >                     FillStyleList;
41 typedef RefVector< LineProperties >                     LineStyleList;
42 typedef RefVector< PropertyMap >                        EffectStyleList;
43 typedef RefMap< sal_Int32, TextCharacterProperties >    FontScheme;
44 
45 // ============================================================================
46 
47 class Theme
48 {
49 public:
50     explicit            Theme();
51                         ~Theme();
52 
setStyleName(const::rtl::OUString & rStyleName)53     inline void                     setStyleName( const ::rtl::OUString& rStyleName ) { maStyleName = rStyleName; }
getStyleName() const54     inline const ::rtl::OUString&   getStyleName() const { return maStyleName; }
55 
getClrScheme()56     inline ClrScheme&               getClrScheme() { return maClrScheme; }
getClrScheme() const57     inline const ClrScheme&         getClrScheme() const { return maClrScheme; }
58 
getFillStyleList()59     inline FillStyleList&           getFillStyleList() { return maFillStyleList; }
getFillStyleList() const60     inline const FillStyleList&     getFillStyleList() const { return maFillStyleList; }
getBgFillStyleList()61     inline FillStyleList&           getBgFillStyleList() { return maBgFillStyleList; }
getBgFillStyleList() const62     inline const FillStyleList&     getBgFillStyleList() const { return maBgFillStyleList; }
63     /** Returns the fill properties of the passed one-based themed style index. */
64     const FillProperties*           getFillStyle( sal_Int32 nIndex ) const;
65 
getLineStyleList()66     inline LineStyleList&           getLineStyleList() { return maLineStyleList; }
getLineStyleList() const67     inline const LineStyleList&     getLineStyleList() const { return maLineStyleList; }
68     /** Returns the line properties of the passed one-based themed style index. */
69     const LineProperties*           getLineStyle( sal_Int32 nIndex ) const;
70 
getEffectStyleList()71     inline EffectStyleList&         getEffectStyleList() { return maEffectStyleList; }
getEffectStyleList() const72     inline const EffectStyleList&   getEffectStyleList() const { return maEffectStyleList; }
73     /** Returns the effect properties of the passed one-based themed style index. */
74     const PropertyMap*              getEffectStyle( sal_Int32 nIndex ) const;
75 
getFontScheme()76     inline FontScheme&              getFontScheme() { return maFontScheme; }
getFontScheme() const77     inline const FontScheme&        getFontScheme() const { return maFontScheme; }
78     /** Returns theme font properties by scheme type (major/minor). */
79     const TextCharacterProperties*  getFontStyle( sal_Int32 nSchemeType ) const;
80     /** Returns theme font by placeholder name, e.g. the major latin theme font for the font name '+mj-lt'. */
81     const TextFont*                 resolveFont( const ::rtl::OUString& rName ) const;
82 
getSpDef()83     inline Shape&                   getSpDef() { return maSpDef; }
getSpDef() const84     inline const Shape&             getSpDef() const { return maSpDef; }
85 
getLnDef()86     inline Shape&                   getLnDef() { return maLnDef; }
getLnDef() const87     inline const Shape&             getLnDef() const { return maLnDef; }
88 
getTxDef()89     inline Shape&                   getTxDef() { return maTxDef; }
getTxDef() const90     inline const Shape&             getTxDef() const { return maTxDef; }
91 
92 private:
93     ::rtl::OUString     maStyleName;
94     ClrScheme           maClrScheme;
95     FillStyleList       maFillStyleList;
96     FillStyleList       maBgFillStyleList;
97     LineStyleList       maLineStyleList;
98     EffectStyleList     maEffectStyleList;
99     FontScheme          maFontScheme;
100     Shape               maSpDef;
101     Shape               maLnDef;
102     Shape               maTxDef;
103 };
104 
105 // ============================================================================
106 
107 } // namespace drawingml
108 } // namespace oox
109 
110 #endif
111 
112