Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / source / filter / xml / xmlsubti.hxx
blobb0c6e745722482fb72c87786a1194a873e8a75c9
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 .
19 #pragma once
21 #include "XMLTableShapeResizer.hxx"
22 #include <formula/grammar.hxx>
23 #include <tabprotection.hxx>
24 #include <rangelst.hxx>
26 namespace com::sun::star::drawing { class XDrawPage; }
27 namespace com::sun::star::sheet { class XSpreadsheet; }
28 namespace com::sun::star::table { class XCellRange; }
29 namespace com::sun::star::drawing { class XShapes; }
31 class ScXMLImport;
33 struct ScXMLTabProtectionData
35 OUString maPassword;
36 ScPasswordHash meHash1;
37 ScPasswordHash meHash2;
38 bool mbProtected;
39 bool mbSelectProtectedCells;
40 bool mbSelectUnprotectedCells;
41 bool mbInsertColumns;
42 bool mbInsertRows;
43 bool mbDeleteColumns;
44 bool mbDeleteRows;
46 ScXMLTabProtectionData();
49 class ScMyTables
51 private:
52 ScXMLImport& rImport;
54 ScMyOLEFixer aFixupOLEs;
56 css::uno::Reference< css::sheet::XSpreadsheet > xCurrentSheet;
57 css::uno::Reference< css::drawing::XDrawPage > xDrawPage;
58 css::uno::Reference < css::drawing::XShapes > xShapes;
59 OUString sCurrentSheetName;
60 ScAddress maCurrentCellPos;
61 ScRangeList maMatrixRangeList;
62 ScXMLTabProtectionData maProtectionData;
63 sal_Int32 nCurrentColCount;
64 sal_Int16 nCurrentDrawPage;
65 sal_Int16 nCurrentXShapes;
67 void SetTableStyle(const OUString& sStyleName);
68 public:
69 explicit ScMyTables(ScXMLImport& rImport);
70 ~ScMyTables();
71 void NewSheet(const OUString& sTableName, const OUString& sStyleName,
72 const ScXMLTabProtectionData& rProtectData);
73 void AddRow();
74 void SetRowStyle(const OUString& rCellStyleName);
75 void AddColumn(bool bIsCovered);
76 void FixupOLEs() { aFixupOLEs.FixupOLEs(); }
77 static bool IsOLE(const css::uno::Reference< css::drawing::XShape >& rShape)
78 { return ScMyOLEFixer::IsOLE(rShape); }
79 void DeleteTable();
80 const ScAddress& GetCurrentCellPos() const { return maCurrentCellPos; };
81 void AddColStyle(const sal_Int32 nRepeat, const OUString& rCellStyleName);
82 ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; }
83 const OUString& GetCurrentSheetName() const { return sCurrentSheetName; }
84 SCTAB GetCurrentSheet() const { return (maCurrentCellPos.Tab() >= 0) ? maCurrentCellPos.Tab() : 0; }
85 SCCOL GetCurrentColCount() const;
86 SCROW GetCurrentRow() const { return (maCurrentCellPos.Row() >= 0) ? maCurrentCellPos.Row() : 0; }
87 const css::uno::Reference< css::sheet::XSpreadsheet >&
88 GetCurrentXSheet() const { return xCurrentSheet; }
89 css::uno::Reference< css::drawing::XDrawPage > const &
90 GetCurrentXDrawPage();
91 css::uno::Reference< css::drawing::XShapes > const &
92 GetCurrentXShapes();
93 bool HasDrawPage() const;
94 bool HasXShapes() const;
95 void AddOLE(const css::uno::Reference <css::drawing::XShape>& rShape,
96 const OUString &rRangeList);
98 void AddMatrixRange( const SCCOL nStartColumn,
99 const SCROW nStartRow,
100 const SCCOL nEndColumn,
101 const SCROW nEndRow,
102 const OUString& rFormula,
103 const OUString& rFormulaNmsp,
104 const formula::FormulaGrammar::Grammar );
105 bool IsPartOfMatrix( const ScAddress& rScAddress) const;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */