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