Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / acredlin.hxx
blobd097dd8e3db9b924a47b7847b3ebde38737571fa
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 SC_ACREDLIN_HXX
21 #define SC_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>
37 class ScViewData;
38 class ScDocument;
40 #define FLT_DATE_BEFORE 0
41 #define FLT_DATE_SINCE 1
42 #define FLT_DATE_EQUAL 2
43 #define FLT_DATE_NOTEQUAL 3
44 #define FLT_DATE_BETWEEN 4
45 #define FLT_DATE_SAVE 5
48 class ScViewEntryPtr
50 private:
51 OUString* pAction;
52 OUString* pPos;
53 OUString* pAuthor;
54 OUString* pDate;
55 OUString* pComment;
56 void* pData;
58 public:
60 OUString* GetpAction() {return pAction; }
61 OUString* GetpPos() {return pPos; }
62 OUString* GetpAuthor() {return pAuthor; }
63 OUString* GetpDate() {return pDate; }
64 OUString* GetpComment() {return pComment;}
65 void* GetpData() {return pData; }
67 void SetpAction (OUString* pString) {pAction= pString;}
68 void SetpPos (OUString* pString) {pPos = pString;}
69 void SetpAuthor (OUString* pString) {pAuthor= pString;}
70 void SetpDate (OUString* pString) {pDate = pString;}
71 void SetpComment(OUString* pString) {pComment=pString;}
72 void SetpData (void* pdata) {pData =pdata;}
75 class ScRedlinData : public RedlinData
77 public:
79 ScRedlinData();
80 ~ScRedlinData();
81 SCTAB nTable;
82 SCCOL nCol;
83 SCROW nRow;
84 sal_uLong nActionNo;
85 sal_uLong nInfo;
86 sal_Bool bIsRejectable;
87 sal_Bool bIsAcceptable;
90 typedef long LExpNum;
92 //@ Expand entrys are ambiguous and therefore removed
93 //DECLARE_TABLE( ScChgTrackExps, LExpNum)
94 //==================================================================
96 class ScAcceptChgDlg : public SfxModelessDialog
98 private:
100 Timer aSelectionTimer;
101 Timer aReOpenTimer;
102 SvxAcceptChgCtr* m_pAcceptChgCtr;
103 ScViewData* pViewData;
104 ScDocument* pDoc;
105 ScRangeName aLocalRangeName;
106 Selection theCurSel;
107 SvxTPFilter* pTPFilter;
108 SvxTPView* pTPView;
109 SvxRedlinTable* pTheView; // #i48648 now SvHeaderTabListBox
110 ScRangeList aRangeList;
111 ScChangeViewSettings aChangeViewSet;
112 OUString aStrInsertCols;
113 OUString aStrInsertRows;
114 OUString aStrInsertTabs;
115 OUString aStrDeleteCols;
116 OUString aStrDeleteRows;
117 OUString aStrDeleteTabs;
118 OUString aStrMove;
119 OUString aStrContent;
120 OUString aStrReject;
121 OUString aStrAllAccepted;
122 OUString aStrAllRejected;
123 OUString aStrNoEntry;
124 OUString aStrContentWithChild;
125 OUString aStrChildContent;
126 OUString aStrChildOrgContent;
127 OUString aStrEmpty;
128 OUString aUnknown;
129 sal_uLong nAcceptCount;
130 sal_uLong nRejectCount;
131 bool bAcceptEnableFlag:1;
132 bool bRejectEnableFlag:1;
133 bool bNeedsUpdate:1;
134 bool bIgnoreMsg:1;
135 bool bNoSelection:1;
136 bool bHasFilterEntry:1;
137 bool bUseColor:1;
139 void Init();
140 void InitFilter();
142 DECL_LINK( FilterHandle, SvxTPFilter* );
143 DECL_LINK( RefHandle, void* );
144 DECL_LINK( FilterModified, void* );
145 DECL_LINK( RejectHandle, SvxTPView*);
146 DECL_LINK( AcceptHandle, SvxTPView*);
147 DECL_LINK( RejectAllHandle, void*);
148 DECL_LINK( AcceptAllHandle, void*);
149 DECL_LINK( ExpandingHandle, SvxRedlinTable*);
150 DECL_LINK( SelectHandle, void*);
151 DECL_LINK( RefInfoHandle, OUString*);
153 DECL_LINK( UpdateSelectionHdl, void*);
154 DECL_LINK( ChgTrackModHdl, ScChangeTrack*);
155 DECL_LINK( CommandHdl, void*);
156 DECL_LINK( ReOpenTimerHdl, void*);
157 DECL_LINK( ColCompareHdl, SvSortData*);
161 protected:
163 void RejectFiltered();
164 void AcceptFiltered();
166 bool IsValidAction(const ScChangeAction* pScChangeAction);
168 OUString* MakeTypeString(ScChangeActionType eType);
170 SvTreeListEntry* InsertChangeAction(
171 const ScChangeAction* pScChangeAction,ScChangeActionState eState,
172 SvTreeListEntry* pParent=NULL,bool bDelMaster = false,
173 bool bDisabled = false,sal_uLong nPos = LIST_APPEND);
175 SvTreeListEntry* InsertFilteredAction(
176 const ScChangeAction* pScChangeAction,ScChangeActionState eState,
177 SvTreeListEntry* pParent = NULL,bool bDelMaster = false,
178 bool bDisabled = false, sal_uLong nPos = LIST_APPEND);
180 SvTreeListEntry* InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
181 SvTreeListEntry* pParent,sal_uLong nSpecial);
183 void GetDependents( const ScChangeAction* pScChangeAction,
184 ScChangeActionMap& aActionMap,
185 SvTreeListEntry* pEntry);
187 bool InsertContentChildren( ScChangeActionMap* pActionMap, SvTreeListEntry* pParent );
189 bool InsertAcceptedORejected(SvTreeListEntry* pParent);
191 bool InsertDeletedChildren( const ScChangeAction* pChangeAction, ScChangeActionMap* pActionMap,
192 SvTreeListEntry* pParent);
194 bool InsertChildren( ScChangeActionMap* pActionMap, SvTreeListEntry* pParent );
196 void AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction,
197 sal_uLong nPos=LIST_APPEND);
199 void RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction);
200 void UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction);
202 void UpdateView();
203 void ClearView();
205 bool Expand(ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
206 SvTreeListEntry* pEntry, bool bFilter = false);
208 public:
209 ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
210 ScViewData* ptrViewData);
212 ~ScAcceptChgDlg();
214 void ReInit(ScViewData* ptrViewData);
216 virtual long PreNotify( NotifyEvent& rNEvt );
218 void Initialize (SfxChildWinInfo* pInfo);
219 virtual void FillInfo(SfxChildWinInfo&) const;
224 #endif // SC_NAMEDLG_HXX
226 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */