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 <redline.hxx>
24 #include <tools/datetime.hxx>
25 #include <svl/eitem.hxx>
27 #include <sfx2/basedlgs.hxx>
28 #include <sfx2/viewfrm.hxx>
29 #include <sfx2/dispatch.hxx>
30 #include <svx/ctredlin.hxx>
31 #include <svx/postattr.hxx>
32 #include <o3tl/sorted_vector.hxx>
33 
34 #include <memory>
35 #include <vector>
36 
37 class SwChildWinWrapper;
38 
40 {
41  const SwRedlineData* pChild; // link to original stacked data
42  const SwRedlineDataChild* pNext; // link to stacked data
43  std::unique_ptr<weld::TreeIter> xTLBChild; // corresponding TreeListBox entry
44 };
45 
47 {
48  const SwRedlineData* pData; // RedlineDataPtr
49  const SwRedlineDataChild* pNext; // link to stacked data
50  std::unique_ptr<weld::TreeIter> xTLBParent; // corresponding TreeListBox entry
51  OUString sComment; // redline comment
52 
53  bool operator< ( const SwRedlineDataParent& rObj ) const
54  { return (pData && pData->GetSeqNo() < rObj.pData->GetSeqNo()); }
55 };
56 
57 class SwRedlineDataParentSortArr : public o3tl::sorted_vector<SwRedlineDataParent*, o3tl::less_ptr_to<SwRedlineDataParent> > {};
58 
59 typedef std::vector<std::unique_ptr<SwRedlineDataChild>> SwRedlineDataChildArr;
60 
62 {
63  std::shared_ptr<weld::Window> m_xParentDlg;
64  std::vector<std::unique_ptr<SwRedlineDataParent>> m_RedlineParents;
68  OUString const m_sInserted;
69  OUString const m_sDeleted;
70  OUString const m_sFormated;
71  OUString const m_sTableChgd;
72  OUString const m_sFormatCollSet;
73  OUString m_sFilterAction;
74  OUString const m_sAutoFormat;
76  bool const m_bRedlnAutoFormat;
77 
78  // prevent update dialog data during longer operations (cf #102657#)
80 
81  std::unique_ptr<SvxAcceptChgCtr> m_xTabPagesCTRL;
82  std::unique_ptr<weld::Menu> m_xPopup;
84  SvxRedlinTable* m_pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
85 
86  DECL_DLLPRIVATE_LINK( AcceptHdl, SvxTPView*, void );
87  DECL_DLLPRIVATE_LINK( AcceptAllHdl, SvxTPView*, void );
88  DECL_DLLPRIVATE_LINK( RejectHdl, SvxTPView*, void );
89  DECL_DLLPRIVATE_LINK( RejectAllHdl, SvxTPView*, void );
90  DECL_DLLPRIVATE_LINK( UndoHdl, SvxTPView*, void );
91  DECL_DLLPRIVATE_LINK( SelectHdl, weld::TreeView&, void );
92  DECL_DLLPRIVATE_LINK( GotoHdl, Timer*, void );
93  DECL_DLLPRIVATE_LINK( CommandHdl, const CommandEvent&, bool );
94 
95  SAL_DLLPRIVATE SwRedlineTable::size_type CalcDiff(SwRedlineTable::size_type nStart, bool bChild);
96  SAL_DLLPRIVATE void InsertChildren(SwRedlineDataParent *pParent, const SwRangeRedline& rRedln, bool bHasRedlineAutoFormat);
97  SAL_DLLPRIVATE void InsertParents(SwRedlineTable::size_type nStart, SwRedlineTable::size_type nEnd = SwRedlineTable::npos);
98  SAL_DLLPRIVATE void RemoveParents(SwRedlineTable::size_type nStart, SwRedlineTable::size_type nEnd);
99  SAL_DLLPRIVATE void InitAuthors();
100 
101  SAL_DLLPRIVATE static OUString GetActionImage(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0);
102  SAL_DLLPRIVATE OUString GetActionText(const SwRangeRedline& rRedln, sal_uInt16 nStack = 0);
103  SAL_DLLPRIVATE SwRedlineTable::size_type GetRedlinePos(const weld::TreeIter& rEntry);
104 
105  SwRedlineAcceptDlg(SwRedlineAcceptDlg const&) = delete;
106  SwRedlineAcceptDlg& operator=(SwRedlineAcceptDlg const&) = delete;
107 
108 public:
109  SwRedlineAcceptDlg(const std::shared_ptr<weld::Window>& rParent, weld::Builder *pBuilder, weld::Container *pContentArea, bool bAutoFormat = false);
111 
112  DECL_LINK( FilterChangedHdl, SvxTPFilter*, void );
113 
114  SvxAcceptChgCtr& GetChgCtrl() { return *m_xTabPagesCTRL.get(); }
115  bool HasRedlineAutoFormat() const { return m_bRedlnAutoFormat; }
116 
117  void Init(SwRedlineTable::size_type nStart = 0);
118  void CallAcceptReject( bool bSelect, bool bAccept );
119 
120  void Initialize(OUString &rExtraData);
121  void FillInfo(OUString &rExtraData) const;
122 
123  void Activate();
124 };
125 
127 {
128  std::unique_ptr<weld::Container> m_xContentArea;
129  std::unique_ptr<SwRedlineAcceptDlg> m_xImplDlg;
131 
132 public:
134  virtual ~SwModelessRedlineAcceptDlg() override;
135 
136  virtual void Activate() override;
137  virtual void FillInfo(SfxChildWinInfo&) const override;
138  void Initialize(SfxChildWinInfo * pInfo);
139 };
140 
142 {
143 public:
145  sal_uInt16 nId,
146  SfxBindings*,
147  SfxChildWinInfo*);
148 
150 
151  virtual bool ReInitDlg(SwDocShell *pDocSh) override;
152 };
153 
156 {
157  std::unique_ptr<SwRedlineAcceptDlg> mpImplDlg;
158  std::unique_ptr<weld::Container> mxContentArea;
159 public:
160  SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame);
161  virtual ~SwRedlineAcceptPanel() override;
162  virtual void dispose() override;
163 
165  virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
166 };
167 
168 #endif
169 
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetSeqNo() const
Definition: redline.hxx:166
SvxAcceptChgCtr & GetChgCtrl()
Definition: redlndlg.hxx:114
void Init()
std::unique_ptr< SvxAcceptChgCtr > m_xTabPagesCTRL
Definition: redlndlg.hxx:81
virtual void dispose() override
Definition: redlndlg.cxx:1246
OUString const m_sFormated
Definition: redlndlg.hxx:70
virtual void Activate() override
Definition: redlndlg.cxx:93
std::unique_ptr< weld::TreeIter > xTLBParent
Definition: redlndlg.hxx:50
sal_Int16 nId
SwRedlineDataChildArr m_RedlineChildren
Definition: redlndlg.hxx:65
bool HasRedlineAutoFormat() const
Definition: redlndlg.hxx:115
OUString const m_sFormatCollSet
Definition: redlndlg.hxx:72
virtual ~SwModelessRedlineAcceptDlg() override
Definition: redlndlg.cxx:139
std::shared_ptr< weld::Window > m_xParentDlg
Definition: redlndlg.hxx:63
std::unique_ptr< weld::Container > mxContentArea
Definition: redlndlg.hxx:158
bool operator<(const SwRedlineDataParent &rObj) const
Definition: redlndlg.hxx:53
SwRedlineAcceptPanel(vcl::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rFrame)
Definition: redlndlg.cxx:1229
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:1252
std::vector< std::unique_ptr< SwRedlineDataParent > > m_RedlineParents
Definition: redlndlg.hxx:64
OUString const m_sDeleted
Definition: redlndlg.hxx:69
SvxTPView * m_pTPView
Definition: redlndlg.hxx:83
OUString m_sFilterAction
Definition: redlndlg.hxx:73
std::unique_ptr< SwRedlineAcceptDlg > mpImplDlg
Definition: redlndlg.hxx:157
std::unique_ptr< weld::TreeIter > xTLBChild
Definition: redlndlg.hxx:43
SwRedlineAcceptChild(vcl::Window *, sal_uInt16 nId, SfxBindings *, SfxChildWinInfo *)
Definition: redlndlg.cxx:62
void Initialize(SfxChildWinInfo *pInfo)
Definition: redlndlg.cxx:125
vector_type::size_type size_type
Definition: docary.hxx:330
const SwRedlineDataChild * pNext
Definition: redlndlg.hxx:49
Redline (Manage Changes) panel for the sidebar.
Definition: redlndlg.hxx:155
const SwRedlineData * pChild
Definition: redlndlg.hxx:41
SvxRedlinTable * m_pTable
Definition: redlndlg.hxx:84
static sal_uInt64 CalcDiff(const Point &rPt1, const Point &rPt2)
Definition: trvlfrm.cxx:1137
bool const m_bRedlnAutoFormat
Definition: redlndlg.hxx:76
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
virtual ~SwRedlineAcceptPanel() override
Definition: redlndlg.cxx:1241
std::unique_ptr< weld::Container > m_xContentArea
Definition: redlndlg.hxx:128
std::unique_ptr< SwRedlineAcceptDlg > m_xImplDlg
Definition: redlndlg.hxx:129
OUString const m_sAutoFormat
Definition: redlndlg.hxx:74
SwChildWinWrapper * pChildWin
Definition: redlndlg.hxx:130
SwModelessRedlineAcceptDlg(SfxBindings *, SwChildWinWrapper *, weld::Window *pParent)
Definition: redlndlg.cxx:83
virtual bool ReInitDlg(SwDocShell *pDocSh) override
Definition: redlndlg.cxx:74
bool m_bOnlyFormatedRedlines
Definition: redlndlg.hxx:75
const SwRedlineData * pData
Definition: redlndlg.hxx:48
std::vector< std::unique_ptr< SwRedlineDataChild > > SwRedlineDataChildArr
Definition: redlndlg.hxx:59
const SwRedlineDataChild * pNext
Definition: redlndlg.hxx:42
virtual void FillInfo(SfxChildWinInfo &) const override
Definition: redlndlg.cxx:133
SwRedlineDataParentSortArr m_aUsedSeqNo
Definition: redlndlg.hxx:66
OUString const m_sTableChgd
Definition: redlndlg.hxx:71
static constexpr size_type npos
Definition: docary.hxx:331
OUString const m_sInserted
Definition: redlndlg.hxx:68
SFX_DECL_CHILDWINDOW_WITHID(SwRedlineAcceptChild)
std::unique_ptr< weld::Menu > m_xPopup
Definition: redlndlg.hxx:82