1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <hintids.hxx>
23 #include <vcl/field.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <vcl/edit.hxx>
26 #include <vcl/button.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/combobox.hxx>
29 #include <vcl/group.hxx>
30 #include <vcl/layout.hxx>
31 #include <svtools/treelistbox.hxx>
32 #include <sfx2/basedlgs.hxx>
33 #include <sfx2/tabdlg.hxx>
34 #include <editeng/brushitem.hxx>
36 #include <condedit.hxx>
37 #include <section.hxx>
38 #include <fmtclds.hxx>
39 #include <fmtftntx.hxx>
40 #include <fmtclbl.hxx>
41 #include <numberingtypelistbox.hxx>
42 #include <editeng/frmdiritem.hxx>
43 #include <vcl/image.hxx>
44 #include <svx/paraprev.hxx>
45 #include <editeng/lrspitem.hxx>
47 #include <boost/ptr_container/ptr_set.hpp>
53 class DocumentInserter
;
54 class FileDialogHelper
;
57 /*************************************************************************
59 *************************************************************************/
61 typedef SectRepr
* SectReprPtr
;
62 typedef boost::ptr_set
<SectRepr
> SectReprArr
;
64 class SwEditRegionDlg
: public SfxModalDialog
67 SvTreeListBox
* m_pTree
;
69 TriStateBox
* m_pFileCB
;
71 VclContainer
* m_pDDEFrame
;
72 FixedText
* m_pFileNameFT
;
73 FixedText
* m_pDDECommandFT
;
75 PushButton
* m_pFilePB
;
76 FixedText
* m_pSubRegionFT
;
77 ComboBox
* m_pSubRegionED
;
78 bool m_bSubRegionsFilled
;
80 TriStateBox
* m_pProtectCB
;
81 CheckBox
* m_pPasswdCB
;
82 PushButton
* m_pPasswdPB
;
84 TriStateBox
* m_pHideCB
;
85 FixedText
* m_pConditionFT
;
86 ConditionEdit
* m_pConditionED
;
88 // #114856# edit in readonly sections
89 TriStateBox
* m_pEditInReadonlyCB
;
92 PushButton
* m_pOptionsPB
;
93 PushButton
* m_pDismiss
;
97 SectReprArr aSectReprArr
;
98 const SwSection
* pCurrSect
;
99 sfx2::DocumentInserter
* m_pDocInserter
;
100 Window
* m_pOldDefDlgParent
;
102 sal_Bool bDontCheckPasswd
:1;
106 Image
BuildBitmap(sal_Bool bProtect
,sal_Bool bHidden
);
108 void RecurseList( const SwSectionFmt
* pFmt
, SvTreeListEntry
* pEntry
);
109 sal_uInt16
FindArrPos(const SwSectionFmt
* pFmt
);
111 DECL_LINK( GetFirstEntryHdl
, SvTreeListBox
* );
112 DECL_LINK( DeselectHdl
, SvTreeListBox
* );
114 DECL_LINK(OkHdl
, void *);
115 DECL_LINK(NameEditHdl
, void *);
116 DECL_LINK( ConditionEditHdl
, Edit
* );
118 DECL_LINK( ChangePasswdHdl
, Button
* );
119 DECL_LINK( ChangeProtectHdl
, TriStateBox
* );
120 DECL_LINK( ChangeHideHdl
, TriStateBox
* );
121 // #114856# edit in readonly sections
122 DECL_LINK( ChangeEditInReadonlyHdl
, TriStateBox
* );
123 DECL_LINK(ChangeDismissHdl
, void *);
124 DECL_LINK( UseFileHdl
, CheckBox
* );
125 DECL_LINK(FileSearchHdl
, void *);
126 DECL_LINK(OptionsHdl
, void *);
127 DECL_LINK( FileNameHdl
, Edit
* );
128 DECL_LINK( DDEHdl
, CheckBox
* );
129 DECL_LINK( DlgClosedHdl
, sfx2::FileDialogHelper
* );
130 DECL_LINK( SubRegionEventHdl
, VclWindowEvent
* );
132 sal_Bool
CheckPasswd(CheckBox
* pBox
= 0);
135 SwEditRegionDlg( Window
* pParent
, SwWrtShell
& rWrtSh
);
136 virtual ~SwEditRegionDlg();
138 void SelectSection(const String
& rSectionName
);
142 /*************************************************************************
143 dialog "insert region"
144 *************************************************************************/
145 class SwInsertSectionTabPage
: public SfxTabPage
153 FixedText aDDECommandFT
;
154 FixedText aFileNameFT
;
157 FixedText aSubRegionFT
;
158 ComboBox aSubRegionED
;
160 FixedLine aProtectFL
;
163 PushButton aPasswdPB
;
167 FixedText aConditionFT
;
168 ConditionEdit aConditionED
;
170 // #114856# edit in readonly sections
171 FixedLine aPropertiesFL
;
172 CheckBox aEditInReadonlyCB
;
175 String m_sFilterName
;
176 String m_sFilePasswd
;
179 ::com::sun::star::uno::Sequence
<sal_Int8
> m_aNewPasswd
;
180 SwWrtShell
* m_pWrtSh
;
181 sfx2::DocumentInserter
* m_pDocInserter
;
182 Window
* m_pOldDefDlgParent
;
184 DECL_LINK( ChangeHideHdl
, CheckBox
* );
185 // #114856# edit in readonly sections
186 DECL_LINK(ChangeEditInReadonlyHdl
, void *);
187 DECL_LINK( ChangeProtectHdl
, CheckBox
* );
188 DECL_LINK( ChangePasswdHdl
, Button
* );
189 DECL_LINK(NameEditHdl
, void *);
190 DECL_LINK( UseFileHdl
, CheckBox
* );
191 DECL_LINK(FileSearchHdl
, void *);
192 DECL_LINK( DDEHdl
, CheckBox
* );
193 DECL_LINK( DlgClosedHdl
, sfx2::FileDialogHelper
* );
196 SwInsertSectionTabPage(Window
*pParent
, const SfxItemSet
&rAttrSet
);
197 virtual ~SwInsertSectionTabPage();
199 void SetWrtShell(SwWrtShell
& rSh
);
201 virtual sal_Bool
FillItemSet( SfxItemSet
& );
202 virtual void Reset( const SfxItemSet
& );
204 static SfxTabPage
* Create( Window
* pParent
,
205 const SfxItemSet
& rAttrSet
);
208 class SwSectionFtnEndTabPage
: public SfxTabPage
211 CheckBox aFtnNtAtTextEndCB
;
213 CheckBox aFtnNtNumCB
;
214 FixedText aFtnOffsetLbl
;
215 NumericField aFtnOffsetFld
;
217 CheckBox aFtnNtNumFmtCB
;
218 FixedText aFtnPrefixFT
;
220 SwNumberingTypeListBox aFtnNumViewBox
;
221 FixedText aFtnSuffixFT
;
225 CheckBox aEndNtAtTextEndCB
;
227 CheckBox aEndNtNumCB
;
228 FixedText aEndOffsetLbl
;
229 NumericField aEndOffsetFld
;
231 CheckBox aEndNtNumFmtCB
;
232 FixedText aEndPrefixFT
;
234 SwNumberingTypeListBox aEndNumViewBox
;
235 FixedText aEndSuffixFT
;
239 DECL_LINK( FootEndHdl
, CheckBox
* );
240 void ResetState( sal_Bool bFtn
, const SwFmtFtnEndAtTxtEnd
& );
243 SwSectionFtnEndTabPage( Window
*pParent
, const SfxItemSet
&rAttrSet
);
244 virtual ~SwSectionFtnEndTabPage();
246 virtual sal_Bool
FillItemSet( SfxItemSet
& );
247 virtual void Reset( const SfxItemSet
& );
249 static SfxTabPage
* Create( Window
* pParent
,
250 const SfxItemSet
& rAttrSet
);
253 class SwSectionIndentTabPage
: public SfxTabPage
257 MetricField aBeforeMF
;
259 MetricField aAfterMF
;
261 SvxParaPrevWindow aPreviewWin
;
263 DECL_LINK(IndentModifyHdl
, void *);
265 SwSectionIndentTabPage( Window
*pParent
, const SfxItemSet
&rAttrSet
);
266 virtual ~SwSectionIndentTabPage();
268 virtual sal_Bool
FillItemSet( SfxItemSet
& );
269 virtual void Reset( const SfxItemSet
& );
271 static SfxTabPage
* Create( Window
* pParent
,
272 const SfxItemSet
& rAttrSet
);
274 void SetWrtShell(SwWrtShell
& rSh
);
277 class SwInsertSectionTabDialog
: public SfxTabDialog
280 ::std::auto_ptr
<SwSectionData
> m_pSectionData
;
283 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
);
286 SwInsertSectionTabDialog(Window
* pParent
, const SfxItemSet
& rSet
, SwWrtShell
& rSh
);
287 virtual ~SwInsertSectionTabDialog();
289 void SetSectionData(SwSectionData
const& rSect
);
290 SwSectionData
* GetSectionData() { return m_pSectionData
.get(); }
293 class SwSectionPropertyTabDialog
: public SfxTabDialog
297 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
);
299 SwSectionPropertyTabDialog(Window
* pParent
, const SfxItemSet
& rSet
, SwWrtShell
& rSh
);
300 virtual ~SwSectionPropertyTabDialog();
305 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */