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_NUMPAGES_HXX 28 #define _SVX_NUMPAGES_HXX 29 30 // include --------------------------------------------------------------- 31 32 #include <sfx2/tabdlg.hxx> 33 #include <vcl/group.hxx> 34 #include <vcl/fixed.hxx> 35 #include <vcl/menubtn.hxx> 36 #include <vcl/lstbox.hxx> 37 #include <vcl/edit.hxx> 38 #include <vcl/field.hxx> 39 #ifndef _SVX_NUMDEF_HXX 40 #include <editeng/numdef.hxx> 41 #endif 42 #include <svtools/ctrlbox.hxx> 43 #include <svl/svarray.hxx> 44 45 // ----------------------------------------------------------------------- 46 class SvxNumRule; 47 class SvxBmpNumValueSet; 48 class SvxNumValueSet; 49 class ValueSet; 50 class SvxNumberingPreview; 51 class SvxBrushItem; 52 53 /*-----------------13.02.97 14.02------------------- 54 55 --------------------------------------------------*/ 56 57 struct SvxNumSettings_Impl 58 { 59 short nNumberType; 60 short nParentNumbering; 61 rtl::OUString sPrefix; 62 rtl::OUString sSuffix; 63 rtl::OUString sBulletChar; 64 rtl::OUString sBulletFont; 65 SvxNumSettings_Impl() : 66 nNumberType(0), 67 nParentNumbering(0) 68 {} 69 }; 70 71 typedef SvxNumSettings_Impl* SvxNumSettings_ImplPtr; 72 SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr,8,4) 73 74 /*-----------------07.02.97 11.36------------------- 75 76 --------------------------------------------------*/ 77 class SvxSingleNumPickTabPage : public SfxTabPage 78 { 79 using TabPage::ActivatePage; 80 using TabPage::DeactivatePage; 81 82 FixedLine aValuesFL; 83 SvxNumValueSet* pExamplesVS; 84 SvxNumSettingsArr_Impl aNumSettingsArr; 85 SvxNumRule* pActNum; 86 SvxNumRule* pSaveNum; 87 sal_uInt16 nActNumLvl; 88 sal_Bool bModified : 1; 89 sal_Bool bPreset : 1; 90 91 String sNumCharFmtName; 92 sal_uInt16 nNumItemId; 93 94 protected: 95 DECL_LINK( NumSelectHdl_Impl, ValueSet*); 96 DECL_LINK( DoubleClickHdl_Impl, ValueSet* ); 97 98 public: 99 SvxSingleNumPickTabPage(Window* pParent, 100 const SfxItemSet& rSet); 101 ~SvxSingleNumPickTabPage(); 102 103 static SfxTabPage* Create( Window* pParent, 104 const SfxItemSet& rAttrSet); 105 106 virtual void ActivatePage(const SfxItemSet& rSet); 107 virtual int DeactivatePage(SfxItemSet *pSet); 108 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 109 virtual void Reset( const SfxItemSet& rSet ); 110 111 void SetNumCharFmtName(const String& rName){sNumCharFmtName = rName;} 112 }; 113 114 /*-----------------07.02.97 11.36------------------- 115 116 --------------------------------------------------*/ 117 118 class SvxBulletPickTabPage : public SfxTabPage 119 { 120 using TabPage::ActivatePage; 121 using TabPage::DeactivatePage; 122 123 FixedLine aValuesFL; 124 SvxNumValueSet* pExamplesVS; 125 SvxNumRule* pActNum; 126 SvxNumRule* pSaveNum; 127 sal_uInt16 nActNumLvl; 128 sal_Bool bModified : 1; 129 sal_Bool bPreset : 1; 130 sal_uInt16 nNumItemId; 131 132 String sBulletCharFmtName; 133 protected: 134 DECL_LINK(NumSelectHdl_Impl, ValueSet*); 135 DECL_LINK( DoubleClickHdl_Impl, ValueSet* ); 136 public: 137 SvxBulletPickTabPage(Window* pParent, 138 const SfxItemSet& rSet); 139 ~SvxBulletPickTabPage(); 140 141 static SfxTabPage* Create( Window* pParent, 142 const SfxItemSet& rAttrSet); 143 144 virtual void ActivatePage(const SfxItemSet& rSet); 145 virtual int DeactivatePage(SfxItemSet *pSet); 146 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 147 virtual void Reset( const SfxItemSet& rSet ); 148 149 void SetCharFmtName(const String& rName){sBulletCharFmtName = rName;} 150 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 151 }; 152 153 /*-----------------07.02.97 11.36------------------- 154 TabPage fuer vollstaendig Numerierung 155 --------------------------------------------------*/ 156 #define NUMTYPE_MEMBER 4 // Anzahl der Elemente des FormatStrings je Ebene 157 #define NUM_VALUSET_COUNT 16 158 class SvxNumPickTabPage : public SfxTabPage 159 { 160 using TabPage::ActivatePage; 161 using TabPage::DeactivatePage; 162 163 FixedLine aValuesFL; 164 SvxNumValueSet* pExamplesVS; 165 String sNumCharFmtName; 166 String sBulletCharFmtName; 167 168 SvxNumSettingsArr_Impl aNumSettingsArrays[NUM_VALUSET_COUNT]; // wird mit den fuenf Formaten initialisiert 169 170 SvxNumRule* pActNum; 171 SvxNumRule* pSaveNum; 172 sal_uInt16 nActNumLvl; 173 sal_uInt16 nNumItemId; 174 sal_Bool bModified : 1; 175 sal_Bool bPreset : 1; 176 177 178 protected: 179 DECL_LINK(NumSelectHdl_Impl, ValueSet*); 180 DECL_LINK( DoubleClickHdl_Impl, ValueSet* ); 181 182 public: 183 SvxNumPickTabPage(Window* pParent, 184 const SfxItemSet& rSet); 185 ~SvxNumPickTabPage(); 186 187 static SfxTabPage* Create( Window* pParent, 188 const SfxItemSet& rAttrSet); 189 190 virtual void ActivatePage(const SfxItemSet& rSet); 191 virtual int DeactivatePage(SfxItemSet *pSet); 192 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 193 virtual void Reset( const SfxItemSet& rSet ); 194 195 void SetCharFmtNames(const String& rCharName, const String& rBulName) 196 { sNumCharFmtName = rCharName; 197 sBulletCharFmtName = rBulName;} 198 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 199 }; 200 201 /*-----------------12.02.97 07.42------------------- 202 203 --------------------------------------------------*/ 204 class SvxBitmapPickTabPage : public SfxTabPage 205 { 206 using TabPage::ActivatePage; 207 using TabPage::DeactivatePage; 208 209 FixedLine aValuesFL; 210 SvxBmpNumValueSet* pExamplesVS; 211 FixedText aErrorText; 212 CheckBox aLinkedCB; 213 214 List aGrfNames; 215 String sNumCharFmtName; 216 217 SvxNumRule* pActNum; 218 SvxNumRule* pSaveNum; 219 sal_uInt16 nActNumLvl; 220 sal_uInt16 nNumItemId; 221 SfxMapUnit eCoreUnit; 222 sal_Bool bModified : 1; 223 sal_Bool bPreset : 1; 224 225 protected: 226 DECL_LINK( NumSelectHdl_Impl, ValueSet*); 227 DECL_LINK( DoubleClickHdl_Impl, ValueSet* ); 228 DECL_LINK( LinkBmpHdl_Impl, CheckBox* ); 229 230 public: 231 SvxBitmapPickTabPage(Window* pParent, 232 const SfxItemSet& rSet); 233 ~SvxBitmapPickTabPage(); 234 235 static SfxTabPage* Create( Window* pParent, 236 const SfxItemSet& rAttrSet); 237 238 virtual void ActivatePage(const SfxItemSet& rSet); 239 virtual int DeactivatePage(SfxItemSet *pSet); 240 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 241 virtual void Reset( const SfxItemSet& rSet ); 242 243 void SetNumCharFmtName(const String& rName){sNumCharFmtName = rName;} 244 }; 245 246 /*-----------------01.12.97 16:13------------------- 247 248 --------------------------------------------------*/ 249 class SvxNumOptionsTabPage : public SfxTabPage 250 { 251 using TabPage::ActivatePage; 252 using TabPage::DeactivatePage; 253 254 FixedLine aFormatFL; 255 FixedText aLevelFT; 256 MultiListBox aLevelLB; 257 258 FixedText aFmtFT; 259 ListBox aFmtLB; 260 FixedText aPrefixFT; 261 Edit aPrefixED; 262 FixedText aSuffixFT; 263 Edit aSuffixED; 264 FixedText aCharFmtFT; 265 ListBox aCharFmtLB; 266 FixedText aBulColorFT; 267 ColorListBox aBulColLB; 268 FixedText aBulRelSizeFT; 269 MetricField aBulRelSizeMF; 270 FixedText aAllLevelFT; 271 NumericField aAllLevelNF; 272 FixedText aStartFT; 273 NumericField aStartED; 274 PushButton aBulletPB; 275 FixedText aAlignFT; 276 ListBox aAlignLB; 277 FixedText aBitmapFT; 278 MenuButton aBitmapMB; 279 FixedText aSizeFT; 280 MetricField aWidthMF; 281 FixedText aMultFT; 282 MetricField aHeightMF; 283 CheckBox aRatioCB; 284 FixedText aOrientFT; 285 ListBox aOrientLB; 286 287 FixedLine aSameLevelFL; 288 CheckBox aSameLevelCB; 289 290 String sNumCharFmtName; 291 String sBulletCharFmtName; 292 293 Timer aInvalidateTimer; 294 295 SvxNumberingPreview* pPreviewWIN; 296 297 SvxNumRule* pActNum; 298 SvxNumRule* pSaveNum; 299 300 Size aInitSize[SVX_MAX_NUM]; 301 302 sal_Bool bLastWidthModified : 1; 303 sal_Bool bModified : 1; 304 sal_Bool bPreset : 1; 305 sal_Bool bAutomaticCharStyles: 1; 306 sal_Bool bHTMLMode : 1; 307 sal_Bool bMenuButtonInitialized : 1; 308 309 List aGrfNames; 310 Font aActBulletFont; 311 String sBullet; 312 String sStartWith; 313 314 sal_uInt8 nBullet; 315 sal_uInt16 nActNumLvl; 316 sal_uInt16 nNumItemId; 317 SfxMapUnit eCoreUnit; 318 319 void InitControls(); 320 void SwitchNumberType( sal_uInt8 nType, sal_Bool bBmp = sal_False ); 321 void CheckForStartValue_Impl(sal_uInt16 nNumberingType); 322 323 DECL_LINK( NumberTypeSelectHdl_Impl, ListBox * ); 324 DECL_LINK( LevelHdl_Impl, ListBox * ); 325 DECL_LINK( PopupActivateHdl_Impl, Menu * ); 326 DECL_LINK( GraphicHdl_Impl, MenuButton * ); 327 DECL_LINK( BulletHdl_Impl, Button * ); 328 DECL_LINK( SizeHdl_Impl, MetricField * ); 329 DECL_LINK( RatioHdl_Impl, CheckBox * ); 330 DECL_LINK( CharFmtHdl_Impl, ListBox * ); 331 DECL_LINK( EditModifyHdl_Impl, Edit * ); 332 DECL_LINK( AllLevelHdl_Impl, NumericField * ); 333 DECL_LINK( OrientHdl_Impl, ListBox * ); 334 DECL_LINK( SameLevelHdl_Impl, CheckBox * ); 335 DECL_LINK( BulColorHdl_Impl, ColorListBox* ); 336 DECL_LINK( BulRelSizeHdl_Impl, MetricField *); 337 DECL_LINK( PreviewInvalidateHdl_Impl, Timer* ); 338 339 DECL_STATIC_LINK( SvxNumOptionsTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* ); 340 341 public: 342 SvxNumOptionsTabPage(Window* pParent, 343 const SfxItemSet& rSet); 344 ~SvxNumOptionsTabPage(); 345 346 static SfxTabPage* Create( Window* pParent, 347 const SfxItemSet& rAttrSet); 348 349 virtual void ActivatePage(const SfxItemSet& rSet); 350 virtual int DeactivatePage(SfxItemSet *pSet); 351 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 352 virtual void Reset( const SfxItemSet& rSet ); 353 354 //??? void SetWrtShell(SwWrtShell* pSh); 355 void SetCharFmts(const String& rNumName, const String& rBulletName ) 356 { 357 sNumCharFmtName = rNumName; 358 sBulletCharFmtName = rBulletName; 359 } 360 void SetMetric(FieldUnit eSet); 361 362 ListBox& GetCharFmtListBox() {return aCharFmtLB;} 363 void SetModified(sal_Bool bRepaint = sal_True); 364 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 365 }; 366 367 /*-----------------03.12.97 10:18------------------- 368 369 --------------------------------------------------*/ 370 class SvxNumPositionTabPage : public SfxTabPage 371 { 372 using TabPage::ActivatePage; 373 using TabPage::DeactivatePage; 374 375 FixedLine aPositionFL; 376 FixedText aLevelFT; 377 MultiListBox aLevelLB; 378 379 // --> OD 2008-01-11 #newlistlevelattrs# 380 // former set of controls shown for numbering rules containing list level 381 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION 382 FixedText aDistBorderFT; 383 MetricField aDistBorderMF; 384 CheckBox aRelativeCB; 385 FixedText aIndentFT; 386 MetricField aIndentMF; 387 FixedText aDistNumFT; 388 MetricField aDistNumMF; 389 FixedText aAlignFT; 390 ListBox aAlignLB; 391 // <-- 392 393 // --> OD 2008-01-10 #newlistlevelattrs# 394 // new set of controls shown for numbering rules containing list level 395 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT 396 FixedText aLabelFollowedByFT; 397 ListBox aLabelFollowedByLB; 398 FixedText aListtabFT; 399 MetricField aListtabMF; 400 FixedText aAlign2FT; 401 ListBox aAlign2LB; 402 FixedText aAlignedAtFT; 403 MetricField aAlignedAtMF; 404 FixedText aIndentAtFT; 405 MetricField aIndentAtMF; 406 // <-- 407 408 PushButton aStandardPB; 409 410 #if OSL_DEBUG_LEVEL > 1 411 FixedText* pDebugFixedText; 412 #endif 413 SvxNumberingPreview* pPreviewWIN; 414 415 SvxNumRule* pActNum; 416 SvxNumRule* pSaveNum; 417 418 sal_uInt16 nActNumLvl; 419 sal_uInt16 nNumItemId; 420 SfxMapUnit eCoreUnit; 421 422 sal_Bool bModified : 1; 423 sal_Bool bPreset : 1; 424 sal_Bool bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein 425 // --> OD 2008-01-11 #newlistlevelattrs# 426 bool bLabelAlignmentPosAndSpaceModeActive; 427 // <-- 428 429 void InitControls(); 430 431 DECL_LINK( LevelHdl_Impl, ListBox * ); 432 DECL_LINK( EditModifyHdl_Impl, Edit*); 433 DECL_LINK( DistanceHdl_Impl, MetricField * ); 434 DECL_LINK( RelativeHdl_Impl, CheckBox * ); 435 DECL_LINK( StandardHdl_Impl, PushButton * ); 436 437 // --> OD 2008-01-11 #newlistlevelattrs# 438 void InitPosAndSpaceMode(); 439 void ShowControlsDependingOnPosAndSpaceMode(); 440 441 DECL_LINK( LabelFollowedByHdl_Impl, ListBox* ); 442 DECL_LINK( ListtabPosHdl_Impl, MetricField* ); 443 DECL_LINK( AlignAtHdl_Impl, MetricField* ); 444 DECL_LINK( IndentAtHdl_Impl, MetricField* ); 445 // <-- 446 447 public: 448 SvxNumPositionTabPage(Window* pParent, 449 const SfxItemSet& rSet); 450 ~SvxNumPositionTabPage(); 451 452 virtual void ActivatePage(const SfxItemSet& rSet); 453 virtual int DeactivatePage(SfxItemSet *pSet); 454 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 455 virtual void Reset( const SfxItemSet& rSet ); 456 457 static SfxTabPage* Create( Window* pParent, 458 const SfxItemSet& rAttrSet); 459 460 void SetMetric(FieldUnit eSet); 461 void SetModified(sal_Bool bRepaint = sal_True); 462 virtual void PageCreated(SfxAllItemSet aSet); // add CHINA001 463 }; 464 465 #endif 466 467 468 469 470