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