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 
19 class ScDocument;
20 
21 namespace sc {
22 
24 {
37 };
38 
40 
41 enum class AGGREGATE_FUNCTION { SUM, AVERAGE, MIN, MAX };
42 
45 
49 
51 {
52 protected:
53 
54  static SCROW getLastRow(const ScDocument& rDoc, SCCOL nCol);
55 
56 public:
57  virtual ~DataTransformation();
58 
59  virtual void Transform(ScDocument& rDoc) const = 0;
60 
61  virtual TransformationType getTransformationType() const = 0;
62 
63 };
64 
66 {
67  std::set<SCCOL> maColumns;
68 
69 public:
70 
71  ColumnRemoveTransformation(const 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 
83 public:
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 
97 public:
98 
99  MergeColumnTransformation(const std::set<SCCOL>& rColumns, const OUString& rMergeString);
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 {
109 public:
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(const 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(const 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(const std::set<SCCOL>& nCol, const NUMBER_TRANSFORM_TYPE rType);
151  NumberTransformation(const 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;
163  OUString msReplaceWith;
164 
165  public:
166  ReplaceNullTransformation(const std::set<SCCOL>& nCol, const 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(const 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;
191  OUString maReplaceString;
192 
193  public:
194  FindReplaceTransformation(SCCOL nCol, const OUString& aFindString, const 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, const 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 {
217  SCROW mxRow, nxRow;
218 
219  public:
220  SwapRowsTransformation(SCROW mRow, SCROW nRow);
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: */
AGGREGATE_FUNCTION maType
FindReplaceTransformation(SCCOL nCol, const OUString &aFindString, const OUString &aReplaceString)
NUMBER_TRANSFORM_TYPE maType
virtual TransformationType getTransformationType() const override
virtual TransformationType getTransformationType() const override
const ScSortParam & getSortParam() const
TEXT_TRANSFORM_TYPE maType
sal_uInt16 sal_Unicode
B2DTuple getColumn(const B2DHomMatrix &rMatrix, sal_uInt16 nCol)
DATETIME_TRANSFORMATION_TYPE
sal_Int16 SCCOL
Definition: types.hxx:21
virtual void Transform(ScDocument &rDoc) const override
void Transform(void *pInputStream, void *pOutputStream, Degree10 nAngle)
virtual void Transform(ScDocument &rDoc) const override
std::set< SCCOL > maColumns
sal_Int32 SCROW
Definition: types.hxx:17
const OUString & getFindString() const
DATETIME_TRANSFORMATION_TYPE maType
const OUString & getReplaceString() const
DeleteRowTransformation(SCCOL nCol, const OUString &aFindString)
const OUString & getFindString() const
SortTransformation(const ScSortParam &rParam)
virtual void Transform(ScDocument &rDoc) const override
virtual TransformationType getTransformationType() const override
#define SC_DLLPUBLIC
Definition: scdllapi.h:27