update credits
[LibreOffice.git] / sc / inc / documentimport.hxx
blob8a980c43c3424aeddb7cd635b35131b32a9797b5
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 SC_DOCUMENTIMPORT_HXX
11 #define SC_DOCUMENTIMPORT_HXX
13 #include "scdllapi.h"
14 #include "address.hxx"
16 #include "rtl/ustring.hxx"
18 #include <boost/noncopyable.hpp>
20 class EditTextObject;
21 class ScDocument;
22 class ScColumn;
23 class ScAddress;
24 class ScTokenArray;
25 class ScBaseCell;
26 class ScFormulaCell;
27 struct ScDocumentImportImpl;
29 /**
30 * Accessor class to ScDocument. Its purpose is to allow import filter to
31 * fill the document model and nothing but that. Filling the document via
32 * this class does not trigger any kind of broadcasting, drawing object
33 * position calculation, or anything else that requires expensive
34 * computation which are unnecessary and undesirable during import.
36 class SC_DLLPUBLIC ScDocumentImport : boost::noncopyable
38 ScDocumentImportImpl* mpImpl;
40 ScDocumentImport(); // disabled
42 public:
43 ScDocumentImport(ScDocument& rDoc);
44 ~ScDocumentImport();
46 ScDocument& getDoc();
47 const ScDocument& getDoc() const;
49 void setDefaultNumericScript(sal_uInt16 nScript);
51 /**
52 * @param rName sheet name.
54 * @return 0-based sheet index, or -1 in case no sheet is found by
55 * specified name.
57 SCTAB getSheetIndex(const OUString& rName) const;
58 SCTAB getSheetCount() const;
59 bool appendSheet(const OUString& rName);
61 void setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay);
63 void setAutoInput(const ScAddress& rPos, const OUString& rStr);
64 void setNumericCell(const ScAddress& rPos, double fVal);
65 void setStringCell(const ScAddress& rPos, const OUString& rStr);
66 void setEditCell(const ScAddress& rPos, EditTextObject* pEditText);
67 void setFormulaCell(const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar);
68 void setFormulaCell(const ScAddress& rPos, const ScTokenArray& rArray);
69 void setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCell);
71 void setMatrixCells(
72 const ScRange& rRange, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGrammar);
74 void finalize();
76 private:
77 void setCell(ScColumn& rCol, SCROW nRow, ScBaseCell* pCell);
78 void initColumn(ScColumn& rCol);
81 #endif
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */