update dev300-m58
[ooovba.git] / sw / source / ui / inc / regionsw.hxx
blob0d9e77616bd8e6e6aa80f3146b67349c7b6d133e
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: regionsw.hxx,v $
10 * $Revision: 1.16 $
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 _REGIONSW_HXX
31 #define _REGIONSW_HXX
33 #include <hintids.hxx>
34 #include <vcl/field.hxx>
35 #include <vcl/lstbox.hxx>
36 #ifndef _EDIT_HXX //autogen
37 #include <vcl/edit.hxx>
38 #endif
39 #ifndef _BUTTON_HXX //autogen
40 #include <vcl/button.hxx>
41 #endif
42 #ifndef _FIXED_HXX //autogen
43 #include <vcl/fixed.hxx>
44 #endif
45 #ifndef _COMBOBOX_HXX //autogen
46 #include <vcl/combobox.hxx>
47 #endif
48 #ifndef _GROUP_HXX //autogen
49 #include <vcl/group.hxx>
50 #endif
51 #include <svtools/svtreebx.hxx>
52 #include <sfx2/basedlgs.hxx>
53 #include <sfx2/tabdlg.hxx>
54 #include <svx/brshitem.hxx>
56 #ifndef _CONDEDIT_HXX
57 #include <condedit.hxx>
58 #endif
59 #include <section.hxx>
60 #include <fmtclds.hxx>
61 #include <fmtftntx.hxx>
62 #include <fmtclbl.hxx>
63 #include <numberingtypelistbox.hxx>
64 #include "svx/frmdiritem.hxx"
65 #include <vcl/image.hxx>
66 #include <svx/paraprev.hxx>
67 #include <svx/lrspitem.hxx>
70 class SwWrtShell;
71 class EditRegionDlg;
73 namespace sfx2
75 class DocumentInserter;
76 class FileDialogHelper;
79 /*--------------------------------------------------------------------
80 Beschreibung:
81 --------------------------------------------------------------------*/
83 class SectRepr
85 SwSection aSection;
86 SwFmtCol aCol;
87 SvxBrushItem aBrush;
88 SwFmtFtnAtTxtEnd aFtnNtAtEnd;
89 SwFmtEndAtTxtEnd aEndNtAtEnd;
90 SwFmtNoBalancedColumns aBalance;
91 SvxFrameDirectionItem aFrmDirItem;
92 SvxLRSpaceItem aLRSpaceItem;
93 USHORT nArrPos;
94 USHORT nColumn;
95 BOOL bContent : 1; //zeigt an, ob evtl. Textinhalt im Bereich ist
96 BOOL bSelected : 1; //fuer Multiselektion erst markieren, dann mit der TreeListBox arbeiten!
97 ::com::sun::star::uno::Sequence <sal_Int8 > aTempPasswd;
98 public:
99 SectRepr(USHORT nPos, SwSection& rSect);
100 BOOL operator ==(SectRepr& rSectRef) const
101 {return nArrPos==rSectRef.GetArrPos();}
103 BOOL operator <(SectRepr& rSectRef) const
104 {return nArrPos<rSectRef.GetArrPos();}
106 SwSection& GetSection() { return aSection; }
107 SwFmtCol& GetCol() { return aCol; }
108 SvxBrushItem& GetBackground() { return aBrush; }
109 SwFmtFtnAtTxtEnd& GetFtnNtAtEnd() { return aFtnNtAtEnd; }
110 SwFmtEndAtTxtEnd& GetEndNtAtEnd() { return aEndNtAtEnd; }
111 SwFmtNoBalancedColumns& GetBalance() { return aBalance; }
112 SvxFrameDirectionItem& GetFrmDir() { return aFrmDirItem; }
113 SvxLRSpaceItem& GetLRSpace() { return aLRSpaceItem; }
115 USHORT GetArrPos() const {return nArrPos;}
116 const String& GetCondition() const {return aSection.GetCondition();}
117 const String& GetName() const { return aSection.GetName(); }
118 String GetFile() const;
119 String GetSubRegion() const;
120 void SetFile( const String& rFile );
121 void SetFilter( const String& rFilter );
122 void SetSubRegion( const String& rSubRegion );
124 void SetFilePasswd( const String& rPasswd )
125 { aSection.SetLinkFilePassWd( rPasswd ); }
126 void SetCondition( const String& rString )
127 {aSection.SetCondition( rString);}
128 BOOL IsCondHidden()const
129 {return aSection.IsCondHidden();}
130 BOOL IsHidden()const
131 {return aSection.IsHidden();}
132 BOOL IsProtect()const
133 {return aSection.IsProtect();}
134 // --> FME 2004-06-22 #114856# edit in readonly sections
135 BOOL IsEditInReadonly()const
136 {return aSection.IsEditInReadonly();}
137 void SetEditInReadonly(BOOL bFlag = TRUE)
138 {aSection.SetEditInReadonly(bFlag);}
139 // <--
140 void SetHidden(BOOL bFlag = TRUE)
141 {aSection.SetHidden(bFlag);}
142 void SetCondHidden(BOOL bFlag = TRUE)
143 {aSection.SetCondHidden(bFlag);}
144 void SetProtect(BOOL bFlag = TRUE)
145 {aSection.SetProtect(bFlag);}
146 BOOL IsContent(){return bContent;}
147 void SetContent(BOOL bValue){bContent = bValue;}
148 void SetSectionType(SectionType eSectionType) {aSection.SetType(eSectionType);}
149 SectionType GetSectionType(){return aSection.GetType();}
151 void SetSelected(){bSelected = TRUE;}
152 BOOL IsSelected() const {return bSelected;}
155 const ::com::sun::star::uno::Sequence <sal_Int8 >& GetPasswd() const {return aSection.GetPasswd();}
156 ::com::sun::star::uno::Sequence <sal_Int8 >& GetTempPasswd() {return aTempPasswd;}
157 void SetTempPasswd(const ::com::sun::star::uno::Sequence <sal_Int8 >& aPasswd) {aTempPasswd = aPasswd;}
160 /*************************************************************************
161 Dialog "Bereiche bearbeiten"
162 *************************************************************************/
164 typedef SectRepr* SectReprPtr;
165 SV_DECL_PTRARR_SORT( SectReprArr, SectReprPtr, 0, 4 )
167 class SwEditRegionDlg : public SfxModalDialog
169 FixedLine aNameFL;
170 Edit aCurName;
171 SvTreeListBox aTree;
173 FixedLine aLinkFL;
174 TriStateBox aFileCB;
175 CheckBox aDDECB;
176 FixedText aFileNameFT;
177 FixedText aDDECommandFT;
178 Edit aFileNameED;
179 PushButton aFilePB;
180 FixedText aSubRegionFT;
181 ComboBox aSubRegionED;
183 FixedLine aProtectFL;
184 TriStateBox aProtectCB;
185 CheckBox aPasswdCB;
186 PushButton aPasswdPB;
188 FixedLine aHideFL;
189 TriStateBox aHideCB;
190 FixedText aConditionFT;
191 ConditionEdit aConditionED;
193 // --> FME 2004-06-22 #114856# edit in readonly sections
194 FixedLine aPropertiesFL;
195 TriStateBox aEditInReadonlyCB;
196 // <--
198 OKButton aOK;
199 CancelButton aCancel;
200 PushButton aOptionsPB;
201 PushButton aDismiss;
202 HelpButton aHelp;
203 ImageList aImageIL;
204 ImageList aImageILH;
206 SwWrtShell& rSh;
207 SectReprArr aSectReprArr;
208 SvLBoxEntry* pAktEntry;
209 const SwSection* pCurrSect;
210 sfx2::DocumentInserter* m_pDocInserter;
211 Window* m_pOldDefDlgParent;
213 BOOL bDontCheckPasswd :1;
214 BOOL bWeb :1;
217 Image BuildBitmap(BOOL bProtect,BOOL bHidden,BOOL bHighContrast);
219 void RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry);
220 USHORT FindArrPos(const SwSectionFmt* pFmt);
222 DECL_LINK( GetFirstEntryHdl, SvTreeListBox * );
223 DECL_LINK( DeselectHdl, SvTreeListBox * );
225 DECL_LINK( OkHdl, CheckBox * );
226 DECL_LINK( NameEditHdl, Edit * );
227 DECL_LINK( ConditionEditHdl, Edit * );
229 DECL_LINK( ChangePasswdHdl, Button * );
230 DECL_LINK( ChangeProtectHdl, TriStateBox * );
231 DECL_LINK( ChangeHideHdl, TriStateBox * );
232 // --> FME 2004-06-22 #114856# edit in readonly sections
233 DECL_LINK( ChangeEditInReadonlyHdl, TriStateBox * );
234 // <--
235 DECL_LINK( ChangeDismissHdl, CheckBox * );
236 DECL_LINK( UseFileHdl, CheckBox* );
237 DECL_LINK( FileSearchHdl, PushButton* );
238 DECL_LINK( OptionsHdl, PushButton* );
239 DECL_LINK( FileNameHdl, Edit* );
240 DECL_LINK( DDEHdl, CheckBox* );
241 DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* );
243 BOOL CheckPasswd(CheckBox* pBox = 0);
245 public:
246 SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh );
247 virtual ~SwEditRegionDlg();
249 void SelectSection(const String& rSectionName);
252 /*************************************************************************
253 Dialog "Bereich einfuegen"
254 *************************************************************************/
256 /* -----------------21.05.99 11:05-------------------
258 * --------------------------------------------------*/
259 class SwInsertSectionTabPage : public SfxTabPage
261 FixedLine aNameFL;
262 ComboBox aCurName;
264 FixedLine aLinkFL;
265 CheckBox aFileCB;
266 CheckBox aDDECB;
267 FixedText aDDECommandFT;
268 FixedText aFileNameFT;
269 Edit aFileNameED;
270 PushButton aFilePB;
271 FixedText aSubRegionFT;
272 ComboBox aSubRegionED;
274 FixedLine aProtectFL;
275 CheckBox aProtectCB;
276 CheckBox aPasswdCB;
277 PushButton aPasswdPB;
279 FixedLine aHideFL;
280 CheckBox aHideCB;
281 FixedText aConditionFT;
282 ConditionEdit aConditionED;
284 // --> FME 2004-06-22 #114856# edit in readonly sections
285 FixedLine aPropertiesFL;
286 CheckBox aEditInReadonlyCB;
287 // <--
289 String m_sFileName;
290 String m_sFilterName;
291 String m_sFilePasswd;
293 // SwFmtCol* pCols;
294 ::com::sun::star::uno::Sequence <sal_Int8 > m_aNewPasswd;
295 SwWrtShell* m_pWrtSh;
296 sfx2::DocumentInserter* m_pDocInserter;
297 Window* m_pOldDefDlgParent;
299 DECL_LINK( ChangeHideHdl, CheckBox * );
300 // --> FME 2004-06-22 #114856# edit in readonly sections
301 DECL_LINK( ChangeEditInReadonlyHdl, CheckBox * );
302 // <--
303 DECL_LINK( ChangeProtectHdl, CheckBox * );
304 DECL_LINK( ChangePasswdHdl, Button * );
305 DECL_LINK( NameEditHdl, Edit * );
306 DECL_LINK( UseFileHdl, CheckBox* );
307 DECL_LINK( FileSearchHdl, PushButton* );
308 DECL_LINK( DDEHdl, CheckBox* );
309 DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* );
311 void FillList( const SwSectionFmt* pFmt = 0 );
313 public:
314 SwInsertSectionTabPage(Window *pParent, const SfxItemSet &rAttrSet);
315 virtual ~SwInsertSectionTabPage();
317 void SetWrtShell(SwWrtShell& rSh);
319 virtual BOOL FillItemSet( SfxItemSet& );
320 virtual void Reset( const SfxItemSet& );
322 static SfxTabPage* Create( Window* pParent,
323 const SfxItemSet& rAttrSet);
326 class SwSectionFtnEndTabPage : public SfxTabPage
328 FixedLine aFtnFL;
329 CheckBox aFtnNtAtTextEndCB;
331 CheckBox aFtnNtNumCB;
332 FixedText aFtnOffsetLbl;
333 NumericField aFtnOffsetFld;
335 CheckBox aFtnNtNumFmtCB;
336 FixedText aFtnPrefixFT;
337 Edit aFtnPrefixED;
338 SwNumberingTypeListBox aFtnNumViewBox;
339 FixedText aFtnSuffixFT;
340 Edit aFtnSuffixED;
342 FixedLine aEndFL;
343 CheckBox aEndNtAtTextEndCB;
345 CheckBox aEndNtNumCB;
346 FixedText aEndOffsetLbl;
347 NumericField aEndOffsetFld;
349 CheckBox aEndNtNumFmtCB;
350 FixedText aEndPrefixFT;
351 Edit aEndPrefixED;
352 SwNumberingTypeListBox aEndNumViewBox;
353 FixedText aEndSuffixFT;
354 Edit aEndSuffixED;
357 DECL_LINK( FootEndHdl, CheckBox * );
358 void ResetState( BOOL bFtn, const SwFmtFtnEndAtTxtEnd& );
360 public:
361 SwSectionFtnEndTabPage( Window *pParent, const SfxItemSet &rAttrSet );
362 virtual ~SwSectionFtnEndTabPage();
364 virtual BOOL FillItemSet( SfxItemSet& );
365 virtual void Reset( const SfxItemSet& );
367 static SfxTabPage* Create( Window* pParent,
368 const SfxItemSet& rAttrSet);
370 /* -----------------13.06.2003 09:51-----------------
372 --------------------------------------------------*/
373 class SwSectionIndentTabPage : public SfxTabPage
375 FixedLine aIndentFL;
376 FixedText aBeforeFT;
377 MetricField aBeforeMF;
378 FixedText aAfterFT;
379 MetricField aAfterMF;
381 SvxParaPrevWindow aPreviewWin;
383 DECL_LINK(IndentModifyHdl, MetricField*);
384 public:
385 SwSectionIndentTabPage( Window *pParent, const SfxItemSet &rAttrSet );
386 virtual ~SwSectionIndentTabPage();
388 virtual BOOL FillItemSet( SfxItemSet& );
389 virtual void Reset( const SfxItemSet& );
391 static SfxTabPage* Create( Window* pParent,
392 const SfxItemSet& rAttrSet);
394 void SetWrtShell(SwWrtShell& rSh);
397 /* -----------------21.05.99 13:07-------------------
399 * --------------------------------------------------*/
400 class SwInsertSectionTabDialog : public SfxTabDialog
402 SwWrtShell& rWrtSh;
403 SwSection* pToInsertSection;
404 protected:
405 virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
406 virtual short Ok();
407 public:
408 SwInsertSectionTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
409 virtual ~SwInsertSectionTabDialog();
411 void SetSection(const SwSection& rSect);
412 SwSection* GetSection() { return pToInsertSection;}
415 /* -----------------21.05.99 13:07-------------------
417 * --------------------------------------------------*/
418 class SwSectionPropertyTabDialog : public SfxTabDialog
420 SwWrtShell& rWrtSh;
421 protected:
422 virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
423 public:
424 SwSectionPropertyTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh);
425 virtual ~SwSectionPropertyTabDialog();
428 #endif