merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / docufld.hxx
blob8483cf7b2d392f386aaaa1630611580f7aa0512c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef _DOCUFLD_HXX
28 #define _DOCUFLD_HXX
31 #include <tools/date.hxx>
32 #include <tools/datetime.hxx>
35 #include <svl/macitem.hxx>
37 #include "fldbas.hxx"
38 #include "numrule.hxx"
40 class _SetGetExpFlds;
41 class SwTxtFld;
42 class SwFrm;
43 class OutlinerParaObject;
44 class SwTextAPIObject;
46 enum SwAuthorFormat
48 AF_BEGIN,
49 AF_NAME = AF_BEGIN,
50 AF_SHORTCUT,
51 AF_END,
52 AF_FIXED = 0x8000
55 /*--------------------------------------------------------------------
56 Beschreibung: Untertyp der Dokumentstatistik
57 --------------------------------------------------------------------*/
59 enum SwDocStatSubType
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
72 typedef sal_uInt16 SwDocInfoSubType;
73 namespace nsSwDocInfoSubType
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;
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;
101 enum RegInfoFormat // Nur noch zum laden alter Dokumente!!!
103 RF_AUTHOR,
104 RF_TIME,
105 RF_DATE,
106 RF_ALL
109 enum SwPageNumSubType
111 PG_RANDOM,
112 PG_NEXT,
113 PG_PREV
116 enum SwExtUserSubType
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
137 enum SwJumpEditFormat
139 JE_FMT_TEXT,
140 JE_FMT_TABLE,
141 JE_FMT_FRAME,
142 JE_FMT_GRAPHIC,
143 JE_FMT_OLE
146 /*--------------------------------------------------------------------
147 Beschreibung: Seitennummer
148 --------------------------------------------------------------------*/
150 class SwPageNumberFieldType : public SwFieldType
152 sal_Int16 nNumberingType;
153 USHORT nNum, nMax;
154 BOOL bVirtuell;
156 public:
157 SwPageNumberFieldType();
159 String& Expand( sal_uInt32 nFmt, short nOff, const String&, String& rRet ) const;
160 void ChangeExpansion( SwDoc* pDoc, USHORT nNum, USHORT nMax,
161 BOOL bVirtPageNum, const sal_Int16* pNumFmt = 0 );
162 virtual SwFieldType* Copy() const;
165 /*--------------------------------------------------------------------
166 Beschreibung: Seitennummerierung
167 --------------------------------------------------------------------*/
169 class SW_DLLPUBLIC SwPageNumberField : public SwField
171 String sUserStr;
172 USHORT nSubType;
173 short nOffset;
175 public:
176 SwPageNumberField(SwPageNumberFieldType*, USHORT nSub = PG_RANDOM,
177 sal_uInt32 nFmt = 0, short nOff = 0);
179 virtual String Expand() const;
180 virtual SwField* Copy() const;
182 virtual String GetPar2() const;
183 virtual void SetPar2(const String& rStr);
185 virtual USHORT GetSubType() const;
186 // virtual void SetSubType(USHORT nSub); // OM: entfernt, da unbenoetigt und gefaehrlich
187 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
188 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
190 const String& GetUserString() const { return sUserStr; }
191 void SetUserString( const String& rS ) { sUserStr = rS; }
194 /*--------------------------------------------------------------------
195 Beschreibung: Autoren
196 --------------------------------------------------------------------*/
198 class SwAuthorFieldType : public SwFieldType
200 public:
201 SwAuthorFieldType();
203 String Expand(ULONG) const;
204 virtual SwFieldType* Copy() const;
207 /*--------------------------------------------------------------------
208 Beschreibung: AutorenFeld
209 --------------------------------------------------------------------*/
211 class SwAuthorField : public SwField
213 String aContent;
215 public:
216 SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFmt = 0);
218 virtual String Expand() const;
219 virtual SwField* Copy() const;
221 inline void SetExpansion(const String& rStr) { aContent = rStr; }
222 inline const String& GetContent() const { return aContent; }
224 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
225 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
228 /*--------------------------------------------------------------------
229 Beschreibung: Filename
230 --------------------------------------------------------------------*/
232 class SwFileNameFieldType : public SwFieldType
234 SwDoc *pDoc;
235 public:
236 SwFileNameFieldType(SwDoc*);
238 String Expand(ULONG) const;
239 virtual SwFieldType* Copy() const;
242 /*--------------------------------------------------------------------
243 Beschreibung: FileName
244 --------------------------------------------------------------------*/
246 class SW_DLLPUBLIC SwFileNameField : public SwField
248 String aContent;
250 public:
251 SwFileNameField(SwFileNameFieldType*, sal_uInt32 nFmt = 0);
253 virtual String Expand() const;
254 virtual SwField* Copy() const;
256 inline void SetExpansion(const String& rStr) { aContent = rStr; }
257 inline const String& GetContent() const { return aContent; }
259 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
260 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
263 /*--------------------------------------------------------------------
264 Beschreibung: TemplName
265 --------------------------------------------------------------------*/
267 class SwTemplNameFieldType : public SwFieldType
269 SwDoc *pDoc;
270 public:
271 SwTemplNameFieldType(SwDoc*);
273 String Expand(ULONG) const;
274 virtual SwFieldType* Copy() const;
277 /*--------------------------------------------------------------------
278 Beschreibung: TemplName
279 --------------------------------------------------------------------*/
281 class SW_DLLPUBLIC SwTemplNameField : public SwField
283 public:
284 SwTemplNameField(SwTemplNameFieldType*, sal_uInt32 nFmt = 0);
286 virtual String Expand() const;
287 virtual SwField* Copy() const;
288 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
289 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
293 /*--------------------------------------------------------------------
294 Beschreibung: Docstatistik
295 --------------------------------------------------------------------*/
297 class SwDocStatFieldType : public SwFieldType
299 SwDoc* pDoc;
300 sal_Int16 nNumberingType;//com::sun::star::style::NumberingType
302 public:
303 SwDocStatFieldType(SwDoc*);
304 String Expand(USHORT nSubType, sal_uInt32 nFmt) const;
305 virtual SwFieldType* Copy() const;
307 inline void SetNumFormat( sal_Int16 eFmt ) { nNumberingType = eFmt; }
310 /*--------------------------------------------------------------------
311 Beschreibung: Dokumentstatistik
312 --------------------------------------------------------------------*/
314 class SW_DLLPUBLIC SwDocStatField : public SwField
316 USHORT nSubType;
318 public:
319 SwDocStatField( SwDocStatFieldType*,
320 USHORT nSubType = 0, sal_uInt32 nFmt = 0);
322 void ChangeExpansion( const SwFrm* pFrm );
324 virtual String Expand() const;
325 virtual SwField* Copy() const;
327 virtual USHORT GetSubType() const;
328 virtual void SetSubType(USHORT nSub);
329 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
330 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
333 /*--------------------------------------------------------------------
334 Beschreibung: versteckter Text
335 --------------------------------------------------------------------*/
337 class SwHiddenTxtFieldType : public SwFieldType
339 BOOL bHidden;
340 public:
341 SwHiddenTxtFieldType(BOOL bSetHidden = TRUE);
343 virtual SwFieldType* Copy() const;
345 void SetHiddenFlag( BOOL bSetHidden = TRUE );
346 inline BOOL GetHiddenFlag() const { return bHidden; }
349 /*--------------------------------------------------------------------
350 Beschreibung: Versteckter Text
351 --------------------------------------------------------------------*/
353 class SwHiddenTxtField : public SwField
355 String aTRUETxt; // Text wenn Bedingung TRUE
356 String aFALSETxt; // Wenn Bedingung falsch
357 String aContent; // Ausgewerteter DB-Text
359 String aCond; // Bedingung
360 USHORT nSubType;
362 BOOL bCanToggle : 1; // kann das Feld einzeln getoggelt werden?
363 BOOL bIsHidden : 1; // ist es nicht sichtbar?
364 BOOL bValid : 1; // DB-Feld evaluiert?
366 public:
367 SwHiddenTxtField( SwHiddenTxtFieldType*,
368 BOOL bConditional,
369 const String& rCond,
370 const String& rTxt,
371 BOOL bHidden = FALSE,
372 USHORT nSubType = TYP_HIDDENTXTFLD);
374 SwHiddenTxtField( SwHiddenTxtFieldType*,
375 const String& rCond,
376 const String& rTrue,
377 const String& rFalse,
378 USHORT nSubType = TYP_HIDDENTXTFLD);
380 virtual String GetCntnt(BOOL bName = FALSE) const;
381 virtual String Expand() const;
382 virtual SwField* Copy() const;
384 void Evaluate(SwDoc*);
386 inline void SetValue(BOOL bHidden) { bIsHidden = bHidden; }
387 String GetColumnName(const String& rName);
388 String GetDBName(const String& rName, SwDoc *pDoc);
390 // Condition
391 virtual void SetPar1(const String& rStr);
392 virtual const String& GetPar1() const;
394 // True/False - String
395 virtual void SetPar2(const String& rStr);
396 virtual String GetPar2() const;
399 virtual USHORT GetSubType() const;
400 // virtual void SetSubType(USHORT nSub); // OM: entfernt, da unbenoetigt und gefaehrlich
401 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
402 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
405 /*--------------------------------------------------------------------
406 Beschreibung: Feld das zu einer Leerzeile (ohne Hoehe) expandiert
407 --------------------------------------------------------------------*/
409 class SwHiddenParaFieldType : public SwFieldType
411 public:
412 SwHiddenParaFieldType();
414 virtual SwFieldType* Copy() const;
417 /*--------------------------------------------------------------------
418 Beschreibung: Versteckter Absatz
419 --------------------------------------------------------------------*/
421 class SwHiddenParaField : public SwField
423 String aCond;
424 BOOL bIsHidden:1;
425 public:
426 // Direkte Eingabe alten Wert loeschen
427 SwHiddenParaField(SwHiddenParaFieldType*, const String& rCond);
429 virtual String Expand() const;
430 virtual SwField* Copy() const;
432 void SetHidden(BOOL bHidden) { bIsHidden = bHidden; }
433 BOOL IsHidden() const { return bIsHidden; }
435 // Bedingung erfragen/setzen
436 virtual const String& GetPar1() const;
437 virtual void SetPar1(const String& rStr);
438 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
439 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
442 /*--------------------------------------------------------------------
443 Beschreibung: Macro ausfuehren
444 --------------------------------------------------------------------*/
446 class SwMacroFieldType : public SwFieldType
448 SwDoc* pDoc;
450 public:
451 SwMacroFieldType(SwDoc*);
453 virtual SwFieldType* Copy() const;
456 /*--------------------------------------------------------------------
457 Beschreibung: Macrofeld
458 --------------------------------------------------------------------*/
460 class SW_DLLPUBLIC SwMacroField : public SwField
462 String aMacro;
463 String aText;
464 BOOL bIsScriptURL;
466 public:
467 // Direkte Eingabe alten Wert loeschen
468 SwMacroField( SwMacroFieldType*, const String& rLibAndName,
469 const String& rTxt);
471 inline const String& GetMacro() const { return aMacro; }
472 String GetLibName() const;
473 String GetMacroName() const;
474 SvxMacro GetSvxMacro() const;
476 virtual String GetCntnt(BOOL bName = FALSE) const;
477 virtual String Expand() const;
478 virtual SwField* Copy() const;
480 // Library und FileName
481 virtual const String& GetPar1() const;
482 virtual void SetPar1(const String& rStr);
484 // Macrotext
485 virtual String GetPar2() const;
486 virtual void SetPar2(const String& rStr);
487 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
488 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
490 static void CreateMacroString( String& rMacro,
491 const String& rMacroName,
492 const String& rLibraryName );
494 static BOOL isScriptURL( const String& str );
498 /*--------------------------------------------------------------------
499 Beschreibung: PostIts
500 --------------------------------------------------------------------*/
502 class SwPostItFieldType : public SwFieldType
504 private:
505 SwDoc* mpDoc;
506 public:
507 SwPostItFieldType(SwDoc* pDoc);
509 virtual SwFieldType* Copy() const;
510 SwDoc* GetDoc() {return mpDoc;};
513 /*--------------------------------------------------------------------
514 Beschreibung: PostIt
515 --------------------------------------------------------------------*/
517 class SW_DLLPUBLIC SwPostItField : public SwField
519 String sTxt; // die Anmerkung
520 String sAuthor; // der Author
521 DateTime aDateTime; // Datum und Zeit der Anmerkung
522 OutlinerParaObject* mpText;
523 SwTextAPIObject* m_pTextObject;
525 public:
526 SwPostItField( SwPostItFieldType*,
527 const String& rAuthor, const String& rTxt, const DateTime& rDate);
528 ~SwPostItField();
530 virtual String Expand() const;
531 virtual SwField* Copy() const;
533 inline const Date GetDate() const { return aDateTime.GetDate(); }
534 inline const Time GetTime() const { return aDateTime.GetTime(); }
536 // Author
537 virtual const String& GetPar1() const;
538 virtual void SetPar1(const String& rStr);
540 // Text
541 virtual String GetPar2() const;
542 virtual void SetPar2(const String& rStr);
543 const String& GetTxt() const { return sTxt; }
545 const OutlinerParaObject* GetTextObject() const;
546 void SetTextObject( OutlinerParaObject* pText );
548 sal_uInt32 GetNumberOfParagraphs() const;
550 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
551 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
552 virtual String GetDescription() const;
555 /*--------------------------------------------------------------------
556 Beschreibung: DokumentInfo
557 --------------------------------------------------------------------*/
559 class SwDocInfoFieldType : public SwValueFieldType
561 public:
562 SwDocInfoFieldType(SwDoc* pDc);
564 String Expand(USHORT nSubType, sal_uInt32 nFormat, USHORT nLang, const String& rName) const;
565 virtual SwFieldType* Copy() const;
568 class SW_DLLPUBLIC SwDocInfoField : public SwValueField
570 USHORT nSubType;
571 String aContent;
572 String aName;
574 public:
575 SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, const String& rName, sal_uInt32 nFmt=0);
576 SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, const String& rName, const String& rValue, sal_uInt32 nFmt=0);
578 virtual void SetSubType(USHORT);
579 virtual USHORT GetSubType() const;
580 virtual void SetLanguage(USHORT nLng);
581 virtual String Expand() const;
582 virtual String GetCntnt(BOOL bName = FALSE) const;
583 virtual SwField* Copy() const;
584 String GetName() const { return aName; }
585 void SetName( const String& rName ) { aName = rName; }
586 inline void SetExpansion(const String& rStr) { aContent = rStr; }
587 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
588 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
591 /*--------------------------------------------------------------------
592 Beschreibung: erweiterte Benutzereinstellung
593 --------------------------------------------------------------------*/
596 class SwExtUserFieldType : public SwFieldType
598 String aData;
599 public:
600 SwExtUserFieldType();
602 inline void SetData(const String& rStr) { aData = rStr; }
604 String Expand(USHORT nSubType, sal_uInt32 nFormat) const;
605 virtual SwFieldType* Copy() const;
608 class SwExtUserField : public SwField
610 String aContent;
611 USHORT nType;
613 public:
614 SwExtUserField(SwExtUserFieldType*, USHORT nSub, sal_uInt32 nFmt=0);
616 virtual String Expand() const;
617 virtual SwField* Copy() const;
619 virtual USHORT GetSubType() const;
620 virtual void SetSubType(USHORT nSub);
622 inline void SetExpansion(const String& rStr) { aContent = rStr; }
624 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
625 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
629 /*--------------------------------------------------------------------
630 Beschreibung: Relatives Seitennummern - Feld
631 --------------------------------------------------------------------*/
633 class SwRefPageSetFieldType : public SwFieldType
635 public:
636 SwRefPageSetFieldType();
638 virtual SwFieldType* Copy() const;
639 // ueberlagert, weil es nichts zum Updaten gibt!
640 virtual void Modify( SfxPoolItem *, SfxPoolItem * );
643 /*--------------------------------------------------------------------
644 Beschreibung: Relative Seitennummerierung
645 --------------------------------------------------------------------*/
647 class SwRefPageSetField : public SwField
649 short nOffset;
650 BOOL bOn;
652 public:
653 SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0,
654 BOOL bOn = TRUE );
656 virtual String Expand() const;
657 virtual SwField* Copy() const;
659 virtual String GetPar2() const;
660 virtual void SetPar2(const String& rStr);
662 BOOL IsOn() const { return bOn; }
664 short GetOffset() const { return nOffset; }
665 void SetOffset( short nOff ) { nOffset = nOff; }
666 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
667 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
670 /*--------------------------------------------------------------------
671 Beschreibung: relatives Seitennummern - Abfrage Feld
672 --------------------------------------------------------------------*/
674 class SwRefPageGetFieldType : public SwFieldType
676 SwDoc* pDoc;
677 sal_Int16 nNumberingType;
679 void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
681 public:
682 SwRefPageGetFieldType( SwDoc* pDoc );
683 virtual SwFieldType* Copy() const;
685 // ueberlagert, um alle RefPageGet-Felder zu updaten
686 virtual void Modify( SfxPoolItem *, SfxPoolItem * );
687 USHORT MakeSetList( _SetGetExpFlds& rTmpLst );
689 SwDoc* GetDoc() const { return pDoc; }
692 /*--------------------------------------------------------------------
693 Beschreibung: Relative Seitennummerierung Abfragen
694 --------------------------------------------------------------------*/
696 class SwRefPageGetField : public SwField
698 String sTxt;
699 public:
700 SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt );
702 virtual String Expand() const;
703 virtual SwField* Copy() const;
705 void SetText( const String& rTxt ) { sTxt = rTxt; }
707 void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld );
708 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
709 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
712 /*--------------------------------------------------------------------
713 Beschreibung: Feld zum Anspringen und Editieren
714 --------------------------------------------------------------------*/
716 class SwJumpEditFieldType : public SwFieldType
718 SwDoc* pDoc;
719 SwDepend aDep;
721 public:
722 SwJumpEditFieldType( SwDoc* pDoc );
723 virtual SwFieldType* Copy() const;
725 SwCharFmt* GetCharFmt();
728 class SwJumpEditField : public SwField
730 String sTxt, sHelp;
731 public:
732 SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat,
733 const String& sText, const String& sHelp );
735 virtual String Expand() const;
736 virtual SwField* Copy() const;
738 // Platzhalter-Text
739 virtual const String& GetPar1() const;
740 virtual void SetPar1(const String& rStr);
742 // HinweisText
743 virtual String GetPar2() const;
744 virtual void SetPar2(const String& rStr);
746 SwCharFmt* GetCharFmt() const
747 { return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); }
748 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
749 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
752 /*--------------------------------------------------------------------
753 Beschreibung: Script Fieldtype
754 --------------------------------------------------------------------*/
756 class SwScriptFieldType : public SwFieldType
758 SwDoc* pDoc;
759 public:
760 SwScriptFieldType( SwDoc* pDoc );
762 virtual SwFieldType* Copy() const;
765 /*--------------------------------------------------------------------
766 Beschreibung: Script Field
767 --------------------------------------------------------------------*/
769 class SwScriptField : public SwField
771 String sType; // Type von Code (Java/VBScript/...)
772 String sCode; // der Code als Text
773 // der Code als JavaCode ?
775 BOOL bCodeURL; // Code enthaelt URL eines Scripts
777 public:
778 SwScriptField( SwScriptFieldType*, const String& rType,
779 const String& rCode, BOOL bURL=FALSE );
781 virtual String GetDescription() const;
783 virtual String Expand() const;
784 virtual SwField* Copy() const;
786 // Type
787 virtual const String& GetPar1() const;
788 virtual void SetPar1(const String& rStr);
789 // Text
790 virtual String GetPar2() const;
791 virtual void SetPar2(const String& rStr);
793 BOOL IsCodeURL() const { return bCodeURL; }
794 void SetCodeURL( BOOL bURL ) { bCodeURL = bURL; }
795 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
796 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
799 /*--------------------------------------------------------------------
800 Beschreibung: Combined Character Fieldtype
801 --------------------------------------------------------------------*/
803 class SwCombinedCharFieldType : public SwFieldType
805 public:
806 SwCombinedCharFieldType();
808 virtual SwFieldType* Copy() const;
811 /*--------------------------------------------------------------------
812 Beschreibung: Script Field
813 --------------------------------------------------------------------*/
815 #define MAX_COMBINED_CHARACTERS 6
817 class SW_DLLPUBLIC SwCombinedCharField : public SwField
819 String sCharacters; // combine these characters
821 public:
822 SwCombinedCharField( SwCombinedCharFieldType*, const String& rChars );
824 virtual String Expand() const;
825 virtual SwField* Copy() const;
827 // Characters
828 virtual const String& GetPar1() const;
829 virtual void SetPar1(const String& rStr);
831 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
832 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
836 #endif // _DOCUFLD_HXX