Revert "reduce symbol visibility in sw"
[LibreOffice.git] / sw / source / core / inc / SwXMLBlockImport.hxx
blob821033c1e1e5be2c07e54cec6b49e2f2d4b3c358
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 <xmloff/xmlimp.hxx>
23 #include <xmloff/xmlnamespace.hxx>
24 #include <xmloff/xmltoken.hxx>
25 #include <com/sun/star/xml/sax/FastToken.hpp>
26 #include <sax/fastattribs.hxx>
28 namespace com::sun::star::xml::sax { class XFastTokenHandler; }
30 using namespace css::xml::sax;
31 using namespace xmloff::token;
33 class SwXMLTextBlocks;
34 class SwXMLBlockListImport final : public SvXMLImport
36 private:
37 SwXMLTextBlocks &m_rBlockList;
39 // This method is called after the namespace map has been updated, but
40 // before a context for the current element has been pushed.
41 virtual SvXMLImportContext* CreateFastContext( sal_Int32 Element,
42 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
44 public:
45 SwXMLBlockListImport(
46 const css::uno::Reference< css::uno::XComponentContext >& rContext,
47 SwXMLTextBlocks &rBlocks );
49 SwXMLTextBlocks& getBlockList()
51 return m_rBlockList;
53 virtual ~SwXMLBlockListImport()
54 noexcept override;
57 class SwXMLTextBlockImport final : public SvXMLImport
59 // This method is called after the namespace map has been updated, but
60 // before a context for the current element has been pushed.
61 virtual SvXMLImportContext* CreateFastContext( sal_Int32 Element,
62 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
64 public:
65 bool m_bTextOnly;
66 OUString &m_rText;
67 SwXMLTextBlockImport(
68 const css::uno::Reference< css::uno::XComponentContext >& rContext,
69 OUString &rNewText, bool bNewTextOnly );
71 virtual ~SwXMLTextBlockImport()
72 noexcept override;
73 virtual void SAL_CALL endDocument() override;
76 enum SwXMLTextBlockToken : sal_Int32
78 OFFICE_BODY = FastToken::NAMESPACE | XML_NAMESPACE_OFFICE | XML_BODY,
79 OFFICE_TEXT = FastToken::NAMESPACE | XML_NAMESPACE_OFFICE | XML_TEXT,
80 OFFICE_DOCUMENT = FastToken::NAMESPACE | XML_NAMESPACE_OFFICE | XML_DOCUMENT,
81 OFFICE_DOCUMENT_CONTENT = FastToken::NAMESPACE | XML_NAMESPACE_OFFICE | XML_DOCUMENT_CONTENT,
82 TEXT_P = FastToken::NAMESPACE | XML_NAMESPACE_TEXT | XML_P
85 class SwXMLTextBlockTokenHandler final :
86 public sax_fastparser::FastTokenHandlerBase
88 public:
89 SwXMLTextBlockTokenHandler();
90 virtual ~SwXMLTextBlockTokenHandler() override;
92 //XFastTokenHandler
93 sal_Int32 SAL_CALL getTokenFromUTF8( const css::uno::Sequence< sal_Int8 >& Identifier ) override;
94 css::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 Token ) override;
96 //Much fast direct C++ shortcut to the method that matters
97 virtual sal_Int32 getTokenDirect( const char *pTag, sal_Int32 nLength ) const override;
100 enum SwXMLBlockListToken : sal_Int32
102 ABBREVIATED_NAME = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_ABBREVIATED_NAME,
103 BLOCK = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_BLOCK,
104 BLOCK_LIST = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_BLOCK_LIST,
105 LIST_NAME = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_LIST_NAME,
106 NAME = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_NAME,
107 PACKAGE_NAME = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_PACKAGE_NAME,
108 UNFORMATTED_TEXT = FastToken::NAMESPACE | XML_NAMESPACE_BLOCKLIST | XML_UNFORMATTED_TEXT
111 class SwXMLBlockListTokenHandler final :
112 public sax_fastparser::FastTokenHandlerBase
114 public:
115 SwXMLBlockListTokenHandler();
116 virtual ~SwXMLBlockListTokenHandler() override;
118 //XFastTokenHandler
119 sal_Int32 SAL_CALL getTokenFromUTF8( const css::uno::Sequence< sal_Int8 >& Identifier ) override;
120 css::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 Token ) override;
122 //Much fast direct C++ shortcut to the method that matters
123 virtual sal_Int32 getTokenDirect( const char *pTag, sal_Int32 nLength ) const override;
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */