Bump version to 24.04.3.4
[LibreOffice.git] / editeng / source / outliner / outlundo.hxx
blob066b415e138b8bcebab3ebe9538c1f1ad7c437a7
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 #pragma once
22 #include <editeng/outliner.hxx>
23 #include <editeng/editund2.hxx>
25 class OutlinerUndoBase : public EditUndo
27 private:
28 Outliner* mpOutliner;
30 public:
31 OutlinerUndoBase( sal_uInt16 nId, Outliner* pOutliner );
33 Outliner* GetOutliner() const { return mpOutliner; }
36 class OutlinerUndoChangeParaFlags : public OutlinerUndoBase
38 private:
39 sal_Int32 mnPara;
40 ParaFlag mnOldFlags;
41 ParaFlag mnNewFlags;
43 void ImplChangeFlags( ParaFlag nFlags );
45 public:
46 OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, ParaFlag nOldFlags, ParaFlag nNewFlags );
48 virtual void Undo() override;
49 virtual void Redo() override;
52 class OutlinerUndoChangeParaNumberingRestart : public OutlinerUndoBase
54 private:
55 sal_Int32 mnPara;
57 struct ParaRestartData
59 sal_Int16 mnNumberingStartValue;
60 bool mbParaIsNumberingRestart;
63 ParaRestartData maUndoData;
64 ParaRestartData maRedoData;
66 void ImplApplyData( const ParaRestartData& rData );
67 public:
68 OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_Int32 nPara,
69 sal_Int16 nOldNumberingStartValue, sal_Int16 mnNewNumberingStartValue,
70 bool bOldbParaIsNumberingRestart, bool bNewParaIsNumberingRestart );
72 virtual void Undo() override;
73 virtual void Redo() override;
76 class OutlinerUndoChangeDepth : public OutlinerUndoBase
78 private:
79 sal_Int32 mnPara;
80 sal_Int16 mnOldDepth;
81 sal_Int16 mnNewDepth;
83 public:
84 OutlinerUndoChangeDepth( Outliner* pOutliner, sal_Int32 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth );
86 virtual void Undo() override;
87 virtual void Redo() override;
90 // Help-Undo: If it does not exist an OutlinerUndoAction for a certain action
91 // because this is handled by the EditEngine, but for example the bullet has
92 // to be recalculated.
93 class OutlinerUndoCheckPara : public OutlinerUndoBase
95 private:
96 sal_Int32 mnPara;
98 public:
99 OutlinerUndoCheckPara( Outliner* pOutliner, sal_Int32 nPara );
101 virtual void Undo() override;
102 virtual void Redo() override;
105 class OLUndoExpand : public EditUndo
107 void Restore( bool bUndo );
108 public:
109 OLUndoExpand( Outliner* pOut, sal_uInt16 nId );
110 virtual ~OLUndoExpand() override;
111 virtual void Undo() override;
112 virtual void Redo() override;
114 Outliner* pOutliner;
115 sal_Int32 nCount;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */