Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / xml / XMLDDELinksContext.hxx
blob67fbab3f29b1c394b51263367969230131a17b01
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_XMLDDELINKSCONTEXT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLDDELINKSCONTEXT_HXX
23 #include "importcontext.hxx"
24 #include <vector>
26 namespace sax_fastparser { class FastAttributeList; }
28 class ScXMLDDELinksContext : public ScXMLImportContext
30 public:
31 ScXMLDDELinksContext( ScXMLImport& rImport);
33 virtual ~ScXMLDDELinksContext() override;
35 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
36 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
39 struct ScDDELinkCell
41 OUString sValue;
42 double fValue;
43 bool bString;
44 bool bEmpty;
47 typedef std::vector<ScDDELinkCell> ScDDELinkCells;
49 class ScXMLDDELinkContext : public ScXMLImportContext
51 ScDDELinkCells aDDELinkTable;
52 ScDDELinkCells aDDELinkRow;
53 OUString sApplication;
54 OUString sTopic;
55 OUString sItem;
56 sal_Int32 nPosition;
57 sal_Int32 nColumns;
58 sal_Int32 nRows;
59 sal_uInt8 nMode;
61 public:
62 ScXMLDDELinkContext( ScXMLImport& rImport);
64 virtual ~ScXMLDDELinkContext() override;
66 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
67 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
69 void SetApplication(const OUString& sValue) { sApplication = sValue; }
70 void SetTopic(const OUString& sValue) { sTopic = sValue; }
71 void SetItem(const OUString& sValue) { sItem = sValue; }
72 void SetMode(const sal_uInt8 nValue) { nMode = nValue; }
73 void CreateDDELink();
74 void AddColumns(const sal_Int32 nValue) { nColumns += nValue; }
75 void AddRows(const sal_Int32 nValue) { nRows += nValue; }
76 void AddCellToRow(const ScDDELinkCell& aCell);
77 void AddRowsToTable(const sal_Int32 nRows);
79 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
82 class ScXMLDDESourceContext : public ScXMLImportContext
84 ScXMLDDELinkContext* pDDELink;
86 public:
87 ScXMLDDESourceContext( ScXMLImport& rImport,
88 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
89 ScXMLDDELinkContext* pDDELink);
91 virtual ~ScXMLDDESourceContext() override;
93 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
96 class ScXMLDDETableContext : public ScXMLImportContext
98 ScXMLDDELinkContext* const pDDELink;
100 public:
101 ScXMLDDETableContext( ScXMLImport& rImport,
102 ScXMLDDELinkContext* pDDELink);
104 virtual ~ScXMLDDETableContext() override;
106 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
107 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
110 class ScXMLDDEColumnContext : public ScXMLImportContext
112 public:
113 ScXMLDDEColumnContext( ScXMLImport& rImport,
114 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
115 ScXMLDDELinkContext* pDDELink);
117 virtual ~ScXMLDDEColumnContext() override;
120 class ScXMLDDERowContext : public ScXMLImportContext
122 ScXMLDDELinkContext* pDDELink;
123 sal_Int32 nRows;
125 public:
126 ScXMLDDERowContext( ScXMLImport& rImport,
127 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
128 ScXMLDDELinkContext* pDDELink);
130 virtual ~ScXMLDDERowContext() override;
132 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
133 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
135 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
138 class ScXMLDDECellContext : public ScXMLImportContext
140 OUString sValue;
141 double fValue;
142 sal_Int32 nCells;
143 bool bString;
144 bool bString2;
145 bool bEmpty;
147 ScXMLDDELinkContext* pDDELink;
149 public:
150 ScXMLDDECellContext( ScXMLImport& rImport,
151 const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList,
152 ScXMLDDELinkContext* pDDELink);
154 virtual ~ScXMLDDECellContext() override;
156 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
159 #endif
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */