LibreOffice Module xmloff (master) 1
ximpstyl.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 <svl/zforlist.hxx>
23#include <xmloff/xmlictxt.hxx>
24#include <xmloff/xmlimppr.hxx>
25#include <xmloff/xmlnumfi.hxx>
26#include "sdxmlimp_impl.hxx"
27#include "ximppage.hxx"
28#include <xmloff/xmlstyle.hxx>
29#include <com/sun/star/view/PaperOrientation.hpp>
30#include <memory>
31#include <vector>
32
35
36// special style:style context inside style:page-master context
37
39{
40 sal_Int32 mnBorderBottom;
41 sal_Int32 mnBorderLeft;
42 sal_Int32 mnBorderRight;
43 sal_Int32 mnBorderTop;
44 sal_Int32 mnWidth;
45 sal_Int32 mnHeight;
46 css::view::PaperOrientation meOrientation;
47
48 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
49 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
50
51public:
52
54 SdXMLImport& rImport,
55 sal_Int32 nElement,
56 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
57 virtual ~SdXMLPageMasterStyleContext() override;
58
59 sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
60 sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
61 sal_Int32 GetBorderRight() const { return mnBorderRight; }
62 sal_Int32 GetBorderTop() const { return mnBorderTop; }
63 sal_Int32 GetWidth() const { return mnWidth; }
64 sal_Int32 GetHeight() const { return mnHeight; }
65 css::view::PaperOrientation GetOrientation() const { return meOrientation; }
66};
67
68// style:page-master context
69
71{
73
74 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
75 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
76
77public:
78
80 SdXMLImport& rImport,
81 sal_Int32 nElement,
82 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
83
84 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
85 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
86
88};
89
90// style:masterpage context
91
93{
94 OUString msName;
95 OUString msDisplayName;
96
97public:
98
100 SdXMLImport& rImport,
101 sal_Int32 nElement,
102 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
103 css::uno::Reference< css::drawing::XShapes > const & rShapes);
104 virtual ~SdXMLMasterPageContext() override;
105
106 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
107 sal_Int32 nElement,
108 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
109
110 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
111
112 const OUString& GetDisplayName() const { return msDisplayName; }
113
114};
115
116// presentation:placeholder context
117
119{
120 OUString msName;
121 sal_Int32 mnX;
122
123 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
124 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
125
126public:
128 SdXMLImport& rImport,
129 sal_Int32 nElement,
130 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
131 virtual ~SdXMLPresentationPlaceholderContext() override;
132
133 const OUString& GetName() const { return msName; }
134 sal_Int32 GetX() const { return mnX; }
135};
136
137// style:presentation-page-layout context
138
140{
141 std::vector< rtl::Reference< SdXMLPresentationPlaceholderContext > >
143 sal_uInt16 mnTypeId;
144
145 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
146 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
147
148public:
149
151 SdXMLImport& rImport,
152 sal_Int32 nElement,
153 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
154
155 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
156 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
157
158 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
159
160 sal_uInt16 GetTypeId() const { return mnTypeId; }
161};
162
163// office:styles context
164
166{
169 std::unique_ptr<SvXMLNumFmtHelper> mpNumFmtHelper;
170 std::unique_ptr<SvNumberFormatter> mpNumFormatter;
171
172 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
173 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
174
175 void ImpSetGraphicStyles() const;
176 void ImpSetCellStyles() const;
177 void ImpSetGraphicStyles( css::uno::Reference< css::container::XNameAccess > const & xPageStyles,
178 XmlStyleFamily nFamily, const OUString& rPrefix) const;
179
180protected:
183 sal_Int32 nElement,
184 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
185
188 XmlStyleFamily nFamily,
189 sal_Int32 nElement,
190 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
191
194 XmlStyleFamily nFamily,
195 sal_Int32 nElement,
196 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
197public:
198
200 SdXMLImport& rImport,
201 bool bIsAutoStyle);
202
203 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
205
206 void SetMasterPageStyles(SdXMLMasterPageContext const & rMaster) const;
207
208 css::uno::Reference< css::container::XNameAccess > getPageLayouts() const;
209};
210
211// office:master-styles context
212
214{
215 std::vector< rtl::Reference< SdXMLMasterPageContext > > maMasterPageList;
216
217 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
218 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
219
220public:
221
223
224 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
225 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
226};
227
228// <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl>
229
231{
232public:
234 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList );
235
236 virtual bool IsTransient() const override;
237 virtual void SAL_CALL endFastElement(sal_Int32 ) override;
238 virtual void SAL_CALL characters( const OUString& rChars ) override;
239
240private:
241 OUString maStrName;
242 OUString maStrText;
245};
246
247/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
Definition: ximpstyl.cxx:1457
virtual void SAL_CALL endFastElement(sal_Int32) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:1462
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
Definition: ximpstyl.cxx:1484
SdXMLHeaderFooterDeclContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:1431
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:821
virtual ~SdXMLMasterPageContext() override
Definition: ximpstyl.cxx:817
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: ximpstyl.cxx:835
SdXMLMasterPageContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpstyl.cxx:729
const OUString & GetDisplayName() const
Definition: ximpstyl.hxx:112
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:217
SdXMLMasterStylesContext(SdXMLImport &rImport)
Definition: ximpstyl.cxx:1358
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: ximpstyl.cxx:1364
SdXMLImport & GetSdImport()
Definition: ximpstyl.hxx:218
std::vector< rtl::Reference< SdXMLMasterPageContext > > maMasterPageList
Definition: ximpstyl.hxx:215
SdXMLPageMasterContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:414
rtl::Reference< SdXMLPageMasterStyleContext > mxPageMasterStyle
Definition: ximpstyl.hxx:72
const SdXMLPageMasterStyleContext * GetPageMasterStyle() const
Definition: ximpstyl.hxx:87
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: ximpstyl.cxx:425
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:74
SdXMLImport & GetSdImport()
Definition: ximpstyl.hxx:75
sal_Int32 GetBorderRight() const
Definition: ximpstyl.hxx:61
sal_Int32 GetBorderLeft() const
Definition: ximpstyl.hxx:60
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:48
css::view::PaperOrientation GetOrientation() const
Definition: ximpstyl.hxx:65
sal_Int32 GetBorderBottom() const
Definition: ximpstyl.hxx:59
virtual ~SdXMLPageMasterStyleContext() override
Definition: ximpstyl.cxx:409
sal_Int32 GetHeight() const
Definition: ximpstyl.hxx:64
sal_Int32 GetBorderTop() const
Definition: ximpstyl.hxx:62
css::view::PaperOrientation meOrientation
Definition: ximpstyl.hxx:46
sal_Int32 GetWidth() const
Definition: ximpstyl.hxx:63
SdXMLImport & GetSdImport()
Definition: ximpstyl.hxx:49
SdXMLPageMasterStyleContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:333
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:474
SdXMLPresentationPageLayoutContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:441
std::vector< rtl::Reference< SdXMLPresentationPlaceholderContext > > maList
Definition: ximpstyl.hxx:142
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:145
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: ximpstyl.cxx:452
SdXMLPresentationPlaceholderContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:680
const OUString & GetName() const
Definition: ximpstyl.hxx:133
virtual ~SdXMLPresentationPlaceholderContext() override
Definition: ximpstyl.cxx:724
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:123
std::unique_ptr< SvXMLNumFmtHelper > mpNumFmtHelper
Definition: ximpstyl.hxx:169
void ImpSetCellStyles() const
Definition: ximpstyl.cxx:1136
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:172
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpstyl.cxx:955
void SetMasterPageStyles(SdXMLMasterPageContext const &rMaster) const
Definition: ximpstyl.cxx:1096
void ImpSetGraphicStyles() const
Definition: ximpstyl.cxx:1122
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpstyl.cxx:975
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override
Definition: ximpstyl.cxx:991
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:1036
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpstyl.cxx:901
rtl::Reference< SvXMLImportPropertyMapper > xPresImpPropMapper
Definition: ximpstyl.hxx:167
SdXMLStylesContext(SdXMLImport &rImport, bool bIsAutoStyle)
Definition: ximpstyl.cxx:890
void ImpSetGraphicStyles(css::uno::Reference< css::container::XNameAccess > const &xPageStyles, XmlStyleFamily nFamily, const OUString &rPrefix) const
css::uno::Reference< css::container::XNameAccess > getPageLayouts() const
Definition: ximpstyl.cxx:1341
SdXMLImport & GetSdImport()
Definition: ximpstyl.hxx:173
std::unique_ptr< SvNumberFormatter > mpNumFormatter
Definition: ximpstyl.hxx:170
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:448
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:316
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:414
XmlStyleFamily
Definition: families.hxx:50