LibreOffice Module sw (master) 1
UndoRedline.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_UNDOREDLINE_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_UNDOREDLINE_HXX
22
23#include <memory>
24#include <undobj.hxx>
26
27struct SwSortOptions;
28class SwRangeRedline;
30class SwUndoDelete;
31
32class SwUndoRedline : public SwUndo, public SwUndRng
33{
34protected:
35 std::unique_ptr<SwRedlineData> mpRedlData;
36 std::unique_ptr<SwRedlineSaveDatas> mpRedlSaveData;
39
40 virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
41 virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
42
43public:
44 SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange );
45
46 virtual ~SwUndoRedline() override;
47
48 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
49 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
50
51 sal_uInt16 GetRedlSaveCount() const;
52};
53
55{
56private:
57 std::unique_ptr<SwHistory> m_pHistory;
58
59 bool m_bCanGroup : 1;
60 bool m_bIsDelim : 1;
62
64
65 void InitHistory(SwPaM const& rRange);
66
67 virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
68 virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
69
70public:
72 virtual SwRewriter GetRewriter() const override;
73
74 bool CanGrouping( const SwUndoRedlineDelete& rPrev );
75
76 // SwUndoTableCpyTable needs this information:
78 sal_Int32 ContentStart() const { return m_nSttContent; }
79
80 void SetRedlineText(const OUString & rText);
81};
82
83class SwUndoRedlineSort final : public SwUndoRedline
84{
85 std::unique_ptr<SwSortOptions> m_pOpt;
88
89 virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
90 virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
91
92public:
93 SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt );
94
95 virtual ~SwUndoRedlineSort() override;
96
97 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
98
99 void SetSaveRange( const SwPaM& rRange );
100};
101
104{
105private:
106 virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
107
108public:
109 SwUndoAcceptRedline( const SwPaM& rRange );
110
111 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
112};
113
115{
116private:
117 virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
118
119public:
120 SwUndoRejectRedline( const SwPaM& rRange );
121
122 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
123};
124
125class SwUndoCompDoc final : public SwUndo, public SwUndRng
126{
127 std::unique_ptr<SwRedlineData> m_pRedlineData;
128 std::unique_ptr<SwUndoDelete> m_pUndoDelete, m_pUndoDelete2;
129 std::unique_ptr<SwRedlineSaveDatas> m_pRedlineSaveDatas;
131
132public:
133 SwUndoCompDoc( const SwPaM& rRg, bool bIns );
134 SwUndoCompDoc( const SwRangeRedline& rRedl );
135
136 virtual ~SwUndoCompDoc() override;
137
138 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
139 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
140};
141
142#endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOREDLINE_HXX
143
144/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
sal_Int32 m_nSttContent
Definition: undobj.hxx:232
SwNodeOffset m_nSttNode
Definition: undobj.hxx:231
SwNodeOffset m_nEndNode
Definition: undobj.hxx:231
Undo for Edit -> track changes -> accept.
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:430
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:425
SwUndoAcceptRedline(const SwPaM &rRange)
Definition: unredln.cxx:420
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveDatas
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:552
std::unique_ptr< SwUndoDelete > m_pUndoDelete
std::unique_ptr< SwUndoDelete > m_pUndoDelete2
SwUndoCompDoc(const SwPaM &rRg, bool bIns)
Definition: unredln.cxx:450
virtual ~SwUndoCompDoc() override
Definition: unredln.cxx:482
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:490
std::unique_ptr< SwRedlineData > m_pRedlineData
bool CanGrouping(const SwUndoRedlineDelete &rPrev)
Definition: unredln.cxx:285
SwNodeOffset NodeDiff() const
Definition: UndoRedline.hxx:77
std::unique_ptr< SwHistory > m_pHistory
for moved fly anchors
Definition: UndoRedline.hxx:57
void InitHistory(SwPaM const &rRange)
Definition: unredln.cxx:230
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:271
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:262
void SetRedlineText(const OUString &rText)
Definition: unredln.cxx:257
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unredln.cxx:245
sal_Int32 ContentStart() const
Definition: UndoRedline.hxx:78
SwUndoRedlineDelete(const SwPaM &rRange, SwUndoId nUserId, SwDeleteFlags flags=SwDeleteFlags::Default)
Definition: unredln.cxx:202
sal_Int32 m_nSaveEndContent
Definition: UndoRedline.hxx:87
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:378
void SetSaveRange(const SwPaM &rRange)
Definition: unredln.cxx:413
std::unique_ptr< SwSortOptions > m_pOpt
Definition: UndoRedline.hxx:85
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:408
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:331
SwNodeOffset m_nSaveEndNode
Definition: UndoRedline.hxx:86
virtual ~SwUndoRedlineSort() override
Definition: unredln.cxx:327
SwUndoRedlineSort(const SwPaM &rRange, const SwSortOptions &rOpt)
Definition: unredln.cxx:319
virtual ~SwUndoRedline() override
Definition: unredln.cxx:80
SwUndoId mnUserId
Definition: UndoRedline.hxx:37
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:91
std::unique_ptr< SwRedlineSaveDatas > mpRedlSaveData
Definition: UndoRedline.hxx:36
bool mbHiddenRedlines
Definition: UndoRedline.hxx:38
std::unique_ptr< SwRedlineData > mpRedlData
Definition: UndoRedline.hxx:35
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:197
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:169
sal_uInt16 GetRedlSaveCount() const
Definition: unredln.cxx:86
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:192
SwUndoRedline(SwUndoId nUserId, const SwPaM &rRange)
Definition: unredln.cxx:40
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:440
SwUndoRejectRedline(const SwPaM &rRange)
Definition: unredln.cxx:435
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:445
SwUndoId
Definition: swundo.hxx:30