1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
; }
29 struct ScXMLExternalTabData
;
31 class ScXMLExternalRefTabSourceContext
: public ScXMLImportContext
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
;
43 ScXMLExternalTabData
& mrExternalRefInfo
;
45 OUString maRelativeUrl
;
46 OUString maFilterName
;
47 OUString maFilterOptions
;
50 class ScXMLExternalRefRowsContext
: public ScXMLImportContext
53 ScXMLExternalRefRowsContext( ScXMLImport
& rImport
,
54 ScXMLExternalTabData
& rRefInfo
);
56 virtual ~ScXMLExternalRefRowsContext() override
;
58 virtual css::uno::Reference
< XFastContextHandler
> SAL_CALL
createFastChildContext(
60 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
63 ScXMLExternalTabData
& mrExternalRefInfo
;
66 class ScXMLExternalRefRowContext
: public ScXMLImportContext
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(
79 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
82 ScXMLImport
& mrScImport
;
83 ScXMLExternalTabData
& mrExternalRefInfo
;
84 sal_Int32 mnRepeatRowCount
;
87 class ScXMLExternalRefCellContext
: public ScXMLImportContext
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(
100 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
102 void SetCellString(const OUString
& rStr
);
105 ScXMLImport
& mrScImport
;
106 ScXMLExternalTabData
& mrExternalRefInfo
;
107 OUString maCellString
;
109 sal_Int32 mnRepeatCount
;
110 sal_Int32 mnNumberFormat
;
111 sal_Int16 mnCellType
; // TODO: import to document core
116 class ScXMLExternalRefCellTextContext
: public ScXMLImportContext
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
;
128 ScXMLExternalRefCellContext
& mrParent
;
130 OUStringBuffer maCellStrBuf
;
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */