build fix
[LibreOffice.git] / sc / inc / documentimport.hxx
blob1d8641af357f784ae816c1d977057d3bad0339f7
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/.
8 */
10 #ifndef INCLUDED_SC_INC_DOCUMENTIMPORT_HXX
11 #define INCLUDED_SC_INC_DOCUMENTIMPORT_HXX
13 #include "scdllapi.h"
14 #include "address.hxx"
16 #include <rtl/ustring.hxx>
18 #include <memory>
20 class EditTextObject;
21 class ScDocument;
22 class ScColumn;
23 class ScAddress;
24 struct ScAttrEntry;
25 class ScTokenArray;
26 class ScFormulaCell;
27 class ScStyleSheet;
28 struct ScSetStringParam;
29 struct ScTabOpParam;
30 struct ScDocumentImportImpl;
31 enum class SvtScriptType;
33 /**
34 * Accessor class to ScDocument. Its purpose is to allow import filter to
35 * fill the document model and nothing but that. Filling the document via
36 * this class does not trigger any kind of broadcasting, drawing object
37 * position calculation, or anything else that requires expensive
38 * computation which are unnecessary and undesirable during import.
40 class SC_DLLPUBLIC ScDocumentImport
42 std::unique_ptr<ScDocumentImportImpl> mpImpl;
44 public:
46 struct SC_DLLPUBLIC Attrs
48 ScAttrEntry* mpData;
49 size_t mnSize;
51 bool mbLatinNumFmtOnly;
53 Attrs();
56 ScDocumentImport() = delete;
57 ScDocumentImport(ScDocument& rDoc);
58 ScDocumentImport(const ScDocumentImport&) = delete;
59 const ScDocumentImport& operator=(const ScDocumentImport&) = delete;
60 ~ScDocumentImport();
62 ScDocument& getDoc();
63 const ScDocument& getDoc() const;
65 void setDefaultNumericScript(SvtScriptType nScript);
67 /**
68 * Apply specified cell style to an entire sheet.
70 void setCellStyleToSheet(SCTAB nTab, const ScStyleSheet& rStyle);
72 /**
73 * @param rName sheet name.
75 * @return 0-based sheet index, or -1 in case no sheet is found by
76 * specified name.
78 SCTAB getSheetIndex(const OUString& rName) const;
79 SCTAB getSheetCount() const;
80 bool appendSheet(const OUString& rName);
82 void setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay);
84 void setAutoInput(const ScAddress& rPos, const OUString& rStr,
85 ScSetStringParam* pStringParam = nullptr);
86 void setNumericCell(const ScAddress& rPos, double fVal);
87 void setStringCell(const ScAddress& rPos, const OUString& rStr);
88 void setEditCell(const ScAddress& rPos, EditTextObject* pEditText);
89 void setFormulaCell(const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar);
90 void setFormulaCell(const ScAddress& rPos, ScTokenArray* pArray);
91 void setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCell);
93 void setMatrixCells(
94 const ScRange& rRange, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGrammar);
96 void setTableOpCells(const ScRange& rRange, const ScTabOpParam& rParam);
98 /**
99 * Set an array of cell attributes to specified column. This call
100 * transfers the ownership of the ScAttrEntry array from the caller to the
101 * column.
103 void setAttrEntries( SCTAB nTab, SCCOL nCol, Attrs& rAttrs );
105 void setRowsVisible(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, bool bVisible);
107 void finalize();
109 private:
110 void initColumn(ScColumn& rCol);
113 #endif
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */