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 _SVX_PARAGRPH_HXX 28 #define _SVX_PARAGRPH_HXX 29 30 // include --------------------------------------------------------------- 31 32 #include <vcl/button.hxx> 33 #include <vcl/fixed.hxx> 34 #include <sfx2/tabdlg.hxx> 35 #include <svx/relfld.hxx> // SvxRelativeField 36 #include <svx/paraprev.hxx> // Preview 37 #include <svx/frmdirlbox.hxx> 38 #include <vcl/lstbox.hxx> 39 #include <svx/flagsdef.hxx> 40 41 // define ---------------------------------------------------------------- 42 43 // 1/2 cm in TWIPS 44 // wird auch fuer Minimalgrosse der LayFrms aller Arten benutzt 45 //CHINA001 #define MM50 283 46 47 // forward --------------------------------------------------------------- 48 49 class SvxLineSpacingItem; 50 class SvxParagraphControllerItem; 51 52 // class SvxStdParagraphTabPage ------------------------------------------ 53 54 /* {k:\svx\prototyp\dialog\parastd.bmp} 55 56 [Beschreibung] 57 Mit dieser TabPage koennen Standard-Attribute eines Absatzes eingestellt 58 werden (Einzug, Abstand, Ausrichtung, Zeilenabstand). 59 60 [Items] 61 <SvxAdjustItem><SID_ATTR_PARA_ADJUST> 62 <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE> 63 <SvxULSpaceItem><SID_ATTR_ULSPACE> 64 <SvxLRSpaceItem><SID_ATTR_LRSPACE> 65 */ 66 67 class SvxStdParagraphTabPage: public SfxTabPage 68 { 69 using TabPage::DeactivatePage; 70 71 private: 72 SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet ); 73 74 FixedLine aIndentFrm; 75 // Einzug 76 FixedText aLeftLabel; 77 SvxRelativeField aLeftIndent; 78 79 FixedText aRightLabel; 80 SvxRelativeField aRightIndent; 81 82 FixedText aFLineLabel; 83 SvxRelativeField aFLineIndent; 84 CheckBox aAutoCB; 85 86 FixedLine aDistFrm; 87 88 // Abstaende 89 FixedText aTopLabel; 90 SvxRelativeField aTopDist; 91 FixedText aBottomLabel; 92 SvxRelativeField aBottomDist; 93 94 // Zeilenabstand 95 FixedLine aLineDistFrm; 96 ListBox aLineDist; 97 FixedText aLineDistAtLabel; 98 MetricField aLineDistAtPercentBox; 99 MetricField aLineDistAtMetricBox; 100 String sAbsDist; 101 SvxParaPrevWindow aExampleWin; 102 103 //Registerhaltigkeit - nur Writer 104 FixedLine aRegisterFL; 105 CheckBox aRegisterCB; 106 107 Edit* pActLineDistFld; 108 long nAbst; 109 long nWidth; 110 long nMinFixDist; 111 sal_Bool bRelativeMode; 112 sal_Bool bNegativeIndents; 113 114 #ifdef _SVX_PARAGRPH_CXX 115 void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr ); 116 void Init_Impl(); 117 void UpdateExample_Impl( sal_Bool bAll = sal_False ); 118 119 DECL_LINK( LineDistHdl_Impl, ListBox* ); 120 DECL_LINK( ModifyHdl_Impl, SvxRelativeField* ); 121 DECL_LINK( AutoHdl_Impl, CheckBox* ); 122 #endif 123 124 protected: 125 virtual int DeactivatePage( SfxItemSet* pSet = 0 ); 126 127 public: 128 DECL_LINK( ELRLoseFocusHdl, Edit* ); 129 130 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet ); 131 static sal_uInt16* GetRanges(); 132 133 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 134 virtual void Reset( const SfxItemSet& rSet ); 135 136 137 void SetPageWidth( sal_uInt16 nPageWidth ); 138 void EnableRelativeMode(); 139 void EnableRegisterMode(); 140 void EnableAutoFirstLine(); 141 void EnableAbsLineDist(long nMinTwip); 142 void EnableNegativeMode(); 143 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 144 }; 145 146 // class SvxParaAlignTabPage ------------------------------------------------ 147 148 class SvxParaAlignTabPage : public SfxTabPage 149 { 150 using TabPage::DeactivatePage; 151 152 // Ausrichtung 153 FixedLine aAlignFrm; 154 RadioButton aLeft; 155 RadioButton aRight; 156 RadioButton aCenter; 157 RadioButton aJustify; 158 FixedText aLastLineFT; 159 ListBox aLastLineLB; 160 CheckBox aExpandCB; 161 162 CheckBox aSnapToGridCB; 163 164 //preview 165 SvxParaPrevWindow aExampleWin; 166 //vertical alignment 167 FixedLine aVertAlignFL; 168 169 FixedText aVertAlignFT; 170 ListBox aVertAlignLB; 171 172 FixedLine aPropertiesFL; 173 FixedText aTextDirectionFT; 174 svx::FrameDirectionListBox aTextDirectionLB; 175 176 #ifdef _SVX_PARAGRPH_CXX 177 DECL_LINK( AlignHdl_Impl, RadioButton* ); 178 DECL_LINK( LastLineHdl_Impl, ListBox* ); 179 DECL_LINK( TextDirectionHdl_Impl, ListBox* ); 180 181 void UpdateExample_Impl( sal_Bool bAll = sal_False ); 182 #endif 183 184 SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet ); 185 virtual ~SvxParaAlignTabPage(); 186 187 protected: 188 virtual int DeactivatePage( SfxItemSet* pSet = 0 ); 189 190 public: 191 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet ); 192 static sal_uInt16* GetRanges(); 193 194 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 195 virtual void Reset( const SfxItemSet& rSet ); 196 197 void EnableJustifyExt(); 198 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 199 }; 200 201 // class SvxExtParagraphTabPage ------------------------------------------ 202 203 /* {k:\svx\prototyp\dialog\paraext.bmp} 204 205 [Beschreibung] 206 Mit dieser TabPage koennen Spezial-Attribute eines Absatzes eingestellt 207 werden (Silbentrennung, Seitenumbruch, Schusterjungen, Hurenkinder, ...). 208 209 [Items] 210 <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE> 211 <SvxFmtBreakItem><SID_ATTR_PARA_PAGEBREAK> 212 <SvxFmtSplitItem><SID_ATTR_PARA_SPLIT> 213 <SvxWidowsItem><SID_ATTR_PARA_WIDOWS> 214 <SvxOrphansItem><SID_ATTR_PARA_ORPHANS> 215 */ 216 217 class SvxExtParagraphTabPage: public SfxTabPage 218 { 219 using TabPage::DeactivatePage; 220 221 public: 222 virtual ~SvxExtParagraphTabPage(); 223 224 static SfxTabPage* Create( Window* pParent, 225 const SfxItemSet& rSet ); 226 static sal_uInt16* GetRanges(); 227 228 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 229 virtual void Reset( const SfxItemSet& rSet ); 230 231 void DisablePageBreak(); 232 233 protected: 234 virtual int DeactivatePage( SfxItemSet* pSet = 0 ); 235 236 private: 237 SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rSet ); 238 239 // Silbentrennung 240 FixedLine aExtFL; 241 TriStateBox aHyphenBox; 242 FixedText aBeforeText; 243 NumericField aExtHyphenBeforeBox; 244 // FixedText aHyphenBeforeLabel; 245 FixedText aAfterText; 246 NumericField aExtHyphenAfterBox; 247 // FixedText aHyphenAfterLabel; 248 FixedText aMaxHyphenLabel; 249 NumericField aMaxHyphenEdit; 250 251 // Seitenumbruch 252 FixedLine aBreaksFL; 253 TriStateBox aPageBreakBox; 254 FixedText aBreakTypeFT; 255 ListBox aBreakTypeLB; 256 FixedText aBreakPositionFT; 257 ListBox aBreakPositionLB; 258 TriStateBox aApplyCollBtn; 259 ListBox aApplyCollBox; 260 FixedText aPagenumText; 261 NumericField aPagenumEdit; 262 263 FixedLine aExtendFL; 264 265 // Absatzteilung 266 TriStateBox aKeepTogetherBox; 267 TriStateBox aKeepParaBox; 268 269 // Witwen/Waisen 270 TriStateBox aOrphanBox; 271 NumericField aOrphanRowNo; 272 FixedText aOrphanRowLabel; 273 274 TriStateBox aWidowBox; 275 NumericField aWidowRowNo; 276 FixedText aWidowRowLabel; 277 278 sal_Bool bPageBreak; 279 sal_Bool bHtmlMode; 280 sal_uInt16 nStdPos; 281 282 #ifdef _SVX_PARAGRPH_CXX 283 DECL_LINK( PageBreakHdl_Impl, TriStateBox* ); 284 DECL_LINK( KeepTogetherHdl_Impl, TriStateBox* ); 285 DECL_LINK( WidowHdl_Impl, TriStateBox* ); 286 DECL_LINK( OrphanHdl_Impl, TriStateBox* ); 287 DECL_LINK( HyphenClickHdl_Impl, TriStateBox* ); 288 DECL_LINK( ApplyCollClickHdl_Impl, TriStateBox* ); 289 DECL_LINK( PageBreakPosHdl_Impl, ListBox* ); 290 DECL_LINK( PageBreakTypeHdl_Impl, ListBox* ); 291 #endif 292 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 293 }; 294 /* -----------------------------29.11.00 11:33-------------------------------- 295 296 ---------------------------------------------------------------------------*/ 297 class SvxAsianTabPage : public SfxTabPage 298 { 299 FixedLine aOptionsFL; 300 301 TriStateBox aForbiddenRulesCB; 302 TriStateBox aHangingPunctCB; 303 304 TriStateBox aScriptSpaceCB; 305 306 SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet ); 307 308 #ifdef _SVX_PARAGRPH_CXX 309 DECL_LINK( ClickHdl_Impl, TriStateBox* ); 310 #endif 311 public: 312 ~SvxAsianTabPage(); 313 314 315 static SfxTabPage* Create( Window* pParent, 316 const SfxItemSet& rSet ); 317 static sal_uInt16* GetRanges(); 318 319 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 320 virtual void Reset( const SfxItemSet& rSet ); 321 322 }; 323 324 #endif // #ifndef _SVX_PARAGRPH_HXX 325 326 327