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 <xmloff/xmlictxt.hxx>
23 #include <rtl/ustrbuf.hxx>
24 #include <editeng/editdata.hxx>
25 #include "importcontext.hxx"
30 enum class XmlStyleFamily
;
31 namespace com::sun::star::drawing
{ class XShape
; }
32 namespace com::sun::star::drawing
{ class XShapes
; }
34 struct ScXMLAnnotationStyleEntry
36 XmlStyleFamily mnFamily
;
38 ESelection maSelection
;
40 ScXMLAnnotationStyleEntry( XmlStyleFamily nFam
, OUString aNam
, const ESelection
& rSel
) :
42 maName(std::move( aNam
)),
48 struct ScXMLAnnotationData
50 css::uno::Reference
< css::drawing::XShape
>
52 css::uno::Reference
< css::drawing::XShapes
>
55 OUString maCreateDate
;
56 OUString maSimpleText
;
61 std::vector
<ScXMLAnnotationStyleEntry
> maContentStyles
;
63 explicit ScXMLAnnotationData();
64 ~ScXMLAnnotationData();
67 class ScXMLAnnotationContext
: public ScXMLImportContext
71 ScXMLAnnotationContext( ScXMLImport
& rImport
,
73 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
,
74 ScXMLAnnotationData
& rAnnotationData
);
76 virtual ~ScXMLAnnotationContext() override
;
78 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
80 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
82 virtual void SAL_CALL
startFastElement(sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
84 virtual void SAL_CALL
characters( const OUString
& rChars
) override
;
86 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
89 const css::uno::Reference
< css::drawing::XShape
>& rxShape
,
90 const css::uno::Reference
< css::drawing::XShapes
>& rxShapes
,
91 const OUString
& rStyleName
, const OUString
& rTextStyle
);
93 void AddContentStyle( XmlStyleFamily nFamily
, const OUString
& rName
, const ESelection
& rSelection
);
96 ScXMLAnnotationData
& mrAnnotationData
;
97 OUStringBuffer maTextBuffer
;
98 OUStringBuffer maAuthorBuffer
;
99 OUStringBuffer maCreateDateBuffer
;
100 OUStringBuffer maCreateDateStringBuffer
;
101 std::unique_ptr
<SvXMLImportContext
> pShapeContext
;
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */