1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
31 class SAL_DLLPUBLIC_RTTI DocumentRedlineManager
: public IDocumentRedlineAccess
34 DocumentRedlineManager( SwDoc
& i_rSwdoc
);
37 * Replaced by SwRootFrame::IsHideRedlines() (this is model-level redline
40 virtual RedlineFlags
GetRedlineFlags() const override
;
42 virtual void SetRedlineFlags_intern(/*[in]*/RedlineFlags eMode
) override
;
44 virtual void SetRedlineFlags(/*[in]*/RedlineFlags eMode
) override
;
46 virtual bool IsRedlineOn() const override
;
48 virtual bool IsIgnoreRedline() const override
;
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 virtual bool HasExtraRedlineTable() const override
;
56 virtual bool IsInRedlines(const SwNode
& rNode
) const override
;
58 virtual AppendResult
AppendRedline(/*[in]*/SwRangeRedline
* pPtr
, /*[in]*/bool bCallDelete
) override
;
60 virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline
* pPtr
) override
;
61 virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline
* pPtr
) override
;
63 virtual bool SplitRedline(/*[in]*/const SwPaM
& rPam
) override
;
65 virtual bool DeleteRedline(
66 /*[in]*/const SwPaM
& rPam
,
67 /*[in]*/bool bSaveInUndo
,
68 /*[in]*/RedlineType nDelType
) override
;
70 virtual bool DeleteRedline(
71 /*[in]*/const SwStartNode
& rSection
,
72 /*[in]*/bool bSaveInUndo
,
73 /*[in]*/RedlineType nDelType
) override
;
75 virtual SwRedlineTable::size_type
GetRedlinePos(
76 /*[in]*/const SwNode
& rNode
,
77 /*[in]*/RedlineType nType
) const override
;
79 virtual bool HasRedline(
80 /*[in]*/const SwPaM
& rPam
,
81 /*[in]*/RedlineType nType
,
82 /*[in]*/bool bStartOrEndInRange
) const override
;
84 virtual void CompressRedlines() override
;
86 virtual const SwRangeRedline
* GetRedline(
87 /*[in]*/const SwPosition
& rPos
,
88 /*[in]*/SwRedlineTable::size_type
* pFndPos
) const override
;
90 virtual bool IsRedlineMove() const override
;
92 virtual void SetRedlineMove(/*[in]*/bool bFlag
) override
;
94 virtual bool AcceptRedline(/*[in]*/SwRedlineTable::size_type nPos
, /*[in]*/bool bCallDelete
) override
;
96 virtual bool AcceptRedline(/*[in]*/const SwPaM
& rPam
, /*[in]*/bool bCallDelete
) override
;
98 virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM
& rPam
) override
;
100 virtual bool RejectRedline(/*[in]*/SwRedlineTable::size_type nPos
, /*[in]*/bool bCallDelete
) override
;
102 virtual bool RejectRedline(/*[in]*/const SwPaM
& rPam
, /*[in]*/bool bCallDelete
) override
;
104 virtual void AcceptAllRedline(/*[in]*/bool bAcceptReject
) override
;
106 virtual const SwRangeRedline
* SelNextRedline(/*[in]*/SwPaM
& rPam
) const override
;
108 virtual const SwRangeRedline
* SelPrevRedline(/*[in]*/SwPaM
& rPam
) const override
;
110 virtual void UpdateRedlineAttr() override
;
112 virtual std::size_t GetRedlineAuthor() override
;
114 virtual std::size_t InsertRedlineAuthor(const OUString
& rAuthor
) override
;
116 virtual bool SetRedlineComment(
117 /*[in]*/const SwPaM
& rPam
,
118 /*[in]*/const OUString
& rComment
) override
;
120 virtual const css::uno::Sequence
<sal_Int8
>& GetRedlinePassword() const override
;
122 virtual void SetRedlinePassword(
123 /*[in]*/const css::uno::Sequence
<sal_Int8
>& rNewPassword
) override
;
125 //Non Interface methods;
127 /** Set comment-text for Redline. It then comes in via AppendRedLine.
128 Used by AutoFormat. 0-pointer resets mode.
129 Sequence number is for conjoining of Redlines by the UI. */
130 void SetAutoFormatRedlineComment( const OUString
* pText
, sal_uInt16 nSeqNo
= 0 );
132 bool IsHideRedlines() const { return m_bHideRedlines
; }
133 void SetHideRedlines(bool const bHideRedlines
) { m_bHideRedlines
= bHideRedlines
; }
135 virtual ~DocumentRedlineManager() override
;
139 DocumentRedlineManager(DocumentRedlineManager
const&) = delete;
140 DocumentRedlineManager
& operator=(DocumentRedlineManager
const&) = delete;
144 RedlineFlags meRedlineFlags
; //< Current Redline Mode.
145 std::unique_ptr
<SwRedlineTable
> mpRedlineTable
; //< List of all Ranged Redlines.
146 std::unique_ptr
<SwExtraRedlineTable
> mpExtraRedlineTable
; //< List of all Extra Redlines.
147 std::unique_ptr
<OUString
> mpAutoFormatRedlnComment
; //< Comment for Redlines inserted via AutoFormat.
148 bool mbIsRedlineMove
; //< true: Redlines are moved into to / out of the section.
149 sal_uInt16 mnAutoFormatRedlnCommentNo
; /**< SeqNo for conjoining of AutoFormat-Redlines.
150 by the UI. Managed by SwAutoFormat! */
151 css::uno::Sequence
<sal_Int8
> maRedlinePasswd
;
153 /// this flag is necessary for file import because the ViewShell/layout is
154 /// created "too late" and the ShowRedlineChanges item is not below "Views"
155 bool m_bHideRedlines
= false;
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */