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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
23 #include <vcl/morebtn.hxx>
24 #include <vcl/combobox.hxx>
25 #include <vcl/group.hxx>
26 #include <svtools/headbar.hxx>
27 #include <svtools/simptabl.hxx>
28 #include <svtools/svtabbx.hxx>
29 #include "rangenam.hxx"
30 #include "anyrefdg.hxx"
31 #include <vcl/lstbox.hxx>
32 #include <svx/ctredlin.hxx>
33 #include "chgtrack.hxx"
34 #include "chgviset.hxx"
35 #include <vcl/timer.hxx>
36 #include <vcl/idle.hxx>
41 class ScRedlinData
: public RedlinData
45 virtual ~ScRedlinData();
55 class ScAcceptChgDlg
: public SfxModelessDialog
61 VclPtr
<SvxAcceptChgCtr
> m_pAcceptChgCtr
;
62 ScViewData
* pViewData
;
64 VclPtr
<SvxTPFilter
> pTPFilter
;
65 VclPtr
<SvxTPView
> pTPView
;
66 VclPtr
<SvxRedlinTable
> pTheView
; // #i48648 now SvHeaderTabListBox
67 ScRangeList aRangeList
;
68 ScChangeViewSettings aChangeViewSet
;
69 OUString aStrInsertCols
;
70 OUString aStrInsertRows
;
71 OUString aStrInsertTabs
;
72 OUString aStrDeleteCols
;
73 OUString aStrDeleteRows
;
74 OUString aStrDeleteTabs
;
78 OUString aStrAllAccepted
;
79 OUString aStrAllRejected
;
81 OUString aStrContentWithChild
;
82 OUString aStrChildContent
;
83 OUString aStrChildOrgContent
;
86 sal_uLong nAcceptCount
;
87 sal_uLong nRejectCount
;
88 bool bAcceptEnableFlag
:1;
89 bool bRejectEnableFlag
:1;
93 bool bHasFilterEntry
:1;
99 DECL_LINK_TYPED( FilterHandle
, SvxTPFilter
*, void );
100 DECL_LINK_TYPED( RefHandle
, SvxTPFilter
*, void );
101 DECL_LINK_TYPED( RejectHandle
, SvxTPView
*, void );
102 DECL_LINK_TYPED( AcceptHandle
, SvxTPView
*, void );
103 DECL_LINK_TYPED( RejectAllHandle
, SvxTPView
*, void );
104 DECL_LINK_TYPED( AcceptAllHandle
, SvxTPView
*, void );
105 DECL_LINK_TYPED( ExpandingHandle
, SvTreeListBox
*, bool );
106 DECL_LINK_TYPED( SelectHandle
, SvTreeListBox
*, void );
107 DECL_LINK_TYPED( RefInfoHandle
, const OUString
*, void );
109 DECL_LINK_TYPED( UpdateSelectionHdl
, Idle
*, void );
110 DECL_LINK_TYPED( ChgTrackModHdl
, ScChangeTrack
&, void );
111 DECL_LINK_TYPED( CommandHdl
, SvSimpleTable
*, void );
112 DECL_LINK_TYPED( ReOpenTimerHdl
, Idle
*, void );
113 DECL_LINK_TYPED( ColCompareHdl
, const SvSortData
*, sal_Int32
);
117 void RejectFiltered();
118 void AcceptFiltered();
120 bool IsValidAction(const ScChangeAction
* pScChangeAction
);
122 OUString
* MakeTypeString(ScChangeActionType eType
);
124 SvTreeListEntry
* InsertChangeAction(
125 const ScChangeAction
* pScChangeAction
,ScChangeActionState eState
,
126 SvTreeListEntry
* pParent
=nullptr,bool bDelMaster
= false,
127 bool bDisabled
= false,sal_uLong nPos
= TREELIST_APPEND
);
129 SvTreeListEntry
* InsertFilteredAction(
130 const ScChangeAction
* pScChangeAction
,ScChangeActionState eState
,
131 SvTreeListEntry
* pParent
= nullptr,bool bDelMaster
= false,
132 bool bDisabled
= false, sal_uLong nPos
= TREELIST_APPEND
);
134 SvTreeListEntry
* InsertChangeActionContent(const ScChangeActionContent
* pScChangeAction
,
135 SvTreeListEntry
* pParent
,sal_uLong nSpecial
);
137 void GetDependents( const ScChangeAction
* pScChangeAction
,
138 ScChangeActionMap
& aActionMap
,
139 SvTreeListEntry
* pEntry
);
141 bool InsertContentChildren( ScChangeActionMap
* pActionMap
, SvTreeListEntry
* pParent
);
143 bool InsertAcceptedORejected(SvTreeListEntry
* pParent
);
145 bool InsertDeletedChildren( const ScChangeAction
* pChangeAction
, ScChangeActionMap
* pActionMap
,
146 SvTreeListEntry
* pParent
);
148 bool InsertChildren( ScChangeActionMap
* pActionMap
, SvTreeListEntry
* pParent
);
150 void AppendChanges(ScChangeTrack
* pChanges
,sal_uLong nStartAction
, sal_uLong nEndAction
,
151 sal_uLong nPos
=TREELIST_APPEND
);
153 void RemoveEntrys(sal_uLong nStartAction
,sal_uLong nEndAction
);
154 void UpdateEntrys(ScChangeTrack
* pChgTrack
, sal_uLong nStartAction
,sal_uLong nEndAction
);
159 bool Expand(ScChangeTrack
* pChanges
,const ScChangeAction
* pScChangeAction
,
160 SvTreeListEntry
* pEntry
, bool bFilter
= false);
163 ScAcceptChgDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, vcl::Window
* pParent
,
164 ScViewData
* ptrViewData
);
166 virtual ~ScAcceptChgDlg();
167 virtual void dispose() override
;
169 void ReInit(ScViewData
* ptrViewData
);
171 virtual bool PreNotify( NotifyEvent
& rNEvt
) override
;
173 void Initialize (SfxChildWinInfo
* pInfo
);
174 virtual void FillInfo(SfxChildWinInfo
&) const override
;
178 #endif // INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */