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
21class EditTextObject;
22class ScDocument;
23class ScColumn;
24class ScPatternAttr;
25class ScTokenArray;
26class ScFormulaCell;
27class ScStyleSheet;
28struct ScSetStringParam;
29struct ScTabOpParam;
31enum class SvtScriptType : sal_uInt8;
32
41{
42 std::unique_ptr<ScDocumentImportImpl> mpImpl;
43
44public:
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 bool operator==(const Attrs& other) const
57 {
58 return mvData == other.mvData && mbLatinNumFmtOnly == other.mbLatinNumFmtOnly;
59 }
60 Attrs& operator=( Attrs&& attrs ) = default;
61 };
62
63 ScDocumentImport() = delete;
68
69 ScDocument& getDoc();
70 const ScDocument& getDoc() const;
71
76 void initForSheets();
77
78 void setDefaultNumericScript(SvtScriptType nScript);
79
83 void setCellStyleToSheet(SCTAB nTab, const ScStyleSheet& rStyle);
84
91 SCTAB getSheetIndex(const OUString& rName) const;
92 SCTAB getSheetCount() const;
93 bool appendSheet(const OUString& rName);
94 void setSheetName(SCTAB nTab, const OUString& rName);
95
96 void setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay);
97
98 void setAutoInput(const ScAddress& rPos, const OUString& rStr,
99 const ScSetStringParam* pStringParam = nullptr);
100 void setNumericCell(const ScAddress& rPos, double fVal);
101 void setStringCell(const ScAddress& rPos, const OUString& rStr);
102 void setEditCell(const ScAddress& rPos, std::unique_ptr<EditTextObject> pEditText);
103
104 void setFormulaCell(
105 const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar,
106 const double* pResult = nullptr );
107
108 void setFormulaCell(
109 const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar,
110 const OUString& rResult );
111
112 void setFormulaCell(const ScAddress& rPos, std::unique_ptr<ScTokenArray> pArray);
113 void setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCell);
114
115 void setMatrixCells(
116 const ScRange& rRange, const ScTokenArray& rArray, formula::FormulaGrammar::Grammar eGrammar);
117
118 void setTableOpCells(const ScRange& rRange, const ScTabOpParam& rParam);
119
120 void fillDownCells(const ScAddress& rPos, SCROW nFillSize);
121
127 void setAttrEntries( SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, Attrs&& rAttrs );
128
129 void setRowsVisible(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, bool bVisible);
130
131 void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
132
133 void invalidateBlockPositionSet(SCTAB nTab);
134
135 void finalize();
136
141 void broadcastRecalcAfterImport();
142
144 bool isLatinScript(sal_uInt32 nFormat);
145 bool isLatinScript(const ScPatternAttr&);
146
147private:
148 void initColumn(ScColumn& rCol);
149 static void broadcastRecalcAfterImportColumn(ScColumn& rCol);
150};
151
152/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Accessor class to ScDocument.
ScDocumentImport()=delete
std::unique_ptr< ScDocumentImportImpl > mpImpl
const ScDocumentImport & operator=(const ScDocumentImport &)=delete
ScDocumentImport(const ScDocumentImport &)=delete
SvtScriptType
std::vector< std::unique_ptr< SvLinkSource_Entry_Impl > > mvData
Status finalize()
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
bool operator==(const Attrs &other) const
std::vector< ScAttrEntry > mvData
Attrs & operator=(Attrs const &)=delete
Attrs & operator=(Attrs &&attrs)=default
Attrs(Attrs const &)=delete
Store parameters used in the ScDocument::SetString() method.
Definition: stringutil.hxx:35
Parameter for data table aka multiple operations.
Definition: paramisc.hxx:46
unsigned char sal_uInt8
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17