LibreOffice Module sc (master)  1
documentimport.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_SC_INC_DOCUMENTIMPORT_HXX
11 #define INCLUDED_SC_INC_DOCUMENTIMPORT_HXX
12 
13 #include "scdllapi.h"
14 #include "address.hxx"
15 #include "attarray.hxx"
16 
17 #include <rtl/ustring.hxx>
18 
19 #include <memory>
20 #include <vector>
21 
22 class EditTextObject;
23 class ScDocument;
24 class ScColumn;
25 class ScTokenArray;
26 class ScFormulaCell;
27 class ScStyleSheet;
28 struct ScSetStringParam;
29 struct ScTabOpParam;
31 enum class SvtScriptType;
32 
41 {
42  std::unique_ptr<ScDocumentImportImpl> mpImpl;
43 
44 public:
45 
47  {
48  std::vector<ScAttrEntry> mvData;
49 
51 
52  Attrs();
53  ~Attrs();
54  Attrs& operator=( Attrs const & ) = delete; // MSVC2015 workaround
55  Attrs( Attrs const & ) = delete; // MSVC2015 workaround
56  };
57 
58  ScDocumentImport() = delete;
60  ScDocumentImport(const ScDocumentImport&) = delete;
61  const ScDocumentImport& operator=(const ScDocumentImport&) = delete;
63 
64  ScDocument& getDoc();
65  const ScDocument& getDoc() const;
66 
71  void initForSheets();
72 
73  void setDefaultNumericScript(SvtScriptType nScript);
74 
78  void setCellStyleToSheet(SCTAB nTab, const ScStyleSheet& rStyle);
79 
86  SCTAB getSheetIndex(const OUString& rName) const;
87  SCTAB getSheetCount() const;
88  bool appendSheet(const OUString& rName);
89  void setSheetName(SCTAB nTab, const OUString& rName);
90 
91  void setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay);
92 
93  void setAutoInput(const ScAddress& rPos, const OUString& rStr,
94  const ScSetStringParam* pStringParam = nullptr);
95  void setNumericCell(const ScAddress& rPos, double fVal);
96  void setStringCell(const ScAddress& rPos, const OUString& rStr);
97  void setEditCell(const ScAddress& rPos, std::unique_ptr<EditTextObject> pEditText);
98 
99  void setFormulaCell(
100  const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar,
101  const double* pResult = nullptr );
102 
103  void setFormulaCell(
104  const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar,
105  const OUString& rResult );
106 
107  void setFormulaCell(const ScAddress& rPos, std::unique_ptr<ScTokenArray> pArray);
108  void setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCell);
109 
110  void setMatrixCells(
111  const ScRange& rRange, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGrammar);
112 
113  void setTableOpCells(const ScRange& rRange, const ScTabOpParam& rParam);
114 
115  void fillDownCells(const ScAddress& rPos, SCROW nFillSize);
116 
122  void setAttrEntries( SCTAB nTab, SCCOL nCol, Attrs&& rAttrs );
123 
124  void setRowsVisible(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, bool bVisible);
125 
126  void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
127 
128  void finalize();
129 
134  void broadcastRecalcAfterImport();
135 
136 private:
137  void initColumn(ScColumn& rCol);
138  static void broadcastRecalcAfterImportColumn(ScColumn& rCol);
139 };
140 
141 #endif
142 
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Store parameters used in the ScDocument::SetString() method.
Definition: stringutil.hxx:35
Status finalize()
Accessor class to ScDocument.
Parameter for data table aka multiple operations.
Definition: paramisc.hxx:46
SvtScriptType
std::vector< ScAttrEntry > mvData
sal_Int16 SCCOL
Definition: types.hxx:22
sal_Int32 SCROW
Definition: types.hxx:18
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
std::unique_ptr< ScDocumentImportImpl > mpImpl
sal_Int16 SCTAB
Definition: types.hxx:23