LibreOffice Module sc (master) 1
xmlannoi.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <utility>
22#include <xmloff/xmlictxt.hxx>
23#include <rtl/ustrbuf.hxx>
24#include <editeng/editdata.hxx>
25#include "importcontext.hxx"
26
27#include <vector>
28
29class ScXMLImport;
30enum class XmlStyleFamily;
31namespace com::sun::star::drawing { class XShape; }
32namespace com::sun::star::drawing { class XShapes; }
33
35{
37 OUString maName;
39
40 ScXMLAnnotationStyleEntry( XmlStyleFamily nFam, OUString aNam, const ESelection& rSel ) :
41 mnFamily( nFam ),
42 maName(std::move( aNam )),
43 maSelection( rSel )
44 {
45 }
46};
47
49{
50 css::uno::Reference< css::drawing::XShape >
52 css::uno::Reference< css::drawing::XShapes >
54 OUString maAuthor;
55 OUString maCreateDate;
56 OUString maSimpleText;
57 OUString maStyleName;
58 OUString maTextStyle;
60 bool mbShown;
61 std::vector<ScXMLAnnotationStyleEntry> maContentStyles;
62
63 explicit ScXMLAnnotationData();
65};
66
68{
69public:
70
72 sal_Int32 nElement,
73 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
74 ScXMLAnnotationData& rAnnotationData);
75
76 virtual ~ScXMLAnnotationContext() override;
77
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;
81
82 virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList) override;
83
84 virtual void SAL_CALL characters( const OUString& rChars ) override;
85
86 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
87
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 );
92
93 void AddContentStyle( XmlStyleFamily nFamily, const OUString& rName, const ESelection& rSelection );
94
95private:
97 OUStringBuffer maTextBuffer;
98 OUStringBuffer maAuthorBuffer;
99 OUStringBuffer maCreateDateBuffer;
101 std::unique_ptr<SvXMLImportContext> pShapeContext;
102};
103
104/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScXMLAnnotationData & mrAnnotationData
Definition: xmlannoi.hxx:96
std::unique_ptr< SvXMLImportContext > pShapeContext
Definition: xmlannoi.hxx:101
OUStringBuffer maAuthorBuffer
Definition: xmlannoi.hxx:98
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlannoi.cxx:103
OUStringBuffer maCreateDateStringBuffer
Definition: xmlannoi.hxx:100
virtual ~ScXMLAnnotationContext() override
Definition: xmlannoi.cxx:99
OUStringBuffer maTextBuffer
Definition: xmlannoi.hxx:97
void SetShape(const css::uno::Reference< css::drawing::XShape > &rxShape, const css::uno::Reference< css::drawing::XShapes > &rxShapes, const OUString &rStyleName, const OUString &rTextStyle)
Definition: xmlannoi.cxx:157
ScXMLAnnotationContext(ScXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, ScXMLAnnotationData &rAnnotationData)
Definition: xmlannoi.cxx:41
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlannoi.cxx:139
OUStringBuffer maCreateDateBuffer
Definition: xmlannoi.hxx:99
void AddContentStyle(XmlStyleFamily nFamily, const OUString &rName, const ESelection &rSelection)
Definition: xmlannoi.cxx:166
virtual void SAL_CALL characters(const OUString &rChars) override
Definition: xmlannoi.cxx:134
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlannoi.cxx:109
This class exists only to provide GetScImport() to its derived classes.
XmlStyleFamily
std::vector< ScXMLAnnotationStyleEntry > maContentStyles
Definition: xmlannoi.hxx:61
css::uno::Reference< css::drawing::XShape > mxShape
Definition: xmlannoi.hxx:51
OUString maCreateDate
Definition: xmlannoi.hxx:55
OUString maStyleName
Definition: xmlannoi.hxx:57
OUString maTextStyle
Definition: xmlannoi.hxx:58
OUString maSimpleText
Definition: xmlannoi.hxx:56
css::uno::Reference< css::drawing::XShapes > mxShapes
Definition: xmlannoi.hxx:53
ScXMLAnnotationStyleEntry(XmlStyleFamily nFam, OUString aNam, const ESelection &rSel)
Definition: xmlannoi.hxx:40
XmlStyleFamily mnFamily
Definition: xmlannoi.hxx:36