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 #ifndef INCLUDED_SC_SOURCE_UI_DATAPROVIDER_DATATRANSFORMATION_HXX
11 #define INCLUDED_SC_SOURCE_UI_DATAPROVIDER_DATATRANSFORMATION_HXX
12 
13 #include <types.hxx>
14 #include <scdllapi.h>
15 
16 #include <sortparam.hxx>
17 
18 #include <set>
19 
20 class ScDocument;
21 
22 namespace sc {
23 
25 {
35 };
36 
38 
39 enum class AGGREGATE_FUNCTION { SUM, AVERAGE, MIN, MAX };
40 
43 
47 
49 {
50 protected:
51 
52  static SCROW getLastRow(const ScDocument& rDoc, SCCOL nCol);
53 
54 public:
55  virtual ~DataTransformation();
56 
57  virtual void Transform(ScDocument& rDoc) const = 0;
58 
59  virtual TransformationType getTransformationType() const = 0;
60 
61 };
62 
64 {
65  std::set<SCCOL> maColumns;
66 
67 public:
68 
69  ColumnRemoveTransformation(const std::set<SCCOL>& rColumns);
70  virtual ~ColumnRemoveTransformation() override;
71  virtual void Transform(ScDocument& rDoc) const override;
72  virtual TransformationType getTransformationType() const override;
73  const std::set<SCCOL> & getColumns() const;
74 };
75 
77 {
80 
81 public:
82 
84  virtual void Transform(ScDocument& rDoc) const override;
85  virtual TransformationType getTransformationType() const override;
86  SCCOL getColumn() const;
87  sal_Unicode getSeparator() const;
88 };
89 
91 {
92  std::set<SCCOL> maColumns;
93  OUString maMergeString;
94 
95 public:
96 
97  MergeColumnTransformation(const std::set<SCCOL>& rColumns, const OUString& rMergeString);
98  virtual void Transform(ScDocument& rDoc) const override;
99  virtual TransformationType getTransformationType() const override;
100  const OUString & getMergeString() const;
101  const std::set<SCCOL> & getColumns() const;
102 };
103 
105 {
107 public:
108 
109  SortTransformation(const ScSortParam& rParam);
110  virtual void Transform(ScDocument& rDoc) const override;
111  virtual TransformationType getTransformationType() const override;
112  const ScSortParam & getSortParam() const;
113 };
114 
116 {
117  std::set<SCCOL> mnCol;
119 
120  public:
121  TextTransformation(const std::set<SCCOL>& nCol, const TEXT_TRANSFORM_TYPE rType);
122  virtual void Transform(ScDocument& rDoc) const override;
123  virtual TransformationType getTransformationType() const override;
124  TEXT_TRANSFORM_TYPE getTextTransformationType() const;
125  const std::set<SCCOL>& getColumns() const;
126 };
127 
129 {
130  std::set<SCCOL> maColumns;
132 
133  public:
134  AggregateFunction(const std::set<SCCOL>& rColumns, const AGGREGATE_FUNCTION rType);
135  virtual void Transform(ScDocument& rDoc) const override;
136  virtual TransformationType getTransformationType() const override;
137  AGGREGATE_FUNCTION getAggregateType() const;
138  const std::set<SCCOL>& getColumns() const;
139 };
140 
142 {
143  std::set<SCCOL> mnCol;
146 
147  public:
148  NumberTransformation(const std::set<SCCOL>& nCol, const NUMBER_TRANSFORM_TYPE rType);
149  NumberTransformation(const std::set<SCCOL>& nCol, const NUMBER_TRANSFORM_TYPE rType,
150  int nPrecision);
151  virtual void Transform(ScDocument& rDoc) const override;
152  virtual TransformationType getTransformationType() const override;
153  NUMBER_TRANSFORM_TYPE getNumberTransformationType() const;
154  int getPrecision() const;
155  const std::set<SCCOL>& getColumn() const;
156 };
157 
159 {
160  std::set<SCCOL> mnCol;
161  OUString msReplaceWith;
162 
163  public:
164  ReplaceNullTransformation(const std::set<SCCOL>& nCol, const OUString& sReplaceWith);
165  virtual void Transform(ScDocument& rDoc) const override;
166  virtual TransformationType getTransformationType() const override;
167  const std::set<SCCOL>& getColumn() const;
168  const OUString& getReplaceString() const;
169 };
170 
172 {
173  std::set<SCCOL> mnCol;
175 
176  public:
177  DateTimeTransformation(const std::set<SCCOL>& nCol,
178  const DATETIME_TRANSFORMATION_TYPE rType);
179  virtual void Transform(ScDocument& rDoc) const override;
180  virtual TransformationType getTransformationType() const override;
181  DATETIME_TRANSFORMATION_TYPE getDateTimeTransformationType() const;
182  const std::set<SCCOL>& getColumn() const;
183 };
184 
185 }
186 
187 #endif
188 
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AGGREGATE_FUNCTION maType
NUMBER_TRANSFORM_TYPE maType
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)
void Transform(void *pInputStream, void *pOutputStream, long nAngle)
DATETIME_TRANSFORMATION_TYPE
sal_Int16 SCCOL
Definition: types.hxx:22
virtual void Transform(ScDocument &rDoc) const override
std::set< SCCOL > maColumns
sal_Int32 SCROW
Definition: types.hxx:18
DATETIME_TRANSFORMATION_TYPE maType
SortTransformation(const ScSortParam &rParam)
#define SC_DLLPUBLIC
Definition: scdllapi.h:28