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 sDerivedFrom;
38  mutable OUString sNewName;
40  sal_uInt16 nId; // FormatId related
41  bool bAuto;
42 
43 public:
44  SwUndoFormatCreate(SwUndoId nUndoId, SwFormat * pNew, SwFormat const * pDerivedFrom,
45  SwDoc * pDoc);
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 sDerivedFrom;
63  OUString const sOldName;
65  sal_uInt16 nId; // FormatId related
66  bool bAuto;
67 
68 public:
69  SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const * pOld, SwDoc * pDoc);
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:
85  OUString sOldName, sNewName;
87 
88 public:
89  SwUndoRenameFormat(SwUndoId nUndoId, const OUString & sOldName,
90  const OUString & sNewName,
91  SwDoc * pDoc);
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:
106  SwDoc * pDoc);
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 * pDoc);
143 
144  virtual SwFormat * Find(const OUString & rName) const override;
145 };
146 
148 {
149 public:
150  SwUndoCharFormatCreate(SwCharFormat * pNew, SwCharFormat const * pDerivedFrom,
151  SwDoc * pDoc);
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:
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 * pDoc);
174 
175  virtual SwFormat * Find(const OUString & rName) const override;
176 };
177 
179 {
180 public:
182  SwDoc * pDoc);
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:
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 * pDoc);
205 
206  virtual SwFormat * Find(const OUString & rName) const override;
207 };
208 
210 {
211  const SwNumRule * pNew;
212  mutable SwNumRule aNew;
214  mutable bool bInitialized;
215 
216 public:
217  SwUndoNumruleCreate(const SwNumRule * pNew, SwDoc * pDoc);
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 & aRule, SwDoc * pDoc);
232 
233  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
234  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
235 
236  SwRewriter GetRewriter() const override;
237 };
238 
240 {
241  OUString aOldName, aNewName;
243 
244  public:
245  SwUndoNumruleRename(const OUString & aOldName, const OUString & aNewName,
246  SwDoc * pDoc);
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: */
OUString sDerivedFrom
Definition: SwUndoFmt.hxx:36
virtual ~SwUndoFormatCreate() override
Definition: SwUndoFmt.cxx:41
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:353
sal_uInt16 nId
Definition: SwUndoFmt.hxx:40
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:160
SwUndoNumruleDelete(const SwNumRule &aRule, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:413
SwUndoId
Definition: swundo.hxx:29
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:370
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:128
SwUndoFrameFormatDelete(SwFrameFormat const *pOld, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:343
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:170
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:239
Definition: doc.hxx:185
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:218
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:223
SwUndoFrameFormatCreate(SwFrameFormat *pNew, SwFrameFormat const *pDerivedFrom, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:321
SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const *pOld, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:98
SwFormat * pNew
Definition: SwUndoFmt.hxx:35
virtual void Delete()=0
SfxItemSet const aOldSet
Definition: SwUndoFmt.hxx:64
virtual void Delete(SwFormat *pFormat)=0
virtual ~SwUndoRenameFormat() override
Definition: SwUndoFmt.cxx:156
virtual SwFormat * Create(SwFormat *pDerivedFrom)=0
const SwNumRule * pNew
Definition: SwUndoFmt.hxx:211
SwUndoTextFormatCollDelete(SwTextFormatColl const *pOld, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:212
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:338
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:250
SwUndoCondTextFormatCollCreate(SwConditionTextFormatColl *pNew, SwTextFormatColl const *pDerivedFrom, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:233
Base class for various Writer styles.
Definition: format.hxx:43
SwUndoRenameFormatColl(const OUString &sOldName, const OUString &sNewName, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:255
SwUndoNumruleCreate(const SwNumRule *pNew, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:375
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:393
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:456
Style of a layout element.
Definition: frmfmt.hxx:57
SwUndoCharFormatCreate(SwCharFormat *pNew, SwCharFormat const *pDerivedFrom, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:267
OUString const sOldName
Definition: SwUndoFmt.hxx:63
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:419
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:274
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:451
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:112
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:316
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:180
SwUndoNumruleRename(const OUString &aOldName, const OUString &aNewName, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:438
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:424
virtual SwFormat * Find(const OUString &rName) const =0
virtual void Delete() override
Definition: SwUndoFmt.cxx:279
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:66
virtual void Delete() override
Definition: SwUndoFmt.cxx:202
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:348
virtual SwFormat * Find(const OUString &rName) const =0
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:446
SwUndoFormatCreate(SwUndoId nUndoId, SwFormat *pNew, SwFormat const *pDerivedFrom, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:33
SwUndoRenameFormat(SwUndoId nUndoId, const OUString &sOldName, const OUString &sNewName, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:147
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:284
SwUndoCondTextFormatCollDelete(SwTextFormatColl const *pOld, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:244
SwUndoRenameCharFormat(const OUString &sOldName, const OUString &sNewName, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:309
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:382
virtual ~SwUndoFormatDelete() override
Definition: SwUndoFmt.cxx:108
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:328
OUString sDerivedFrom
Definition: SwUndoFmt.hxx:61
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:429
SwUndoCharFormatDelete(SwCharFormat const *pOld, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:289
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:294
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:45
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:358
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:207
virtual void Delete() override
Definition: SwUndoFmt.cxx:333
SwUndoRenameFrameFormat(const OUString &sOldName, const OUString &sNewName, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:363
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:85
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:304
SwUndoTextFormatCollCreate(SwTextFormatColl *pNew, SwTextFormatColl const *pDerivedFrom, SwDoc *pDoc)
Definition: SwUndoFmt.cxx:192
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:299
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:228
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:138
virtual SwFormat * Find(const OUString &rName) const =0
virtual SwFormat * Create(SwFormat *pDerivedFrom)=0
SfxItemSet * pNewSet
Definition: SwUndoFmt.hxx:39
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:398
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:197
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:262
sal_uInt16 nId
Definition: SwUndoFmt.hxx:65