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 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_XMLANNOI_HXX
20 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLANNOI_HXX
21 
22 #include <xmloff/xmlictxt.hxx>
23 #include <rtl/ustrbuf.hxx>
24 #include <editeng/editdata.hxx>
25 #include "importcontext.hxx"
26 
27 #include <vector>
28 
29 class ScXMLImport;
30 enum class XmlStyleFamily;
31 namespace com::sun::star::drawing { class XShape; }
32 namespace com::sun::star::drawing { class XShapes; }
33 
35 {
37  OUString maName;
39 
40  ScXMLAnnotationStyleEntry( XmlStyleFamily nFam, const OUString& rNam, const ESelection& rSel ) :
41  mnFamily( nFam ),
42  maName( rNam ),
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 {
69 public:
70 
71  ScXMLAnnotationContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
72  const OUString& rLName,
73  const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList,
74  ScXMLAnnotationData& rAnnotationData);
75 
76  virtual ~ScXMLAnnotationContext() override;
77 
78  virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
79  const OUString& rLocalName,
80  const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList ) override;
81 
82  virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList>& xAttrList) override;
83 
84  virtual void Characters( const OUString& rChars ) override;
85 
86  virtual void EndElement() 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 
95 private:
97  OUStringBuffer maTextBuffer;
98  OUStringBuffer maAuthorBuffer;
99  OUStringBuffer maCreateDateBuffer;
100  OUStringBuffer maCreateDateStringBuffer;
101  std::unique_ptr<SvXMLImportContext> pShapeContext;
102 };
103 
104 #endif
105 
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString maStyleName
Definition: xmlannoi.hxx:57
OUString maCreateDate
Definition: xmlannoi.hxx:55
virtual void Characters(const OUString &rChars) override
Definition: xmlannoi.cxx:144
OUStringBuffer maCreateDateBuffer
Definition: xmlannoi.hxx:99
OUString maSimpleText
Definition: xmlannoi.hxx:56
XmlStyleFamily
OUStringBuffer maCreateDateStringBuffer
Definition: xmlannoi.hxx:100
css::uno::Reference< css::drawing::XShapes > mxShapes
Definition: xmlannoi.hxx:53
ScXMLAnnotationData & mrAnnotationData
Definition: xmlannoi.hxx:96
virtual void EndElement() override
Definition: xmlannoi.cxx:149
This class exists only to provide GetScImport() to its derived classes.
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:167
virtual ~ScXMLAnnotationContext() override
Definition: xmlannoi.cxx:106
css::uno::Reference< css::drawing::XShape > mxShape
Definition: xmlannoi.hxx:51
ScXMLAnnotationStyleEntry(XmlStyleFamily nFam, const OUString &rNam, const ESelection &rSel)
Definition: xmlannoi.hxx:40
OUStringBuffer maAuthorBuffer
Definition: xmlannoi.hxx:98
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Definition: xmlannoi.cxx:116
ScXMLAnnotationContext(ScXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, ScXMLAnnotationData &rAnnotationData)
Definition: xmlannoi.cxx:43
OUStringBuffer maTextBuffer
Definition: xmlannoi.hxx:97
std::vector< ScXMLAnnotationStyleEntry > maContentStyles
Definition: xmlannoi.hxx:61
std::unique_ptr< SvXMLImportContext > pShapeContext
Definition: xmlannoi.hxx:101
OUString maTextStyle
Definition: xmlannoi.hxx:58
XmlStyleFamily mnFamily
Definition: xmlannoi.hxx:36
virtual void StartElement(const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Definition: xmlannoi.cxx:110
void AddContentStyle(XmlStyleFamily nFamily, const OUString &rName, const ESelection &rSelection)
Definition: xmlannoi.cxx:176