LibreOffice Module sc (master)  1
acredlin.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 
20 #pragma once
21 
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>
28 
29 class ScViewData;
30 class ScDocument;
31 
32 struct SfxChildWinInfo;
33 
34 class ScRedlinData : public RedlinData
35 {
36 public:
37  ScRedlinData();
38  virtual ~ScRedlinData() override;
46 };
47 
49 {
56  OUString aStrInsertCols;
57  OUString aStrInsertRows;
58  OUString aStrInsertTabs;
59  OUString aStrDeleteCols;
60  OUString aStrDeleteRows;
61  OUString aStrDeleteTabs;
62  OUString aStrMove;
63  OUString aStrContent;
64  OUString aStrReject;
65  OUString aStrAllAccepted;
66  OUString aStrAllRejected;
67  OUString aStrNoEntry;
69  OUString aStrChildContent;
71  OUString aStrEmpty;
72  OUString aUnknown;
75  bool bIgnoreMsg:1;
76  bool bNoSelection:1;
78  bool bUseColor:1;
79 
82  SvxRedlinTable* pTheView; // #i48648 now SvHeaderTabListBox
83 
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;
87 
88  void Init();
89 
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 );
99 
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 );
104 
105  int ColCompareHdl(const weld::TreeIter& rLeft, const weld::TreeIter& rRight) const;
106 
107  void RejectFiltered();
108  void AcceptFiltered();
109 
110  bool IsValidAction(const ScChangeAction* pScChangeAction);
111 
112  OUString* MakeTypeString(ScChangeActionType eType);
113 
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);
118 
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);
124 
125  std::unique_ptr<weld::TreeIter> InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
126  const weld::TreeIter& rParent, sal_uLong nSpecial);
127 
128  void GetDependents(const ScChangeAction* pScChangeAction,
129  ScChangeActionMap& aActionMap,
130  const weld::TreeIter& rEntry);
131 
132  bool InsertContentChildren(ScChangeActionMap* pActionMap, const weld::TreeIter& rParent);
133 
134  bool InsertAcceptedORejected(const weld::TreeIter& rParent);
135 
136  bool InsertDeletedChildren(const ScChangeAction* pChangeAction, ScChangeActionMap* pActionMap,
137  const weld::TreeIter& rParent);
138 
139  bool InsertChildren(ScChangeActionMap* pActionMap, const weld::TreeIter& rParent);
140 
141  void AppendChanges(const ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction);
142 
143  void RemoveEntries(sal_uLong nStartAction,sal_uLong nEndAction);
144  void UpdateEntries(const ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction);
145 
146  void UpdateView();
147  void ClearView();
148 
149  bool Expand(const ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
150  const weld::TreeIter& rEntry, bool bFilter = false);
151 
152 public:
154  ScViewData* ptrViewData);
155  virtual ~ScAcceptChgDlg() override;
156 
157  void ReInit(ScViewData* ptrViewData);
158 
159  void Initialize (SfxChildWinInfo* pInfo);
160  virtual void FillInfo(SfxChildWinInfo&) const override;
161 };
162 
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool bHasFilterEntry
Definition: acredlin.hxx:77
OUString aStrReject
Definition: acredlin.hxx:64
OUString aStrDeleteCols
Definition: acredlin.hxx:59
void AppendChanges(const ScChangeTrack *pChanges, sal_uLong nStartAction, sal_uLong nEndAction)
Definition: acredlin.cxx:1328
ScChangeActionState
Definition: chgtrack.hxx:76
std::unique_ptr< weld::TreeIter > AppendChangeAction(const ScChangeAction *pScChangeAction, bool bCreateOnDemand, const weld::TreeIter *pParent=nullptr, bool bDelMaster=false, bool bDisabled=false)
Definition: acredlin.cxx:355
sal_uLong nRejectCount
Definition: acredlin.hxx:74
OUString aStrInsertCols
Definition: acredlin.hxx:56
std::unique_ptr< weld::Menu > m_xPopup
Definition: acredlin.hxx:85
sal_uIntPtr sal_uLong
OUString aStrAllAccepted
Definition: acredlin.hxx:65
SCROW nRow
Definition: acredlin.hxx:43
ScChangeActionType
Definition: chgtrack.hxx:62
bool bIsRejectable
Definition: acredlin.hxx:44
SvxTPView * pTPView
Definition: acredlin.hxx:81
bool InsertContentChildren(ScChangeActionMap *pActionMap, const weld::TreeIter &rParent)
Definition: acredlin.cxx:1069
sal_uLong nInfo
Definition: acredlin.hxx:40
bool Expand(const ScChangeTrack *pChanges, const ScChangeAction *pScChangeAction, const weld::TreeIter &rEntry, bool bFilter=false)
Definition: acredlin.cxx:1231
OUString aStrContentWithChild
Definition: acredlin.hxx:68
virtual void FillInfo(SfxChildWinInfo &) const override
Definition: acredlin.cxx:1720
OUString aStrChildOrgContent
Definition: acredlin.hxx:70
int ColCompareHdl(const weld::TreeIter &rLeft, const weld::TreeIter &rRight) const
Definition: acredlin.cxx:1752
Idle aSelectionIdle
Definition: acredlin.hxx:50
OUString aStrEmpty
Definition: acredlin.hxx:71
std::unique_ptr< weld::TreeIter > InsertChangeActionContent(const ScChangeActionContent *pScChangeAction, const weld::TreeIter &rParent, sal_uLong nSpecial)
Definition: acredlin.cxx:616
OUString aStrInsertTabs
Definition: acredlin.hxx:58
bool bIsAcceptable
Definition: acredlin.hxx:45
void AcceptFiltered()
Definition: acredlin.cxx:965
bool InsertAcceptedORejected(const weld::TreeIter &rParent)
Definition: acredlin.cxx:1144
OUString aStrContent
Definition: acredlin.hxx:63
OUString aStrNoEntry
Definition: acredlin.hxx:67
void UpdateEntries(const ScChangeTrack *pChgTrack, sal_uLong nStartAction, sal_uLong nEndAction)
Definition: acredlin.cxx:1444
void RemoveEntries(sal_uLong nStartAction, sal_uLong nEndAction)
Definition: acredlin.cxx:1401
OUString aStrChildContent
Definition: acredlin.hxx:69
OUString aStrAllRejected
Definition: acredlin.hxx:66
std::unique_ptr< weld::TreeIter > AppendFilteredAction(const ScChangeAction *pScChangeAction, ScChangeActionState eState, bool bCreateOnDemand, const weld::TreeIter *pParent=nullptr, bool bDelMaster=false, bool bDisabled=false)
Definition: acredlin.cxx:502
OUString aUnknown
Definition: acredlin.hxx:72
std::unique_ptr< SvxAcceptChgCtr > m_xAcceptChgCtr
Definition: acredlin.hxx:86
sal_Int16 SCCOL
Definition: types.hxx:21
void ReInit(ScViewData *ptrViewData)
Definition: acredlin.cxx:158
OUString aStrDeleteRows
Definition: acredlin.hxx:60
bool IsValidAction(const ScChangeAction *pScChangeAction)
Definition: acredlin.cxx:307
OUString * MakeTypeString(ScChangeActionType eType)
Definition: acredlin.cxx:286
OUString aStrInsertRows
Definition: acredlin.hxx:57
bool InsertChildren(ScChangeActionMap *pActionMap, const weld::TreeIter &rParent)
Definition: acredlin.cxx:1173
ScRangeList aRangeList
Definition: acredlin.hxx:54
std::map< sal_uLong, ScChangeAction * > ScChangeActionMap
Definition: chgtrack.hxx:805
sal_Int32 SCROW
Definition: types.hxx:17
OUString aStrMove
Definition: acredlin.hxx:62
virtual ~ScRedlinData() override
Definition: acredlin.cxx:59
void UpdateView()
Definition: acredlin.cxx:736
sal_uLong nActionNo
Definition: acredlin.hxx:39
bool InsertDeletedChildren(const ScChangeAction *pChangeAction, ScChangeActionMap *pActionMap, const weld::TreeIter &rParent)
Definition: acredlin.cxx:1199
SCTAB nTable
Definition: acredlin.hxx:41
std::unique_ptr< weld::Container > m_xContentArea
Definition: acredlin.hxx:84
bool bNoSelection
Definition: acredlin.hxx:76
void ClearView()
Definition: acredlin.cxx:276
std::unique_ptr< weld::Menu > m_xSortMenu
Definition: acredlin.hxx:85
Idle aReOpenIdle
Definition: acredlin.hxx:51
ScAcceptChgDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData *ptrViewData)
Definition: acredlin.cxx:70
SvxRedlinTable * pTheView
Definition: acredlin.hxx:82
ScChangeViewSettings aChangeViewSet
Definition: acredlin.hxx:55
OUString aStrDeleteTabs
Definition: acredlin.hxx:61
void Initialize(SfxChildWinInfo *pInfo)
Definition: acredlin.cxx:1686
void RejectFiltered()
Definition: acredlin.cxx:945
virtual ~ScAcceptChgDlg() override
Definition: acredlin.cxx:146
void GetDependents(const ScChangeAction *pScChangeAction, ScChangeActionMap &aActionMap, const weld::TreeIter &rEntry)
Definition: acredlin.cxx:1044
DECL_LINK(FilterHandle, SvxTPFilter *, void)
sal_uLong nAcceptCount
Definition: acredlin.hxx:73
ScViewData * pViewData
Definition: acredlin.hxx:52
ScDocument * pDoc
Definition: acredlin.hxx:53
SvxTPFilter * pTPFilter
Definition: acredlin.hxx:80
sal_Int16 SCTAB
Definition: types.hxx:22
SCCOL nCol
Definition: acredlin.hxx:42