Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / acredlin.hxx
blobc5ce73de1693fa3ead70f403d1f3a3cdf6d4d0e7
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 <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>
38 class ScViewData;
39 class ScDocument;
41 class ScRedlinData : public RedlinData
43 public:
44 ScRedlinData();
45 virtual ~ScRedlinData();
46 SCTAB nTable;
47 SCCOL nCol;
48 SCROW nRow;
49 sal_uLong nActionNo;
50 sal_uLong nInfo;
51 bool bIsRejectable;
52 bool bIsAcceptable;
55 class ScAcceptChgDlg : public SfxModelessDialog
57 private:
59 Idle aSelectionIdle;
60 Idle aReOpenIdle;
61 VclPtr<SvxAcceptChgCtr> m_pAcceptChgCtr;
62 ScViewData* pViewData;
63 ScDocument* pDoc;
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;
75 OUString aStrMove;
76 OUString aStrContent;
77 OUString aStrReject;
78 OUString aStrAllAccepted;
79 OUString aStrAllRejected;
80 OUString aStrNoEntry;
81 OUString aStrContentWithChild;
82 OUString aStrChildContent;
83 OUString aStrChildOrgContent;
84 OUString aStrEmpty;
85 OUString aUnknown;
86 sal_uLong nAcceptCount;
87 sal_uLong nRejectCount;
88 bool bAcceptEnableFlag:1;
89 bool bRejectEnableFlag:1;
90 bool bNeedsUpdate:1;
91 bool bIgnoreMsg:1;
92 bool bNoSelection:1;
93 bool bHasFilterEntry:1;
94 bool bUseColor:1;
96 void Init();
97 void InitFilter();
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 );
115 protected:
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);
156 void UpdateView();
157 void ClearView();
159 bool Expand(ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
160 SvTreeListEntry* pEntry, bool bFilter = false);
162 public:
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: */