fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / undodat.hxx
blobc9c3060afb0fbcf6f4693e1cdb167d56cf3abdc7
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_SC_SOURCE_UI_INC_UNDODAT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_UNDODAT_HXX
23 #include "undobase.hxx"
24 #include "rangeutl.hxx"
25 #include "rangelst.hxx"
26 #include "sortparam.hxx"
27 #include "queryparam.hxx"
28 #include "subtotalparam.hxx"
29 #include "pivot.hxx"
31 #include <boost/scoped_ptr.hpp>
33 class ScDocShell;
34 class ScDocument;
35 class ScOutlineTable;
36 class ScRangeName;
37 class ScDBData;
38 class ScDBCollection;
39 class ScDPObject;
40 class SdrUndoAction;
41 class ScMarkData;
43 class ScUndoDoOutline: public ScSimpleUndo
45 public:
46 TYPEINFO_OVERRIDE();
47 ScUndoDoOutline( ScDocShell* pNewDocShell,
48 SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab,
49 ScDocument* pNewUndoDoc, bool bNewColumns,
50 sal_uInt16 nNewLevel, sal_uInt16 nNewEntry, bool bNewShow );
51 virtual ~ScUndoDoOutline();
53 virtual void Undo() SAL_OVERRIDE;
54 virtual void Redo() SAL_OVERRIDE;
55 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
56 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
58 virtual OUString GetComment() const SAL_OVERRIDE;
60 private:
61 SCCOLROW nStart;
62 SCCOLROW nEnd;
63 SCTAB nTab;
64 ScDocument* pUndoDoc;
65 bool bColumns;
66 sal_uInt16 nLevel;
67 sal_uInt16 nEntry;
68 bool bShow;
71 class ScUndoMakeOutline: public ScSimpleUndo
73 public:
74 TYPEINFO_OVERRIDE();
75 ScUndoMakeOutline( ScDocShell* pNewDocShell,
76 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
77 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
78 ScOutlineTable* pNewUndoTab,
79 bool bNewColumns, bool bNewMake );
80 virtual ~ScUndoMakeOutline();
82 virtual void Undo() SAL_OVERRIDE;
83 virtual void Redo() SAL_OVERRIDE;
84 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
85 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
87 virtual OUString GetComment() const SAL_OVERRIDE;
89 private:
90 ScAddress aBlockStart;
91 ScAddress aBlockEnd;
92 ScOutlineTable* pUndoTable;
93 bool bColumns;
94 bool bMake;
97 class ScUndoOutlineLevel: public ScSimpleUndo
99 public:
100 TYPEINFO_OVERRIDE();
101 ScUndoOutlineLevel( ScDocShell* pNewDocShell,
102 SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab,
103 ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab,
104 bool bNewColumns, sal_uInt16 nNewLevel );
105 virtual ~ScUndoOutlineLevel();
107 virtual void Undo() SAL_OVERRIDE;
108 virtual void Redo() SAL_OVERRIDE;
109 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
110 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
112 virtual OUString GetComment() const SAL_OVERRIDE;
114 private:
115 SCCOLROW nStart;
116 SCCOLROW nEnd;
117 SCTAB nTab;
118 ScDocument* pUndoDoc;
119 ScOutlineTable* pUndoTable;
120 bool bColumns;
121 sal_uInt16 nLevel;
124 class ScUndoOutlineBlock: public ScSimpleUndo
126 public:
127 TYPEINFO_OVERRIDE();
128 ScUndoOutlineBlock( ScDocShell* pNewDocShell,
129 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
130 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
131 ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab,
132 bool bNewShow );
133 virtual ~ScUndoOutlineBlock();
135 virtual void Undo() SAL_OVERRIDE;
136 virtual void Redo() SAL_OVERRIDE;
137 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
138 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
140 virtual OUString GetComment() const SAL_OVERRIDE;
142 private:
143 ScAddress aBlockStart;
144 ScAddress aBlockEnd;
145 ScDocument* pUndoDoc;
146 ScOutlineTable* pUndoTable;
147 bool bShow;
150 class ScUndoRemoveAllOutlines: public ScSimpleUndo
152 public:
153 TYPEINFO_OVERRIDE();
154 ScUndoRemoveAllOutlines( ScDocShell* pNewDocShell,
155 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
156 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
157 ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab );
158 virtual ~ScUndoRemoveAllOutlines();
160 virtual void Undo() SAL_OVERRIDE;
161 virtual void Redo() SAL_OVERRIDE;
162 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
163 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
165 virtual OUString GetComment() const SAL_OVERRIDE;
167 private:
168 ScAddress aBlockStart;
169 ScAddress aBlockEnd;
170 ScDocument* pUndoDoc;
171 ScOutlineTable* pUndoTable;
174 class ScUndoAutoOutline: public ScSimpleUndo
176 public:
177 TYPEINFO_OVERRIDE();
178 ScUndoAutoOutline( ScDocShell* pNewDocShell,
179 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
180 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
181 ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab );
182 virtual ~ScUndoAutoOutline();
184 virtual void Undo() SAL_OVERRIDE;
185 virtual void Redo() SAL_OVERRIDE;
186 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
187 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
189 virtual OUString GetComment() const SAL_OVERRIDE;
191 private:
192 ScAddress aBlockStart;
193 ScAddress aBlockEnd;
194 ScDocument* pUndoDoc;
195 ScOutlineTable* pUndoTable;
198 class ScUndoSubTotals: public ScDBFuncUndo
200 public:
201 TYPEINFO_OVERRIDE();
202 ScUndoSubTotals( ScDocShell* pNewDocShell, SCTAB nNewTab,
203 const ScSubTotalParam& rNewParam, SCROW nNewEndY,
204 ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab,
205 // ScDBData* pNewData,
206 ScRangeName* pNewUndoRange, ScDBCollection* pNewUndoDB );
207 virtual ~ScUndoSubTotals();
209 virtual void Undo() SAL_OVERRIDE;
210 virtual void Redo() SAL_OVERRIDE;
211 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
212 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
214 virtual OUString GetComment() const SAL_OVERRIDE;
216 private:
217 SCTAB nTab;
218 ScSubTotalParam aParam; // The original passed parameter
219 SCROW nNewEndRow; // Size of result
220 ScDocument* pUndoDoc;
221 ScOutlineTable* pUndoTable;
222 // ScDBData* pUndoDBData;
223 ScRangeName* pUndoRange;
224 ScDBCollection* pUndoDB;
227 class ScUndoQuery: public ScDBFuncUndo
229 public:
230 TYPEINFO_OVERRIDE();
231 ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab,
232 const ScQueryParam& rParam, ScDocument* pNewUndoDoc,
233 ScDBCollection* pNewUndoDB, const ScRange* pOld,
234 bool bSize, const ScRange* pAdvSrc );
235 virtual ~ScUndoQuery();
237 virtual void Undo() SAL_OVERRIDE;
238 virtual void Redo() SAL_OVERRIDE;
239 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
240 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
242 virtual OUString GetComment() const SAL_OVERRIDE;
244 private:
245 SdrUndoAction* pDrawUndo;
246 SCTAB nTab;
247 ScQueryParam aQueryParam;
248 ScDocument* pUndoDoc;
249 ScDBCollection* pUndoDB; // due to source and target range
250 ScRange aOldDest;
251 ScRange aAdvSource;
252 bool bIsAdvanced;
253 bool bDestArea;
254 bool bDoSize;
257 class ScUndoAutoFilter: public ScDBFuncUndo
259 private:
260 OUString aDBName;
261 bool bFilterSet;
263 void DoChange( bool bUndo );
265 public:
266 TYPEINFO_OVERRIDE();
267 ScUndoAutoFilter( ScDocShell* pNewDocShell, const ScRange& rRange,
268 const OUString& rName, bool bSet );
269 virtual ~ScUndoAutoFilter();
271 virtual void Undo() SAL_OVERRIDE;
272 virtual void Redo() SAL_OVERRIDE;
273 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
274 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
276 virtual OUString GetComment() const SAL_OVERRIDE;
279 class ScUndoDBData: public ScSimpleUndo
281 public:
282 TYPEINFO_OVERRIDE();
283 ScUndoDBData( ScDocShell* pNewDocShell,
284 ScDBCollection* pNewUndoColl, ScDBCollection* pNewRedoColl );
285 virtual ~ScUndoDBData();
287 virtual void Undo() SAL_OVERRIDE;
288 virtual void Redo() SAL_OVERRIDE;
289 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
290 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
292 virtual OUString GetComment() const SAL_OVERRIDE;
294 private:
295 ScDBCollection* pUndoColl;
296 ScDBCollection* pRedoColl;
299 class ScUndoImportData: public ScSimpleUndo
301 public:
302 TYPEINFO_OVERRIDE();
303 ScUndoImportData( ScDocShell* pNewDocShell, SCTAB nNewTab,
304 const ScImportParam& rParam, SCCOL nNewEndX, SCROW nNewEndY,
305 SCCOL nNewFormula,
306 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
307 ScDBData* pNewUndoData, ScDBData* pNewRedoData );
308 virtual ~ScUndoImportData();
310 virtual void Undo() SAL_OVERRIDE;
311 virtual void Redo() SAL_OVERRIDE;
312 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
313 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
315 virtual OUString GetComment() const SAL_OVERRIDE;
317 private:
318 SCTAB nTab;
319 ScImportParam aImportParam;
320 SCCOL nEndCol;
321 SCROW nEndRow;
322 ScDocument* pUndoDoc;
323 ScDocument* pRedoDoc;
324 ScDBData* pUndoDBData;
325 ScDBData* pRedoDBData;
326 SCCOL nFormulaCols;
327 bool bRedoFilled;
330 class ScUndoRepeatDB: public ScSimpleUndo
332 public:
333 TYPEINFO_OVERRIDE();
334 ScUndoRepeatDB( ScDocShell* pNewDocShell, SCTAB nNewTab,
335 SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
336 SCROW nResultEndRow, SCCOL nCurX, SCROW nCurY,
337 ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab,
338 ScRangeName* pNewUndoRange, ScDBCollection* pNewUndoDB,
339 const ScRange* pOldQ, const ScRange* pNewQ );
340 virtual ~ScUndoRepeatDB();
342 virtual void Undo() SAL_OVERRIDE;
343 virtual void Redo() SAL_OVERRIDE;
344 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
345 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
347 virtual OUString GetComment() const SAL_OVERRIDE;
349 private:
350 ScAddress aBlockStart;
351 ScAddress aBlockEnd;
352 SCROW nNewEndRow;
353 ScAddress aCursorPos;
354 ScDocument* pUndoDoc;
355 ScOutlineTable* pUndoTable;
356 ScRangeName* pUndoRange;
357 ScDBCollection* pUndoDB;
358 ScRange aOldQuery;
359 ScRange aNewQuery;
360 bool bQuerySize;
363 class ScUndoDataPilot: public ScSimpleUndo
365 public:
366 TYPEINFO_OVERRIDE();
367 ScUndoDataPilot( ScDocShell* pNewDocShell,
368 ScDocument* pOldDoc, ScDocument* pNewDoc,
369 const ScDPObject* pOldObj, const ScDPObject* pNewObj,
370 bool bMove );
371 virtual ~ScUndoDataPilot();
373 virtual void Undo() SAL_OVERRIDE;
374 virtual void Redo() SAL_OVERRIDE;
375 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
376 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
378 virtual OUString GetComment() const SAL_OVERRIDE;
380 private:
381 ScDocument* pOldUndoDoc;
382 ScDocument* pNewUndoDoc;
383 ScDPObject* pOldDPObject;
384 ScDPObject* pNewDPObject;
385 bool bAllowMove;
388 class ScUndoConsolidate: public ScSimpleUndo
390 public:
391 TYPEINFO_OVERRIDE();
392 ScUndoConsolidate( ScDocShell* pNewDocShell,
393 const ScArea& rArea, const ScConsolidateParam& rPar,
394 ScDocument* pNewUndoDoc, bool bReference,
395 SCROW nInsCount, ScOutlineTable* pTab,
396 ScDBData* pData );
397 virtual ~ScUndoConsolidate();
399 virtual void Undo() SAL_OVERRIDE;
400 virtual void Redo() SAL_OVERRIDE;
401 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
402 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
404 virtual OUString GetComment() const SAL_OVERRIDE;
406 private:
407 ScArea aDestArea;
408 ScDocument* pUndoDoc;
409 ScConsolidateParam aParam;
410 bool bInsRef;
411 SCSIZE nInsertCount;
412 ScOutlineTable* pUndoTab;
413 ScDBData* pUndoData;
416 class ScUndoChartData: public ScSimpleUndo
418 public:
419 TYPEINFO_OVERRIDE();
420 ScUndoChartData( ScDocShell* pNewDocShell,
421 const OUString& rName, const ScRange& rNew,
422 bool bColHdr, bool bRowHdr, bool bAdd );
423 ScUndoChartData( ScDocShell* pNewDocShell,
424 const OUString& rName, const ScRangeListRef& rNew,
425 bool bColHdr, bool bRowHdr, bool bAdd );
426 virtual ~ScUndoChartData();
428 virtual void Undo() SAL_OVERRIDE;
429 virtual void Redo() SAL_OVERRIDE;
430 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
431 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
433 virtual OUString GetComment() const SAL_OVERRIDE;
435 private:
436 OUString aChartName;
437 ScRangeListRef aOldRangeListRef;
438 bool bOldColHeaders;
439 bool bOldRowHeaders;
440 // ScRange aNewRange;
441 ScRangeListRef aNewRangeListRef;
442 bool bNewColHeaders;
443 bool bNewRowHeaders;
444 bool bAddRange;
446 void Init();
449 class ScUndoDataForm: public ScBlockUndo
451 public:
452 TYPEINFO_OVERRIDE();
453 ScUndoDataForm( ScDocShell* pNewDocShell,
454 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
455 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
456 const ScMarkData& rMark,
457 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
458 InsertDeleteFlags nNewFlags,
459 ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3,
460 bool bRedoIsFilled = true
462 virtual ~ScUndoDataForm();
464 virtual void Undo() SAL_OVERRIDE;
465 virtual void Redo() SAL_OVERRIDE;
466 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
467 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
469 virtual OUString GetComment() const SAL_OVERRIDE;
471 private:
472 boost::scoped_ptr<ScMarkData> mpMarkData;
473 ScDocument* pUndoDoc;
474 ScDocument* pRedoDoc;
475 InsertDeleteFlags nFlags;
476 ScRefUndoData* pRefUndoData;
477 ScRefUndoData* pRefRedoData;
478 sal_uLong nStartChangeAction;
479 sal_uLong nEndChangeAction;
480 bool bRedoFilled;
482 void DoChange( const bool bUndo );
483 void SetChangeTrack();
486 #endif
488 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */