1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/container/XIndexReplace.hpp>
23 #include <com/sun/star/uno/Reference.h>
24 #include <xmloff/xmlictxt.hxx>
25 #include "txthints.hxx"
27 namespace com::sun::star
{
28 namespace text
{ class XTextRange
; }
29 namespace xml::sax
{ class XAttributeList
; }
32 #define CONV_FROM_STAR_BATS 1
33 #define CONV_FROM_STAR_MATH 2
34 #define CONV_STAR_FONT_FLAGS_VALID 4
36 class XMLParaContext
: public SvXMLImportContext
38 css::uno::Reference
< css::text::XTextRange
> xStart
;
45 css::uno::Any m_aMarkerStyleName
;
47 sal_Int8 nOutlineLevel
;
48 std::optional
<XMLHints_Impl
> m_oHints
;
49 // Lost outline numbering in master document (#i73509#)
50 bool mbOutlineLevelAttrFound
;
51 bool mbOutlineContentVisible
;
52 bool bIgnoreLeadingSpace
;
56 sal_Int16 nStartValue
;
57 sal_uInt8 nStarFontsConvFlags
;
62 XMLParaContext( SvXMLImport
& rImport
,
64 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
);
66 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
68 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
69 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
71 virtual void SAL_CALL
characters( const OUString
& rChars
) override
;
75 class XMLNumberedParaContext
: public SvXMLImportContext
77 /// text:list-level MINUS 1
80 sal_Int16 m_StartValue
;
84 css::uno::Reference
< css::container::XIndexReplace
> m_xNumRules
;
89 XMLNumberedParaContext( SvXMLImport
& i_rImport
,
91 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & i_xAttrList
);
93 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
95 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
96 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
98 sal_Int16
GetLevel() const { return m_Level
; }
99 const css::uno::Reference
< css::container::XIndexReplace
>& GetNumRules() const
100 { return m_xNumRules
; }
101 const OUString
& GetListId() const { return m_ListId
; }
102 sal_Int16
GetStartValue() const { return m_StartValue
; }
107 class XMLStyleHint_Impl
;
109 class XMLImpSpanContext_Impl
: public SvXMLImportContext
111 XMLHints_Impl
& m_rHints
;
112 XMLStyleHint_Impl
*pHint
;
114 bool& rIgnoreLeadingSpace
;
116 sal_uInt8 nStarFontsConvFlags
;
121 XMLImpSpanContext_Impl(
122 SvXMLImport
& rImport
,
124 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
,
125 XMLHints_Impl
& rHints
,
127 sal_uInt8 nSFConvFlags
130 static css::uno::Reference
< css::xml::sax::XFastContextHandler
> CreateSpanContext(
131 SvXMLImport
& rImport
,
133 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
,
134 XMLHints_Impl
& rHints
,
136 sal_uInt8 nStarFontsConvFlags
= 0
139 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
140 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
142 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
143 virtual void SAL_CALL
characters( const OUString
& rChars
) override
;
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */