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/.
10 #ifndef INCLUDED_SC_INC_DOCUMENTIMPORT_HXX
11 #define INCLUDED_SC_INC_DOCUMENTIMPORT_HXX
14 #include "address.hxx"
16 #include <rtl/ustring.hxx>
28 struct ScSetStringParam
;
30 struct ScDocumentImportImpl
;
31 enum class SvtScriptType
;
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
;
46 struct SC_DLLPUBLIC Attrs
51 bool mbLatinNumFmtOnly
;
56 ScDocumentImport() = delete;
57 ScDocumentImport(ScDocument
& rDoc
);
58 ScDocumentImport(const ScDocumentImport
&) = delete;
59 const ScDocumentImport
& operator=(const ScDocumentImport
&) = delete;
63 const ScDocument
& getDoc() const;
65 void setDefaultNumericScript(SvtScriptType nScript
);
68 * Apply specified cell style to an entire sheet.
70 void setCellStyleToSheet(SCTAB nTab
, const ScStyleSheet
& rStyle
);
73 * @param rName sheet name.
75 * @return 0-based sheet index, or -1 in case no sheet is found by
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
);
94 const ScRange
& rRange
, const ScTokenArray
& rArray
, formula::FormulaGrammar::Grammar eGrammar
);
96 void setTableOpCells(const ScRange
& rRange
, const ScTabOpParam
& rParam
);
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
103 void setAttrEntries( SCTAB nTab
, SCCOL nCol
, Attrs
& rAttrs
);
105 void setRowsVisible(SCTAB nTab
, SCROW nRowStart
, SCROW nRowEnd
, bool bVisible
);
110 void initColumn(ScColumn
& rCol
);
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */