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>
18 #include <boost/noncopyable.hpp>
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
: boost::noncopyable
42 ScDocumentImportImpl
* mpImpl
;
44 ScDocumentImport(); // disabled
48 struct SC_DLLPUBLIC Attrs
53 bool mbLatinNumFmtOnly
;
58 ScDocumentImport(ScDocument
& rDoc
);
62 const ScDocument
& getDoc() const;
64 void setDefaultNumericScript(SvtScriptType nScript
);
67 * Apply specified cell style to an entire sheet.
69 void setCellStyleToSheet(SCTAB nTab
, const ScStyleSheet
& rStyle
);
72 * @param rName sheet name.
74 * @return 0-based sheet index, or -1 in case no sheet is found by
77 SCTAB
getSheetIndex(const OUString
& rName
) const;
78 SCTAB
getSheetCount() const;
79 bool appendSheet(const OUString
& rName
);
81 void setOriginDate(sal_uInt16 nYear
, sal_uInt16 nMonth
, sal_uInt16 nDay
);
83 void setAutoInput(const ScAddress
& rPos
, const OUString
& rStr
,
84 ScSetStringParam
* pStringParam
= NULL
);
85 void setNumericCell(const ScAddress
& rPos
, double fVal
);
86 void setStringCell(const ScAddress
& rPos
, const OUString
& rStr
);
87 void setEditCell(const ScAddress
& rPos
, EditTextObject
* pEditText
);
88 void setFormulaCell(const ScAddress
& rPos
, const OUString
& rFormula
, formula::FormulaGrammar::Grammar eGrammar
);
89 void setFormulaCell(const ScAddress
& rPos
, ScTokenArray
* pArray
);
90 void setFormulaCell(const ScAddress
& rPos
, ScFormulaCell
* pCell
);
93 const ScRange
& rRange
, const ScTokenArray
& rArray
, formula::FormulaGrammar::Grammar eGrammar
);
95 void setTableOpCells(const ScRange
& rRange
, const ScTabOpParam
& rParam
);
98 * Set an array of cell attributes to specified column. This call
99 * transfers the ownership of the ScAttrEntry array from the caller to the
102 void setAttrEntries( SCTAB nTab
, SCCOL nCol
, Attrs
& rAttrs
);
107 void initColumn(ScColumn
& rCol
);
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */