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
30
31namespace sw::mark
32{
33class IMark;
34class IFieldmark;
35}
36
37class SwDoc;
38
39class SwUndoBookmark : public SwUndo
40{
41 const std::unique_ptr<SwHistoryBookmark> m_pHistoryBookmark;
42
43protected:
44 SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::IMark&);
45
46 void SetInDoc(SwDoc*);
47 void ResetInDoc(SwDoc&);
48
49public:
50 virtual ~SwUndoBookmark() override;
51
64 virtual SwRewriter GetRewriter() const override;
65};
66
68{
69public:
70 SwUndoInsBookmark(const ::sw::mark::IMark&);
71
72 virtual void UndoImpl(::sw::UndoRedoContext&) override;
73 virtual void RedoImpl(::sw::UndoRedoContext&) override;
74};
75
77{
78public:
79 SwUndoDeleteBookmark(const ::sw::mark::IMark&);
80
81 virtual void UndoImpl(::sw::UndoRedoContext&) override;
82 virtual void RedoImpl(::sw::UndoRedoContext&) override;
83};
84
85class SwUndoRenameBookmark final : public SwUndo
86{
87 const OUString m_sOldName;
88 const OUString m_sNewName;
89
90public:
91 SwUndoRenameBookmark(OUString aOldName, OUString aNewName, const SwDoc& rDoc);
92 virtual ~SwUndoRenameBookmark() override;
93
94private:
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{
104private:
105 const std::unique_ptr<SwHistoryNoTextFieldmark> m_pHistoryNoTextFieldmark;
106
107public:
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{
117private:
118 const std::unique_ptr<SwHistoryNoTextFieldmark> m_pHistoryNoTextFieldmark;
119
120public:
121 SwUndoDelNoTextFieldmark(const ::sw::mark::IFieldmark& rFieldmark);
123
124 virtual void UndoImpl(::sw::UndoRedoContext&) override;
125 virtual void RedoImpl(::sw::UndoRedoContext&) override;
126};
127
129class SwUndoInsTextFieldmark final : public SwUndo
130{
131private:
132 const std::unique_ptr<SwHistoryTextFieldmark> m_pHistoryTextFieldmark;
133
134public:
135 SwUndoInsTextFieldmark(const ::sw::mark::IFieldmark& rFieldmark);
136
137 virtual void UndoImpl(::sw::UndoRedoContext&) override;
138 virtual void RedoImpl(::sw::UndoRedoContext&) override;
139};
140
142class SwUndoDelTextFieldmark final : public SwUndo
143{
144private:
145 const std::unique_ptr<SwHistoryTextFieldmark> m_pHistoryTextFieldmark;
146
147public:
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: */
Definition: doc.hxx:197
History object containing all information used during undo / redo of checkbox and drop-down form fiel...
Definition: rolbck.hxx:276
History object containing all information used during undo / redo of text form field insertion.
Definition: rolbck.hxx:291
const std::unique_ptr< SwHistoryBookmark > m_pHistoryBookmark
SwUndoBookmark(SwUndoId nUndoId, const ::sw::mark::IMark &)
Definition: unbkmk.cxx:38
void SetInDoc(SwDoc *)
Definition: unbkmk.cxx:49
virtual ~SwUndoBookmark() override
Definition: unbkmk.cxx:45
void ResetInDoc(SwDoc &)
Definition: unbkmk.cxx:54
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this undo object.
Definition: unbkmk.cxx:69
Handling undo / redo of checkbox and drop-down form field deletion.
SwUndoDelNoTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:171
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:179
const std::unique_ptr< SwHistoryNoTextFieldmark > m_pHistoryNoTextFieldmark
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:184
Handling undo / redo of text form field deletion.
const std::unique_ptr< SwHistoryTextFieldmark > m_pHistoryTextFieldmark
SwUndoDelTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:205
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:213
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:218
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:98
SwUndoDeleteBookmark(const ::sw::mark::IMark &)
Definition: unbkmk.cxx:93
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:103
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:83
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:88
SwUndoInsBookmark(const ::sw::mark::IMark &)
Definition: unbkmk.cxx:78
Handling undo / redo of checkbox and drop-down form field insertion.
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:161
const std::unique_ptr< SwHistoryNoTextFieldmark > m_pHistoryNoTextFieldmark
SwUndoInsNoTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:155
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:166
Handling undo / redo of text form field insertion.
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:200
SwUndoInsTextFieldmark(const ::sw::mark::IFieldmark &rFieldmark)
Definition: unbkmk.cxx:189
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:195
const std::unique_ptr< SwHistoryTextFieldmark > m_pHistoryTextFieldmark
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:145
virtual ~SwUndoRenameBookmark() override
Definition: unbkmk.cxx:115
static void Rename(::sw::UndoRedoContext const &, const OUString &sFrom, const OUString &sTo)
Definition: unbkmk.cxx:135
const OUString m_sOldName
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unbkmk.cxx:126
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unbkmk.cxx:150
const OUString m_sNewName
SwUndoRenameBookmark(OUString aOldName, OUString aNewName, const SwDoc &rDoc)
Definition: unbkmk.cxx:108
SwUndoId
Definition: swundo.hxx:30