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