update dev300-m58
[ooovba.git] / writerfilter / source / dmapper / StyleSheetTable.hxx
blob2cab5544bce95ad638d60945936eefcf5912bbcb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: StyleSheetTable.hxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_STYLESHEETTABLE_HXX
31 #define INCLUDED_STYLESHEETTABLE_HXX
33 #include <WriterFilterDllApi.hxx>
34 #include <dmapper/DomainMapper.hxx>
35 #include <com/sun/star/lang/XComponent.hpp>
36 #include <PropertyMap.hxx>
37 #include <FontTable.hxx>
38 #include <resourcemodel/WW8ResourceModel.hxx>
40 namespace com{ namespace sun { namespace star { namespace text{
41 class XTextDocument;
42 }}}}
44 namespace writerfilter {
45 namespace dmapper
49 enum StyleType
51 STYLE_TYPE_UNKNOWN,
52 STYLE_TYPE_PARA,
53 STYLE_TYPE_CHAR,
54 STYLE_TYPE_TABLE,
55 STYLE_LIST
58 struct StyleSheetTable_Impl;
59 struct StyleSheetEntry
61 ::rtl::OUString sStyleIdentifierI;
62 ::rtl::OUString sStyleIdentifierD;
63 bool bIsDefaultStyle;
64 bool bInvalidHeight;
65 bool bHasUPE; //universal property expansion
66 StyleType nStyleTypeCode; //sgc
67 ::rtl::OUString sBaseStyleIdentifier;
68 ::rtl::OUString sNextStyleIdentifier;
69 ::rtl::OUString sStyleName;
70 ::rtl::OUString sStyleName1;
71 PropertyMapPtr pProperties;
72 ::rtl::OUString sConvertedStyleName;
73 StyleSheetEntry();
75 class DomainMapper;
76 class WRITERFILTER_DLLPRIVATE StyleSheetTable :
77 public Properties,
78 public Table
80 StyleSheetTable_Impl *m_pImpl;
82 public:
83 StyleSheetTable( DomainMapper& rDMapper,
84 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextDocument> xTextDocument );
85 virtual ~StyleSheetTable();
87 // Properties
88 virtual void attribute(Id Name, Value & val);
89 virtual void sprm(Sprm & sprm);
91 // Table
92 virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref);
94 void ApplyStyleSheets( FontTablePtr rFontTable );
95 const StyleSheetEntry* FindStyleSheetByISTD(const ::rtl::OUString& sIndex);
96 const StyleSheetEntry* FindStyleSheetByStyleName(const ::rtl::OUString& rIndex);
97 const StyleSheetEntry* FindStyleSheetByConvertedStyleName(const ::rtl::OUString& rIndex);
98 // returns the parent of the one with the given name - if empty the parent of the current style sheet is returned
99 const StyleSheetEntry* FindParentStyleSheet(::rtl::OUString sBaseStyle);
101 ::rtl::OUString ConvertStyleName( const ::rtl::OUString& rWWName, bool bExtendedSearch = false );
102 ::rtl::OUString GetStyleIdFromIndex(const sal_uInt32 sti);
104 ::rtl::OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties );
106 private:
107 void resolveAttributeProperties(Value & val);
108 void resolveSprmProps(Sprm & sprm_);
109 void applyDefaults(bool bParaProperties);
111 typedef boost::shared_ptr< StyleSheetTable > StyleSheetTablePtr;
115 #endif //