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 : 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  virtual bool HasExtraRedlineTable() const override;
55 
56  virtual bool IsInRedlines(const SwNode& rNode) const override;
57 
58  virtual AppendResult AppendRedline(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool bCallDelete) override;
59 
60  virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr) override;
61  virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr) override;
62 
63  virtual bool SplitRedline(/*[in]*/const SwPaM& rPam) override;
64 
65  virtual bool DeleteRedline(
66  /*[in]*/const SwPaM& rPam,
67  /*[in]*/bool bSaveInUndo,
68  /*[in]*/RedlineType nDelType) override;
69 
70  virtual bool DeleteRedline(
71  /*[in]*/const SwStartNode& rSection,
72  /*[in]*/bool bSaveInUndo,
73  /*[in]*/RedlineType nDelType) override;
74 
75  virtual SwRedlineTable::size_type GetRedlinePos(
76  /*[in]*/const SwNode& rNode,
77  /*[in]*/RedlineType nType) const override;
78 
79  virtual bool HasRedline(
80  /*[in]*/const SwPaM& rPam,
81  /*[in]*/RedlineType nType,
82  /*[in]*/bool bStartOrEndInRange) const override;
83 
84  virtual void CompressRedlines() override;
85 
86  virtual const SwRangeRedline* GetRedline(
87  /*[in]*/const SwPosition& rPos,
88  /*[in]*/SwRedlineTable::size_type* pFndPos) const override;
89 
90  virtual bool IsRedlineMove() const override;
91 
92  virtual void SetRedlineMove(/*[in]*/bool bFlag) override;
93 
94  virtual bool AcceptRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) override;
95 
96  virtual bool AcceptRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) override;
97 
98  virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam) override;
99 
100  virtual bool RejectRedline(/*[in]*/SwRedlineTable::size_type nPos, /*[in]*/bool bCallDelete) override;
101 
102  virtual bool RejectRedline(/*[in]*/const SwPaM& rPam, /*[in]*/bool bCallDelete) override;
103 
104  virtual void AcceptAllRedline(/*[in]*/bool bAcceptReject) override;
105 
106  virtual const SwRangeRedline* SelNextRedline(/*[in]*/SwPaM& rPam) const override;
107 
108  virtual const SwRangeRedline* SelPrevRedline(/*[in]*/SwPaM& rPam) const override;
109 
110  virtual void UpdateRedlineAttr() override;
111 
112  virtual std::size_t GetRedlineAuthor() override;
113 
114  virtual std::size_t InsertRedlineAuthor(const OUString& rAuthor) override;
115 
116  virtual bool SetRedlineComment(
117  /*[in]*/const SwPaM& rPam,
118  /*[in]*/const OUString& rComment) override;
119 
120  virtual const css::uno::Sequence <sal_Int8>& GetRedlinePassword() const override;
121 
122  virtual void SetRedlinePassword(
123  /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
124 
125  //Non Interface methods;
126 
130  void SetAutoFormatRedlineComment( const OUString* pText, sal_uInt16 nSeqNo = 0 );
131 
132  bool IsHideRedlines() const { return m_bHideRedlines; }
133  void SetHideRedlines(bool const bHideRedlines) { m_bHideRedlines = bHideRedlines; }
134 
135  virtual ~DocumentRedlineManager() override;
136 
137 private:
138 
140  DocumentRedlineManager& operator=(DocumentRedlineManager const&) = delete;
141 
143 
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.
151  css::uno::Sequence <sal_Int8 > maRedlinePasswd;
152 
155  bool m_bHideRedlines = false;
156 };
157 
158 }
159 
160 #endif
161 
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Starts a section of nodes in the document model.
Definition: node.hxx:311
std::unique_ptr< SwRedlineTable > mpRedlineTable
Marks a position in the document model.
Definition: pam.hxx:35
Definition: doc.hxx:186
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:277
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
vector_type::size_type size_type
Definition: docary.hxx:228
void SetHideRedlines(bool const bHideRedlines)
std::unique_ptr< SwExtraRedlineTable > mpExtraRedlineTable
Redline that holds information about a table-row that had some change.
Definition: redline.hxx:280
std::unique_ptr< OUString > mpAutoFormatRedlnComment
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:79