LibreOffice Module sw (master)  1
UndoBookmark.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_UNDOBOOKMARK_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNDOBOOKMARK_HXX
22 
23 #include <memory>
24 #include <undobj.hxx>
25 #include "rolbck.hxx"
26 
27 class SwHistoryBookmark;
30 
31 namespace sw::mark
32 {
33 class IMark;
34 class IFieldmark;
35 }
36 
37 class SwDoc;
38 
39 class SwUndoBookmark : public SwUndo
40 {
41  const std::unique_ptr<SwHistoryBookmark> m_pHistoryBookmark;
42 
43 protected:
44  SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::IMark&);
45 
46  void SetInDoc(SwDoc*);
47  void ResetInDoc(SwDoc&);
48 
49 public:
50  virtual ~SwUndoBookmark() override;
51 
64  virtual SwRewriter GetRewriter() const override;
65 };
66 
68 {
69 public:
70  SwUndoInsBookmark(const ::sw::mark::IMark&);
71 
72  virtual void UndoImpl(::sw::UndoRedoContext&) override;
73  virtual void RedoImpl(::sw::UndoRedoContext&) override;
74 };
75 
77 {
78 public:
79  SwUndoDeleteBookmark(const ::sw::mark::IMark&);
80 
81  virtual void UndoImpl(::sw::UndoRedoContext&) override;
82  virtual void RedoImpl(::sw::UndoRedoContext&) override;
83 };
84 
86 {
87  const OUString m_sOldName;
88  const OUString m_sNewName;
89 
90 public:
91  SwUndoRenameBookmark(const OUString& rOldName, const OUString& rNewName, const SwDoc& rDoc);
92  virtual ~SwUndoRenameBookmark() override;
93 
94 private:
95  virtual SwRewriter GetRewriter() const override;
96  static void Rename(::sw::UndoRedoContext const&, const OUString& sFrom, const OUString& sTo);
97  virtual void UndoImpl(::sw::UndoRedoContext&) override;
98  virtual void RedoImpl(::sw::UndoRedoContext&) override;
99 };
100 
103 {
104 private:
105  const std::unique_ptr<SwHistoryNoTextFieldmark> m_pHistoryNoTextFieldmark;
106 
107 public:
108  SwUndoInsNoTextFieldmark(const ::sw::mark::IFieldmark& rFieldmark);
109 
110  virtual void UndoImpl(::sw::UndoRedoContext&) override;
111  virtual void RedoImpl(::sw::UndoRedoContext&) override;
112 };
113 
116 {
117 private:
118  const std::unique_ptr<SwHistoryNoTextFieldmark> m_pHistoryNoTextFieldmark;
119 
120 public:
121  SwUndoDelNoTextFieldmark(const ::sw::mark::IFieldmark& rFieldmark);
123 
124  virtual void UndoImpl(::sw::UndoRedoContext&) override;
125  virtual void RedoImpl(::sw::UndoRedoContext&) override;
126 };
127 
130 {
131 private:
132  const std::unique_ptr<SwHistoryTextFieldmark> m_pHistoryTextFieldmark;
133 
134 public:
135  SwUndoInsTextFieldmark(const ::sw::mark::IFieldmark& rFieldmark);
136 
137  virtual void UndoImpl(::sw::UndoRedoContext&) override;
138  virtual void RedoImpl(::sw::UndoRedoContext&) override;
139 };
140 
143 {
144 private:
145  const std::unique_ptr<SwHistoryTextFieldmark> m_pHistoryTextFieldmark;
146 
147 public:
148  SwUndoDelTextFieldmark(const ::sw::mark::IFieldmark& rFieldmark);
150 
151  virtual void UndoImpl(::sw::UndoRedoContext&) override;
152  virtual void RedoImpl(::sw::UndoRedoContext&) override;
153 };
154 
155 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOBOOKMARK_HXX
156 
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwUndoDelTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:204
History object containing all information used during undo / redo of text form field insertion...
Definition: rolbck.hxx:288
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:199
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:149
SwUndoId
Definition: swundo.hxx:29
virtual ~SwUndoBookmark() override
Definition: unbkmk.cxx:44
void SetInDoc(SwDoc *)
Definition: unbkmk.cxx:48
const std::unique_ptr< SwHistoryNoTextFieldmark > m_pHistoryNoTextFieldmark
Definition: doc.hxx:187
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:183
SwUndoInsTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:188
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:160
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unbkmk.cxx:125
virtual ~SwUndoRenameBookmark() override
Definition: unbkmk.cxx:114
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:165
void ResetInDoc(SwDoc &)
Definition: unbkmk.cxx:53
SwUndoDelNoTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:170
History object containing all information used during undo / redo of checkbox and drop-down form fiel...
Definition: rolbck.hxx:273
SwUndoRenameBookmark(const OUString &rOldName, const OUString &rNewName, const SwDoc &rDoc)
Definition: unbkmk.cxx:107
const std::unique_ptr< SwHistoryBookmark > m_pHistoryBookmark
SwUndoInsBookmark(const ::sw::mark::IMark &)
Definition: unbkmk.cxx:77
static void Rename(::sw::UndoRedoContext const &, const OUString &sFrom, const OUString &sTo)
Definition: unbkmk.cxx:134
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this undo object.
Definition: unbkmk.cxx:68
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:178
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:144
Handling undo / redo of text form field deletion.
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:194
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:87
SwUndoInsNoTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:154
Handling undo / redo of text form field insertion.
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:102
const std::unique_ptr< SwHistoryTextFieldmark > m_pHistoryTextFieldmark
Handling undo / redo of checkbox and drop-down form field deletion.
const std::unique_ptr< SwHistoryTextFieldmark > m_pHistoryTextFieldmark
SwUndoDeleteBookmark(const ::sw::mark::IMark &)
Definition: unbkmk.cxx:92
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:97
const OUString m_sOldName
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:212
const std::unique_ptr< SwHistoryNoTextFieldmark > m_pHistoryNoTextFieldmark
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:82
SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::IMark &)
Definition: unbkmk.cxx:37
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:217
const OUString m_sNewName
Handling undo / redo of checkbox and drop-down form field insertion.