Line data Source code
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 : #ifndef _SWREDLNDLG_HXX
20 : #define _SWREDLNDLG_HXX
21 : #include "swdllapi.h"
22 : #include "chldwrap.hxx"
23 : #include <redline.hxx>
24 : #include <tools/datetime.hxx>
25 : #include <vcl/msgbox.hxx>
26 : #include <svl/eitem.hxx>
27 : #include <sfx2/basedlgs.hxx>
28 : #include <sfx2/viewfrm.hxx>
29 : #include <sfx2/dispatch.hxx>
30 : #include <svx/ctredlin.hxx>
31 : #include <svx/postattr.hxx>
32 : #include <boost/ptr_container/ptr_vector.hpp>
33 : #include <o3tl/sorted_vector.hxx>
34 :
35 : class SwChildWinWrapper;
36 :
37 : struct SwRedlineDataChild
38 : {
39 : const SwRedlineData* pChild; // link to original stacked data
40 : const SwRedlineDataChild* pNext; // link to stacked data
41 : SvTreeListEntry* pTLBChild; // corresponding TreeListBox entry
42 : };
43 :
44 0 : struct SwRedlineDataParent
45 : {
46 : const SwRedlineData* pData; // RedlineDataPtr
47 : const SwRedlineDataChild* pNext; // link to stacked data
48 : SvTreeListEntry* pTLBParent; // corresponding TreeListBox entry
49 : String sComment; // redline comment
50 :
51 : inline sal_Bool operator==( const SwRedlineDataParent& rObj ) const
52 : { return (pData && pData->GetSeqNo() == rObj.pData->GetSeqNo()); }
53 0 : inline sal_Bool operator< ( const SwRedlineDataParent& rObj ) const
54 0 : { return (pData && pData->GetSeqNo() < rObj.pData->GetSeqNo()); }
55 : };
56 :
57 : typedef boost::ptr_vector<SwRedlineDataParent> SwRedlineDataParentArr;
58 :
59 0 : class SwRedlineDataParentSortArr : public o3tl::sorted_vector<SwRedlineDataParent*, o3tl::less_ptr_to<SwRedlineDataParent> > {};
60 :
61 :
62 : typedef SwRedlineDataChild* SwRedlineDataChildPtr;
63 : typedef boost::ptr_vector<SwRedlineDataChild> SwRedlineDataChildArr;
64 :
65 :
66 : typedef SvTreeListEntry* SvLBoxEntryPtr;
67 : typedef std::vector<SvLBoxEntryPtr> SvLBoxEntryArr;
68 :
69 : class SW_DLLPUBLIC SwRedlineAcceptDlg
70 : {
71 : Dialog* pParentDlg;
72 : SwRedlineDataParentArr aRedlineParents;
73 : SwRedlineDataChildArr aRedlineChildren;
74 : SwRedlineDataParentSortArr aUsedSeqNo;
75 : SvxAcceptChgCtr aTabPagesCTRL;
76 : PopupMenu aPopup;
77 : Timer aDeselectTimer;
78 : Timer aSelectTimer;
79 : String sInserted;
80 : String sDeleted;
81 : String sFormated;
82 : String sTableChgd;
83 : String sFmtCollSet;
84 : String sFilterAction;
85 : String sAutoFormat;
86 : Size aBorderSz;
87 : SvxTPView* pTPView;
88 : SvxRedlinTable* pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
89 : Link aOldSelectHdl;
90 : Link aOldDeselectHdl;
91 : sal_Bool bOnlyFormatedRedlines;
92 : sal_Bool bHasReadonlySel;
93 : sal_Bool bRedlnAutoFmt;
94 :
95 : // prevent update dialog data during longer operations (cf #102657#)
96 : bool bInhibitActivate;
97 :
98 : SW_DLLPRIVATE DECL_LINK( AcceptHdl, void* );
99 : SW_DLLPRIVATE DECL_LINK( AcceptAllHdl, void* );
100 : SW_DLLPRIVATE DECL_LINK( RejectHdl, void* );
101 : SW_DLLPRIVATE DECL_LINK( RejectAllHdl, void* );
102 : SW_DLLPRIVATE DECL_LINK( UndoHdl, void* );
103 : SW_DLLPRIVATE DECL_LINK( DeselectHdl, void* );
104 : SW_DLLPRIVATE DECL_LINK( SelectHdl, void* );
105 : SW_DLLPRIVATE DECL_LINK( GotoHdl, void* );
106 : SW_DLLPRIVATE DECL_LINK( CommandHdl, void* );
107 :
108 : SW_DLLPRIVATE sal_uInt16 CalcDiff(sal_uInt16 nStart, sal_Bool bChild);
109 : SW_DLLPRIVATE void InsertChildren(SwRedlineDataParent *pParent, const SwRedline& rRedln, const sal_uInt16 nAutoFmt);
110 : SW_DLLPRIVATE void InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd = USHRT_MAX);
111 : SW_DLLPRIVATE void RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd);
112 : SW_DLLPRIVATE void InitAuthors();
113 :
114 : SW_DLLPRIVATE String GetRedlineText(const SwRedline& rRedln, DateTime &rDateTime, sal_uInt16 nStack = 0);
115 : SW_DLLPRIVATE const String& GetActionText(const SwRedline& rRedln, sal_uInt16 nStack = 0);
116 : SW_DLLPRIVATE sal_uInt16 GetRedlinePos( const SvTreeListEntry& rEntry) const;
117 :
118 : public:
119 : SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt = sal_False);
120 : virtual ~SwRedlineAcceptDlg();
121 :
122 : DECL_LINK( FilterChangedHdl, void *pDummy = 0 );
123 :
124 0 : inline SvxAcceptChgCtr* GetChgCtrl() { return &aTabPagesCTRL; }
125 0 : inline sal_Bool HasRedlineAutoFmt() const { return bRedlnAutoFmt; }
126 :
127 : void Init(sal_uInt16 nStart = 0);
128 : void CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept );
129 :
130 : void Initialize(const String &rExtraData);
131 : void FillInfo(String &rExtraData) const;
132 :
133 : virtual void Activate();
134 : virtual void Resize();
135 : };
136 :
137 : class SwModelessRedlineAcceptDlg : public SfxModelessDialog
138 : {
139 : SwRedlineAcceptDlg* pImplDlg;
140 : SwChildWinWrapper* pChildWin;
141 :
142 : virtual void Resize();
143 :
144 : public:
145 : SwModelessRedlineAcceptDlg(SfxBindings*, SwChildWinWrapper*, Window *pParent);
146 : ~SwModelessRedlineAcceptDlg();
147 :
148 : virtual void Activate();
149 : virtual void FillInfo(SfxChildWinInfo&) const;
150 : void Initialize (SfxChildWinInfo* pInfo);
151 : };
152 :
153 0 : class SwRedlineAcceptChild : public SwChildWinWrapper
154 : {
155 : public:
156 : SwRedlineAcceptChild( Window* ,
157 : sal_uInt16 nId,
158 : SfxBindings*,
159 : SfxChildWinInfo* );
160 :
161 : SFX_DECL_CHILDWINDOW_WITHID( SwRedlineAcceptChild );
162 :
163 : virtual sal_Bool ReInitDlg(SwDocShell *pDocSh);
164 : };
165 :
166 :
167 : #endif
168 :
169 :
170 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|