tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / filter / xml / xmlannoi.hxx
blob6f8c9dc492e7d04ec4a7eda3234129cc12f83f0e
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 #pragma once
21 #include <utility>
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 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;
37 OUString maName;
38 ESelection maSelection;
40 ScXMLAnnotationStyleEntry( XmlStyleFamily nFam, OUString aNam, const ESelection& rSel ) :
41 mnFamily( nFam ),
42 maName(std::move( aNam )),
43 maSelection( rSel )
48 struct ScXMLAnnotationData
50 css::uno::Reference< css::drawing::XShape >
51 mxShape;
52 css::uno::Reference< css::drawing::XShapes >
53 mxShapes;
54 OUString maAuthor;
55 OUString maCreateDate;
56 OUString maSimpleText;
57 OUString maStyleName;
58 OUString maTextStyle;
59 bool mbUseShapePos;
60 bool mbShown;
61 std::vector<ScXMLAnnotationStyleEntry> maContentStyles;
63 explicit ScXMLAnnotationData();
64 ~ScXMLAnnotationData();
67 class ScXMLAnnotationContext : public ScXMLImportContext
69 public:
71 ScXMLAnnotationContext( ScXMLImport& rImport,
72 sal_Int32 nElement,
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(
79 sal_Int32 nElement,
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;
88 void SetShape(
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 );
95 private:
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: */