LibreOffice Module sw (master) 1
redlndlg.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#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_REDLNDLG_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_REDLNDLG_HXX
21#include <swdllapi.h>
22#include "chldwrap.hxx"
23#include <docary.hxx>
24#include <redline.hxx>
26#include <sfx2/basedlgs.hxx>
27#include <svl/lstner.hxx>
28#include <svx/ctredlin.hxx>
30
31#include <memory>
32#include <vector>
33
35
37{
38 const SwRedlineData* pChild; // link to original stacked data
39 const SwRedlineDataChild* pNext; // link to stacked data
40 std::unique_ptr<weld::TreeIter> xTLBChild; // corresponding TreeListBox entry
41};
42
44{
45 const SwRedlineData* pData; // RedlineDataPtr
46 const SwRedlineDataChild* pNext; // link to stacked data
47 std::unique_ptr<weld::TreeIter> xTLBParent; // corresponding TreeListBox entry
48 OUString sComment; // redline comment
49
50 bool operator< ( const SwRedlineDataParent& rObj ) const
51 { return (pData && pData->GetSeqNo() < rObj.pData->GetSeqNo()); }
52};
53
54class SwRedlineDataParentSortArr : public o3tl::sorted_vector<SwRedlineDataParent*, o3tl::less_ptr_to<SwRedlineDataParent> > {};
55
57{
58 std::shared_ptr<weld::Window> m_xParentDlg;
59 std::vector<std::unique_ptr<SwRedlineDataParent>> m_RedlineParents;
60 std::vector<std::unique_ptr<SwRedlineDataChild>>
62 // purely here so we don't leak
63 std::vector<std::unique_ptr<RedlinData>>
67 OUString m_sInserted;
68 OUString m_sDeleted;
69 OUString m_sFormated;
70 OUString m_sTableChgd;
73 OUString m_sAutoFormat;
76
77 // prevent update dialog data during longer operations (cf #102657#)
79
80 std::unique_ptr<SvxAcceptChgCtr> m_xTabPagesCTRL;
81 std::unique_ptr<weld::Menu> m_xPopup, m_xSortMenu;
83 SvxRedlinTable* m_pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
84
85 DECL_DLLPRIVATE_LINK( AcceptHdl, SvxTPView*, void );
86 DECL_DLLPRIVATE_LINK( AcceptAllHdl, SvxTPView*, void );
87 DECL_DLLPRIVATE_LINK( RejectHdl, SvxTPView*, void );
88 DECL_DLLPRIVATE_LINK( RejectAllHdl, SvxTPView*, void );
89 DECL_DLLPRIVATE_LINK( UndoHdl, SvxTPView*, void );
91 DECL_DLLPRIVATE_LINK( GotoHdl, Timer*, void );
92 DECL_DLLPRIVATE_LINK( CommandHdl, const CommandEvent&, bool );
93
94 SAL_DLLPRIVATE SwRedlineTable::size_type CalcDiff(SwRedlineTable::size_type nStart, bool bChild);
95 SAL_DLLPRIVATE void InsertChildren(SwRedlineDataParent *pParent, const SwRangeRedline& rRedln, bool bHasRedlineAutoFormat);
96 SAL_DLLPRIVATE void InsertParents(SwRedlineTable::size_type nStart, SwRedlineTable::size_type nEnd = SwRedlineTable::npos);
97 SAL_DLLPRIVATE void RemoveParents(SwRedlineTable::size_type nStart, SwRedlineTable::size_type nEnd);
98 SAL_DLLPRIVATE void InitAuthors();
99
100 SAL_DLLPRIVATE static OUString GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0, bool bRowChanges = false);
101 SAL_DLLPRIVATE OUString GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0);
102 SAL_DLLPRIVATE SwRedlineTable::size_type GetRedlinePos(const weld::TreeIter& rEntry);
103
106
107public:
108 SwRedlineAcceptDlg(std::shared_ptr<weld::Window> xParent, weld::Builder *pBuilder, weld::Container *pContentArea, bool bAutoFormat = false);
110
111 DECL_LINK( FilterChangedHdl, SvxTPFilter*, void );
112
113 SvxAcceptChgCtr& GetChgCtrl() { return *m_xTabPagesCTRL; }
114 bool HasRedlineAutoFormat() const { return m_bRedlnAutoFormat; }
115
116 void Init(SwRedlineTable::size_type nStart = 0);
117 void CallAcceptReject( bool bSelect, bool bAccept );
118
119 void Initialize(OUString &rExtraData);
120 void FillInfo(OUString &rExtraData) const;
121
122 void Activate();
123};
124
126{
127 std::unique_ptr<weld::Container> m_xContentArea;
128 std::unique_ptr<SwRedlineAcceptDlg> m_xImplDlg;
130
131public:
133 virtual ~SwModelessRedlineAcceptDlg() override;
134
135 virtual void Activate() override;
136 virtual void FillInfo(SfxChildWinInfo&) const override;
137 void Initialize(SfxChildWinInfo * pInfo);
138};
139
141{
142public:
144 sal_uInt16 nId,
147
149
150 virtual bool ReInitDlg(SwDocShell *pDocSh) override;
151};
152
154class SwRedlineAcceptPanel final : public PanelLayout, public SfxListener
155{
156 std::unique_ptr<SwRedlineAcceptDlg> mpImplDlg;
157 std::unique_ptr<weld::Container> mxContentArea;
158public:
160 virtual ~SwRedlineAcceptPanel() override;
161
163 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
164};
165
166#endif
167
168/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwModelessRedlineAcceptDlg(SfxBindings *, SwChildWinWrapper *, weld::Window *pParent)
Definition: redlndlg.cxx:81
virtual void FillInfo(SfxChildWinInfo &) const override
Definition: redlndlg.cxx:131
void Initialize(SfxChildWinInfo *pInfo)
Definition: redlndlg.cxx:123
virtual void Activate() override
Definition: redlndlg.cxx:91
std::unique_ptr< SwRedlineAcceptDlg > m_xImplDlg
Definition: redlndlg.hxx:128
std::unique_ptr< weld::Container > m_xContentArea
Definition: redlndlg.hxx:127
SwChildWinWrapper * m_pChildWin
Definition: redlndlg.hxx:129
virtual ~SwModelessRedlineAcceptDlg() override
Definition: redlndlg.cxx:137
virtual bool ReInitDlg(SwDocShell *pDocSh) override
Definition: redlndlg.cxx:72
SFX_DECL_CHILDWINDOW_WITHID(SwRedlineAcceptChild)
SwRedlineAcceptChild(vcl::Window *, sal_uInt16 nId, SfxBindings *, SfxChildWinInfo *)
Definition: redlndlg.cxx:60
bool HasRedlineAutoFormat() const
Definition: redlndlg.hxx:114
SvxAcceptChgCtr & GetChgCtrl()
Definition: redlndlg.hxx:113
OUString m_sFormated
Definition: redlndlg.hxx:69
SwRedlineAcceptDlg & operator=(SwRedlineAcceptDlg const &)=delete
OUString m_sFilterAction
Definition: redlndlg.hxx:72
OUString m_sInserted
Definition: redlndlg.hxx:67
OUString m_sDeleted
Definition: redlndlg.hxx:68
std::vector< std::unique_ptr< SwRedlineDataChild > > m_RedlineChildren
Definition: redlndlg.hxx:61
DECL_DLLPRIVATE_LINK(UndoHdl, SvxTPView *, void)
DECL_DLLPRIVATE_LINK(GotoHdl, Timer *, void)
DECL_DLLPRIVATE_LINK(AcceptAllHdl, SvxTPView *, void)
SvxTPView * m_pTPView
Definition: redlndlg.hxx:82
DECL_DLLPRIVATE_LINK(AcceptHdl, SvxTPView *, void)
OUString m_sAutoFormat
Definition: redlndlg.hxx:73
DECL_DLLPRIVATE_LINK(SelectHdl, weld::TreeView &, void)
std::unique_ptr< weld::Menu > m_xPopup
Definition: redlndlg.hxx:81
std::shared_ptr< weld::Window > m_xParentDlg
Definition: redlndlg.hxx:58
bool m_bOnlyFormatedRedlines
Definition: redlndlg.hxx:74
OUString m_sFormatCollSet
Definition: redlndlg.hxx:71
std::unique_ptr< SvxAcceptChgCtr > m_xTabPagesCTRL
Definition: redlndlg.hxx:80
DECL_DLLPRIVATE_LINK(RejectAllHdl, SvxTPView *, void)
SwRedlineAcceptDlg(SwRedlineAcceptDlg const &)=delete
DECL_LINK(FilterChangedHdl, SvxTPFilter *, void)
DECL_DLLPRIVATE_LINK(CommandHdl, const CommandEvent &, bool)
OUString m_sTableChgd
Definition: redlndlg.hxx:70
SwRedlineDataParentSortArr m_aUsedSeqNo
Definition: redlndlg.hxx:65
std::vector< std::unique_ptr< SwRedlineDataParent > > m_RedlineParents
Definition: redlndlg.hxx:59
std::vector< std::unique_ptr< RedlinData > > m_RedlinData
Definition: redlndlg.hxx:64
DECL_DLLPRIVATE_LINK(RejectHdl, SvxTPView *, void)
SvxRedlinTable * m_pTable
Definition: redlndlg.hxx:83
Redline (Manage Changes) panel for the sidebar.
Definition: redlndlg.hxx:155
std::unique_ptr< SwRedlineAcceptDlg > mpImplDlg
Definition: redlndlg.hxx:156
SwRedlineAcceptPanel(weld::Widget *pParent)
Definition: redlndlg.cxx:1439
std::unique_ptr< weld::Container > mxContentArea
Definition: redlndlg.hxx:157
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
We need to be a SfxListener to be able to update the list of changes when we get SfxHintId::DocChange...
Definition: redlndlg.cxx:1455
virtual ~SwRedlineAcceptPanel() override
Definition: redlndlg.cxx:1451
sal_uInt16 GetSeqNo() const
Definition: redline.hxx:150
static constexpr size_type npos
Definition: docary.hxx:223
vector_type::size_type size_type
Definition: docary.hxx:222
void Init()
sal_Int16 nId
const SwRedlineData * pChild
Definition: redlndlg.hxx:38
std::unique_ptr< weld::TreeIter > xTLBChild
Definition: redlndlg.hxx:40
const SwRedlineDataChild * pNext
Definition: redlndlg.hxx:39
bool operator<(const SwRedlineDataParent &rObj) const
Definition: redlndlg.hxx:50
std::unique_ptr< weld::TreeIter > xTLBParent
Definition: redlndlg.hxx:47
const SwRedlineDataChild * pNext
Definition: redlndlg.hxx:46
const SwRedlineData * pData
Definition: redlndlg.hxx:45
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
static sal_uInt64 CalcDiff(const Point &rPt1, const Point &rPt2)
Definition: trvlfrm.cxx:1141