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 _NUM_HXX 28 #define _NUM_HXX 29 30 31 #include <sfx2/tabdlg.hxx> 32 #ifndef _MENUBTN_HXX //autogen 33 #include <vcl/menubtn.hxx> 34 #endif 35 #ifndef _FIELD_HXX //autogen 36 #include <vcl/field.hxx> 37 #endif 38 #ifndef _FIXED_HXX //autogen 39 #include <vcl/fixed.hxx> 40 #endif 41 #include <svtools/stdctrl.hxx> 42 #ifndef _BUTTON_HXX //autogen 43 #include <vcl/button.hxx> 44 #endif 45 #ifndef _LSTBOX_HXX //autogen 46 #include <vcl/lstbox.hxx> 47 #endif 48 #ifndef _EDIT_HXX //autogen 49 #include <vcl/edit.hxx> 50 #endif 51 #include <svx/stddlg.hxx> 52 #include <numprevw.hxx> 53 #include "numrule.hxx" 54 55 class SwWrtShell; 56 class SvxBrushItem; 57 class SwOutlineTabDialog; 58 59 60 /*-----------------13.02.97 14.02------------------- 61 62 --------------------------------------------------*/ 63 64 struct SwBmpItemInfo 65 { 66 SvxBrushItem* pBrushItem; 67 sal_uInt16 nItemId; 68 }; 69 70 71 /*-----------------07.02.97 15.37------------------- 72 73 --------------------------------------------------*/ 74 #define NUM_PAGETYPE_BULLET 0 75 #define NUM_PAGETYPE_SINGLENUM 1 76 #define NUM_PAGETYPE_NUM 2 77 #define NUM_PAGETYPE_BMP 3 78 #define PAGETYPE_USER_START 10 79 80 /*-----------------03.12.97 10:18------------------- 81 82 --------------------------------------------------*/ 83 class SwNumPositionTabPage : public SfxTabPage 84 { 85 FixedLine aLevelFL; 86 MultiListBox aLevelLB; 87 88 // --> OD 2008-02-01 #newlistlevelattrs# 89 // former set of controls shown for numbering rules containing list level 90 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION 91 FixedLine aPositionFL; 92 FixedText aDistBorderFT; 93 MetricField aDistBorderMF; 94 CheckBox aRelativeCB; 95 FixedText aIndentFT; 96 MetricField aIndentMF; 97 FixedText aDistNumFT; 98 MetricField aDistNumMF; 99 FixedText aAlignFT; 100 ListBox aAlignLB; 101 // <-- 102 103 // --> OD 2008-02-01 #newlistlevelattrs# 104 // new set of controls shown for numbering rules containing list level 105 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT 106 FixedText aLabelFollowedByFT; 107 ListBox aLabelFollowedByLB; 108 FixedText aListtabFT; 109 MetricField aListtabMF; 110 FixedText aAlign2FT; 111 ListBox aAlign2LB; 112 FixedText aAlignedAtFT; 113 MetricField aAlignedAtMF; 114 FixedText aIndentAtFT; 115 MetricField aIndentAtMF; 116 // <-- 117 118 PushButton aStandardPB; 119 120 NumberingPreview aPreviewWIN; 121 122 SwNumRule* pActNum; 123 SwNumRule* pSaveNum; 124 SwWrtShell* pWrtSh; 125 126 SwOutlineTabDialog* pOutlineDlg; 127 sal_uInt16 nActNumLvl; 128 129 sal_Bool bModified : 1; 130 sal_Bool bPreset : 1; 131 sal_Bool bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein 132 // --> OD 2008-02-01 #newlistlevelattrs# 133 bool bLabelAlignmentPosAndSpaceModeActive; 134 // <-- 135 136 void InitControls(); 137 138 DECL_LINK( LevelHdl, ListBox * ); 139 DECL_LINK( EditModifyHdl, Edit*); 140 DECL_LINK( DistanceHdl, MetricField * ); 141 DECL_LINK( RelativeHdl, CheckBox * ); 142 DECL_LINK( StandardHdl, PushButton * ); 143 144 // --> OD 2008-02-01 #newlistlevelattrs# 145 void InitPosAndSpaceMode(); 146 void ShowControlsDependingOnPosAndSpaceMode(); 147 148 DECL_LINK( LabelFollowedByHdl_Impl, ListBox* ); 149 DECL_LINK( ListtabPosHdl_Impl, MetricField* ); 150 DECL_LINK( AlignAtHdl_Impl, MetricField* ); 151 DECL_LINK( IndentAtHdl_Impl, MetricField* ); 152 // <-- 153 154 using SfxTabPage::ActivatePage; 155 using SfxTabPage::DeactivatePage; 156 157 public: 158 159 SwNumPositionTabPage(Window* pParent, 160 const SfxItemSet& rSet); 161 ~SwNumPositionTabPage(); 162 163 virtual void ActivatePage(const SfxItemSet& rSet); 164 virtual int DeactivatePage(SfxItemSet *pSet); 165 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 166 virtual void Reset( const SfxItemSet& rSet ); 167 168 static SfxTabPage* Create( Window* pParent, 169 const SfxItemSet& rAttrSet); 170 171 void SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;} 172 void SetWrtShell(SwWrtShell* pSh); 173 #if OSL_DEBUG_LEVEL > 1 174 void SetModified(sal_Bool bRepaint = sal_True); 175 #else 176 void SetModified(sal_Bool bRepaint = sal_True) 177 { bModified = sal_True; 178 if(bRepaint) 179 { 180 aPreviewWIN.SetLevel(nActNumLvl); 181 aPreviewWIN.Invalidate(); 182 } 183 } 184 #endif 185 }; 186 187 class SwSvxNumBulletTabDialog : public SfxTabDialog 188 { 189 SwWrtShell& rWrtSh; 190 191 String sRemoveText; 192 int nRetOptionsDialog; 193 194 protected: 195 virtual short Ok(); 196 virtual void PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage); 197 DECL_LINK(RemoveNumberingHdl, PushButton*); 198 public: 199 SwSvxNumBulletTabDialog(Window* pParent, 200 const SfxItemSet* pSwItemSet, 201 SwWrtShell &); 202 ~SwSvxNumBulletTabDialog(); 203 }; 204 #endif // _NUM_CXX 205 206