tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / xmloff / source / draw / ximpstyl.hxx
blob3b0bbe23703246bb64038f5d3d0821608f4b1017
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/numformat.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 <com/sun/star/drawing/XDrawPages2.hpp>
31 #include <memory>
32 #include <vector>
34 // special style:style context inside style:page-master context
36 class SdXMLPageMasterStyleContext: public SvXMLStyleContext
38 sal_Int32 mnBorderBottom;
39 sal_Int32 mnBorderLeft;
40 sal_Int32 mnBorderRight;
41 sal_Int32 mnBorderTop;
42 sal_Int32 mnWidth;
43 sal_Int32 mnHeight;
44 css::view::PaperOrientation meOrientation;
46 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
47 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
49 public:
51 SdXMLPageMasterStyleContext(
52 SdXMLImport& rImport,
53 sal_Int32 nElement,
54 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
55 virtual ~SdXMLPageMasterStyleContext() override;
57 sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
58 sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
59 sal_Int32 GetBorderRight() const { return mnBorderRight; }
60 sal_Int32 GetBorderTop() const { return mnBorderTop; }
61 sal_Int32 GetWidth() const { return mnWidth; }
62 sal_Int32 GetHeight() const { return mnHeight; }
63 css::view::PaperOrientation GetOrientation() const { return meOrientation; }
66 // style:page-master context
68 class SdXMLPageMasterContext: public SvXMLStyleContext
70 rtl::Reference<SdXMLPageMasterStyleContext> mxPageMasterStyle;
72 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
73 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
75 public:
77 SdXMLPageMasterContext(
78 SdXMLImport& rImport,
79 sal_Int32 nElement,
80 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
82 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
83 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
85 const SdXMLPageMasterStyleContext* GetPageMasterStyle() const { return mxPageMasterStyle.get(); }
88 // style:masterpage context
90 class SdXMLMasterPageContext: public SdXMLGenericPageContext
92 OUString msName;
93 OUString msDisplayName;
95 public:
97 // called for normal master page
98 SdXMLMasterPageContext(
99 SdXMLImport& rImport,
100 sal_Int32 nElement,
101 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
102 css::uno::Reference< css::drawing::XDrawPages2 > const & xMasterPages);
103 // Called for handout master page
104 SdXMLMasterPageContext(
105 SdXMLImport& rImport,
106 sal_Int32 nElement,
107 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
108 css::uno::Reference< css::drawing::XShapes > const & rShapes);
109 virtual ~SdXMLMasterPageContext() override;
111 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
112 sal_Int32 nElement,
113 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
115 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
117 const OUString& GetDisplayName() const { return msDisplayName; }
121 // presentation:placeholder context
123 class SdXMLPresentationPlaceholderContext: public SvXMLImportContext
125 OUString msName;
126 sal_Int32 mnX;
128 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
129 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
131 public:
132 SdXMLPresentationPlaceholderContext(
133 SdXMLImport& rImport,
134 sal_Int32 nElement,
135 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
136 virtual ~SdXMLPresentationPlaceholderContext() override;
138 const OUString& GetName() const { return msName; }
139 sal_Int32 GetX() const { return mnX; }
142 // style:presentation-page-layout context
144 class SdXMLPresentationPageLayoutContext: public SvXMLStyleContext
146 std::vector< rtl::Reference< SdXMLPresentationPlaceholderContext > >
147 maList;
148 sal_uInt16 mnTypeId;
150 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
151 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
153 public:
155 SdXMLPresentationPageLayoutContext(
156 SdXMLImport& rImport,
157 sal_Int32 nElement,
158 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
160 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
161 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
163 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
165 sal_uInt16 GetTypeId() const { return mnTypeId; }
168 // office:styles context
170 class SdXMLStylesContext : public SvXMLStylesContext
172 rtl::Reference< SvXMLImportPropertyMapper > xPresImpPropMapper;
173 bool mbIsAutoStyle;
174 std::unique_ptr<SvXMLNumFmtHelper> mpNumFmtHelper;
175 std::unique_ptr<SvNumberFormatter> mpNumFormatter;
177 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
178 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
180 void ImpSetGraphicStyles() const;
181 void ImpSetCellStyles() const;
182 void ImpSetGraphicStyles( css::uno::Reference< css::container::XNameAccess > const & xPageStyles,
183 XmlStyleFamily nFamily, const OUString& rPrefix) const;
185 protected:
186 using SvXMLStylesContext::CreateStyleChildContext;
187 virtual SvXMLStyleContext* CreateStyleChildContext(
188 sal_Int32 nElement,
189 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
191 using SvXMLStylesContext::CreateStyleStyleChildContext;
192 virtual SvXMLStyleContext *CreateStyleStyleChildContext(
193 XmlStyleFamily nFamily,
194 sal_Int32 nElement,
195 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
197 using SvXMLStylesContext::CreateDefaultStyleStyleChildContext;
198 virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext(
199 XmlStyleFamily nFamily,
200 sal_Int32 nElement,
201 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList) override;
202 public:
204 SdXMLStylesContext(
205 SdXMLImport& rImport,
206 bool bIsAutoStyle);
208 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
209 virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override;
211 void SetMasterPageStyles(SdXMLMasterPageContext const & rMaster) const;
213 css::uno::Reference< css::container::XNameAccess > getPageLayouts() const;
216 // office:master-styles context
218 class SdXMLMasterStylesContext : public SvXMLImportContext
220 std::vector< rtl::Reference< SdXMLMasterPageContext > > maMasterPageList;
222 const SdXMLImport& GetSdImport() const { return static_cast<const SdXMLImport&>(GetImport()); }
223 SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
225 public:
227 SdXMLMasterStylesContext(SdXMLImport& rImport);
229 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
230 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
233 // <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl>
235 class SdXMLHeaderFooterDeclContext : public SvXMLStyleContext
237 public:
238 SdXMLHeaderFooterDeclContext( SvXMLImport& rImport,
239 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList );
241 virtual bool IsTransient() const override;
242 virtual void SAL_CALL endFastElement(sal_Int32 ) override;
243 virtual void SAL_CALL characters( const OUString& rChars ) override;
245 private:
246 OUString maStrName;
247 OUString maStrText;
248 OUString maStrDateTimeFormat;
249 bool mbFixed;
252 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */