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>
29#include <xmloff/txtstyli.hxx>
30#include "xmlimprt.hxx"
31
33
35{
36protected:
37
38public:
39
42 SvXMLImport& rImport);
43 virtual ~ScXMLCellImportPropertyMapper() override;
44
46 virtual void finished(
47 ::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const override;
48};
49
51{
52protected:
53
54public:
55
58 SvXMLImport& rImport);
59 virtual ~ScXMLRowImportPropertyMapper() override;
60
62 virtual void finished(
63 ::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const override;
64};
65
67{
69 OUString sPageStyle;
71 sal_Int32 nNumberFormat;
76
77 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
78 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
79
80protected:
81
82 virtual void SetAttribute( sal_Int32 nElement,
83 const OUString& rValue ) override;
84
85public:
86
88 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle = false );
89 virtual ~XMLTableStyleContext() override;
90
91 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
92 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
93
94 virtual void FillPropertySet(const css::uno::Reference<
95 css::beans::XPropertySet > & rPropSet ) override;
96
97 virtual void SetDefaults() override;
98
99 void AddProperty(sal_Int16 nContextID, const css::uno::Any& aValue);
100 XMLPropertyState* FindProperty(const sal_Int16 nContextID);
101
102 sal_Int32 GetNumberFormat();// { return nNumberFormat; }
103
104 SCTAB GetLastSheet() const { return nLastSheet; }
105 void SetLastSheet(SCTAB nNew) { nLastSheet = nNew; }
106
107 void ApplyCondFormat( const css::uno::Sequence<css::table::CellRangeAddress>& xCellRanges );
108
109private:
111};
112
114{
115 css::uno::Reference< css::container::XNameContainer > xCellStyles;
116 css::uno::Reference< css::container::XNameContainer > xColumnStyles;
117 css::uno::Reference< css::container::XNameContainer > xRowStyles;
118 css::uno::Reference< css::container::XNameContainer > xTableStyles;
119 css::uno::Reference< css::container::XNameContainer > xGraphicStyles;
125
130
131 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
132 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
133
134protected:
135
136 // Create a style context.
139 XmlStyleFamily nFamily,
140 sal_Int32 nElement,
141 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
142
145 XmlStyleFamily nFamily, sal_Int32 nElement,
146 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
147
148public:
149
151 virtual ~XMLTableStylesContext() override;
152
153 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
154
156 XmlStyleFamily nFamily ) const override;
157 virtual css::uno::Reference< css::container::XNameContainer >
158 GetStylesContainer( XmlStyleFamily nFamily ) const override;
159 virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override;
160
161 sal_Int32 GetIndex(const sal_Int16 nContextID);
162};
163
165{
166protected:
167 virtual SvXMLStyleContext *CreateStyleChildContext( sal_Int32 nElement,
168 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
169
172 sal_Int32 nElement,
173 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
174
175 virtual bool InsertStyleFamily( XmlStyleFamily nFamily ) const override;
176
177public:
178
180
181 virtual ~ScXMLMasterStylesContext() override;
182 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
183};
184
186{
187 css::uno::Reference<css::beans::XPropertySet> xPropSet;
190
191 void ClearContent(const OUString& rContent);
192public:
193
194
195 ScMasterPageContext( SvXMLImport& rImport, sal_Int32 nElement,
196 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
197 bool bOverwrite );
198 virtual ~ScMasterPageContext() override;
199
201 sal_Int32 nElement,
202 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
203 const bool bFooter,
204 const bool bLeft,
205 const bool bFirst ) override;
206
207 virtual void Finish( bool bOverwrite ) override;
208};
209
211{
212 sal_Int32 nLastSheet;
213
214 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
215 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
216
217public:
219 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily );
220 virtual ~ScCellTextStyleContext() override;
221
222 // override FillPropertySet to store style information
223 virtual void FillPropertySet(
224 const css::uno::Reference< css::beans::XPropertySet > & rPropSet ) override;
225};
226
228{
230 void Finish(bool bOverwrite) override;
231};
232
233/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:214
ScCellTextStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily)
Definition: xmlstyli.cxx:1013
ScXMLImport & GetScImport()
Definition: xmlstyli.hxx:215
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: xmlstyli.cxx:1024
virtual ~ScCellTextStyleContext() override
Definition: xmlstyli.cxx:1020
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:963
void ClearContent(const OUString &rContent)
Definition: xmlstyli.cxx:986
ScMasterPageContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, bool bOverwrite)
Definition: xmlstyli.cxx:949
virtual ~ScMasterPageContext() override
Definition: xmlstyli.cxx:959
css::uno::Reference< css::beans::XPropertySet > xPropSet
Definition: xmlstyli.hxx:187
virtual void Finish(bool bOverwrite) override
Definition: xmlstyli.cxx:1004
void Finish(bool bOverwrite) override
Definition: xmlstyli.cxx:1063
ScXMLCellImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImport)
Definition: xmlstyli.cxx:68
virtual ~ScXMLCellImportPropertyMapper() override
Definition: xmlstyli.cxx:75
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:79
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:918
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlstyli.cxx:943
ScXMLMasterStylesContext(SvXMLImport &rImport)
Definition: xmlstyli.cxx:909
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:935
virtual bool InsertStyleFamily(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:904
virtual ~ScXMLMasterStylesContext() override
Definition: xmlstyli.cxx:914
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:220
ScXMLRowImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImport)
Definition: xmlstyli.cxx:209
virtual ~ScXMLRowImportPropertyMapper() override
Definition: xmlstyli.cxx:216
SvXMLImport & GetImport()
friend friend class SvXMLImport
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)
XMLShapeStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily)
OUString sDataStyleName
Definition: xmlstyli.hxx:68
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:443
void ApplyCondFormat(const css::uno::Sequence< css::table::CellRangeAddress > &xCellRanges)
Definition: xmlstyli.cxx:475
void AddProperty(sal_Int16 nContextID, const css::uno::Any &aValue)
Definition: xmlstyli.cxx:558
SCTAB GetLastSheet() const
Definition: xmlstyli.hxx:104
XMLPropertyState * FindProperty(const sal_Int16 nContextID)
Definition: xmlstyli.cxx:569
void SetLastSheet(SCTAB nNew)
Definition: xmlstyli.hxx:105
ScXMLImport & GetScImport()
Definition: xmlstyli.hxx:78
virtual void SetDefaults() override
Definition: xmlstyli.cxx:544
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: xmlstyli.cxx:519
ScConditionalFormat * mpCondFormat
Definition: xmlstyli.hxx:74
SvXMLStylesContext * pStyles
Definition: xmlstyli.hxx:70
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: xmlstyli.cxx:408
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:77
XMLTableStyleContext(ScXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false)
Definition: xmlstyli.cxx:425
sal_Int32 GetNumberFormat()
Definition: xmlstyli.cxx:590
sal_Int32 nNumberFormat
Definition: xmlstyli.hxx:71
virtual ~XMLTableStyleContext() override
Definition: xmlstyli.cxx:437
sal_Int32 nMasterPageNameIndex
Definition: xmlstyli.hxx:123
css::uno::Reference< css::container::XNameContainer > xRowStyles
Definition: xmlstyli.hxx:117
ScXMLImport & GetScImport()
Definition: xmlstyli.hxx:132
sal_Int32 nConditionalFormatIndex
Definition: xmlstyli.hxx:121
sal_Int32 nCellStyleIndex
Definition: xmlstyli.hxx:122
sal_Int32 nNumberFormatIndex
Definition: xmlstyli.hxx:120
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:747
rtl::Reference< SvXMLImportPropertyMapper > xTableImpPropMapper
Definition: xmlstyli.hxx:129
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlstyli.cxx:686
rtl::Reference< SvXMLImportPropertyMapper > xRowImpPropMapper
Definition: xmlstyli.hxx:128
virtual ~XMLTableStylesContext() override
Definition: xmlstyli.cxx:682
XMLTableStylesContext(SvXMLImport &rImport, bool bAutoStyles)
Definition: xmlstyli.cxx:671
css::uno::Reference< css::container::XNameContainer > xColumnStyles
Definition: xmlstyli.hxx:116
virtual OUString GetServiceName(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:841
css::uno::Reference< css::container::XNameContainer > xCellStyles
Definition: xmlstyli.hxx:115
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:645
css::uno::Reference< css::container::XNameContainer > xTableStyles
Definition: xmlstyli.hxx:118
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:695
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:614
sal_Int32 GetIndex(const sal_Int16 nContextID)
Definition: xmlstyli.cxx:869
css::uno::Reference< css::container::XNameContainer > xGraphicStyles
Definition: xmlstyli.hxx:119
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:131
rtl::Reference< SvXMLImportPropertyMapper > xCellImpPropMapper
Definition: xmlstyli.hxx:126
rtl::Reference< SvXMLImportPropertyMapper > xColumnImpPropMapper
Definition: xmlstyli.hxx:127
XmlStyleFamily
sal_Int16 SCTAB
Definition: types.hxx:22