LibreOffice Module sw (master)  1
DocumentRedlineManager.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_DOCUMENTREDLINEMANAGER_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTREDLINEMANAGER_HXX
22 
24 #include <memory>
25 
26 class SwDoc;
27 
28 namespace sw
29 {
30 
31 class SAL_DLLPUBLIC_RTTI DocumentRedlineManager final : public IDocumentRedlineAccess
32 {
33 public:
34  DocumentRedlineManager( SwDoc& i_rSwdoc );
35 
40  virtual RedlineFlags GetRedlineFlags() const override;
41 
42  virtual void SetRedlineFlags_intern(/*[in]*/RedlineFlags eMode) override;
43 
44  virtual void SetRedlineFlags(/*[in]*/RedlineFlags eMode) override;
45 
46  virtual bool IsRedlineOn() const override;
47 
48  virtual bool IsIgnoreRedline() const override;
49 
50  virtual const SwRedlineTable& GetRedlineTable() const override;
51  virtual SwRedlineTable& GetRedlineTable() override;
52  virtual const SwExtraRedlineTable& GetExtraRedlineTable() const override;
53  virtual SwExtraRedlineTable& GetExtraRedlineTable() override;
54 
55  virtual bool IsInRedlines(const SwNode& rNode) const override;
56 
57  virtual AppendResult AppendRedline(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool bCallDelete) override;
58 
59  virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr) override;
60  virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr) override;
61 
62  virtual bool SplitRedline(/*[in]*/const SwPaM& rPam) override;
63 
64  virtual bool DeleteRedline(
65  /*[in]*/const SwPaM& rPam,
66  /*[in]*/bool bSaveInUndo,
67  /*[in]*/RedlineType nDelType) override;
68 
69  virtual bool DeleteRedline(
70  /*[in]*/const SwStartNode& rSection,
71  /*[in]*/bool bSaveInUndo,
72  /*[in]*/RedlineType nDelType) override;
73 
74  virtual SwRedlineTable::size_type GetRedlinePos(
75  /*[in]*/const SwNode& rNode,
76  /*[in]*/RedlineType nType) const override;
77 
78  virtual bool HasRedline(
79  /*[in]*/const SwPaM& rPam,
80  /*[in]*/RedlineType nType,
81  /*[in]*/bool bStartOrEndInRange) const override;
82 
83  virtual void CompressRedlines() override;
84 
85  virtual const SwRangeRedline* GetRedline(
86  /*[in]*/const SwPosition& rPos,
87  /*[in]*/SwRedlineTable::size_type* pFndPos) const override;
88 
89  virtual bool IsRedlineMove() const override;
90 
91  virtual void SetRedlineMove(/*[in]*/bool bFlag) override;
92 
93  virtual bool AcceptRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) override;
94 
95  virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) override;
96 
97  virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam) override;
98 
99  virtual bool RejectRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) override;
100 
101  virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) override;
102 
103  virtual void AcceptAllRedline(/*[in]*/bool bAcceptReject) override;
104 
105  virtual const SwRangeRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const override;
106 
107  virtual const SwRangeRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const override;
108 
109  virtual void UpdateRedlineAttr() override;
110 
111  virtual std::size_t GetRedlineAuthor() override;
112 
113  virtual std::size_t InsertRedlineAuthor(const OUString& rAuthor) override;
114 
115  virtual bool SetRedlineComment(
116  /*[in]*/const SwPaM& rPam,
117  /*[in]*/const OUString& rComment) override;
118 
119  virtual const css::uno::Sequence <sal_Int8>& GetRedlinePassword() const override;
120 
121  virtual void SetRedlinePassword(
122  /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
123 
124  //Non Interface methods;
125 
129  void SetAutoFormatRedlineComment( const OUString* pText, sal_uInt16 nSeqNo = 0 );
130 
131  bool IsHideRedlines() const { return m_bHideRedlines; }
132  void SetHideRedlines(bool const bHideRedlines) { m_bHideRedlines = bHideRedlines; }
133 
134  void HideAll(bool bDeletion);
135  void ShowAll();
136 
137  virtual ~DocumentRedlineManager() override;
138 
139 private:
140 
142  DocumentRedlineManager& operator=(DocumentRedlineManager const&) = delete;
143 
145 
146  RedlineFlags meRedlineFlags; //< Current Redline Mode.
147  SwRedlineTable maRedlineTable; //< List of all Ranged Redlines.
148  SwExtraRedlineTable maExtraRedlineTable; //< List of all Extra Redlines.
149  std::optional<OUString> moAutoFormatRedlnComment; //< Comment for Redlines inserted via AutoFormat.
150  bool mbIsRedlineMove; //< true: Redlines are moved into to / out of the section.
153  css::uno::Sequence <sal_Int8 > maRedlinePasswd;
154 
157  bool m_bHideRedlines = false;
158 };
159 
160 }
161 
162 #endif
163 
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Starts a section of nodes in the document model.
Definition: node.hxx:312
Marks a position in the document model.
Definition: pam.hxx:35
std::optional< OUString > moAutoFormatRedlnComment
Definition: doc.hxx:188
Dialog to specify the properties of date form field.
Mode eMode
Redline that holds information about a table-cell that had some change.
Definition: redline.hxx:301
Table that holds 'extra' redlines, such as 'table row insert/delete', 'paragraph moves' etc...
Definition: docary.hxx:279
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
vector_type::size_type size_type
Definition: docary.hxx:223
void SetHideRedlines(bool const bHideRedlines)
Redline that holds information about a table-row that had some change.
Definition: redline.hxx:280
sal_uInt16 mnAutoFormatRedlnCommentNo
SeqNo for conjoining of AutoFormat-Redlines.
QPRO_FUNC_TYPE nType
RedlineType
css::uno::Sequence< sal_Int8 > maRedlinePasswd
sal_uInt16 nPos
Base class of the Writer document model elements.
Definition: node.hxx:80