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 <xmloff/xmlictxt.hxx>
22 #include <rtl/ustrbuf.hxx>
23 #include <editeng/editdata.hxx>
24 #include "importcontext.hxx"
25 
26 #include <vector>
27 
28 class ScXMLImport;
29 enum class XmlStyleFamily;
30 namespace com::sun::star::drawing { class XShape; }
31 namespace com::sun::star::drawing { class XShapes; }
32 
34 {
36  OUString maName;
38 
39  ScXMLAnnotationStyleEntry( XmlStyleFamily nFam, const OUString& rNam, const ESelection& rSel ) :
40  mnFamily( nFam ),
41  maName( rNam ),
42  maSelection( rSel )
43  {
44  }
45 };
46 
48 {
49  css::uno::Reference< css::drawing::XShape >
51  css::uno::Reference< css::drawing::XShapes >
53  OUString maAuthor;
54  OUString maCreateDate;
55  OUString maSimpleText;
56  OUString maStyleName;
57  OUString maTextStyle;
59  bool mbShown;
60  std::vector<ScXMLAnnotationStyleEntry> maContentStyles;
61 
62  explicit ScXMLAnnotationData();
64 };
65 
67 {
68 public:
69 
71  sal_Int32 nElement,
72  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList,
73  ScXMLAnnotationData& rAnnotationData);
74 
75  virtual ~ScXMLAnnotationContext() override;
76 
77  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
78  sal_Int32 nElement,
79  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
80 
81  virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList) override;
82 
83  virtual void SAL_CALL characters( const OUString& rChars ) override;
84 
85  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
86 
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 );
91 
92  void AddContentStyle( XmlStyleFamily nFamily, const OUString& rName, const ESelection& rSelection );
93 
94 private:
96  OUStringBuffer maTextBuffer;
97  OUStringBuffer maAuthorBuffer;
98  OUStringBuffer maCreateDateBuffer;
99  OUStringBuffer maCreateDateStringBuffer;
100  std::unique_ptr<SvXMLImportContext> pShapeContext;
101 };
102 
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString maStyleName
Definition: xmlannoi.hxx:56
OUString maCreateDate
Definition: xmlannoi.hxx:54
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:111
OUStringBuffer maCreateDateBuffer
Definition: xmlannoi.hxx:98
OUString maSimpleText
Definition: xmlannoi.hxx:55
XmlStyleFamily
OUStringBuffer maCreateDateStringBuffer
Definition: xmlannoi.hxx:99
css::uno::Reference< css::drawing::XShapes > mxShapes
Definition: xmlannoi.hxx:52
ScXMLAnnotationData & mrAnnotationData
Definition: xmlannoi.hxx:95
This class exists only to provide GetScImport() to its derived classes.
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlannoi.cxx:141
ScXMLAnnotationContext(ScXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, ScXMLAnnotationData &rAnnotationData)
Definition: xmlannoi.cxx:43
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:159
virtual void SAL_CALL characters(const OUString &rChars) override
Definition: xmlannoi.cxx:136
virtual ~ScXMLAnnotationContext() override
Definition: xmlannoi.cxx:101
css::uno::Reference< css::drawing::XShape > mxShape
Definition: xmlannoi.hxx:50
ScXMLAnnotationStyleEntry(XmlStyleFamily nFam, const OUString &rNam, const ESelection &rSel)
Definition: xmlannoi.hxx:39
OUStringBuffer maAuthorBuffer
Definition: xmlannoi.hxx:97
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlannoi.cxx:105
OUStringBuffer maTextBuffer
Definition: xmlannoi.hxx:96
std::vector< ScXMLAnnotationStyleEntry > maContentStyles
Definition: xmlannoi.hxx:60
std::unique_ptr< SvXMLImportContext > pShapeContext
Definition: xmlannoi.hxx:100
OUString maTextStyle
Definition: xmlannoi.hxx:57
XmlStyleFamily mnFamily
Definition: xmlannoi.hxx:35
void AddContentStyle(XmlStyleFamily nFamily, const OUString &rName, const ESelection &rSelection)
Definition: xmlannoi.cxx:168