sc: filter: html: fix missing color scale conditional format
[LibreOffice.git] / svx / source / table / tableundo.hxx
blob822f5ec642fa7d839a1c929f9ec38a25475fcff5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_SOURCE_TABLE_TABLEUNDO_HXX
21 #define INCLUDED_SVX_SOURCE_TABLE_TABLEUNDO_HXX
23 #include <com/sun/star/container/XIndexAccess.hpp>
25 #include <svx/svdotable.hxx>
26 #include <svx/svdobj.hxx>
27 #include <svx/svdundo.hxx>
28 #include <svx/sdrobjectuser.hxx>
30 #include <celltypes.hxx>
32 namespace sdr::properties {
33 class TextProperties;
36 class OutlinerParaObject;
39 namespace sdr::table {
41 class CellUndo : public SdrUndoAction, public sdr::ObjectUser
43 public:
44 CellUndo( SdrObject* pObj, const CellRef& xCell );
45 virtual ~CellUndo() override;
47 virtual void Undo() override;
48 virtual void Redo() override;
49 virtual bool Merge( SfxUndoAction *pNextAction ) override;
51 void dispose();
52 virtual void ObjectInDestruction(const SdrObject& rObject) override;
54 private:
55 struct Data
57 sdr::properties::TextProperties* mpProperties;
58 std::optional<OutlinerParaObject> mpOutlinerParaObject;
60 OUString msFormula;
61 double mfValue;
62 ::sal_Int32 mnError;
63 bool mbMerged;
64 ::sal_Int32 mnRowSpan;
65 ::sal_Int32 mnColSpan;
67 Data()
68 : mpProperties(nullptr)
69 , mfValue(0)
70 , mnError(0)
71 , mbMerged(false)
72 , mnRowSpan(0)
73 , mnColSpan(0)
78 void setDataToCell( const Data& rData );
79 void getDataFromCell( Data& rData );
81 tools::WeakReference<SdrObject> mxObjRef;
82 CellRef mxCell;
83 Data maUndoData;
84 Data maRedoData;
85 bool mbUndo;
89 class InsertRowUndo : public SdrUndoAction
91 public:
92 InsertRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aNewRows );
93 virtual ~InsertRowUndo() override;
95 virtual void Undo() override;
96 virtual void Redo() override;
98 private:
99 TableModelRef mxTable;
100 sal_Int32 mnIndex;
101 RowVector maRows;
102 bool mbUndo;
106 class RemoveRowUndo : public SdrUndoAction
108 public:
109 RemoveRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aRemovedRows );
110 virtual ~RemoveRowUndo() override;
112 virtual void Undo() override;
113 virtual void Redo() override;
115 private:
116 TableModelRef mxTable;
117 sal_Int32 mnIndex;
118 RowVector maRows;
119 bool mbUndo;
123 class InsertColUndo : public SdrUndoAction
125 public:
126 InsertColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells );
127 virtual ~InsertColUndo() override;
129 virtual void Undo() override;
130 virtual void Redo() override;
132 private:
133 TableModelRef mxTable;
134 sal_Int32 mnIndex;
135 ColumnVector maColumns;
136 CellVector maCells;
137 bool mbUndo;
141 class RemoveColUndo : public SdrUndoAction
143 public:
144 RemoveColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells );
145 virtual ~RemoveColUndo() override;
147 virtual void Undo() override;
148 virtual void Redo() override;
150 private:
151 TableModelRef mxTable;
152 sal_Int32 mnIndex;
153 ColumnVector maColumns;
154 CellVector maCells;
155 bool mbUndo;
159 class TableColumnUndo : public SdrUndoAction
161 public:
162 explicit TableColumnUndo( const TableColumnRef& xCol );
163 virtual ~TableColumnUndo() override;
165 virtual void Undo() override;
166 virtual void Redo() override;
167 virtual bool Merge( SfxUndoAction *pNextAction ) override;
169 private:
170 struct Data
172 sal_Int32 mnColumn;
173 sal_Int32 mnWidth;
174 bool mbOptimalWidth;
175 bool mbIsVisible;
176 bool mbIsStartOfNewPage;
177 OUString maName;
179 Data()
180 : mnColumn(0)
181 , mnWidth(0)
182 , mbOptimalWidth(false)
183 , mbIsVisible(false)
184 , mbIsStartOfNewPage(false)
189 void setData( const Data& rData );
190 void getData( Data& rData );
192 TableColumnRef mxCol;
193 Data maUndoData;
194 Data maRedoData;
195 bool mbHasRedoData;
199 class TableRowUndo : public SdrUndoAction
201 public:
202 explicit TableRowUndo( const TableRowRef& xRow );
203 virtual ~TableRowUndo() override;
205 virtual void Undo() override;
206 virtual void Redo() override;
207 virtual bool Merge( SfxUndoAction *pNextAction ) override;
209 private:
210 struct Data
212 sal_Int32 mnRow;
213 sal_Int32 mnHeight;
214 bool mbOptimalHeight;
215 bool mbIsVisible;
216 bool mbIsStartOfNewPage;
217 OUString maName;
220 void setData( const Data& rData );
221 void getData( Data& rData );
223 TableRowRef mxRow;
224 Data maUndoData;
225 Data maRedoData;
226 bool mbHasRedoData;
229 class TableStyleUndo : public SdrUndoAction
231 public:
232 explicit TableStyleUndo( const SdrTableObj& rTableObj );
234 virtual void Undo() override;
235 virtual void Redo() override;
237 private:
238 tools::WeakReference<SdrTableObj> mxObjRef;
240 struct Data
242 TableStyleSettings maSettings;
243 css::uno::Reference< css::container::XIndexAccess > mxTableStyle;
246 void setData( const Data& rData );
247 void getData( Data& rData );
249 Data maUndoData;
250 Data maRedoData;
251 bool mbHasRedoData;
256 #endif
258 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */