Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / xml / xmlannoi.hxx
blob22f8576d2b3f2aea75dad9626e5c19dd96b3bd47
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 .
19 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_XMLANNOI_HXX
20 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLANNOI_HXX
22 #include <xmloff/xmlictxt.hxx>
23 #include <rtl/ustrbuf.hxx>
24 #include <editeng/editdata.hxx>
25 #include "importcontext.hxx"
27 #include <vector>
29 class ScXMLImport;
30 namespace com { namespace sun { namespace star { namespace drawing { class XShape; } } } }
31 namespace com { namespace sun { namespace star { namespace drawing { class XShapes; } } } }
33 struct ScXMLAnnotationStyleEntry
35 sal_uInt16 const mnFamily;
36 OUString const maName;
37 ESelection const maSelection;
39 ScXMLAnnotationStyleEntry( sal_uInt16 nFam, const OUString& rNam, const ESelection& rSel ) :
40 mnFamily( nFam ),
41 maName( rNam ),
42 maSelection( rSel )
47 struct ScXMLAnnotationData
49 css::uno::Reference< css::drawing::XShape >
50 mxShape;
51 css::uno::Reference< css::drawing::XShapes >
52 mxShapes;
53 OUString maAuthor;
54 OUString maCreateDate;
55 OUString maSimpleText;
56 OUString maStyleName;
57 OUString maTextStyle;
58 bool mbUseShapePos;
59 bool mbShown;
60 std::vector<ScXMLAnnotationStyleEntry> maContentStyles;
62 explicit ScXMLAnnotationData();
63 ~ScXMLAnnotationData();
66 class ScXMLAnnotationContext : public ScXMLImportContext
68 public:
70 ScXMLAnnotationContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
71 const OUString& rLName,
72 const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
73 ScXMLAnnotationData& rAnnotationData);
75 virtual ~ScXMLAnnotationContext() override;
77 virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
78 const OUString& rLocalName,
79 const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override;
81 virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList) override;
83 virtual void Characters( const OUString& rChars ) override;
85 virtual void EndElement() override;
87 void SetShape(
88 const css::uno::Reference< css::drawing::XShape >& rxShape,
89 const css::uno::Reference< css::drawing::XShapes >& rxShapes,
90 const OUString& rStyleName, const OUString& rTextStyle );
92 void AddContentStyle( sal_uInt16 nFamily, const OUString& rName, const ESelection& rSelection );
94 private:
95 ScXMLAnnotationData& mrAnnotationData;
96 OUStringBuffer maTextBuffer;
97 OUStringBuffer maAuthorBuffer;
98 OUStringBuffer maCreateDateBuffer;
99 OUStringBuffer maCreateDateStringBuffer;
100 std::unique_ptr<SvXMLImportContext> pShapeContext;
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */