LibreOffice Module sc (master) 1
datatransformation.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 <types.hxx>
13#include <scdllapi.h>
14
15#include <sortparam.hxx>
16
17#include <set>
18
19class ScDocument;
20
21namespace sc {
22
24{
37};
38
40
42
45
49
51{
52protected:
53
54 static SCROW getLastRow(const ScDocument& rDoc, SCCOL nCol);
55
56public:
57 virtual ~DataTransformation();
58
59 virtual void Transform(ScDocument& rDoc) const = 0;
60
62
63};
64
66{
67 std::set<SCCOL> maColumns;
68
69public:
70
71 ColumnRemoveTransformation(std::set<SCCOL>&& rColumns);
72 virtual ~ColumnRemoveTransformation() override;
73 virtual void Transform(ScDocument& rDoc) const override;
74 virtual TransformationType getTransformationType() const override;
75 const std::set<SCCOL> & getColumns() const;
76};
77
79{
82
83public:
84
86 virtual void Transform(ScDocument& rDoc) const override;
87 virtual TransformationType getTransformationType() const override;
88 SCCOL getColumn() const;
89 sal_Unicode getSeparator() const;
90};
91
93{
94 std::set<SCCOL> maColumns;
95 OUString maMergeString;
96
97public:
98
99 MergeColumnTransformation(std::set<SCCOL>&& rColumns, OUString aMergeString);
100 virtual void Transform(ScDocument& rDoc) const override;
101 virtual TransformationType getTransformationType() const override;
102 const OUString & getMergeString() const;
103 const std::set<SCCOL> & getColumns() const;
104};
105
107{
109public:
110
111 SortTransformation(const ScSortParam& rParam);
112 virtual void Transform(ScDocument& rDoc) const override;
113 virtual TransformationType getTransformationType() const override;
114 const ScSortParam & getSortParam() const;
115};
116
118{
119 std::set<SCCOL> mnCol;
121
122 public:
123 TextTransformation(std::set<SCCOL>&& nCol, const TEXT_TRANSFORM_TYPE rType);
124 virtual void Transform(ScDocument& rDoc) const override;
125 virtual TransformationType getTransformationType() const override;
126 TEXT_TRANSFORM_TYPE getTextTransformationType() const;
127 const std::set<SCCOL>& getColumns() const;
128};
129
131{
132 std::set<SCCOL> maColumns;
134
135 public:
136 AggregateFunction(std::set<SCCOL>&& rColumns, const AGGREGATE_FUNCTION rType);
137 virtual void Transform(ScDocument& rDoc) const override;
138 virtual TransformationType getTransformationType() const override;
139 AGGREGATE_FUNCTION getAggregateType() const;
140 const std::set<SCCOL>& getColumns() const;
141};
142
144{
145 std::set<SCCOL> mnCol;
148
149 public:
150 NumberTransformation(std::set<SCCOL>&& nCol, const NUMBER_TRANSFORM_TYPE rType);
151 NumberTransformation(std::set<SCCOL>&& nCol, const NUMBER_TRANSFORM_TYPE rType,
152 int nPrecision);
153 virtual void Transform(ScDocument& rDoc) const override;
154 virtual TransformationType getTransformationType() const override;
155 NUMBER_TRANSFORM_TYPE getNumberTransformationType() const;
156 int getPrecision() const;
157 const std::set<SCCOL>& getColumn() const;
158};
159
161{
162 std::set<SCCOL> mnCol;
164
165 public:
166 ReplaceNullTransformation(std::set<SCCOL>&& nCol, OUString sReplaceWith);
167 virtual void Transform(ScDocument& rDoc) const override;
168 virtual TransformationType getTransformationType() const override;
169 const std::set<SCCOL>& getColumn() const;
170 const OUString& getReplaceString() const;
171};
172
174{
175 std::set<SCCOL> mnCol;
177
178 public:
179 DateTimeTransformation(std::set<SCCOL>&& nCol,
180 const DATETIME_TRANSFORMATION_TYPE rType);
181 virtual void Transform(ScDocument& rDoc) const override;
182 virtual TransformationType getTransformationType() const override;
183 DATETIME_TRANSFORMATION_TYPE getDateTimeTransformationType() const;
184 const std::set<SCCOL>& getColumn() const;
185};
186
188{
190 OUString maFindString;
192
193 public:
194 FindReplaceTransformation(SCCOL nCol, OUString aFindString, OUString aReplaceString);
195 virtual void Transform(ScDocument& rDoc) const override;
196 virtual TransformationType getTransformationType() const override;
197 SCCOL getColumn() const;
198 const OUString & getFindString() const;
199 const OUString & getReplaceString() const;
200};
201
203{
205 OUString maFindString;
206
207 public:
208 DeleteRowTransformation(SCCOL nCol, OUString aFindString);
209 virtual void Transform(ScDocument& rDoc) const override;
210 virtual TransformationType getTransformationType() const override;
211 SCCOL getColumn() const;
212 const OUString & getFindString() const;
213};
214
216{
218
219 public:
221 virtual void Transform(ScDocument& rDoc) const override;
222 virtual TransformationType getTransformationType() const override;
223 SCROW getFirstRow() const;
224 SCROW getSecondRow() const;
225};
226
227}
228
229/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define MIN(x, y)
std::set< SCCOL > maColumns
AGGREGATE_FUNCTION maType
virtual void Transform(ScDocument &rDoc) const =0
virtual TransformationType getTransformationType() const =0
DATETIME_TRANSFORMATION_TYPE maType
DeleteRowTransformation(SCCOL nCol, OUString aFindString)
virtual TransformationType getTransformationType() const override
const OUString & getFindString() const
virtual void Transform(ScDocument &rDoc) const override
const OUString & getFindString() const
const OUString & getReplaceString() const
virtual TransformationType getTransformationType() const override
FindReplaceTransformation(SCCOL nCol, OUString aFindString, OUString aReplaceString)
virtual void Transform(ScDocument &rDoc) const override
NUMBER_TRANSFORM_TYPE maType
virtual void Transform(ScDocument &rDoc) const override
const ScSortParam & getSortParam() const
virtual TransformationType getTransformationType() const override
SortTransformation(const ScSortParam &rParam)
virtual TransformationType getTransformationType() const override
virtual void Transform(ScDocument &rDoc) const override
SwapRowsTransformation(SCROW mRow, SCROW nRow)
TEXT_TRANSFORM_TYPE maType
SQUARE
void Transform(void *pInputStream, void *pOutputStream, Degree10 nAngle)
#define ROUND(x)
#define ROUND_UP(n, incr)
B2DTuple getColumn(const B2DHomMatrix &rMatrix, sal_uInt16 nCol)
CAUTION! The following defines must be in the same namespace as the respective type.
DATETIME_TRANSFORMATION_TYPE
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
sal_uInt16 sal_Unicode
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17