LibreOffice Module sc (master)  1
xmlnexpi.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_XMLNEXPI_HXX
20 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLNEXPI_HXX
21 
22 #include <types.hxx>
23 #include "importcontext.hxx"
24 
25 #include <memory>
26 
27 namespace sax_fastparser { class FastAttributeList; }
28 
29 struct ScMyNamedExpression;
30 
32 {
33 public:
34 
35  class Inserter
36  {
37  public:
38  virtual ~Inserter() {}
39  virtual void insert(ScMyNamedExpression* pExp) = 0;
40  };
41 
46  class GlobalInserter : public Inserter
47  {
48  public:
49  explicit GlobalInserter(ScXMLImport& rImport);
50  virtual void insert(ScMyNamedExpression* pExp) override;
51  private:
53  };
54 
61  {
62  public:
63  SheetLocalInserter(ScXMLImport& rImport, SCTAB nTab);
64  virtual void insert(ScMyNamedExpression* pExp) override;
65  private:
68  };
69 
71  ScXMLImport& rImport,
72  std::shared_ptr<Inserter> pInserter );
73 
74  virtual ~ScXMLNamedExpressionsContext() override;
75 
76  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
77  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
78 
79 private:
80  std::shared_ptr<Inserter> mpInserter;
81 };
82 
84 {
85 public:
86 
88  ScXMLImport& rImport,
91 
92  virtual ~ScXMLNamedRangeContext() override;
93 };
94 
96 {
97 public:
98 
100  ScXMLImport& rImport,
103 
104  virtual ~ScXMLNamedExpressionContext() override;
105 };
106 
107 #endif
108 
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScXMLNamedExpressionContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLNamedExpressionsContext::Inserter *pInserter)
Definition: xmlnexpi.cxx:126
std::shared_ptr< Inserter > mpInserter
Definition: xmlnexpi.hxx:80
virtual ~ScXMLNamedRangeContext() override
Definition: xmlnexpi.cxx:122
Global named expressions are inserted into ScXMLImport, which does the bulk insertion at the end of t...
Definition: xmlnexpi.hxx:46
virtual ~ScXMLNamedExpressionContext() override
Definition: xmlnexpi.cxx:161
SheetLocalInserter(ScXMLImport &rImport, SCTAB nTab)
Definition: xmlnexpi.cxx:37
This class exists only to provide GetScImport() to its derived classes.
virtual void insert(ScMyNamedExpression *pExp) override
Definition: xmlnexpi.cxx:40
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: xmlnexpi.cxx:59
virtual void insert(ScMyNamedExpression *pExp) override
Definition: xmlnexpi.cxx:31
virtual ~ScXMLNamedExpressionsContext() override
Definition: xmlnexpi.cxx:54
Sheet local named expressions are inserted directly into ScRangeName instance of that sheet...
Definition: xmlnexpi.hxx:60
ScXMLNamedRangeContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLNamedExpressionsContext::Inserter *pInserter)
Definition: xmlnexpi.cxx:81
virtual void insert(ScMyNamedExpression *pExp)=0
sal_Int16 SCTAB
Definition: types.hxx:23
ScXMLNamedExpressionsContext(ScXMLImport &rImport, std::shared_ptr< Inserter > pInserter)
Definition: xmlnexpi.cxx:45