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 .
22 #include <svx/ctredlin.hxx>
23 #include <sfx2/basedlgs.hxx>
24 #include <sfx2/bindings.hxx>
25 #include <chgtrack.hxx>
26 #include <chgviset.hxx>
27 #include <vcl/idle.hxx>
32 struct SfxChildWinInfo
;
34 class ScRedlinData
: public RedlinData
38 virtual ~ScRedlinData() override
;
48 class ScAcceptChgDlg final
: public SfxModelessDialogController
52 ScViewData
* pViewData
;
54 ScRangeList aRangeList
;
55 ScChangeViewSettings aChangeViewSet
;
56 OUString aStrInsertCols
;
57 OUString aStrInsertRows
;
58 OUString aStrInsertTabs
;
59 OUString aStrDeleteCols
;
60 OUString aStrDeleteRows
;
61 OUString aStrDeleteTabs
;
65 OUString aStrAllAccepted
;
66 OUString aStrAllRejected
;
68 OUString aStrContentWithChild
;
69 OUString aStrChildContent
;
70 OUString aStrChildOrgContent
;
73 sal_uLong nAcceptCount
;
74 sal_uLong nRejectCount
;
77 bool bHasFilterEntry
:1;
80 SvxTPFilter
* pTPFilter
;
82 SvxRedlinTable
* pTheView
; // #i48648 now SvHeaderTabListBox
84 std::unique_ptr
<weld::Container
> m_xContentArea
;
85 std::unique_ptr
<weld::Menu
> m_xPopup
, m_xSortMenu
;
86 std::unique_ptr
<SvxAcceptChgCtr
> m_xAcceptChgCtr
;
90 DECL_LINK( FilterHandle
, SvxTPFilter
*, void );
91 DECL_LINK( RefHandle
, SvxTPFilter
*, void );
92 DECL_LINK( RejectHandle
, SvxTPView
*, void );
93 DECL_LINK( AcceptHandle
, SvxTPView
*, void );
94 DECL_LINK( RejectAllHandle
, SvxTPView
*, void );
95 DECL_LINK( AcceptAllHandle
, SvxTPView
*, void );
96 DECL_LINK( ExpandingHandle
, const weld::TreeIter
&, bool );
97 DECL_LINK( SelectHandle
, weld::TreeView
&, void );
98 DECL_LINK( RefInfoHandle
, const OUString
*, void );
100 DECL_LINK( UpdateSelectionHdl
, Timer
*, void );
101 DECL_LINK( ChgTrackModHdl
, ScChangeTrack
&, void );
102 DECL_LINK( CommandHdl
, const CommandEvent
&, bool );
103 DECL_LINK( ReOpenTimerHdl
, Timer
*, void );
105 int ColCompareHdl(const weld::TreeIter
& rLeft
, const weld::TreeIter
& rRight
) const;
107 void RejectFiltered();
108 void AcceptFiltered();
110 bool IsValidAction(const ScChangeAction
* pScChangeAction
);
112 OUString
* MakeTypeString(ScChangeActionType eType
);
114 std::unique_ptr
<weld::TreeIter
> AppendChangeAction(
115 const ScChangeAction
* pScChangeAction
, bool bCreateOnDemand
,
116 const weld::TreeIter
* pParent
= nullptr, bool bDelMaster
= false,
117 bool bDisabled
= false);
119 std::unique_ptr
<weld::TreeIter
> AppendFilteredAction(
120 const ScChangeAction
* pScChangeAction
,ScChangeActionState eState
,
121 bool bCreateOnDemand
,
122 const weld::TreeIter
* pParent
= nullptr, bool bDelMaster
= false,
123 bool bDisabled
= false);
125 std::unique_ptr
<weld::TreeIter
> InsertChangeActionContent(const ScChangeActionContent
* pScChangeAction
,
126 const weld::TreeIter
& rParent
, sal_uLong nSpecial
);
128 void GetDependents(const ScChangeAction
* pScChangeAction
,
129 ScChangeActionMap
& aActionMap
,
130 const weld::TreeIter
& rEntry
);
132 bool InsertContentChildren(ScChangeActionMap
* pActionMap
, const weld::TreeIter
& rParent
);
134 bool InsertAcceptedORejected(const weld::TreeIter
& rParent
);
136 bool InsertDeletedChildren(const ScChangeAction
* pChangeAction
, ScChangeActionMap
* pActionMap
,
137 const weld::TreeIter
& rParent
);
139 bool InsertChildren(ScChangeActionMap
* pActionMap
, const weld::TreeIter
& rParent
);
141 void AppendChanges(const ScChangeTrack
* pChanges
,sal_uLong nStartAction
, sal_uLong nEndAction
);
143 void RemoveEntries(sal_uLong nStartAction
,sal_uLong nEndAction
);
144 void UpdateEntries(const ScChangeTrack
* pChgTrack
, sal_uLong nStartAction
,sal_uLong nEndAction
);
149 bool Expand(const ScChangeTrack
* pChanges
,const ScChangeAction
* pScChangeAction
,
150 const weld::TreeIter
& rEntry
, bool bFilter
= false);
153 ScAcceptChgDlg(SfxBindings
* pB
, SfxChildWindow
* pCW
, weld::Window
* pParent
,
154 ScViewData
* ptrViewData
);
155 virtual ~ScAcceptChgDlg() override
;
157 void ReInit(ScViewData
* ptrViewData
);
159 void Initialize (SfxChildWinInfo
* pInfo
);
160 virtual void FillInfo(SfxChildWinInfo
&) const override
;
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */