nss: upgrade to release 3.73
[LibreOffice.git] / xmloff / source / draw / sdxmlimp_impl.hxx
blobb033a6bb913c05f4859b32e047cf157bfed58263
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 #ifndef INCLUDED_XMLOFF_SOURCE_DRAW_SDXMLIMP_IMPL_HXX
21 #define INCLUDED_XMLOFF_SOURCE_DRAW_SDXMLIMP_IMPL_HXX
23 #include <com/sun/star/drawing/XDrawPage.hpp>
24 #include <com/sun/star/task/XStatusIndicator.hpp>
25 #include <xmloff/xmltkmap.hxx>
26 #include <com/sun/star/container/XNameAccess.hpp>
28 #include <map>
29 #include <memory>
30 #include <vector>
31 #include <xmloff/xmlimp.hxx>
33 class SvXMLUnitConverter;
34 class SvXMLTokenMap;
35 class SdXMLMasterStylesContext;
37 struct DateTimeDeclContextImpl
39 OUString maStrText;
40 bool mbFixed;
41 OUString maStrDateTimeFormat;
43 DateTimeDeclContextImpl() : mbFixed(true) {}
46 typedef std::map<OUString, OUString> HeaderFooterDeclMap;
47 typedef std::map<OUString, DateTimeDeclContextImpl> DateTimeDeclMap;
49 class SdXMLImport: public SvXMLImport
51 css::uno::Reference< css::container::XNameAccess > mxDocStyleFamilies;
52 css::uno::Reference< css::container::XIndexAccess > mxDocMasterPages;
53 css::uno::Reference< css::container::XIndexAccess > mxDocDrawPages;
54 css::uno::Reference< css::container::XNameAccess > mxPageLayouts;
56 // contexts for Style and AutoStyle import
57 rtl::Reference<SdXMLMasterStylesContext> mxMasterStylesContext;
59 sal_Int32 mnNewPageCount;
60 sal_Int32 mnNewMasterPageCount;
62 bool mbIsDraw;
63 bool mbLoadDoc;
64 bool mbPreview;
66 static constexpr OUStringLiteral gsPageLayouts = u"PageLayouts";
67 static constexpr OUStringLiteral gsPreview = u"Preview";
69 HeaderFooterDeclMap maHeaderDeclsMap;
70 HeaderFooterDeclMap maFooterDeclsMap;
71 DateTimeDeclMap maDateTimeDeclsMap;
73 protected:
75 // This method is called after the namespace map has been updated, but
76 // before a context for the current element has been pushed.
77 virtual SvXMLImportContext *CreateFastContext( sal_Int32 nElement,
78 const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList ) override;
80 public:
81 SdXMLImport(
82 const css::uno::Reference< css::uno::XComponentContext >& xContext,
83 OUString const & implementationName,
84 bool bIsDraw, SvXMLImportFlags nImportFlags );
86 // XImporter
87 virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override;
89 // XInitialization
90 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
92 virtual void SetViewSettings(const css::uno::Sequence<css::beans::PropertyValue>& aViewProps) override;
93 virtual void SetConfigurationSettings(const css::uno::Sequence<css::beans::PropertyValue>& aConfigProps) override;
95 // namespace office
96 // NB: in contrast to other CreateFooContexts, this particular one handles
97 // the root element (i.e. office:document-meta)
98 SvXMLImportContext* CreateMetaContext(const sal_Int32 nElement,
99 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList);
100 SvXMLStylesContext* CreateStylesContext();
101 SvXMLStylesContext* CreateAutoStylesContext();
102 SvXMLImportContext* CreateMasterStylesContext();
103 SvXMLImportContext *CreateFontDeclsContext();
105 // export local parameters concerning page access and similar
106 const css::uno::Reference< css::container::XNameAccess >& GetLocalDocStyleFamilies() const { return mxDocStyleFamilies; }
107 const css::uno::Reference< css::container::XIndexAccess >& GetLocalMasterPages() const { return mxDocMasterPages; }
108 const css::uno::Reference< css::container::XIndexAccess >& GetLocalDrawPages() const { return mxDocDrawPages; }
110 sal_Int32 GetNewPageCount() const { return mnNewPageCount; }
111 void IncrementNewPageCount() { mnNewPageCount++; }
112 sal_Int32 GetNewMasterPageCount() const { return mnNewMasterPageCount; }
113 void IncrementNewMasterPageCount() { mnNewMasterPageCount++; }
115 const css::uno::Reference< css::container::XNameAccess >& getPageLayouts() const { return mxPageLayouts; }
117 bool IsDraw() const { return mbIsDraw; }
118 bool IsImpress() const { return !mbIsDraw; }
120 virtual void SetStatistics(
121 const css::uno::Sequence< css::beans::NamedValue> & i_rStats) override;
123 bool IsPreview() const { return mbPreview; }
125 void AddHeaderDecl( const OUString& rName, const OUString& rText );
126 void AddFooterDecl( const OUString& rName, const OUString& rText );
127 void AddDateTimeDecl( const OUString& rName, const OUString& rText, bool bFixed, const OUString& rDateTimeFormat );
129 OUString GetHeaderDecl( const OUString& rName ) const;
130 OUString GetFooterDecl( const OUString& rName ) const;
131 OUString GetDateTimeDecl( const OUString& rName, bool& rbFixed, OUString& rDateTimeFormat );
133 virtual void NotifyContainsEmbeddedFont() override;
136 #endif // _SDXMLIMP_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */