xref: /aoo42x/main/sc/source/ui/inc/acredlin.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_ACREDLIN_HXX
25 #define SC_ACREDLIN_HXX
26 
27 #ifndef _MOREBTN_HXX //autogen
28 #include <vcl/morebtn.hxx>
29 #endif
30 #ifndef _COMBOBOX_HXX //autogen
31 #include <vcl/combobox.hxx>
32 #endif
33 #ifndef _GROUP_HXX //autogen
34 #include <vcl/group.hxx>
35 #endif
36 #include <svtools/headbar.hxx>
37 #include <svtools/svtabbx.hxx>
38 
39 
40 #include "rangenam.hxx"
41 #include "anyrefdg.hxx"
42 #include <vcl/lstbox.hxx>
43 
44 #ifndef _SVX_ACREDLIN_HXX
45 #include <svx/ctredlin.hxx>
46 #endif
47 #include <svx/simptabl.hxx>
48 
49 #ifndef _SVARRAY_HXX
50 #define _SVARRAY_HXX
51 #include <svl/svarray.hxx>
52 #endif
53 #include "chgtrack.hxx"
54 #include "chgviset.hxx"
55 #include <vcl/timer.hxx>
56 
57 class ScViewData;
58 class ScDocument;
59 
60 #define FLT_DATE_BEFORE		0
61 #define FLT_DATE_SINCE		1
62 #define FLT_DATE_EQUAL		2
63 #define FLT_DATE_NOTEQUAL	3
64 #define FLT_DATE_BETWEEN	4
65 #define FLT_DATE_SAVE		5
66 
67 
68 class ScViewEntryPtr
69 {
70 private:
71 	String*			pAction;
72 	String*			pPos;
73 	String*			pAuthor;
74 	String*			pDate;
75 	String*			pComment;
76 	void*			pData;
77 
78 public:
79 
GetpAction()80 	String*			GetpAction()	{return pAction; }
GetpPos()81 	String*			GetpPos()		{return pPos;    }
GetpAuthor()82 	String*			GetpAuthor()	{return	pAuthor; }
GetpDate()83 	String*			GetpDate()		{return	pDate;   }
GetpComment()84 	String*			GetpComment()	{return	pComment;}
GetpData()85 	void*			GetpData()		{return pData;	 }
86 
SetpAction(String * pString)87 	void		SetpAction (String* pString)	{pAction= pString;}
SetpPos(String * pString)88 	void		SetpPos    (String* pString)	{pPos	= pString;}
SetpAuthor(String * pString)89 	void		SetpAuthor (String* pString)	{pAuthor= pString;}
SetpDate(String * pString)90 	void		SetpDate   (String* pString)	{pDate	= pString;}
SetpComment(String * pString)91 	void		SetpComment(String* pString)	{pComment=pString;}
SetpData(void * pdata)92 	void		SetpData   (void*   pdata)		{pData	 =pdata;}
93 };
94 
95 class ScViewEntryPtrList
96 {
97 	ScViewEntryPtrList* pNext;
98 	ScViewEntryPtrList* pLast;
99 
100 	ScViewEntryPtr*	pData;
101 };
102 
103 
104 class ScRedlinData : public RedlinData
105 {
106 public:
107 
108 					ScRedlinData();
109 					~ScRedlinData();
110 	SCTAB			nTable;
111 	SCCOL			nCol;
112 	SCROW			nRow;
113 	sal_uLong			nActionNo;
114 	sal_uLong			nInfo;
115 	sal_Bool			bIsRejectable;
116 	sal_Bool			bIsAcceptable;
117 };
118 
119 typedef	long LExpNum;
120 
121 //@ Expand-Entrys nicht eindeutig, daher gestrichen
122 //DECLARE_TABLE( ScChgTrackExps, LExpNum)
123 //==================================================================
124 
125 class ScAcceptChgDlg : public SfxModelessDialog
126 {
127 private:
128 
129 	Timer					aSelectionTimer;
130 	Timer					aReOpenTimer;
131 	SvxAcceptChgCtr 		aAcceptChgCtr;
132 	ScViewData*				pViewData;
133 	ScDocument*				pDoc;
134 	ScRangeName				aLocalRangeName;
135 	Selection				theCurSel;
136 	SvxTPFilter*			pTPFilter;
137 	SvxTPView*				pTPView;
138 	SvxRedlinTable*			pTheView; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
139 	Size					MinSize;
140 	ScRangeList				aRangeList;
141 	ScChangeViewSettings	aChangeViewSet;
142 	String					aStrInsertCols;
143 	String					aStrInsertRows;
144 	String					aStrInsertTabs;
145 	String					aStrDeleteCols;
146 	String					aStrDeleteRows;
147 	String					aStrDeleteTabs;
148 	String					aStrMove;
149 	String					aStrContent;
150 	String					aStrReject;
151 	String					aUnknown;
152 	String					aStrAllAccepted;
153 	String					aStrAllRejected;
154 	String					aStrNoEntry;
155 	String					aStrContentWithChild;
156 	String					aStrChildContent;
157 	String					aStrChildOrgContent;
158 	String					aStrEmpty;
159 	sal_uLong					nAcceptCount;
160 	sal_uLong					nRejectCount;
161 	sal_Bool					bAcceptEnableFlag;
162 	sal_Bool					bRejectEnableFlag;
163 	sal_Bool					bNeedsUpdate;
164 	sal_Bool					bIgnoreMsg;
165 	sal_Bool					bNoSelection;
166 	sal_Bool					bHasFilterEntry;
167 	sal_Bool					bUseColor;
168 	//ScChgTrackExps			aExpandArray;
169 
170 	void			Init();
171 	void			InitFilter();
172 //UNUSED2008-05  void			SetMyStaticData();
173 
174 	DECL_LINK( FilterHandle, SvxTPFilter* );
175 	DECL_LINK( RefHandle, SvxTPFilter* );
176 	DECL_LINK( FilterModified, SvxTPFilter* );
177 	DECL_LINK( MinSizeHandle, SvxAcceptChgCtr*);
178 	DECL_LINK( RejectHandle, SvxTPView*);
179 	DECL_LINK( AcceptHandle, SvxTPView*);
180 	DECL_LINK( RejectAllHandle, SvxTPView*);
181 	DECL_LINK( AcceptAllHandle, SvxTPView*);
182 	DECL_LINK( ExpandingHandle, SvxRedlinTable*);
183 	DECL_LINK( SelectHandle, SvxRedlinTable*);
184 	DECL_LINK( RefInfoHandle, String*);
185 
186 	DECL_LINK( UpdateSelectionHdl, Timer*);
187 	DECL_LINK( ChgTrackModHdl, ScChangeTrack*);
188 	DECL_LINK( CommandHdl, Control*);
189 	DECL_LINK( ReOpenTimerHdl, Timer*);
190 	DECL_LINK( ColCompareHdl, SvSortData*);
191 
192 
193 
194 protected:
195 
196 	virtual void	Resize();
197 	virtual sal_Bool	Close();
198 
199 	void			RejectFiltered();
200 	void			AcceptFiltered();
201 
202 	sal_Bool			IsValidAction(const ScChangeAction* pScChangeAction);
203 
204 	String*			MakeTypeString(ScChangeActionType eType);
205 
206 	SvLBoxEntry*	InsertChangeAction(const ScChangeAction* pScChangeAction,ScChangeActionState eState,
207 									SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=sal_False,
208 									sal_Bool bDisabled=sal_False,sal_uLong nPos=LIST_APPEND);
209 
210 	SvLBoxEntry*	InsertFilteredAction(const ScChangeAction* pScChangeAction,ScChangeActionState eState,
211 									SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=sal_False,
212 									sal_Bool bDisabled=sal_False,sal_uLong nPos=LIST_APPEND);
213 
214 
215 	SvLBoxEntry*	InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
216 											  SvLBoxEntry* pParent,sal_uLong nSpecial);
217 
218 	void			GetDependents( const ScChangeAction* pScChangeAction,
219 								ScChangeActionTable& aActionTable,
220 								SvLBoxEntry* pEntry);
221 
222 	sal_Bool			InsertContentChilds(ScChangeActionTable* pActionTable,SvLBoxEntry* pParent);
223 
224 	sal_Bool			InsertAcceptedORejected(SvLBoxEntry* pParent);
225 
226 	sal_Bool			InsertDeletedChilds(const ScChangeAction *pChangeAction, ScChangeActionTable* pActionTable,
227 										SvLBoxEntry* pParent);
228 
229 	sal_Bool			InsertChilds(ScChangeActionTable* pActionTable,SvLBoxEntry* pParent);
230 
231 	void			AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction,
232 									sal_uLong nPos=LIST_APPEND);
233 
234 	void			RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction);
235 	void			UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction);
236 
237 	void			UpdateView();
238 	void			ClearView();
239 
240 	sal_Bool			Expand(ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
241 							SvLBoxEntry* pEntry, sal_Bool bFilter=sal_False);
242 
243 public:
244 					ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
245 							   ScViewData*		ptrViewData);
246 
247 					~ScAcceptChgDlg();
248 
249 	void			ReInit(ScViewData* ptrViewData);
250 
251 	virtual long	PreNotify( NotifyEvent& rNEvt );
252 
253 	void			Initialize (SfxChildWinInfo* pInfo);
254 	virtual void    FillInfo(SfxChildWinInfo&) const;
255 
256 };
257 
258 
259 #endif // SC_NAMEDLG_HXX
260 
261