update dev300-m58
[ooovba.git] / sw / source / ui / inc / redlndlg.hxx
blob74d99eaa785fc20fc807a1b53479dc8412b4a673
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: redlndlg.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SWREDLNDLG_HXX
31 #define _SWREDLNDLG_HXX
32 #include "swdllapi.h"
33 #include "chldwrap.hxx"
34 #include <redline.hxx>
35 #include <tools/datetime.hxx>
36 #include <vcl/msgbox.hxx>
37 #ifndef _SVSTDARR_HXX
38 #include <svtools/svstdarr.hxx>
39 #endif
40 #include <svtools/eitem.hxx>
41 #include <sfx2/basedlgs.hxx>
42 #include <sfx2/viewfrm.hxx>
43 #include <sfx2/dispatch.hxx>
44 #include <svx/ctredlin.hxx>
45 #include <svx/postattr.hxx>
47 class SwChildWinWrapper;
49 struct SwRedlineDataChild
51 const SwRedlineData* pChild; // Verweis auf originale gestackte Daten
52 const SwRedlineDataChild* pNext; // Verweis auf gestackte Daten
53 SvLBoxEntry* pTLBChild; // zugehoeriger TreeListBox-Eintrag
56 struct SwRedlineDataParent
58 const SwRedlineData* pData; // RedlineDataPtr
59 const SwRedlineDataChild* pNext; // Verweis auf gestackte Daten
60 SvLBoxEntry* pTLBParent; // zugehoeriger TreeListBox-Eintrag
61 String sComment; // Redline-Kommentar
63 inline BOOL operator==( const SwRedlineDataParent& rObj ) const
64 { return (pData && pData->GetSeqNo() == rObj.pData->GetSeqNo()); }
65 inline BOOL operator< ( const SwRedlineDataParent& rObj ) const
66 { return (pData && pData->GetSeqNo() < rObj.pData->GetSeqNo()); }
69 typedef SwRedlineDataParent* SwRedlineDataParentPtr;
70 SV_DECL_PTRARR_DEL(SwRedlineDataParentArr, SwRedlineDataParentPtr, 10, 20)
73 SV_DECL_PTRARR_SORT(SwRedlineDataParentSortArr, SwRedlineDataParentPtr, 10, 20)
76 typedef SwRedlineDataChild* SwRedlineDataChildPtr;
77 SV_DECL_PTRARR_DEL(SwRedlineDataChildArr, SwRedlineDataChildPtr, 4, 4)
80 typedef SvLBoxEntry* SvLBoxEntryPtr;
81 SV_DECL_PTRARR(SvLBoxEntryArr, SvLBoxEntryPtr, 100, 100)
83 class SW_DLLPUBLIC SwRedlineAcceptDlg
85 Dialog* pParentDlg;
86 SwRedlineDataParentArr aRedlineParents;
87 SwRedlineDataChildArr aRedlineChilds;
88 SwRedlineDataParentSortArr aUsedSeqNo;
89 SvxAcceptChgCtr aTabPagesCTRL;
90 PopupMenu aPopup;
91 Timer aDeselectTimer;
92 Timer aSelectTimer;
93 String sInserted;
94 String sDeleted;
95 String sFormated;
96 String sTableChgd;
97 String sFmtCollSet;
98 String sFilterAction;
99 String sAutoFormat;
100 Size aBorderSz;
101 SvxTPView* pTPView;
102 SvxRedlinTable* pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
103 Link aOldSelectHdl;
104 Link aOldDeselectHdl;
105 BOOL bOnlyFormatedRedlines;
106 BOOL bHasReadonlySel;
107 BOOL bRedlnAutoFmt;
109 // prevent update dialog data during longer operations (cf #102657#)
110 bool bInhibitActivate;
112 SW_DLLPRIVATE DECL_LINK( AcceptHdl, void* );
113 SW_DLLPRIVATE DECL_LINK( AcceptAllHdl, void* );
114 SW_DLLPRIVATE DECL_LINK( RejectHdl, void* );
115 SW_DLLPRIVATE DECL_LINK( RejectAllHdl, void* );
116 SW_DLLPRIVATE DECL_LINK( UndoHdl, void* );
117 SW_DLLPRIVATE DECL_LINK( DeselectHdl, void* );
118 SW_DLLPRIVATE DECL_LINK( SelectHdl, void* );
119 SW_DLLPRIVATE DECL_LINK( GotoHdl, void* );
120 SW_DLLPRIVATE DECL_LINK( CommandHdl, void* );
122 SW_DLLPRIVATE USHORT CalcDiff(USHORT nStart, BOOL bChild);
123 SW_DLLPRIVATE void InsertChilds(SwRedlineDataParent *pParent, const SwRedline& rRedln, const USHORT nAutoFmt);
124 SW_DLLPRIVATE void InsertParents(USHORT nStart, USHORT nEnd = USHRT_MAX);
125 SW_DLLPRIVATE void RemoveParents(USHORT nStart, USHORT nEnd);
126 SW_DLLPRIVATE void InitAuthors();
128 SW_DLLPRIVATE String GetRedlineText(const SwRedline& rRedln, DateTime &rDateTime, USHORT nStack = 0);
129 SW_DLLPRIVATE const String& GetActionText(const SwRedline& rRedln, USHORT nStack = 0);
130 SW_DLLPRIVATE USHORT GetRedlinePos( const SvLBoxEntry& rEntry) const;
132 public:
133 SwRedlineAcceptDlg(Dialog *pParent, BOOL bAutoFmt = FALSE);
134 virtual ~SwRedlineAcceptDlg();
136 DECL_LINK( FilterChangedHdl, void *pDummy = 0 );
138 inline SvxAcceptChgCtr* GetChgCtrl() { return &aTabPagesCTRL; }
139 inline BOOL HasRedlineAutoFmt() const { return bRedlnAutoFmt; }
141 void Init(USHORT nStart = 0);
142 void CallAcceptReject( BOOL bSelect, BOOL bAccept );
144 void Initialize(const String &rExtraData);
145 void FillInfo(String &rExtraData) const;
147 virtual void Activate();
148 virtual void Resize();
151 /*------------------------------------------------------------------------
152 Beschreibung:
153 ------------------------------------------------------------------------*/
155 class SwModelessRedlineAcceptDlg : public SfxModelessDialog
157 SwRedlineAcceptDlg* pImplDlg;
158 SwChildWinWrapper* pChildWin;
160 virtual void Resize();
162 public:
163 SwModelessRedlineAcceptDlg(SfxBindings*, SwChildWinWrapper*, Window *pParent);
164 ~SwModelessRedlineAcceptDlg();
166 virtual void Activate();
167 virtual void FillInfo(SfxChildWinInfo&) const;
168 void Initialize (SfxChildWinInfo* pInfo);
172 /*------------------------------------------------------------------------
173 Beschreibung:
174 ------------------------------------------------------------------------*/
176 class SwRedlineAcceptChild : public SwChildWinWrapper
178 public:
179 SwRedlineAcceptChild( Window* ,
180 USHORT nId,
181 SfxBindings*,
182 SfxChildWinInfo* );
184 SFX_DECL_CHILDWINDOW( SwRedlineAcceptChild );
186 virtual BOOL ReInitDlg(SwDocShell *pDocSh);
190 #endif