bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / xmloff / xmlictxt.hxx
blobbc3943cefb6aa8f11109c162b81c45c3d330fe2b
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_XMLICTXT_HXX
21 #define INCLUDED_XMLOFF_XMLICTXT_HXX
23 #include <sal/config.h>
24 #include <xmloff/dllapi.h>
25 #include <sal/types.h>
26 #include <com/sun/star/xml/sax/XFastContextHandler.hpp>
27 #include <rtl/ustring.hxx>
28 #include <cppuhelper/implbase.hxx>
29 #include <xmloff/nmspmap.hxx>
30 #include <memory>
32 namespace com { namespace sun { namespace star { namespace xml { namespace sax { class XAttributeList; } } } } }
34 class SvXMLImport;
36 class SvXMLImportContext;
38 typedef rtl::Reference<SvXMLImportContext> SvXMLImportContextRef;
40 class XMLOFF_DLLPUBLIC SvXMLImportContext : public cppu::WeakImplHelper< css::xml::sax::XFastContextHandler >
42 friend class SvXMLImport;
44 SvXMLImport& mrImport;
46 sal_uInt16 const mnPrefix;
47 OUString const maLocalName;
49 std::unique_ptr<SvXMLNamespaceMap> m_pRewindMap;
51 SAL_DLLPRIVATE std::unique_ptr<SvXMLNamespaceMap> TakeRewindMap() { return std::move(m_pRewindMap); }
52 SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr<SvXMLNamespaceMap> p) { m_pRewindMap = std::move(p); }
54 protected:
56 SvXMLImport& GetImport() { return mrImport; }
57 const SvXMLImport& GetImport() const { return mrImport; }
59 public:
61 sal_uInt16 GetPrefix() const { return mnPrefix; }
62 const OUString& GetLocalName() const { return maLocalName; }
64 /** A contexts constructor does anything that is required if an element
65 * starts. Namespace processing has been done already.
66 * Note that virtual methods cannot be used inside constructors. Use
67 * StartElement instead if this is required. */
68 SvXMLImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
69 const OUString& rLName );
71 SvXMLImportContext( SvXMLImport& rImport );
73 /** A contexts destructor does anything that is required if an element
74 * ends. By default, nothing is done.
75 * Note that virtual methods cannot be used inside destructors. Use
76 * EndElement instead if this is required. */
77 virtual ~SvXMLImportContext() override;
79 /** Create a children element context. By default, the import's
80 * CreateContext method is called to create a new default context. */
81 virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
82 const OUString& rLocalName,
83 const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList );
85 /** StartElement is called after a context has been constructed and
86 * before a elements context is parsed. It may be used for actions that
87 * require virtual methods. The default is to do nothing. */
88 virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList );
90 /** EndElement is called before a context will be destructed, but
91 * after a elements context has been parsed. It may be used for actions
92 * that require virtual methods. The default is to do nothing. */
93 virtual void EndElement();
95 /** This method is called for all characters that are contained in the
96 * current element. The default is to ignore them. */
97 virtual void Characters( const OUString& rChars );
99 // css::xml::sax::XFastContextHandler:
100 virtual void SAL_CALL startFastElement (sal_Int32 Element,
101 const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs) override;
103 virtual void SAL_CALL startUnknownElement(const OUString & Namespace, const OUString & Name,
104 const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) override;
106 virtual void SAL_CALL endFastElement(sal_Int32 Element) override;
108 virtual void SAL_CALL endUnknownElement(const OUString & Namespace, const OUString & Name) override;
110 virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element,
111 const css::uno::Reference<css::xml::sax::XFastAttributeList>& Attribs) override;
113 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext(
114 const OUString & Namespace, const OUString & Name,
115 const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs) override;
117 virtual void SAL_CALL characters(const OUString & aChars) override;
120 #endif // INCLUDED_XMLOFF_XMLICTXT_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */