Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / DocumentRedlineManager.hxx
bloba3644f4aea9e1ce87b3b0519256f9b2bca8e458d
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(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool bCallDelete) override;
58 virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr) override;
59 virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr) override;
61 virtual bool SplitRedline(/*[in]*/const SwPaM& rPam) override;
63 virtual bool DeleteRedline(
64 /*[in]*/const SwPaM& rPam,
65 /*[in]*/bool bSaveInUndo,
66 /*[in]*/RedlineType nDelType) override;
68 virtual bool DeleteRedline(
69 /*[in]*/const SwStartNode& rSection,
70 /*[in]*/bool bSaveInUndo,
71 /*[in]*/RedlineType nDelType) override;
73 virtual SwRedlineTable::size_type GetRedlinePos(
74 /*[in]*/const SwNode& rNode,
75 /*[in]*/RedlineType nType) const override;
77 virtual bool HasRedline(
78 /*[in]*/const SwPaM& rPam,
79 /*[in]*/RedlineType nType,
80 /*[in]*/bool bStartOrEndInRange) const override;
82 virtual void CompressRedlines(size_t nStartIdx = 0) override;
84 virtual const SwRangeRedline* GetRedline(
85 /*[in]*/const SwPosition& rPos,
86 /*[in]*/SwRedlineTable::size_type* pFndPos) const override;
88 virtual bool IsRedlineMove() const override;
90 virtual void SetRedlineMove(/*[in]*/bool bFlag) override;
92 virtual bool AcceptRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) override;
94 virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) override;
96 virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam) override;
98 virtual bool RejectRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) override;
100 virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) override;
102 virtual void AcceptAllRedline(/*[in]*/bool bAcceptReject) override;
104 virtual const SwRangeRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const override;
106 virtual const SwRangeRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const override;
108 virtual void UpdateRedlineAttr() override;
110 virtual std::size_t GetRedlineAuthor() override;
112 virtual std::size_t InsertRedlineAuthor(const OUString& rAuthor) override;
114 virtual bool SetRedlineComment(
115 /*[in]*/const SwPaM& rPam,
116 /*[in]*/const OUString& rComment) override;
118 virtual const css::uno::Sequence <sal_Int8>& GetRedlinePassword() const override;
120 virtual void SetRedlinePassword(
121 /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
123 //Non Interface methods;
125 /** Set comment-text for Redline. It then comes in via AppendRedLine.
126 Used by AutoFormat. 0-pointer resets mode.
127 Sequence number is for conjoining of Redlines by the UI. */
128 void SetAutoFormatRedlineComment( const OUString* pText, sal_uInt16 nSeqNo = 0 );
130 bool IsHideRedlines() const { return m_bHideRedlines; }
131 void SetHideRedlines(bool const bHideRedlines) { m_bHideRedlines = bHideRedlines; }
133 void HideAll(bool bDeletion);
134 void ShowAll();
136 virtual ~DocumentRedlineManager() override;
138 private:
140 DocumentRedlineManager(DocumentRedlineManager const&) = delete;
141 DocumentRedlineManager& operator=(DocumentRedlineManager const&) = delete;
143 SwDoc& m_rDoc;
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.
150 sal_uInt16 mnAutoFormatRedlnCommentNo; /**< SeqNo for conjoining of AutoFormat-Redlines.
151 by the UI. Managed by SwAutoFormat! */
152 css::uno::Sequence <sal_Int8 > maRedlinePasswd;
154 /// this flag is necessary for file import because the ViewShell/layout is
155 /// created "too late" and the ShowRedlineChanges item is not below "Views"
156 bool m_bHideRedlines = false;
161 #endif
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */