Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / xml / xmlexternaltabi.hxx
blob5afb5c5f9bfca2a2ed89f5ac7c8de129319cd645
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 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_XMLEXTERNALTABI_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLEXTERNALTABI_HXX
23 #include <rtl/ustrbuf.hxx>
24 #include "importcontext.hxx"
26 namespace sax_fastparser { class FastAttributeList; }
28 class ScXMLImport;
29 struct ScXMLExternalTabData;
31 class ScXMLExternalRefTabSourceContext : public ScXMLImportContext
33 public:
34 ScXMLExternalRefTabSourceContext( ScXMLImport& rImport,
35 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
36 ScXMLExternalTabData& rRefInfo );
38 virtual ~ScXMLExternalRefTabSourceContext() override;
40 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
42 private:
43 ScXMLExternalTabData& mrExternalRefInfo;
45 OUString maRelativeUrl;
46 OUString maFilterName;
47 OUString maFilterOptions;
50 class ScXMLExternalRefRowsContext : public ScXMLImportContext
52 public:
53 ScXMLExternalRefRowsContext( ScXMLImport& rImport,
54 ScXMLExternalTabData& rRefInfo );
56 virtual ~ScXMLExternalRefRowsContext() override;
58 virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(
59 sal_Int32 nElement,
60 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
62 private:
63 ScXMLExternalTabData& mrExternalRefInfo;
66 class ScXMLExternalRefRowContext : public ScXMLImportContext
68 public:
69 ScXMLExternalRefRowContext( ScXMLImport& rImport,
70 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
71 ScXMLExternalTabData& rRefInfo );
73 virtual ~ScXMLExternalRefRowContext() override;
75 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
77 virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(
78 sal_Int32 nElement,
79 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
81 private:
82 ScXMLImport& mrScImport;
83 ScXMLExternalTabData& mrExternalRefInfo;
84 sal_Int32 mnRepeatRowCount;
87 class ScXMLExternalRefCellContext : public ScXMLImportContext
89 public:
90 ScXMLExternalRefCellContext( ScXMLImport& rImport,
91 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
92 ScXMLExternalTabData& rRefInfo );
94 virtual ~ScXMLExternalRefCellContext() override;
96 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
98 virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(
99 sal_Int32 nElement,
100 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
102 void SetCellString(const OUString& rStr);
104 private:
105 ScXMLImport& mrScImport;
106 ScXMLExternalTabData& mrExternalRefInfo;
107 OUString maCellString;
108 double mfCellValue;
109 sal_Int32 mnRepeatCount;
110 sal_Int32 mnNumberFormat;
111 sal_Int16 mnCellType; // TODO: import to document core
112 bool mbIsNumeric;
113 bool mbIsEmpty;
116 class ScXMLExternalRefCellTextContext : public ScXMLImportContext
118 public:
119 ScXMLExternalRefCellTextContext( ScXMLImport& rImport,
120 ScXMLExternalRefCellContext& rParent );
122 virtual ~ScXMLExternalRefCellTextContext() override;
124 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
125 virtual void SAL_CALL characters( const OUString& rChars ) override;
127 private:
128 ScXMLExternalRefCellContext& mrParent;
130 OUStringBuffer maCellStrBuf;
133 #endif
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */