LibreOffice Module sw (master)  1
SwUndoFmt.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  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
22 
23 #include <undobj.hxx>
24 #include <swundo.hxx>
25 #include <numrule.hxx>
26 
27 class SwDoc;
28 class SwTextFormatColl;
30 class SwRewriter;
31 
32 class SwUndoFormatCreate : public SwUndo
33 {
34 protected:
36  OUString m_sDerivedFrom;
38  mutable OUString m_sNewName;
40  sal_uInt16 m_nId; // FormatId related
41  bool m_bAuto;
42 
43 public:
44  SwUndoFormatCreate(SwUndoId nUndoId, SwFormat * pNew, SwFormat const * pDerivedFrom,
45  SwDoc& rDoc);
46  virtual ~SwUndoFormatCreate() override;
47 
48  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
49  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
50 
51  virtual SwRewriter GetRewriter() const override;
52 
53  virtual SwFormat * Create(SwFormat * pDerivedFrom) = 0;
54  virtual void Delete() = 0;
55  virtual SwFormat * Find(const OUString & rName) const = 0;
56 };
57 
58 class SwUndoFormatDelete : public SwUndo
59 {
60 protected:
61  OUString m_sDerivedFrom;
63  OUString m_sOldName;
65  sal_uInt16 m_nId; // FormatId related
66  bool m_bAuto;
67 
68 public:
69  SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const * pOld, SwDoc& rDoc);
70  virtual ~SwUndoFormatDelete() override;
71 
72  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
73  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
74 
75  virtual SwRewriter GetRewriter() const override;
76 
77  virtual SwFormat * Create(SwFormat * pDerivedFrom) = 0;
78  virtual void Delete(SwFormat * pFormat) = 0;
79  virtual SwFormat * Find(const OUString & rName) const = 0;
80 };
81 
82 class SwUndoRenameFormat : public SwUndo
83 {
84 protected:
87 
88 public:
89  SwUndoRenameFormat(SwUndoId nUndoId, const OUString & sOldName,
90  const OUString & sNewName,
91  SwDoc& rDoc);
92  virtual ~SwUndoRenameFormat() override;
93 
94  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
95  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
96 
97  SwRewriter GetRewriter() const override;
98 
99  virtual SwFormat * Find(const OUString & rName) const = 0;
100 };
101 
103 {
104 public:
105  SwUndoTextFormatCollCreate(SwTextFormatColl * pNew, SwTextFormatColl const * pDerivedFrom,
106  SwDoc& rDoc);
107 
108  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
109  virtual void Delete() override;
110  virtual SwFormat * Find(const OUString & rName) const override;
111 };
112 
114 {
115 public:
117 
118  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
119  virtual void Delete(SwFormat * pFormat) override;
120  virtual SwFormat * Find(const OUString & rName) const override;
121 };
122 
124 {
125 public:
127  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
128 };
129 
131 {
132 public:
134  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
135 };
136 
138 {
139 public:
140  SwUndoRenameFormatColl(const OUString & sOldName,
141  const OUString & sNewName,
142  SwDoc& rDoc);
143 
144  virtual SwFormat * Find(const OUString & rName) const override;
145 };
146 
148 {
149 public:
150  SwUndoCharFormatCreate(SwCharFormat * pNew, SwCharFormat const * pDerivedFrom,
151  SwDoc& rDoc);
152 
153  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
154  virtual void Delete() override;
155  virtual SwFormat * Find(const OUString & rName) const override;
156 };
157 
159 {
160 public:
161  SwUndoCharFormatDelete(SwCharFormat const * pOld, SwDoc& rDoc);
162 
163  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
164  virtual void Delete(SwFormat * pFormat) override;
165  virtual SwFormat * Find(const OUString & rName) const override;
166 };
167 
169 {
170 public:
171  SwUndoRenameCharFormat(const OUString & sOldName,
172  const OUString & sNewName,
173  SwDoc& rDoc);
174 
175  virtual SwFormat * Find(const OUString & rName) const override;
176 };
177 
179 {
180 public:
181  SwUndoFrameFormatCreate(SwFrameFormat * pNew, SwFrameFormat const * pDerivedFrom,
182  SwDoc& rDoc);
183 
184  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
185  virtual void Delete() override;
186  virtual SwFormat * Find(const OUString & rName) const override;
187 };
188 
190 {
191 public:
192  SwUndoFrameFormatDelete(SwFrameFormat const * pOld, SwDoc& rDoc);
193 
194  virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
195  virtual void Delete(SwFormat * pFormat) override;
196  virtual SwFormat * Find(const OUString & rName) const override;
197 };
198 
200 {
201 public:
202  SwUndoRenameFrameFormat(const OUString & sOldName,
203  const OUString & sNewName,
204  SwDoc& rDoc);
205 
206  virtual SwFormat * Find(const OUString & rName) const override;
207 };
208 
210 {
211  const SwNumRule * m_pNew;
212  mutable SwNumRule m_aNew;
214  mutable bool m_bInitialized;
215 
216 public:
217  SwUndoNumruleCreate(const SwNumRule * pNew, SwDoc& rDoc);
218 
219  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
220  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
221 
222  SwRewriter GetRewriter() const override;
223 };
224 
226 {
229 
230 public:
231  SwUndoNumruleDelete(const SwNumRule& rRule, SwDoc& rDoc);
232 
233  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
234  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
235 
236  SwRewriter GetRewriter() const override;
237 };
238 
240 {
243 
244  public:
245  SwUndoNumruleRename(const OUString & aOldName, const OUString & aNewName,
246  SwDoc& rDoc);
247 
248  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
249  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
250 
251  SwRewriter GetRewriter() const override;
252 };
253 
254 #endif // INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
255 
256 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwFormat * m_pNew
Definition: SwUndoFmt.hxx:35
SwUndoRenameFrameFormat(const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:362
virtual ~SwUndoFormatCreate() override
Definition: SwUndoFmt.cxx:40
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:352
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:159
SwUndoId
Definition: swundo.hxx:29
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:369
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:127
SwUndoFrameFormatCreate(SwFrameFormat *pNew, SwFrameFormat const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:320
SwUndoCondTextFormatCollDelete(SwTextFormatColl const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:243
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:169
sal_uInt16 m_nId
Definition: SwUndoFmt.hxx:40
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:238
SfxItemSet m_aOldSet
Definition: SwUndoFmt.hxx:64
OUString m_sDerivedFrom
Definition: SwUndoFmt.hxx:36
Definition: doc.hxx:186
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:217
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:222
SwUndoCondTextFormatCollCreate(SwConditionTextFormatColl *pNew, SwTextFormatColl const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:232
virtual void Delete()=0
virtual void Delete(SwFormat *pFormat)=0
virtual ~SwUndoRenameFormat() override
Definition: SwUndoFmt.cxx:155
virtual SwFormat * Create(SwFormat *pDerivedFrom)=0
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:337
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:249
sal_uInt16 m_nId
Definition: SwUndoFmt.hxx:65
Base class for various Writer styles.
Definition: format.hxx:43
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:392
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:455
OUString m_sOldName
Definition: SwUndoFmt.hxx:85
SfxItemSet * m_pNewSet
Definition: SwUndoFmt.hxx:39
Style of a layout element.
Definition: frmfmt.hxx:58
SwUndoNumruleCreate(const SwNumRule *pNew, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:374
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:418
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:273
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:450
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:111
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:315
OUString m_sNewName
Definition: SwUndoFmt.hxx:38
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:179
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:423
virtual SwFormat * Find(const OUString &rName) const =0
virtual void Delete() override
Definition: SwUndoFmt.cxx:278
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:65
SwUndoTextFormatCollDelete(SwTextFormatColl const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:211
OUString m_sDerivedFrom
Definition: SwUndoFmt.hxx:61
virtual void Delete() override
Definition: SwUndoFmt.cxx:201
SwUndoCharFormatCreate(SwCharFormat *pNew, SwCharFormat const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:266
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:347
virtual SwFormat * Find(const OUString &rName) const =0
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:445
const SwNumRule * m_pNew
Definition: SwUndoFmt.hxx:211
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:283
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:381
virtual ~SwUndoFormatDelete() override
Definition: SwUndoFmt.cxx:107
OUString m_sOldName
Definition: SwUndoFmt.hxx:63
SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:97
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:327
SwUndoCharFormatDelete(SwCharFormat const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:288
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:428
SwUndoFrameFormatDelete(SwFrameFormat const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:342
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:293
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:44
SwUndoRenameCharFormat(const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:308
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:357
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:206
virtual void Delete() override
Definition: SwUndoFmt.cxx:332
SwUndoRenameFormatColl(const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:254
SwUndoTextFormatCollCreate(SwTextFormatColl *pNew, SwTextFormatColl const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:191
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:84
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:303
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:298
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:227
SwUndoFormatCreate(SwUndoId nUndoId, SwFormat *pNew, SwFormat const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:32
OUString m_sNewName
Definition: SwUndoFmt.hxx:85
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:137
virtual SwFormat * Find(const OUString &rName) const =0
SwUndoNumruleRename(const OUString &aOldName, const OUString &aNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:437
SwUndoRenameFormat(SwUndoId nUndoId, const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:146
SwUndoNumruleDelete(const SwNumRule &rRule, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:412
virtual SwFormat * Create(SwFormat *pDerivedFrom)=0
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:397
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:196
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:261