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