Revert "reduce symbol visibility in sw"
[LibreOffice.git] / sw / source / core / inc / DocumentRedlineManager.hxx
bloba164dbbeab7f7d534339d494542786d1e06462c8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTREDLINEMANAGER_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTREDLINEMANAGER_HXX
23 #include <IDocumentRedlineAccess.hxx>
25 class SwDoc;
27 namespace sw
30 class SAL_DLLPUBLIC_RTTI DocumentRedlineManager final : public IDocumentRedlineAccess
32 public:
33 DocumentRedlineManager( SwDoc& i_rSwdoc );
35 /**
36 * Replaced by SwRootFrame::IsHideRedlines() (this is model-level redline
37 * hiding).
39 virtual RedlineFlags GetRedlineFlags() const override;
41 virtual void SetRedlineFlags_intern(/*[in]*/RedlineFlags eMode) override;
43 virtual void SetRedlineFlags(/*[in]*/RedlineFlags eMode) override;
45 virtual bool IsRedlineOn() const override;
47 virtual bool IsIgnoreRedline() const override;
49 virtual const SwRedlineTable& GetRedlineTable() const override;
50 virtual SwRedlineTable& GetRedlineTable() override;
51 virtual const SwExtraRedlineTable& GetExtraRedlineTable() const override;
52 virtual SwExtraRedlineTable& GetExtraRedlineTable() override;
54 virtual bool IsInRedlines(const SwNode& rNode) const override;
56 virtual AppendResult AppendRedline(
57 /*[in]*/ SwRangeRedline* pPtr,
58 /*[in]*/ bool bCallDelete,
59 /*[in]*/ sal_uInt32 nMoveIDToDelete = 0) override;
61 virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr) override;
62 virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr) override;
64 virtual bool SplitRedline(/*[in]*/const SwPaM& rPam) override;
66 virtual bool DeleteRedline(
67 /*[in]*/const SwPaM& rPam,
68 /*[in]*/bool bSaveInUndo,
69 /*[in]*/RedlineType nDelType) override;
71 virtual bool DeleteRedline(
72 /*[in]*/const SwStartNode& rSection,
73 /*[in]*/bool bSaveInUndo,
74 /*[in]*/RedlineType nDelType) override;
76 virtual SwRedlineTable::size_type GetRedlinePos(
77 /*[in]*/const SwNode& rNode,
78 /*[in]*/RedlineType nType) const override;
80 virtual SwRedlineTable::size_type GetRedlineEndPos(
81 /*[in]*/ SwRedlineTable::size_type nStartPos,
82 /*[in]*/ const SwNode& rNode,
83 /*[in]*/ RedlineType nType) const override;
85 virtual bool HasRedline(
86 /*[in]*/const SwPaM& rPam,
87 /*[in]*/RedlineType nType,
88 /*[in]*/bool bStartOrEndInRange) const override;
90 virtual void CompressRedlines(size_t nStartIdx = 0) override;
92 virtual const SwRangeRedline* GetRedline(
93 /*[in]*/const SwPosition& rPos,
94 /*[in]*/SwRedlineTable::size_type* pFndPos) const override;
96 virtual bool IsRedlineMove() const override;
98 virtual void SetRedlineMove(/*[in]*/bool bFlag) override;
100 virtual bool AcceptRedline(/*[in]*/ SwRedlineTable::size_type nPos, /*[in]*/ bool bCallDelete,
101 /*[in]*/ bool bRange = false) override;
103 virtual bool AcceptRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool bCallDelete,
104 /*[in]*/ sal_Int8 nDepth = 0) override;
106 virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam) override;
108 virtual bool RejectRedline(/*[in]*/ SwRedlineTable::size_type nPos, /*[in]*/ bool bCallDelete,
109 /*[in]*/ bool bRange = false) override;
111 virtual bool RejectRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool bCallDelete,
112 /*[in]*/ sal_Int8 nDepth = 0) override;
114 virtual void AcceptAllRedline(/*[in]*/bool bAcceptReject) override;
116 virtual const SwRangeRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const override;
118 virtual const SwRangeRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const override;
120 virtual void UpdateRedlineAttr() override;
122 virtual std::size_t GetRedlineAuthor() override;
124 virtual std::size_t InsertRedlineAuthor(const OUString& rAuthor) override;
126 virtual bool SetRedlineComment(
127 /*[in]*/const SwPaM& rPam,
128 /*[in]*/const OUString& rComment) override;
130 virtual const css::uno::Sequence <sal_Int8>& GetRedlinePassword() const override;
132 virtual void SetRedlinePassword(
133 /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
135 // After nodes are removed, m_pContentNode's may not updated
136 virtual void UpdateRedlineContentNode(
137 /*[in]*/ SwRedlineTable::size_type nStartPos,
138 /*[in]*/ SwRedlineTable::size_type nEndPos) const override;
140 //Non Interface methods;
142 /** Set comment-text for Redline. It then comes in via AppendRedLine.
143 Used by AutoFormat. 0-pointer resets mode.
144 Sequence number is for conjoining of Redlines by the UI. */
145 void SetAutoFormatRedlineComment( const OUString* pText, sal_uInt16 nSeqNo = 0 );
147 bool IsHideRedlines() const { return m_bHideRedlines; }
148 void SetHideRedlines(bool const bHideRedlines) { m_bHideRedlines = bHideRedlines; }
150 void HideAll(bool bDeletion);
151 void ShowAll();
153 virtual ~DocumentRedlineManager() override;
155 private:
157 bool RejectRedlineRange(SwRedlineTable::size_type nPosOrigin,
158 SwRedlineTable::size_type& nPosStart,
159 SwRedlineTable::size_type& nPosEnd, bool bCallDelete);
160 bool AcceptRedlineRange(SwRedlineTable::size_type nPosOrigin,
161 SwRedlineTable::size_type& nPosStart,
162 SwRedlineTable::size_type& nPosEnd, bool bCallDelete);
163 bool AcceptMovedRedlines(sal_uInt32 nMovedID, bool bCallDelete);
164 bool RejectMovedRedlines(sal_uInt32 nMovedID, bool bCallDelete);
166 DocumentRedlineManager(DocumentRedlineManager const&) = delete;
167 DocumentRedlineManager& operator=(DocumentRedlineManager const&) = delete;
169 SwDoc& m_rDoc;
171 RedlineFlags meRedlineFlags; //< Current Redline Mode.
172 SwRedlineTable maRedlineTable; //< List of all Ranged Redlines.
173 SwExtraRedlineTable maExtraRedlineTable; //< List of all Extra Redlines.
174 std::optional<OUString> moAutoFormatRedlnComment; //< Comment for Redlines inserted via AutoFormat.
175 bool mbIsRedlineMove; //< true: Redlines are moved into to / out of the section.
176 sal_uInt16 mnAutoFormatRedlnCommentNo; /**< SeqNo for conjoining of AutoFormat-Redlines.
177 by the UI. Managed by SwAutoFormat! */
178 css::uno::Sequence <sal_Int8 > maRedlinePasswd;
180 /// this flag is necessary for file import because the ViewShell/layout is
181 /// created "too late" and the ShowRedlineChanges item is not below "Views"
182 bool m_bHideRedlines = false;
187 #endif
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */