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>
25 
26 struct SwSortOptions;
27 class SwRangeRedline;
28 class SwRedlineSaveDatas;
29 class SwUndoDelete;
30 
31 class SwUndoRedline : public SwUndo, public SwUndRng
32 {
33 protected:
34  std::unique_ptr<SwRedlineData> mpRedlData;
35  std::unique_ptr<SwRedlineSaveDatas> mpRedlSaveData;
38 
39  virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
40  virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam);
41 
42 public:
43  SwUndoRedline( SwUndoId nUserId, const SwPaM& rRange );
44 
45  virtual ~SwUndoRedline() override;
46 
47  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
48  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
49 
50  sal_uInt16 GetRedlSaveCount() const;
51 };
52 
54 {
55  bool bCanGroup : 1;
56  bool bIsDelim : 1;
57  bool bIsBackspace : 1;
58 
59  OUString m_sRedlineText;
60 
61  virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
62  virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
63 
64 public:
65  SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUserId );
66  virtual SwRewriter GetRewriter() const override;
67 
68  bool CanGrouping( const SwUndoRedlineDelete& rPrev );
69 
70  // SwUndoTableCpyTable needs this information:
71  long NodeDiff() const { return nSttNode - nEndNode; }
72  sal_Int32 ContentStart() const { return nSttContent; }
73 
74  void SetRedlineText(const OUString & rText);
75 };
76 
78 {
79  std::unique_ptr<SwSortOptions> pOpt;
81  sal_Int32 nSaveEndContent;
82 
83  virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
84  virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
85 
86 public:
87  SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt );
88 
89  virtual ~SwUndoRedlineSort() override;
90 
91  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
92 
93  void SetSaveRange( const SwPaM& rRange );
94 };
95 
97 {
98 private:
99  virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
100 
101 public:
102  SwUndoAcceptRedline( const SwPaM& rRange );
103 
104  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
105 };
106 
108 {
109 private:
110  virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) override;
111 
112 public:
113  SwUndoRejectRedline( const SwPaM& rRange );
114 
115  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
116 };
117 
118 class SwUndoCompDoc : public SwUndo, public SwUndRng
119 {
120  std::unique_ptr<SwRedlineData> pRedlData;
121  std::unique_ptr<SwUndoDelete> pUnDel, pUnDel2;
122  std::unique_ptr<SwRedlineSaveDatas> pRedlSaveData;
123  bool const bInsert;
124 
125 public:
126  SwUndoCompDoc( const SwPaM& rRg, bool bIns );
127  SwUndoCompDoc( const SwRangeRedline& rRedl );
128 
129  virtual ~SwUndoCompDoc() override;
130 
131  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
132  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
133 };
134 
135 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOREDLINE_HXX
136 
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetRedlSaveCount() const
Definition: unredln.cxx:84
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:378
virtual ~SwUndoRedline() override
Definition: unredln.cxx:78
sal_Int32 nSttContent
Definition: undobj.hxx:217
std::unique_ptr< SwRedlineSaveDatas > mpRedlSaveData
Definition: UndoRedline.hxx:35
SwUndoId
Definition: swundo.hxx:29
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:423
sal_uLong nSaveEndNode
Definition: UndoRedline.hxx:80
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:202
sal_uIntPtr sal_uLong
virtual ~SwUndoRedlineSort() override
Definition: unredln.cxx:253
Definition: doc.hxx:185
virtual ~SwUndoCompDoc() override
Definition: unredln.cxx:415
std::unique_ptr< SwRedlineData > pRedlData
std::unique_ptr< SwRedlineSaveDatas > pRedlSaveData
SwUndoCompDoc(const SwPaM &rRg, bool bIns)
Definition: unredln.cxx:383
void SetRedlineText(const OUString &rText)
Definition: unredln.cxx:192
sal_uLong nEndNode
Definition: undobj.hxx:216
SwUndoRedline(SwUndoId nUserId, const SwPaM &rRange)
Definition: unredln.cxx:38
bool mbHiddenRedlines
Definition: UndoRedline.hxx:37
std::unique_ptr< SwUndoDelete > pUnDel2
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:373
bool CanGrouping(const SwUndoRedlineDelete &rPrev)
Definition: unredln.cxx:211
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:363
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
void SetSaveRange(const SwPaM &rRange)
Definition: unredln.cxx:346
sal_Int32 ContentStart() const
Definition: UndoRedline.hxx:72
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:487
SwUndoRedlineDelete(const SwPaM &rRange, SwUndoId nUserId)
Definition: unredln.cxx:156
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:89
sal_uLong nSttNode
Definition: undobj.hxx:216
std::unique_ptr< SwSortOptions > pOpt
Definition: UndoRedline.hxx:79
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:309
std::unique_ptr< SwRedlineData > mpRedlData
Definition: UndoRedline.hxx:34
SwUndoRejectRedline(const SwPaM &rRange)
Definition: unredln.cxx:368
SwUndoRedlineSort(const SwPaM &rRange, const SwSortOptions &rOpt)
Definition: unredln.cxx:245
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unredln.cxx:123
SwUndoId const mnUserId
Definition: UndoRedline.hxx:36
SwUndoAcceptRedline(const SwPaM &rRange)
Definition: unredln.cxx:353
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:358
sal_Int32 nSaveEndContent
Definition: UndoRedline.hxx:81
bool const bInsert
virtual void RedoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:151
std::unique_ptr< SwUndoDelete > pUnDel
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: unredln.cxx:180
long NodeDiff() const
Definition: UndoRedline.hxx:71
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam)
Definition: unredln.cxx:146
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unredln.cxx:341
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:257
virtual void UndoRedlineImpl(SwDoc &rDoc, SwPaM &rPam) override
Definition: unredln.cxx:197