Bump version to 24.04.3.4
[LibreOffice.git] / xmloff / source / draw / ximpstyl.hxx
blobb26e46eacd7c4172e12144a9d5766693916734cf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
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>
33 class SvNumberFormatter;
34 class SvXMLNumFmtHelper;
36 // special style:style context inside style:page-master context
38 class SdXMLPageMasterStyleContext: public SvXMLStyleContext
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;
48 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
49 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
51 public:
53 SdXMLPageMasterStyleContext(
54 SdXMLImport& rImport,
55 sal_Int32 nElement,
56 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
57 virtual ~SdXMLPageMasterStyleContext() override;
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; }
68 // style:page-master context
70 class SdXMLPageMasterContext: public SvXMLStyleContext
72 rtl::Reference<SdXMLPageMasterStyleContext> mxPageMasterStyle;
74 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
75 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
77 public:
79 SdXMLPageMasterContext(
80 SdXMLImport& rImport,
81 sal_Int32 nElement,
82 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
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;
87 const SdXMLPageMasterStyleContext* GetPageMasterStyle() const { return mxPageMasterStyle.get(); }
90 // style:masterpage context
92 class SdXMLMasterPageContext: public SdXMLGenericPageContext
94 OUString msName;
95 OUString msDisplayName;
97 public:
99 SdXMLMasterPageContext(
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;
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;
110 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
112 const OUString& GetDisplayName() const { return msDisplayName; }
116 // presentation:placeholder context
118 class SdXMLPresentationPlaceholderContext: public SvXMLImportContext
120 OUString msName;
121 sal_Int32 mnX;
123 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
124 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
126 public:
127 SdXMLPresentationPlaceholderContext(
128 SdXMLImport& rImport,
129 sal_Int32 nElement,
130 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
131 virtual ~SdXMLPresentationPlaceholderContext() override;
133 const OUString& GetName() const { return msName; }
134 sal_Int32 GetX() const { return mnX; }
137 // style:presentation-page-layout context
139 class SdXMLPresentationPageLayoutContext: public SvXMLStyleContext
141 std::vector< rtl::Reference< SdXMLPresentationPlaceholderContext > >
142 maList;
143 sal_uInt16 mnTypeId;
145 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
146 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
148 public:
150 SdXMLPresentationPageLayoutContext(
151 SdXMLImport& rImport,
152 sal_Int32 nElement,
153 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
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;
158 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
160 sal_uInt16 GetTypeId() const { return mnTypeId; }
163 // office:styles context
165 class SdXMLStylesContext : public SvXMLStylesContext
167 rtl::Reference< SvXMLImportPropertyMapper > xPresImpPropMapper;
168 bool mbIsAutoStyle;
169 std::unique_ptr<SvXMLNumFmtHelper> mpNumFmtHelper;
170 std::unique_ptr<SvNumberFormatter> mpNumFormatter;
172 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
173 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
175 void ImpSetGraphicStyles() const;
176 void ImpSetCellStyles() const;
177 void ImpSetGraphicStyles( css::uno::Reference< css::container::XNameAccess > const & xPageStyles,
178 XmlStyleFamily nFamily, std::u16string_view rPrefix) const;
180 protected:
181 using SvXMLStylesContext::CreateStyleChildContext;
182 virtual SvXMLStyleContext* CreateStyleChildContext(
183 sal_Int32 nElement,
184 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
186 using SvXMLStylesContext::CreateStyleStyleChildContext;
187 virtual SvXMLStyleContext *CreateStyleStyleChildContext(
188 XmlStyleFamily nFamily,
189 sal_Int32 nElement,
190 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
192 using SvXMLStylesContext::CreateDefaultStyleStyleChildContext;
193 virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
194 XmlStyleFamily nFamily,
195 sal_Int32 nElement,
196 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
197 public:
199 SdXMLStylesContext(
200 SdXMLImport& rImport,
201 bool bIsAutoStyle);
203 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
204 virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override;
206 void SetMasterPageStyles(SdXMLMasterPageContext const & rMaster) const;
208 css::uno::Reference< css::container::XNameAccess > getPageLayouts() const;
211 // office:master-styles context
213 class SdXMLMasterStylesContext : public SvXMLImportContext
215 std::vector< rtl::Reference< SdXMLMasterPageContext > > maMasterPageList;
217 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
218 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
220 public:
222 SdXMLMasterStylesContext(SdXMLImport& rImport);
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;
228 // <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl>
230 class SdXMLHeaderFooterDeclContext : public SvXMLStyleContext
232 public:
233 SdXMLHeaderFooterDeclContext( SvXMLImport& rImport,
234 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList );
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;
240 private:
241 OUString maStrName;
242 OUString maStrText;
243 OUString maStrDateTimeFormat;
244 bool mbFixed;
247 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */