1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _REGIONSW_HXX 28 #define _REGIONSW_HXX 29 30 #include <hintids.hxx> 31 #include <vcl/field.hxx> 32 #include <vcl/lstbox.hxx> 33 #include <vcl/edit.hxx> 34 #include <vcl/button.hxx> 35 #include <vcl/fixed.hxx> 36 #include <vcl/combobox.hxx> 37 #include <vcl/group.hxx> 38 #include <svtools/svtreebx.hxx> 39 #include <sfx2/basedlgs.hxx> 40 #include <sfx2/tabdlg.hxx> 41 #include <editeng/brshitem.hxx> 42 43 #include <condedit.hxx> 44 #include <section.hxx> 45 #include <fmtclds.hxx> 46 #include <fmtftntx.hxx> 47 #include <fmtclbl.hxx> 48 #include <numberingtypelistbox.hxx> 49 #include <editeng/frmdiritem.hxx> 50 #include <vcl/image.hxx> 51 #include <svx/paraprev.hxx> 52 #include <editeng/lrspitem.hxx> 53 54 55 class SwWrtShell; 56 class EditRegionDlg; 57 58 namespace sfx2 59 { 60 class DocumentInserter; 61 class FileDialogHelper; 62 } 63 64 /************************************************************************* 65 Dialog "Bereiche bearbeiten" 66 *************************************************************************/ 67 68 class SectRepr; 69 typedef SectRepr* SectReprPtr; 70 SV_DECL_PTRARR_SORT( SectReprArr, SectReprPtr, 0, 4 ) 71 72 class SwEditRegionDlg : public SfxModalDialog 73 { 74 FixedLine aNameFL; 75 Edit aCurName; 76 SvTreeListBox aTree; 77 78 FixedLine aLinkFL; 79 TriStateBox aFileCB; 80 CheckBox aDDECB; 81 FixedText aFileNameFT; 82 FixedText aDDECommandFT; 83 Edit aFileNameED; 84 PushButton aFilePB; 85 FixedText aSubRegionFT; 86 ComboBox aSubRegionED; 87 bool bSubRegionsFilled; 88 89 FixedLine aProtectFL; 90 TriStateBox aProtectCB; 91 CheckBox aPasswdCB; 92 PushButton aPasswdPB; 93 94 FixedLine aHideFL; 95 TriStateBox aHideCB; 96 FixedText aConditionFT; 97 ConditionEdit aConditionED; 98 99 // --> FME 2004-06-22 #114856# edit in readonly sections 100 FixedLine aPropertiesFL; 101 TriStateBox aEditInReadonlyCB; 102 // <-- 103 104 OKButton aOK; 105 CancelButton aCancel; 106 PushButton aOptionsPB; 107 PushButton aDismiss; 108 HelpButton aHelp; 109 ImageList aImageIL; 110 ImageList aImageILH; 111 112 SwWrtShell& rSh; 113 SectReprArr aSectReprArr; 114 SvLBoxEntry* pAktEntry; 115 const SwSection* pCurrSect; 116 sfx2::DocumentInserter* m_pDocInserter; 117 Window* m_pOldDefDlgParent; 118 119 sal_Bool bDontCheckPasswd :1; 120 sal_Bool bWeb :1; 121 122 123 Image BuildBitmap(sal_Bool bProtect,sal_Bool bHidden,sal_Bool bHighContrast); 124 125 void RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry); 126 sal_uInt16 FindArrPos(const SwSectionFmt* pFmt); 127 128 DECL_LINK( GetFirstEntryHdl, SvTreeListBox * ); 129 DECL_LINK( DeselectHdl, SvTreeListBox * ); 130 131 DECL_LINK( OkHdl, CheckBox * ); 132 DECL_LINK( NameEditHdl, Edit * ); 133 DECL_LINK( ConditionEditHdl, Edit * ); 134 135 DECL_LINK( ChangePasswdHdl, Button * ); 136 DECL_LINK( ChangeProtectHdl, TriStateBox * ); 137 DECL_LINK( ChangeHideHdl, TriStateBox * ); 138 // --> FME 2004-06-22 #114856# edit in readonly sections 139 DECL_LINK( ChangeEditInReadonlyHdl, TriStateBox * ); 140 // <-- 141 DECL_LINK( ChangeDismissHdl, CheckBox * ); 142 DECL_LINK( UseFileHdl, CheckBox* ); 143 DECL_LINK( FileSearchHdl, PushButton* ); 144 DECL_LINK( OptionsHdl, PushButton* ); 145 DECL_LINK( FileNameHdl, Edit* ); 146 DECL_LINK( DDEHdl, CheckBox* ); 147 DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* ); 148 DECL_LINK( SubRegionEventHdl, VclWindowEvent * ); 149 150 sal_Bool CheckPasswd(CheckBox* pBox = 0); 151 152 public: 153 SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ); 154 virtual ~SwEditRegionDlg(); 155 156 void SelectSection(const String& rSectionName); 157 158 }; 159 /************************************************************************* 160 Dialog "Bereich einfuegen" 161 *************************************************************************/ 162 163 /* -----------------21.05.99 11:05------------------- 164 * 165 * --------------------------------------------------*/ 166 class SwInsertSectionTabPage : public SfxTabPage 167 { 168 FixedLine aNameFL; 169 ComboBox aCurName; 170 171 FixedLine aLinkFL; 172 CheckBox aFileCB; 173 CheckBox aDDECB; 174 FixedText aDDECommandFT; 175 FixedText aFileNameFT; 176 Edit aFileNameED; 177 PushButton aFilePB; 178 FixedText aSubRegionFT; 179 ComboBox aSubRegionED; 180 181 FixedLine aProtectFL; 182 CheckBox aProtectCB; 183 CheckBox aPasswdCB; 184 PushButton aPasswdPB; 185 186 FixedLine aHideFL; 187 CheckBox aHideCB; 188 FixedText aConditionFT; 189 ConditionEdit aConditionED; 190 191 // --> FME 2004-06-22 #114856# edit in readonly sections 192 FixedLine aPropertiesFL; 193 CheckBox aEditInReadonlyCB; 194 // <-- 195 196 String m_sFileName; 197 String m_sFilterName; 198 String m_sFilePasswd; 199 200 // SwFmtCol* pCols; 201 ::com::sun::star::uno::Sequence <sal_Int8 > m_aNewPasswd; 202 SwWrtShell* m_pWrtSh; 203 sfx2::DocumentInserter* m_pDocInserter; 204 Window* m_pOldDefDlgParent; 205 206 DECL_LINK( ChangeHideHdl, CheckBox * ); 207 // --> FME 2004-06-22 #114856# edit in readonly sections 208 DECL_LINK( ChangeEditInReadonlyHdl, CheckBox * ); 209 // <-- 210 DECL_LINK( ChangeProtectHdl, CheckBox * ); 211 DECL_LINK( ChangePasswdHdl, Button * ); 212 DECL_LINK( NameEditHdl, Edit * ); 213 DECL_LINK( UseFileHdl, CheckBox* ); 214 DECL_LINK( FileSearchHdl, PushButton* ); 215 DECL_LINK( DDEHdl, CheckBox* ); 216 DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* ); 217 218 public: 219 SwInsertSectionTabPage(Window *pParent, const SfxItemSet &rAttrSet); 220 virtual ~SwInsertSectionTabPage(); 221 222 void SetWrtShell(SwWrtShell& rSh); 223 224 virtual sal_Bool FillItemSet( SfxItemSet& ); 225 virtual void Reset( const SfxItemSet& ); 226 227 static SfxTabPage* Create( Window* pParent, 228 const SfxItemSet& rAttrSet); 229 }; 230 231 class SwSectionFtnEndTabPage : public SfxTabPage 232 { 233 FixedLine aFtnFL; 234 CheckBox aFtnNtAtTextEndCB; 235 236 CheckBox aFtnNtNumCB; 237 FixedText aFtnOffsetLbl; 238 NumericField aFtnOffsetFld; 239 240 CheckBox aFtnNtNumFmtCB; 241 FixedText aFtnPrefixFT; 242 Edit aFtnPrefixED; 243 SwNumberingTypeListBox aFtnNumViewBox; 244 FixedText aFtnSuffixFT; 245 Edit aFtnSuffixED; 246 247 FixedLine aEndFL; 248 CheckBox aEndNtAtTextEndCB; 249 250 CheckBox aEndNtNumCB; 251 FixedText aEndOffsetLbl; 252 NumericField aEndOffsetFld; 253 254 CheckBox aEndNtNumFmtCB; 255 FixedText aEndPrefixFT; 256 Edit aEndPrefixED; 257 SwNumberingTypeListBox aEndNumViewBox; 258 FixedText aEndSuffixFT; 259 Edit aEndSuffixED; 260 261 262 DECL_LINK( FootEndHdl, CheckBox * ); 263 void ResetState( sal_Bool bFtn, const SwFmtFtnEndAtTxtEnd& ); 264 265 public: 266 SwSectionFtnEndTabPage( Window *pParent, const SfxItemSet &rAttrSet ); 267 virtual ~SwSectionFtnEndTabPage(); 268 269 virtual sal_Bool FillItemSet( SfxItemSet& ); 270 virtual void Reset( const SfxItemSet& ); 271 272 static SfxTabPage* Create( Window* pParent, 273 const SfxItemSet& rAttrSet); 274 }; 275 /* -----------------13.06.2003 09:51----------------- 276 277 --------------------------------------------------*/ 278 class SwSectionIndentTabPage : public SfxTabPage 279 { 280 FixedLine aIndentFL; 281 FixedText aBeforeFT; 282 MetricField aBeforeMF; 283 FixedText aAfterFT; 284 MetricField aAfterMF; 285 286 SvxParaPrevWindow aPreviewWin; 287 288 DECL_LINK(IndentModifyHdl, MetricField*); 289 public: 290 SwSectionIndentTabPage( Window *pParent, const SfxItemSet &rAttrSet ); 291 virtual ~SwSectionIndentTabPage(); 292 293 virtual sal_Bool FillItemSet( SfxItemSet& ); 294 virtual void Reset( const SfxItemSet& ); 295 296 static SfxTabPage* Create( Window* pParent, 297 const SfxItemSet& rAttrSet); 298 299 void SetWrtShell(SwWrtShell& rSh); 300 }; 301 302 /* -----------------21.05.99 13:07------------------- 303 * 304 * --------------------------------------------------*/ 305 class SwInsertSectionTabDialog : public SfxTabDialog 306 { 307 SwWrtShell& rWrtSh; 308 ::std::auto_ptr<SwSectionData> m_pSectionData; 309 310 protected: 311 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); 312 virtual short Ok(); 313 public: 314 SwInsertSectionTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); 315 virtual ~SwInsertSectionTabDialog(); 316 317 void SetSectionData(SwSectionData const& rSect); 318 SwSectionData * GetSectionData() { return m_pSectionData.get(); } 319 }; 320 321 /* -----------------21.05.99 13:07------------------- 322 * 323 * --------------------------------------------------*/ 324 class SwSectionPropertyTabDialog : public SfxTabDialog 325 { 326 SwWrtShell& rWrtSh; 327 protected: 328 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); 329 public: 330 SwSectionPropertyTabDialog(Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); 331 virtual ~SwSectionPropertyTabDialog(); 332 }; 333 334 #endif 335 336 337