nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / core / inc / SwUndoFmt.hxx
blobb91eec91d539fc97da006516e16b2bff705c2c0a
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_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
23 #include <undobj.hxx>
24 #include <swundo.hxx>
25 #include <numrule.hxx>
27 class SwDoc;
28 class SwTextFormatColl;
29 class SwConditionTextFormatColl;
30 class SwRewriter;
32 class SwUndoFormatCreate : public SwUndo
34 protected:
35 SwFormat * m_pNew;
36 OUString m_sDerivedFrom;
37 SwDoc& m_rDoc;
38 mutable OUString m_sNewName;
39 SfxItemSet * m_pNewSet;
40 sal_uInt16 m_nId; // FormatId related
41 bool m_bAuto;
43 public:
44 SwUndoFormatCreate(SwUndoId nUndoId, SwFormat * pNew, SwFormat const * pDerivedFrom,
45 SwDoc& rDoc);
46 virtual ~SwUndoFormatCreate() override;
48 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
49 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
51 virtual SwRewriter GetRewriter() const override;
53 virtual SwFormat * Create(SwFormat * pDerivedFrom) = 0;
54 virtual void Delete() = 0;
55 virtual SwFormat * Find(const OUString & rName) const = 0;
58 class SwUndoFormatDelete : public SwUndo
60 protected:
61 OUString m_sDerivedFrom;
62 SwDoc& m_rDoc;
63 OUString m_sOldName;
64 SfxItemSet m_aOldSet;
65 sal_uInt16 m_nId; // FormatId related
66 bool m_bAuto;
68 public:
69 SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const * pOld, SwDoc& rDoc);
70 virtual ~SwUndoFormatDelete() override;
72 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
73 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
75 virtual SwRewriter GetRewriter() const override;
77 virtual SwFormat * Create(SwFormat * pDerivedFrom) = 0;
78 virtual void Delete(SwFormat * pFormat) = 0;
79 virtual SwFormat * Find(const OUString & rName) const = 0;
82 class SwUndoRenameFormat : public SwUndo
84 protected:
85 OUString m_sOldName, m_sNewName;
86 SwDoc& m_rDoc;
88 public:
89 SwUndoRenameFormat(SwUndoId nUndoId, const OUString & sOldName,
90 const OUString & sNewName,
91 SwDoc& rDoc);
92 virtual ~SwUndoRenameFormat() override;
94 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
95 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
97 SwRewriter GetRewriter() const override;
99 virtual SwFormat * Find(const OUString & rName) const = 0;
102 class SwUndoTextFormatCollCreate : public SwUndoFormatCreate
104 public:
105 SwUndoTextFormatCollCreate(SwTextFormatColl * pNew, SwTextFormatColl const * pDerivedFrom,
106 SwDoc& rDoc);
108 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
109 virtual void Delete() override;
110 virtual SwFormat * Find(const OUString & rName) const override;
113 class SwUndoTextFormatCollDelete : public SwUndoFormatDelete
115 public:
116 SwUndoTextFormatCollDelete(SwTextFormatColl const * pOld, SwDoc& rDoc);
118 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
119 virtual void Delete(SwFormat * pFormat) override;
120 virtual SwFormat * Find(const OUString & rName) const override;
123 class SwUndoCondTextFormatCollCreate : public SwUndoTextFormatCollCreate
125 public:
126 SwUndoCondTextFormatCollCreate(SwConditionTextFormatColl * pNew, SwTextFormatColl const * pDerivedFrom, SwDoc& rDoc);
127 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
130 class SwUndoCondTextFormatCollDelete : public SwUndoTextFormatCollDelete
132 public:
133 SwUndoCondTextFormatCollDelete(SwTextFormatColl const * pOld, SwDoc& rDoc);
134 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
137 class SwUndoRenameFormatColl : public SwUndoRenameFormat
139 public:
140 SwUndoRenameFormatColl(const OUString & sOldName,
141 const OUString & sNewName,
142 SwDoc& rDoc);
144 virtual SwFormat * Find(const OUString & rName) const override;
147 class SwUndoCharFormatCreate : public SwUndoFormatCreate
149 public:
150 SwUndoCharFormatCreate(SwCharFormat * pNew, SwCharFormat const * pDerivedFrom,
151 SwDoc& rDoc);
153 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
154 virtual void Delete() override;
155 virtual SwFormat * Find(const OUString & rName) const override;
158 class SwUndoCharFormatDelete : public SwUndoFormatDelete
160 public:
161 SwUndoCharFormatDelete(SwCharFormat const * pOld, SwDoc& rDoc);
163 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
164 virtual void Delete(SwFormat * pFormat) override;
165 virtual SwFormat * Find(const OUString & rName) const override;
168 class SwUndoRenameCharFormat : public SwUndoRenameFormat
170 public:
171 SwUndoRenameCharFormat(const OUString & sOldName,
172 const OUString & sNewName,
173 SwDoc& rDoc);
175 virtual SwFormat * Find(const OUString & rName) const override;
178 class SwUndoFrameFormatCreate : public SwUndoFormatCreate
180 public:
181 SwUndoFrameFormatCreate(SwFrameFormat * pNew, SwFrameFormat const * pDerivedFrom,
182 SwDoc& rDoc);
184 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
185 virtual void Delete() override;
186 virtual SwFormat * Find(const OUString & rName) const override;
189 class SwUndoFrameFormatDelete : public SwUndoFormatDelete
191 public:
192 SwUndoFrameFormatDelete(SwFrameFormat const * pOld, SwDoc& rDoc);
194 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
195 virtual void Delete(SwFormat * pFormat) override;
196 virtual SwFormat * Find(const OUString & rName) const override;
199 class SwUndoRenameFrameFormat : public SwUndoRenameFormat
201 public:
202 SwUndoRenameFrameFormat(const OUString & sOldName,
203 const OUString & sNewName,
204 SwDoc& rDoc);
206 virtual SwFormat * Find(const OUString & rName) const override;
209 class SwUndoNumruleCreate : public SwUndo
211 const SwNumRule * m_pNew;
212 mutable SwNumRule m_aNew;
213 SwDoc& m_rDoc;
214 mutable bool m_bInitialized;
216 public:
217 SwUndoNumruleCreate(const SwNumRule * pNew, SwDoc& rDoc);
219 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
220 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
222 SwRewriter GetRewriter() const override;
225 class SwUndoNumruleDelete : public SwUndo
227 SwNumRule m_aOld;
228 SwDoc& m_rDoc;
230 public:
231 SwUndoNumruleDelete(const SwNumRule& rRule, SwDoc& rDoc);
233 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
234 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
236 SwRewriter GetRewriter() const override;
239 class SwUndoNumruleRename : public SwUndo
241 OUString m_aOldName, m_aNewName;
242 SwDoc& m_rDoc;
244 public:
245 SwUndoNumruleRename(const OUString & aOldName, const OUString & aNewName,
246 SwDoc& rDoc);
248 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
249 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
251 SwRewriter GetRewriter() const override;
254 #endif // INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
256 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */