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 : SvxTPView* pTPView;
87 : SvxRedlinTable* pTable; // PB 2006/02/02 #i48648 now SvHeaderTabListBox
88 : Link aOldSelectHdl;
89 : Link aOldDeselectHdl;
90 : sal_Bool bOnlyFormatedRedlines;
91 : sal_Bool bHasReadonlySel;
92 : sal_Bool bRedlnAutoFmt;
93 :
94 : // prevent update dialog data during longer operations (cf #102657#)
95 : bool bInhibitActivate;
96 :
97 : SW_DLLPRIVATE DECL_LINK( AcceptHdl, void* );
98 : SW_DLLPRIVATE DECL_LINK( AcceptAllHdl, void* );
99 : SW_DLLPRIVATE DECL_LINK( RejectHdl, void* );
100 : SW_DLLPRIVATE DECL_LINK( RejectAllHdl, void* );
101 : SW_DLLPRIVATE DECL_LINK( UndoHdl, void* );
102 : SW_DLLPRIVATE DECL_LINK( DeselectHdl, void* );
103 : SW_DLLPRIVATE DECL_LINK( SelectHdl, void* );
104 : SW_DLLPRIVATE DECL_LINK( GotoHdl, void* );
105 : SW_DLLPRIVATE DECL_LINK( CommandHdl, void* );
106 :
107 : SW_DLLPRIVATE sal_uInt16 CalcDiff(sal_uInt16 nStart, sal_Bool bChild);
108 : SW_DLLPRIVATE void InsertChildren(SwRedlineDataParent *pParent, const SwRedline& rRedln, const sal_uInt16 nAutoFmt);
109 : SW_DLLPRIVATE void InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd = USHRT_MAX);
110 : SW_DLLPRIVATE void RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd);
111 : SW_DLLPRIVATE void InitAuthors();
112 :
113 : SW_DLLPRIVATE String GetRedlineText(const SwRedline& rRedln, DateTime &rDateTime, sal_uInt16 nStack = 0);
114 : SW_DLLPRIVATE const String& GetActionText(const SwRedline& rRedln, sal_uInt16 nStack = 0);
115 : SW_DLLPRIVATE sal_uInt16 GetRedlinePos( const SvTreeListEntry& rEntry) const;
116 :
117 : public:
118 : SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt = sal_False);
119 : virtual ~SwRedlineAcceptDlg();
120 :
121 : DECL_LINK( FilterChangedHdl, void *pDummy = 0 );
122 :
123 0 : inline SvxAcceptChgCtr* GetChgCtrl() { return &aTabPagesCTRL; }
124 0 : inline sal_Bool HasRedlineAutoFmt() const { return bRedlnAutoFmt; }
125 :
126 : void Init(sal_uInt16 nStart = 0);
127 : void CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept );
128 :
129 : void Initialize(const String &rExtraData);
130 : void FillInfo(String &rExtraData) const;
131 :
132 : virtual void Activate();
133 : };
134 :
135 : class SwModelessRedlineAcceptDlg : public SfxModelessDialog
136 : {
137 : SwRedlineAcceptDlg* pImplDlg;
138 : SwChildWinWrapper* pChildWin;
139 :
140 : public:
141 : SwModelessRedlineAcceptDlg(SfxBindings*, SwChildWinWrapper*, Window *pParent);
142 : ~SwModelessRedlineAcceptDlg();
143 :
144 : virtual void Activate();
145 : virtual void FillInfo(SfxChildWinInfo&) const;
146 : void Initialize (SfxChildWinInfo* pInfo);
147 : };
148 :
149 0 : class SwRedlineAcceptChild : public SwChildWinWrapper
150 : {
151 : public:
152 : SwRedlineAcceptChild( Window* ,
153 : sal_uInt16 nId,
154 : SfxBindings*,
155 : SfxChildWinInfo* );
156 :
157 : SFX_DECL_CHILDWINDOW_WITHID( SwRedlineAcceptChild );
158 :
159 : virtual sal_Bool ReInitDlg(SwDocShell *pDocSh);
160 : };
161 :
162 :
163 : #endif
164 :
165 :
166 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|