LibreOffice Module sc (master) 1
xmlstyli.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <rtl/ustring.hxx>
23#include <vector>
24#include <xmloff/xmlictxt.hxx>
25#include <xmloff/prstylei.hxx>
26#include <xmloff/xmlimppr.hxx>
28#include <xmloff/txtstyli.hxx>
29#include "xmlimprt.hxx"
30
32
34{
35protected:
36
37public:
38
42 virtual ~ScXMLCellImportPropertyMapper() override;
43
45 virtual void finished(
46 ::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const override;
47};
48
50{
51protected:
52
53public:
54
58 virtual ~ScXMLRowImportPropertyMapper() override;
59
61 virtual void finished(
62 ::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const override;
63};
64
66{
68 OUString sPageStyle;
70 sal_Int32 nNumberFormat;
75
76 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
77 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
78
79protected:
80
81 virtual void SetAttribute( sal_Int32 nElement,
82 const OUString& rValue ) override;
83
84public:
85
87 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle = false );
88 virtual ~XMLTableStyleContext() override;
89
90 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
91 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
92
93 virtual void FillPropertySet(const css::uno::Reference<
94 css::beans::XPropertySet > & rPropSet ) override;
95
96 virtual void SetDefaults() override;
97
98 void AddProperty(sal_Int16 nContextID, const css::uno::Any& aValue);
99 XMLPropertyState* FindProperty(const sal_Int16 nContextID);
100
101 sal_Int32 GetNumberFormat();// { return nNumberFormat; }
102
103 SCTAB GetLastSheet() const { return nLastSheet; }
104 void SetLastSheet(SCTAB nNew) { nLastSheet = nNew; }
105
106 void ApplyCondFormat( const css::uno::Sequence<css::table::CellRangeAddress>& xCellRanges );
107
108private:
110};
111
113{
114 css::uno::Reference< css::container::XNameContainer > xCellStyles;
115 css::uno::Reference< css::container::XNameContainer > xColumnStyles;
116 css::uno::Reference< css::container::XNameContainer > xRowStyles;
117 css::uno::Reference< css::container::XNameContainer > xTableStyles;
123
128
129 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
130 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
131
132protected:
133
134 // Create a style context.
137 XmlStyleFamily nFamily,
138 sal_Int32 nElement,
139 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
140
143 XmlStyleFamily nFamily, sal_Int32 nElement,
144 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
145
146public:
147
149 virtual ~XMLTableStylesContext() override;
150
151 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
152
154 XmlStyleFamily nFamily ) const override;
155 virtual css::uno::Reference< css::container::XNameContainer >
156 GetStylesContainer( XmlStyleFamily nFamily ) const override;
157 virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override;
158
159 sal_Int32 GetIndex(const sal_Int16 nContextID);
160};
161
163{
164protected:
165 virtual SvXMLStyleContext *CreateStyleChildContext( sal_Int32 nElement,
166 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
167
170 sal_Int32 nElement,
171 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
172
173 virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const override;
174
175public:
176
178
179 virtual ~ScXMLMasterStylesContext() override;
180 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
181};
182
184{
185 css::uno::Reference<css::beans::XPropertySet> xPropSet;
188
189 void ClearContent(const OUString& rContent);
190public:
191
192
193 ScMasterPageContext( SvXMLImport& rImport, sal_Int32 nElement,
194 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
195 bool bOverwrite );
196 virtual ~ScMasterPageContext() override;
197
199 sal_Int32 nElement,
200 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
201 const bool bFooter,
202 const bool bLeft,
203 const bool bFirst ) override;
204
205 virtual void Finish( bool bOverwrite ) override;
206};
207
209{
210 sal_Int32 nLastSheet;
211
212 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
213 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
214
215public:
217 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily );
218 virtual ~ScCellTextStyleContext() override;
219
220 // override FillPropertySet to store style information
221 virtual void FillPropertySet(
222 const css::uno::Reference< css::beans::XPropertySet > & rPropSet ) override;
223};
224
225/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:212
ScCellTextStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily)
Definition: xmlstyli.cxx:987
ScXMLImport & GetScImport()
Definition: xmlstyli.hxx:213
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: xmlstyli.cxx:998
virtual ~ScCellTextStyleContext() override
Definition: xmlstyli.cxx:994
virtual SvXMLImportContext * CreateHeaderFooterContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const bool bFooter, const bool bLeft, const bool bFirst) override
Definition: xmlstyli.cxx:937
void ClearContent(const OUString &rContent)
Definition: xmlstyli.cxx:960
ScMasterPageContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, bool bOverwrite)
Definition: xmlstyli.cxx:923
virtual ~ScMasterPageContext() override
Definition: xmlstyli.cxx:933
css::uno::Reference< css::beans::XPropertySet > xPropSet
Definition: xmlstyli.hxx:185
virtual void Finish(bool bOverwrite) override
Definition: xmlstyli.cxx:978
ScXMLCellImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImport)
Definition: xmlstyli.cxx:63
virtual ~ScXMLCellImportPropertyMapper() override
Definition: xmlstyli.cxx:70
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const override
This method is called when all attributes have been processed.
Definition: xmlstyli.cxx:74
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:892
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlstyli.cxx:917
ScXMLMasterStylesContext(SvXMLImport &rImport)
Definition: xmlstyli.cxx:883
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:909
virtual bool InsertStyleFamily(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:878
virtual ~ScXMLMasterStylesContext() override
Definition: xmlstyli.cxx:888
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const override
This method is called when all attributes have been processed.
Definition: xmlstyli.cxx:215
ScXMLRowImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImport)
Definition: xmlstyli.cxx:204
virtual ~ScXMLRowImportPropertyMapper() override
Definition: xmlstyli.cxx:211
SvXMLImport & GetImport()
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
void SetStyle(const css::uno::Reference< css::style::XStyle > &xStl)
OUString sDataStyleName
Definition: xmlstyli.hxx:67
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: xmlstyli.cxx:434
void ApplyCondFormat(const css::uno::Sequence< css::table::CellRangeAddress > &xCellRanges)
Definition: xmlstyli.cxx:466
void AddProperty(sal_Int16 nContextID, const css::uno::Any &aValue)
Definition: xmlstyli.cxx:549
SCTAB GetLastSheet() const
Definition: xmlstyli.hxx:103
XMLPropertyState * FindProperty(const sal_Int16 nContextID)
Definition: xmlstyli.cxx:560
void SetLastSheet(SCTAB nNew)
Definition: xmlstyli.hxx:104
ScXMLImport & GetScImport()
Definition: xmlstyli.hxx:77
virtual void SetDefaults() override
Definition: xmlstyli.cxx:535
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: xmlstyli.cxx:510
ScConditionalFormat * mpCondFormat
Definition: xmlstyli.hxx:73
SvXMLStylesContext * pStyles
Definition: xmlstyli.hxx:69
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: xmlstyli.cxx:399
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:76
XMLTableStyleContext(ScXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false)
Definition: xmlstyli.cxx:416
sal_Int32 GetNumberFormat()
Definition: xmlstyli.cxx:581
sal_Int32 nNumberFormat
Definition: xmlstyli.hxx:70
virtual ~XMLTableStyleContext() override
Definition: xmlstyli.cxx:428
sal_Int32 nMasterPageNameIndex
Definition: xmlstyli.hxx:121
css::uno::Reference< css::container::XNameContainer > xRowStyles
Definition: xmlstyli.hxx:116
ScXMLImport & GetScImport()
Definition: xmlstyli.hxx:130
sal_Int32 nConditionalFormatIndex
Definition: xmlstyli.hxx:119
sal_Int32 nCellStyleIndex
Definition: xmlstyli.hxx:120
sal_Int32 nNumberFormatIndex
Definition: xmlstyli.hxx:118
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:735
rtl::Reference< SvXMLImportPropertyMapper > xTableImpPropMapper
Definition: xmlstyli.hxx:127
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlstyli.cxx:674
rtl::Reference< SvXMLImportPropertyMapper > xRowImpPropMapper
Definition: xmlstyli.hxx:126
virtual ~XMLTableStylesContext() override
Definition: xmlstyli.cxx:670
XMLTableStylesContext(SvXMLImport &rImport, bool bAutoStyles)
Definition: xmlstyli.cxx:659
css::uno::Reference< css::container::XNameContainer > xColumnStyles
Definition: xmlstyli.hxx:115
virtual OUString GetServiceName(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:818
css::uno::Reference< css::container::XNameContainer > xCellStyles
Definition: xmlstyli.hxx:114
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:634
css::uno::Reference< css::container::XNameContainer > xTableStyles
Definition: xmlstyli.hxx:117
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:683
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:605
sal_Int32 GetIndex(const sal_Int16 nContextID)
Definition: xmlstyli.cxx:843
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:129
rtl::Reference< SvXMLImportPropertyMapper > xCellImpPropMapper
Definition: xmlstyli.hxx:124
rtl::Reference< SvXMLImportPropertyMapper > xColumnImpPropMapper
Definition: xmlstyli.hxx:125
XmlStyleFamily
sal_Int16 SCTAB
Definition: types.hxx:22