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 {
34 };
35 
37 
38 enum class AGGREGATE_FUNCTION { SUM, AVERAGE, MIN, MAX };
39 
42 
46 
48 {
49 protected:
50 
51  static SCROW getLastRow(const ScDocument& rDoc, SCCOL nCol);
52 
53 public:
54  virtual ~DataTransformation();
55 
56  virtual void Transform(ScDocument& rDoc) const = 0;
57 
58  virtual TransformationType getTransformationType() const = 0;
59 
60 };
61 
63 {
64  std::set<SCCOL> maColumns;
65 
66 public:
67 
68  ColumnRemoveTransformation(const std::set<SCCOL>& rColumns);
69  virtual ~ColumnRemoveTransformation() override;
70  virtual void Transform(ScDocument& rDoc) const override;
71  virtual TransformationType getTransformationType() const override;
72  const std::set<SCCOL> & getColumns() const;
73 };
74 
76 {
79 
80 public:
81 
83  virtual void Transform(ScDocument& rDoc) const override;
84  virtual TransformationType getTransformationType() const override;
85  SCCOL getColumn() const;
86  sal_Unicode getSeparator() const;
87 };
88 
90 {
91  std::set<SCCOL> maColumns;
92  OUString maMergeString;
93 
94 public:
95 
96  MergeColumnTransformation(const std::set<SCCOL>& rColumns, const OUString& rMergeString);
97  virtual void Transform(ScDocument& rDoc) const override;
98  virtual TransformationType getTransformationType() const override;
99  const OUString & getMergeString() const;
100  const std::set<SCCOL> & getColumns() const;
101 };
102 
104 {
106 public:
107 
108  SortTransformation(const ScSortParam& rParam);
109  virtual void Transform(ScDocument& rDoc) const override;
110  virtual TransformationType getTransformationType() const override;
111  const ScSortParam & getSortParam() const;
112 };
113 
115 {
116  std::set<SCCOL> mnCol;
118 
119  public:
120  TextTransformation(const std::set<SCCOL>& nCol, const TEXT_TRANSFORM_TYPE rType);
121  virtual void Transform(ScDocument& rDoc) const override;
122  virtual TransformationType getTransformationType() const override;
123  TEXT_TRANSFORM_TYPE getTextTransformationType() const;
124  const std::set<SCCOL>& getColumns() const;
125 };
126 
128 {
129  std::set<SCCOL> maColumns;
131 
132  public:
133  AggregateFunction(const std::set<SCCOL>& rColumns, const AGGREGATE_FUNCTION rType);
134  virtual void Transform(ScDocument& rDoc) const override;
135  virtual TransformationType getTransformationType() const override;
136  AGGREGATE_FUNCTION getAggregateType() const;
137  const std::set<SCCOL>& getColumns() const;
138 };
139 
141 {
142  std::set<SCCOL> mnCol;
145 
146  public:
147  NumberTransformation(const std::set<SCCOL>& nCol, const NUMBER_TRANSFORM_TYPE rType);
148  NumberTransformation(const std::set<SCCOL>& nCol, const NUMBER_TRANSFORM_TYPE rType,
149  int nPrecision);
150  virtual void Transform(ScDocument& rDoc) const override;
151  virtual TransformationType getTransformationType() const override;
152  NUMBER_TRANSFORM_TYPE getNumberTransformationType() const;
153  int getPrecision() const;
154  const std::set<SCCOL>& getColumn() const;
155 };
156 
158 {
159  std::set<SCCOL> mnCol;
160  OUString msReplaceWith;
161 
162  public:
163  ReplaceNullTransformation(const std::set<SCCOL>& nCol, const OUString& sReplaceWith);
164  virtual void Transform(ScDocument& rDoc) const override;
165  virtual TransformationType getTransformationType() const override;
166  const std::set<SCCOL>& getColumn() const;
167  const OUString& getReplaceString() const;
168 };
169 
171 {
172  std::set<SCCOL> mnCol;
174 
175  public:
176  DateTimeTransformation(const std::set<SCCOL>& nCol,
177  const DATETIME_TRANSFORMATION_TYPE rType);
178  virtual void Transform(ScDocument& rDoc) const override;
179  virtual TransformationType getTransformationType() const override;
180  DATETIME_TRANSFORMATION_TYPE getDateTimeTransformationType() const;
181  const std::set<SCCOL>& getColumn() const;
182 };
183 
184 }
185 
186 /* 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)
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)
std::set< SCCOL > maColumns
sal_Int32 SCROW
Definition: types.hxx:17
DATETIME_TRANSFORMATION_TYPE maType
SortTransformation(const ScSortParam &rParam)
#define SC_DLLPUBLIC
Definition: scdllapi.h:27