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