Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / ui / inc / acredlin.hxx
blobe1bec8acdd18b3a534bafb63c7eef83536a15c3b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <svx/ctredlin.hxx>
24 #include <chgtrack.hxx>
25 #include <chgviset.hxx>
26 #include <vcl/idle.hxx>
28 class ScViewData;
29 class ScDocument;
31 struct SfxChildWinInfo;
33 class ScRedlinData : public RedlinData
35 public:
36 ScRedlinData();
37 virtual ~ScRedlinData() override;
38 SCTAB nTable;
39 SCCOL nCol;
40 SCROW nRow;
41 sal_uLong nActionNo;
42 sal_uLong nInfo;
43 bool bIsRejectable;
44 bool bIsAcceptable;
47 class ScAcceptChgDlg final : public SfxModelessDialogController
49 Idle aSelectionIdle;
50 Idle aReOpenIdle;
51 ScViewData* pViewData;
52 ScDocument* pDoc;
53 ScRangeList aRangeList;
54 ScChangeViewSettings aChangeViewSet;
55 OUString aStrInsertCols;
56 OUString aStrInsertRows;
57 OUString aStrInsertTabs;
58 OUString aStrDeleteCols;
59 OUString aStrDeleteRows;
60 OUString aStrDeleteTabs;
61 OUString aStrMove;
62 OUString aStrContent;
63 OUString aStrReject;
64 OUString const aStrAllAccepted;
65 OUString const aStrAllRejected;
66 OUString const aStrNoEntry;
67 OUString const aStrContentWithChild;
68 OUString const aStrChildContent;
69 OUString const aStrChildOrgContent;
70 OUString const aStrEmpty;
71 OUString aUnknown;
72 sal_uLong nAcceptCount;
73 sal_uLong nRejectCount;
74 bool bIgnoreMsg:1;
75 bool bNoSelection:1;
76 bool bHasFilterEntry:1;
77 bool bUseColor:1;
79 SvxTPFilter* pTPFilter;
80 SvxTPView* pTPView;
81 SvxRedlinTable* pTheView; // #i48648 now SvHeaderTabListBox
83 std::unique_ptr<weld::Container> m_xContentArea;
84 std::unique_ptr<weld::Menu> m_xPopup;
85 std::unique_ptr<SvxAcceptChgCtr> m_xAcceptChgCtr;
87 void Init();
89 DECL_LINK( FilterHandle, SvxTPFilter*, void );
90 DECL_LINK( RefHandle, SvxTPFilter*, void );
91 DECL_LINK( RejectHandle, SvxTPView*, void );
92 DECL_LINK( AcceptHandle, SvxTPView*, void );
93 DECL_LINK( RejectAllHandle, SvxTPView*, void );
94 DECL_LINK( AcceptAllHandle, SvxTPView*, void );
95 DECL_LINK( ExpandingHandle, const weld::TreeIter&, bool );
96 DECL_LINK( SelectHandle, weld::TreeView&, void );
97 DECL_LINK( RefInfoHandle, const OUString*, void );
99 DECL_LINK( UpdateSelectionHdl, Timer*, void );
100 DECL_LINK( ChgTrackModHdl, ScChangeTrack&, void );
101 DECL_LINK( CommandHdl, const CommandEvent&, bool );
102 DECL_LINK( ReOpenTimerHdl, Timer*, void );
104 int ColCompareHdl(const weld::TreeIter& rLeft, const weld::TreeIter& rRight) const;
106 void RejectFiltered();
107 void AcceptFiltered();
109 bool IsValidAction(const ScChangeAction* pScChangeAction);
111 OUString* MakeTypeString(ScChangeActionType eType);
113 std::unique_ptr<weld::TreeIter> AppendChangeAction(
114 const ScChangeAction* pScChangeAction, bool bCreateOnDemand,
115 const weld::TreeIter* pParent = nullptr, bool bDelMaster = false,
116 bool bDisabled = false);
118 std::unique_ptr<weld::TreeIter> AppendFilteredAction(
119 const ScChangeAction* pScChangeAction,ScChangeActionState eState,
120 bool bCreateOnDemand,
121 const weld::TreeIter* pParent = nullptr, bool bDelMaster = false,
122 bool bDisabled = false);
124 std::unique_ptr<weld::TreeIter> InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
125 const weld::TreeIter& rParent, sal_uLong nSpecial);
127 void GetDependents(const ScChangeAction* pScChangeAction,
128 ScChangeActionMap& aActionMap,
129 const weld::TreeIter& rEntry);
131 bool InsertContentChildren(ScChangeActionMap* pActionMap, const weld::TreeIter& rParent);
133 bool InsertAcceptedORejected(const weld::TreeIter& rParent);
135 bool InsertDeletedChildren(const ScChangeAction* pChangeAction, ScChangeActionMap* pActionMap,
136 const weld::TreeIter& rParent);
138 bool InsertChildren(ScChangeActionMap* pActionMap, const weld::TreeIter& rParent);
140 void AppendChanges(const ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction);
142 void RemoveEntries(sal_uLong nStartAction,sal_uLong nEndAction);
143 void UpdateEntries(const ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction);
145 void UpdateView();
146 void ClearView();
148 bool Expand(const ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
149 const weld::TreeIter& rEntry, bool bFilter = false);
151 public:
152 ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
153 ScViewData* ptrViewData);
154 virtual ~ScAcceptChgDlg() override;
156 void ReInit(ScViewData* ptrViewData);
158 void Initialize (SfxChildWinInfo* pInfo);
159 virtual void FillInfo(SfxChildWinInfo&) const override;
162 #endif // INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */