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 .
22 #include <rtl/ustrbuf.hxx>
23 #include "importcontext.hxx"
25 namespace sax_fastparser
{ class FastAttributeList
; }
28 struct ScXMLExternalTabData
;
30 class ScXMLExternalRefTabSourceContext
: public ScXMLImportContext
33 ScXMLExternalRefTabSourceContext( ScXMLImport
& rImport
,
34 const rtl::Reference
<sax_fastparser::FastAttributeList
>& rAttrList
,
35 ScXMLExternalTabData
& rRefInfo
);
37 virtual ~ScXMLExternalRefTabSourceContext() override
;
39 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
42 ScXMLExternalTabData
& mrExternalRefInfo
;
44 OUString maRelativeUrl
;
45 OUString maFilterName
;
46 OUString maFilterOptions
;
49 class ScXMLExternalRefRowsContext
: public ScXMLImportContext
52 ScXMLExternalRefRowsContext( ScXMLImport
& rImport
,
53 ScXMLExternalTabData
& rRefInfo
);
55 virtual ~ScXMLExternalRefRowsContext() override
;
57 virtual css::uno::Reference
< XFastContextHandler
> SAL_CALL
createFastChildContext(
59 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
62 ScXMLExternalTabData
& mrExternalRefInfo
;
65 class ScXMLExternalRefRowContext
: public ScXMLImportContext
68 ScXMLExternalRefRowContext( ScXMLImport
& rImport
,
69 const rtl::Reference
<sax_fastparser::FastAttributeList
>& rAttrList
,
70 ScXMLExternalTabData
& rRefInfo
);
72 virtual ~ScXMLExternalRefRowContext() override
;
74 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
76 virtual css::uno::Reference
< XFastContextHandler
> SAL_CALL
createFastChildContext(
78 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
81 ScXMLImport
& mrScImport
;
82 ScXMLExternalTabData
& mrExternalRefInfo
;
83 sal_Int32 mnRepeatRowCount
;
86 class ScXMLExternalRefCellContext
: public ScXMLImportContext
89 ScXMLExternalRefCellContext( ScXMLImport
& rImport
,
90 const rtl::Reference
<sax_fastparser::FastAttributeList
>& rAttrList
,
91 ScXMLExternalTabData
& rRefInfo
);
93 virtual ~ScXMLExternalRefCellContext() override
;
95 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
97 virtual css::uno::Reference
< XFastContextHandler
> SAL_CALL
createFastChildContext(
99 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
101 void SetCellString(const OUString
& rStr
);
104 ScXMLImport
& mrScImport
;
105 ScXMLExternalTabData
& mrExternalRefInfo
;
106 OUString maCellString
;
108 sal_Int32 mnRepeatCount
;
109 sal_Int32 mnNumberFormat
;
110 sal_Int16 mnCellType
; // TODO: import to document core
115 class ScXMLExternalRefCellTextContext
: public ScXMLImportContext
118 ScXMLExternalRefCellTextContext( ScXMLImport
& rImport
,
119 ScXMLExternalRefCellContext
& rParent
);
121 virtual ~ScXMLExternalRefCellTextContext() override
;
123 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
124 virtual void SAL_CALL
characters( const OUString
& rChars
) override
;
127 ScXMLExternalRefCellContext
& mrParent
;
129 OUStringBuffer maCellStrBuf
;
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */