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 SW_DOCUFLD_HXX 28 #define SW_DOCUFLD_HXX 29 30 31 #include <tools/date.hxx> 32 #include <tools/datetime.hxx> 33 34 35 #include <svl/macitem.hxx> 36 37 #include "fldbas.hxx" 38 #include "numrule.hxx" 39 40 class _SetGetExpFlds; 41 class SwTxtFld; 42 class SwFrm; 43 class OutlinerParaObject; 44 class SwTextAPIObject; 45 46 enum SwAuthorFormat 47 { 48 AF_BEGIN, 49 AF_NAME = AF_BEGIN, 50 AF_SHORTCUT, 51 AF_END, 52 AF_FIXED = 0x8000 53 }; 54 55 /*-------------------------------------------------------------------- 56 Beschreibung: Untertyp der Dokumentstatistik 57 --------------------------------------------------------------------*/ 58 59 enum SwDocStatSubType 60 { 61 DS_BEGIN, 62 DS_PAGE = DS_BEGIN, 63 DS_PARA, 64 DS_WORD, 65 DS_CHAR, 66 DS_TBL, 67 DS_GRF, 68 DS_OLE, 69 DS_END 70 }; 71 72 typedef sal_uInt16 SwDocInfoSubType; 73 namespace nsSwDocInfoSubType 74 { 75 // NB: these must denote consecutive integers! 76 // NB2: these are extended by 4 DI_INFO values for backward compatibility 77 // in filter/html/htmlfld.cxx, so make sure that DI_SUBTYPE_END 78 // really is the end, and is at least 4 less than DI_SUB_*! 79 const SwDocInfoSubType DI_SUBTYPE_BEGIN = 0; 80 const SwDocInfoSubType DI_TITEL = DI_SUBTYPE_BEGIN; 81 const SwDocInfoSubType DI_THEMA = 1; 82 const SwDocInfoSubType DI_KEYS = 2; 83 const SwDocInfoSubType DI_COMMENT = 3; 84 const SwDocInfoSubType DI_CREATE = 4; 85 const SwDocInfoSubType DI_CHANGE = 5; 86 const SwDocInfoSubType DI_PRINT = 6; 87 const SwDocInfoSubType DI_DOCNO = 7; 88 const SwDocInfoSubType DI_EDIT = 8; 89 const SwDocInfoSubType DI_CUSTOM = 9; 90 const SwDocInfoSubType DI_SUBTYPE_END = 10; 91 92 93 const SwDocInfoSubType DI_SUB_AUTHOR = 0x0100; 94 const SwDocInfoSubType DI_SUB_TIME = 0x0200; 95 const SwDocInfoSubType DI_SUB_DATE = 0x0300; 96 const SwDocInfoSubType DI_SUB_FIXED = 0x1000; 97 const SwDocInfoSubType DI_SUB_MASK = 0xff00; 98 } 99 100 101 enum RegInfoFormat // Nur noch zum laden alter Dokumente!!! 102 { 103 RF_AUTHOR, 104 RF_TIME, 105 RF_DATE, 106 RF_ALL 107 }; 108 109 enum SwPageNumSubType 110 { 111 PG_RANDOM, 112 PG_NEXT, 113 PG_PREV 114 }; 115 116 enum SwExtUserSubType 117 { 118 EU_COMPANY /*EU_FIRMA*/, 119 EU_FIRSTNAME /*EU_VORNAME*/, 120 EU_NAME /*EU_NAME*/, 121 EU_SHORTCUT /*EU_ABK*/, 122 EU_STREET /*EU_STRASSE*/, 123 EU_COUNTRY /*EU_LAND*/, 124 EU_ZIP /*EU_PLZ*/, 125 EU_CITY /*EU_ORT*/, 126 EU_TITLE /*EU_TITEL*/, 127 EU_POSITION /*EU_POS*/, 128 EU_PHONE_PRIVATE /*EU_TELPRIV*/, 129 EU_PHONE_COMPANY /*EU_TELFIRMA*/, 130 EU_FAX, 131 EU_EMAIL, 132 EU_STATE, 133 EU_FATHERSNAME, 134 EU_APARTMENT 135 }; 136 137 enum SwJumpEditFormat 138 { 139 JE_FMT_TEXT, 140 JE_FMT_TABLE, 141 JE_FMT_FRAME, 142 JE_FMT_GRAPHIC, 143 JE_FMT_OLE 144 }; 145 146 /*-------------------------------------------------------------------- 147 Beschreibung: Seitennummer 148 --------------------------------------------------------------------*/ 149 150 class SwPageNumberFieldType : public SwFieldType 151 { 152 sal_Int16 nNumberingType; 153 sal_uInt16 nNum, nMax; 154 sal_Bool bVirtuell; 155 156 public: 157 SwPageNumberFieldType(); 158 159 String& Expand( sal_uInt32 nFmt, short nOff, const String&, String& rRet ) const; 160 void ChangeExpansion( SwDoc* pDoc, sal_uInt16 nNum, sal_uInt16 nMax, 161 sal_Bool bVirtPageNum, const sal_Int16* pNumFmt = 0 ); 162 virtual SwFieldType* Copy() const; 163 }; 164 165 /*-------------------------------------------------------------------- 166 Beschreibung: Seitennummerierung 167 --------------------------------------------------------------------*/ 168 169 class SW_DLLPUBLIC SwPageNumberField : public SwField 170 { 171 String sUserStr; 172 sal_uInt16 nSubType; 173 short nOffset; 174 175 public: 176 SwPageNumberField(SwPageNumberFieldType*, sal_uInt16 nSub = PG_RANDOM, 177 sal_uInt32 nFmt = 0, short nOff = 0); 178 179 virtual String Expand() const; 180 virtual SwField* Copy() const; 181 182 virtual String GetPar2() const; 183 virtual void SetPar2(const String& rStr); 184 185 virtual sal_uInt16 GetSubType() const; 186 // virtual void SetSubType(sal_uInt16 nSub); // OM: entfernt, da unbenoetigt und gefaehrlich 187 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 188 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 189 190 const String& GetUserString() const { return sUserStr; } 191 void SetUserString( const String& rS ) { sUserStr = rS; } 192 }; 193 194 /*-------------------------------------------------------------------- 195 Beschreibung: Autoren 196 --------------------------------------------------------------------*/ 197 198 class SwAuthorFieldType : public SwFieldType 199 { 200 public: 201 SwAuthorFieldType(); 202 203 String Expand(sal_uLong) const; 204 virtual SwFieldType* Copy() const; 205 }; 206 207 /*-------------------------------------------------------------------- 208 Beschreibung: AutorenFeld 209 --------------------------------------------------------------------*/ 210 211 class SwAuthorField : public SwField 212 { 213 String aContent; 214 215 public: 216 SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFmt = 0); 217 218 virtual String Expand() const; 219 virtual SwField* Copy() const; 220 221 inline void SetExpansion(const String& rStr) { aContent = rStr; } 222 inline const String& GetContent() const { return aContent; } 223 224 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 225 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 226 }; 227 228 /*-------------------------------------------------------------------- 229 Beschreibung: Filename 230 --------------------------------------------------------------------*/ 231 232 class SwFileNameFieldType : public SwFieldType 233 { 234 SwDoc *pDoc; 235 public: 236 SwFileNameFieldType(SwDoc*); 237 238 String Expand(sal_uLong) const; 239 virtual SwFieldType* Copy() const; 240 }; 241 242 /*-------------------------------------------------------------------- 243 Beschreibung: FileName 244 --------------------------------------------------------------------*/ 245 246 class SW_DLLPUBLIC SwFileNameField : public SwField 247 { 248 String aContent; 249 250 public: 251 SwFileNameField(SwFileNameFieldType*, sal_uInt32 nFmt = 0); 252 253 virtual String Expand() const; 254 virtual SwField* Copy() const; 255 256 inline void SetExpansion(const String& rStr) { aContent = rStr; } 257 inline const String& GetContent() const { return aContent; } 258 259 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 260 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 261 }; 262 263 /*-------------------------------------------------------------------- 264 Beschreibung: TemplName 265 --------------------------------------------------------------------*/ 266 267 class SwTemplNameFieldType : public SwFieldType 268 { 269 SwDoc *pDoc; 270 public: 271 SwTemplNameFieldType(SwDoc*); 272 273 String Expand(sal_uLong) const; 274 virtual SwFieldType* Copy() const; 275 }; 276 277 /*-------------------------------------------------------------------- 278 Beschreibung: TemplName 279 --------------------------------------------------------------------*/ 280 281 class SW_DLLPUBLIC SwTemplNameField : public SwField 282 { 283 public: 284 SwTemplNameField(SwTemplNameFieldType*, sal_uInt32 nFmt = 0); 285 286 virtual String Expand() const; 287 virtual SwField* Copy() const; 288 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 289 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 290 }; 291 292 293 /*-------------------------------------------------------------------- 294 Beschreibung: Docstatistik 295 --------------------------------------------------------------------*/ 296 297 class SwDocStatFieldType : public SwFieldType 298 { 299 SwDoc* pDoc; 300 sal_Int16 nNumberingType;//com::sun::star::style::NumberingType 301 302 public: 303 SwDocStatFieldType(SwDoc*); 304 String Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const; 305 virtual SwFieldType* Copy() const; 306 307 inline void SetNumFormat( sal_Int16 eFmt ) { nNumberingType = eFmt; } 308 }; 309 310 /*-------------------------------------------------------------------- 311 Beschreibung: Dokumentstatistik 312 --------------------------------------------------------------------*/ 313 314 class SW_DLLPUBLIC SwDocStatField : public SwField 315 { 316 sal_uInt16 nSubType; 317 318 public: 319 SwDocStatField( SwDocStatFieldType*, 320 sal_uInt16 nSubType = 0, sal_uInt32 nFmt = 0); 321 322 void ChangeExpansion( const SwFrm* pFrm ); 323 324 virtual String Expand() const; 325 virtual SwField* Copy() const; 326 327 virtual sal_uInt16 GetSubType() const; 328 virtual void SetSubType(sal_uInt16 nSub); 329 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 330 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 331 }; 332 333 /*-------------------------------------------------------------------- 334 Beschreibung: versteckter Text 335 --------------------------------------------------------------------*/ 336 337 class SwHiddenTxtFieldType : public SwFieldType 338 { 339 sal_Bool bHidden; 340 public: 341 SwHiddenTxtFieldType(sal_Bool bSetHidden = sal_True); 342 343 virtual SwFieldType* Copy() const; 344 345 void SetHiddenFlag( sal_Bool bSetHidden = sal_True ); 346 inline sal_Bool GetHiddenFlag() const { return bHidden; } 347 }; 348 349 /*-------------------------------------------------------------------- 350 Beschreibung: Versteckter Text 351 --------------------------------------------------------------------*/ 352 353 class SwHiddenTxtField : public SwField 354 { 355 String aTRUETxt; // Text wenn Bedingung sal_True 356 String aFALSETxt; // Wenn Bedingung falsch 357 String aContent; // Ausgewerteter DB-Text 358 359 String aCond; // Bedingung 360 sal_uInt16 nSubType; 361 362 sal_Bool bCanToggle : 1; // kann das Feld einzeln getoggelt werden? 363 sal_Bool bIsHidden : 1; // ist es nicht sichtbar? 364 sal_Bool bValid : 1; // DB-Feld evaluiert? 365 366 virtual String Expand() const; 367 virtual SwField* Copy() const; 368 369 public: 370 SwHiddenTxtField( SwHiddenTxtFieldType*, 371 sal_Bool bConditional, 372 const String& rCond, 373 const String& rTxt, 374 sal_Bool bHidden = sal_False, 375 sal_uInt16 nSubType = TYP_HIDDENTXTFLD); 376 377 SwHiddenTxtField( SwHiddenTxtFieldType*, 378 const String& rCond, 379 const String& rTrue, 380 const String& rFalse, 381 sal_uInt16 nSubType = TYP_HIDDENTXTFLD); 382 383 virtual String GetFieldName() const; 384 385 void Evaluate(SwDoc*); 386 387 inline void SetValue(sal_Bool bHidden) { bIsHidden = bHidden; } 388 String GetColumnName(const String& rName); 389 String GetDBName(const String& rName, SwDoc *pDoc); 390 391 // Condition 392 virtual void SetPar1(const String& rStr); 393 virtual const String& GetPar1() const; 394 395 // True/False - String 396 virtual void SetPar2(const String& rStr); 397 virtual String GetPar2() const; 398 399 400 virtual sal_uInt16 GetSubType() const; 401 // virtual void SetSubType(sal_uInt16 nSub); // OM: entfernt, da unbenoetigt und gefaehrlich 402 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 403 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 404 }; 405 406 /*-------------------------------------------------------------------- 407 Beschreibung: Feld das zu einer Leerzeile (ohne Hoehe) expandiert 408 --------------------------------------------------------------------*/ 409 410 class SwHiddenParaFieldType : public SwFieldType 411 { 412 public: 413 SwHiddenParaFieldType(); 414 415 virtual SwFieldType* Copy() const; 416 }; 417 418 /*-------------------------------------------------------------------- 419 Beschreibung: Versteckter Absatz 420 --------------------------------------------------------------------*/ 421 422 class SwHiddenParaField : public SwField 423 { 424 String aCond; 425 sal_Bool bIsHidden:1; 426 public: 427 // Direkte Eingabe alten Wert loeschen 428 SwHiddenParaField(SwHiddenParaFieldType*, const String& rCond); 429 430 virtual String Expand() const; 431 virtual SwField* Copy() const; 432 433 void SetHidden(sal_Bool bHidden) { bIsHidden = bHidden; } 434 sal_Bool IsHidden() const { return bIsHidden; } 435 436 // Bedingung erfragen/setzen 437 virtual const String& GetPar1() const; 438 virtual void SetPar1(const String& rStr); 439 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 440 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 441 }; 442 443 /*-------------------------------------------------------------------- 444 Beschreibung: Macro ausfuehren 445 --------------------------------------------------------------------*/ 446 447 class SwMacroFieldType : public SwFieldType 448 { 449 SwDoc* pDoc; 450 451 public: 452 SwMacroFieldType(SwDoc*); 453 454 virtual SwFieldType* Copy() const; 455 }; 456 457 /*-------------------------------------------------------------------- 458 Beschreibung: Macrofeld 459 --------------------------------------------------------------------*/ 460 461 class SW_DLLPUBLIC SwMacroField : public SwField 462 { 463 String aMacro; 464 String aText; 465 sal_Bool bIsScriptURL; 466 467 virtual String Expand() const; 468 virtual SwField* Copy() const; 469 470 public: 471 // Direkte Eingabe alten Wert loeschen 472 SwMacroField( SwMacroFieldType*, const String& rLibAndName, 473 const String& rTxt); 474 475 inline const String& GetMacro() const { return aMacro; } 476 String GetLibName() const; 477 String GetMacroName() const; 478 SvxMacro GetSvxMacro() const; 479 480 virtual String GetFieldName() const; 481 482 // Library und FileName 483 virtual const String& GetPar1() const; 484 virtual void SetPar1(const String& rStr); 485 486 // Macrotext 487 virtual String GetPar2() const; 488 virtual void SetPar2(const String& rStr); 489 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 490 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 491 492 static void CreateMacroString( String& rMacro, 493 const String& rMacroName, 494 const String& rLibraryName ); 495 496 static sal_Bool isScriptURL( const String& str ); 497 }; 498 499 500 /*-------------------------------------------------------------------- 501 Beschreibung: PostIts 502 --------------------------------------------------------------------*/ 503 504 class SwPostItFieldType : public SwFieldType 505 { 506 private: 507 SwDoc* mpDoc; 508 public: 509 SwPostItFieldType(SwDoc* pDoc); 510 511 virtual SwFieldType* Copy() const; 512 SwDoc* GetDoc() {return mpDoc;}; 513 }; 514 515 /*-------------------------------------------------------------------- 516 Beschreibung: PostIt 517 --------------------------------------------------------------------*/ 518 519 class SW_DLLPUBLIC SwPostItField : public SwField 520 { 521 String sTxt; // die Anmerkung 522 String sAuthor; // der Author 523 DateTime aDateTime; // Datum und Zeit der Anmerkung 524 OutlinerParaObject* mpText; 525 SwTextAPIObject* m_pTextObject; 526 527 public: 528 SwPostItField( SwPostItFieldType*, 529 const String& rAuthor, const String& rTxt, const DateTime& rDate); 530 ~SwPostItField(); 531 532 virtual String Expand() const; 533 virtual SwField* Copy() const; 534 535 inline const Date GetDate() const { return aDateTime.GetDate(); } 536 inline const Time GetTime() const { return aDateTime.GetTime(); } 537 538 // Author 539 virtual const String& GetPar1() const; 540 virtual void SetPar1(const String& rStr); 541 542 // Text 543 virtual String GetPar2() const; 544 virtual void SetPar2(const String& rStr); 545 const String& GetTxt() const { return sTxt; } 546 547 const OutlinerParaObject* GetTextObject() const; 548 void SetTextObject( OutlinerParaObject* pText ); 549 550 sal_uInt32 GetNumberOfParagraphs() const; 551 552 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 553 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 554 virtual String GetDescription() const; 555 }; 556 557 /*-------------------------------------------------------------------- 558 Beschreibung: DokumentInfo 559 --------------------------------------------------------------------*/ 560 561 class SwDocInfoFieldType : public SwValueFieldType 562 { 563 public: 564 SwDocInfoFieldType(SwDoc* pDc); 565 566 String Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, sal_uInt16 nLang, const String& rName) const; 567 virtual SwFieldType* Copy() const; 568 }; 569 570 class SW_DLLPUBLIC SwDocInfoField : public SwValueField 571 { 572 sal_uInt16 nSubType; 573 String aContent; 574 String aName; 575 576 virtual String Expand() const; 577 virtual SwField* Copy() const; 578 579 public: 580 SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt=0); 581 SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const String& rName, const String& rValue, sal_uInt32 nFmt=0); 582 583 virtual void SetSubType(sal_uInt16); 584 virtual sal_uInt16 GetSubType() const; 585 virtual void SetLanguage(sal_uInt16 nLng); 586 virtual String GetFieldName() const; 587 String GetName() const { return aName; } 588 void SetName( const String& rName ) { aName = rName; } 589 inline void SetExpansion(const String& rStr) { aContent = rStr; } 590 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 591 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 592 }; 593 594 /*-------------------------------------------------------------------- 595 Beschreibung: erweiterte Benutzereinstellung 596 --------------------------------------------------------------------*/ 597 598 599 class SwExtUserFieldType : public SwFieldType 600 { 601 String aData; 602 public: 603 SwExtUserFieldType(); 604 605 inline void SetData(const String& rStr) { aData = rStr; } 606 607 String Expand(sal_uInt16 nSubType, sal_uInt32 nFormat) const; 608 virtual SwFieldType* Copy() const; 609 }; 610 611 class SwExtUserField : public SwField 612 { 613 String aContent; 614 sal_uInt16 nType; 615 616 public: 617 SwExtUserField(SwExtUserFieldType*, sal_uInt16 nSub, sal_uInt32 nFmt=0); 618 619 virtual String Expand() const; 620 virtual SwField* Copy() const; 621 622 virtual sal_uInt16 GetSubType() const; 623 virtual void SetSubType(sal_uInt16 nSub); 624 625 inline void SetExpansion(const String& rStr) { aContent = rStr; } 626 627 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 628 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 629 }; 630 631 632 /*-------------------------------------------------------------------- 633 Beschreibung: Relatives Seitennummern - Feld 634 --------------------------------------------------------------------*/ 635 636 class SwRefPageSetFieldType : public SwFieldType 637 { 638 public: 639 SwRefPageSetFieldType(); 640 641 virtual SwFieldType* Copy() const; 642 643 protected: 644 // ueberlagert, weil es nichts zum Updaten gibt! 645 virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); 646 }; 647 648 /*-------------------------------------------------------------------- 649 Beschreibung: Relative Seitennummerierung 650 --------------------------------------------------------------------*/ 651 652 class SwRefPageSetField : public SwField 653 { 654 short nOffset; 655 sal_Bool bOn; 656 657 public: 658 SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0, 659 sal_Bool bOn = sal_True ); 660 661 virtual String Expand() const; 662 virtual SwField* Copy() const; 663 664 virtual String GetPar2() const; 665 virtual void SetPar2(const String& rStr); 666 667 sal_Bool IsOn() const { return bOn; } 668 669 short GetOffset() const { return nOffset; } 670 void SetOffset( short nOff ) { nOffset = nOff; } 671 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 672 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 673 }; 674 675 /*-------------------------------------------------------------------- 676 Beschreibung: relatives Seitennummern - Abfrage Feld 677 --------------------------------------------------------------------*/ 678 679 class SwRefPageGetFieldType : public SwFieldType 680 { 681 SwDoc* pDoc; 682 sal_Int16 nNumberingType; 683 684 void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList ); 685 protected: 686 // ueberlagert, um alle RefPageGet-Felder zu updaten 687 virtual void Modify( const SfxPoolItem*, const SfxPoolItem * ); 688 public: 689 SwRefPageGetFieldType( SwDoc* pDoc ); 690 virtual SwFieldType* Copy() const; 691 sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst ); 692 SwDoc* GetDoc() const { return pDoc; } 693 }; 694 695 /*-------------------------------------------------------------------- 696 Beschreibung: Relative Seitennummerierung Abfragen 697 --------------------------------------------------------------------*/ 698 699 class SwRefPageGetField : public SwField 700 { 701 String sTxt; 702 public: 703 SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt ); 704 705 virtual String Expand() const; 706 virtual SwField* Copy() const; 707 708 void SetText( const String& rTxt ) { sTxt = rTxt; } 709 710 void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld ); 711 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 712 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 713 }; 714 715 /*-------------------------------------------------------------------- 716 Beschreibung: Feld zum Anspringen und Editieren 717 --------------------------------------------------------------------*/ 718 719 class SwJumpEditFieldType : public SwFieldType 720 { 721 SwDoc* pDoc; 722 SwDepend aDep; 723 724 public: 725 SwJumpEditFieldType( SwDoc* pDoc ); 726 virtual SwFieldType* Copy() const; 727 728 SwCharFmt* GetCharFmt(); 729 }; 730 731 class SwJumpEditField : public SwField 732 { 733 String sTxt, sHelp; 734 public: 735 SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat, 736 const String& sText, const String& sHelp ); 737 738 virtual String Expand() const; 739 virtual SwField* Copy() const; 740 741 // Platzhalter-Text 742 virtual const String& GetPar1() const; 743 virtual void SetPar1(const String& rStr); 744 745 // HinweisText 746 virtual String GetPar2() const; 747 virtual void SetPar2(const String& rStr); 748 749 SwCharFmt* GetCharFmt() const 750 { return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); } 751 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 752 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 753 }; 754 755 /*-------------------------------------------------------------------- 756 Beschreibung: Script Fieldtype 757 --------------------------------------------------------------------*/ 758 759 class SwScriptFieldType : public SwFieldType 760 { 761 SwDoc* pDoc; 762 public: 763 SwScriptFieldType( SwDoc* pDoc ); 764 765 virtual SwFieldType* Copy() const; 766 }; 767 768 /*-------------------------------------------------------------------- 769 Beschreibung: Script Field 770 --------------------------------------------------------------------*/ 771 772 class SwScriptField : public SwField 773 { 774 String sType; // Type von Code (Java/VBScript/...) 775 String sCode; // der Code als Text 776 // der Code als JavaCode ? 777 778 sal_Bool bCodeURL; // Code enthaelt URL eines Scripts 779 780 public: 781 SwScriptField( SwScriptFieldType*, const String& rType, 782 const String& rCode, sal_Bool bURL=sal_False ); 783 784 virtual String GetDescription() const; 785 786 virtual String Expand() const; 787 virtual SwField* Copy() const; 788 789 // Type 790 virtual const String& GetPar1() const; 791 virtual void SetPar1(const String& rStr); 792 // Text 793 virtual String GetPar2() const; 794 virtual void SetPar2(const String& rStr); 795 796 sal_Bool IsCodeURL() const { return bCodeURL; } 797 void SetCodeURL( sal_Bool bURL ) { bCodeURL = bURL; } 798 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 799 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 800 }; 801 802 /*-------------------------------------------------------------------- 803 Beschreibung: Combined Character Fieldtype 804 --------------------------------------------------------------------*/ 805 806 class SwCombinedCharFieldType : public SwFieldType 807 { 808 public: 809 SwCombinedCharFieldType(); 810 811 virtual SwFieldType* Copy() const; 812 }; 813 814 /*-------------------------------------------------------------------- 815 Beschreibung: Script Field 816 --------------------------------------------------------------------*/ 817 818 #define MAX_COMBINED_CHARACTERS 6 819 820 class SW_DLLPUBLIC SwCombinedCharField : public SwField 821 { 822 String sCharacters; // combine these characters 823 824 public: 825 SwCombinedCharField( SwCombinedCharFieldType*, const String& rChars ); 826 827 virtual String Expand() const; 828 virtual SwField* Copy() const; 829 830 // Characters 831 virtual const String& GetPar1() const; 832 virtual void SetPar1(const String& rStr); 833 834 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; 835 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); 836 }; 837 838 839 #endif // SW_DOCUFLD_HXX 840