bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / regionsw.hxx
blob14265da12b72058cd5364c1df69645ecf7f35276
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _REGIONSW_HXX
20 #define _REGIONSW_HXX
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>
49 class SwWrtShell;
51 namespace sfx2
53 class DocumentInserter;
54 class FileDialogHelper;
57 /*************************************************************************
58 dialog "edit regions"
59 *************************************************************************/
60 class SectRepr;
61 typedef SectRepr* SectReprPtr;
62 typedef boost::ptr_set<SectRepr> SectReprArr;
64 class SwEditRegionDlg : public SfxModalDialog
66 Edit* m_pCurName;
67 SvTreeListBox* m_pTree;
69 TriStateBox* m_pFileCB;
70 CheckBox* m_pDDECB;
71 VclContainer* m_pDDEFrame;
72 FixedText* m_pFileNameFT;
73 FixedText* m_pDDECommandFT;
74 Edit* m_pFileNameED;
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;
91 OKButton* m_pOK;
92 PushButton* m_pOptionsPB;
93 PushButton* m_pDismiss;
94 ImageList aImageIL;
96 SwWrtShell& rSh;
97 SectReprArr aSectReprArr;
98 const SwSection* pCurrSect;
99 sfx2::DocumentInserter* m_pDocInserter;
100 Window* m_pOldDefDlgParent;
102 sal_Bool bDontCheckPasswd :1;
103 sal_Bool bWeb :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);
134 public:
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
147 FixedLine aNameFL;
148 ComboBox aCurName;
150 FixedLine aLinkFL;
151 CheckBox aFileCB;
152 CheckBox aDDECB;
153 FixedText aDDECommandFT;
154 FixedText aFileNameFT;
155 Edit aFileNameED;
156 PushButton aFilePB;
157 FixedText aSubRegionFT;
158 ComboBox aSubRegionED;
160 FixedLine aProtectFL;
161 CheckBox aProtectCB;
162 CheckBox aPasswdCB;
163 PushButton aPasswdPB;
165 FixedLine aHideFL;
166 CheckBox aHideCB;
167 FixedText aConditionFT;
168 ConditionEdit aConditionED;
170 // #114856# edit in readonly sections
171 FixedLine aPropertiesFL;
172 CheckBox aEditInReadonlyCB;
174 String m_sFileName;
175 String m_sFilterName;
176 String m_sFilePasswd;
178 // SwFmtCol* pCols;
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* );
195 public:
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
210 FixedLine aFtnFL;
211 CheckBox aFtnNtAtTextEndCB;
213 CheckBox aFtnNtNumCB;
214 FixedText aFtnOffsetLbl;
215 NumericField aFtnOffsetFld;
217 CheckBox aFtnNtNumFmtCB;
218 FixedText aFtnPrefixFT;
219 Edit aFtnPrefixED;
220 SwNumberingTypeListBox aFtnNumViewBox;
221 FixedText aFtnSuffixFT;
222 Edit aFtnSuffixED;
224 FixedLine aEndFL;
225 CheckBox aEndNtAtTextEndCB;
227 CheckBox aEndNtNumCB;
228 FixedText aEndOffsetLbl;
229 NumericField aEndOffsetFld;
231 CheckBox aEndNtNumFmtCB;
232 FixedText aEndPrefixFT;
233 Edit aEndPrefixED;
234 SwNumberingTypeListBox aEndNumViewBox;
235 FixedText aEndSuffixFT;
236 Edit aEndSuffixED;
239 DECL_LINK( FootEndHdl, CheckBox * );
240 void ResetState( sal_Bool bFtn, const SwFmtFtnEndAtTxtEnd& );
242 public:
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
255 FixedLine aIndentFL;
256 FixedText aBeforeFT;
257 MetricField aBeforeMF;
258 FixedText aAfterFT;
259 MetricField aAfterMF;
261 SvxParaPrevWindow aPreviewWin;
263 DECL_LINK(IndentModifyHdl, void *);
264 public:
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
279 SwWrtShell& rWrtSh;
280 ::std::auto_ptr<SwSectionData> m_pSectionData;
282 protected:
283 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
284 virtual short Ok();
285 public:
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
295 SwWrtShell& rWrtSh;
296 protected:
297 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
298 public:
299 SwSectionPropertyTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
300 virtual ~SwSectionPropertyTabDialog();
303 #endif
305 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */