merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / docufld.hxx
blob68219053da0bb29fd283c298a431ddaa2f32c0fa
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: docufld.hxx,v $
10 * $Revision: 1.17.82.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _DOCUFLD_HXX
31 #define _DOCUFLD_HXX
34 #include <tools/date.hxx>
35 #include <tools/datetime.hxx>
38 #include <svtools/macitem.hxx>
40 #include "fldbas.hxx"
41 #include "numrule.hxx"
43 class _SetGetExpFlds;
44 class SwTxtFld;
45 class SwFrm;
46 class OutlinerParaObject;
47 class SwTextAPIObject;
49 enum SwAuthorFormat
51 AF_BEGIN,
52 AF_NAME = AF_BEGIN,
53 AF_SHORTCUT,
54 AF_END,
55 AF_FIXED = 0x8000
58 /*--------------------------------------------------------------------
59 Beschreibung: Untertyp der Dokumentstatistik
60 --------------------------------------------------------------------*/
62 enum SwDocStatSubType
64 DS_BEGIN,
65 DS_PAGE = DS_BEGIN,
66 DS_PARA,
67 DS_WORD,
68 DS_CHAR,
69 DS_TBL,
70 DS_GRF,
71 DS_OLE,
72 DS_END
75 typedef sal_uInt16 SwDocInfoSubType;
76 namespace nsSwDocInfoSubType
78 // NB: these must denote consecutive integers!
79 // NB2: these are extended by 4 DI_INFO values for backward compatibility
80 // in filter/html/htmlfld.cxx, so make sure that DI_SUBTYPE_END
81 // really is the end, and is at least 4 less than DI_SUB_*!
82 const SwDocInfoSubType DI_SUBTYPE_BEGIN = 0;
83 const SwDocInfoSubType DI_TITEL = DI_SUBTYPE_BEGIN;
84 const SwDocInfoSubType DI_THEMA = 1;
85 const SwDocInfoSubType DI_KEYS = 2;
86 const SwDocInfoSubType DI_COMMENT = 3;
87 const SwDocInfoSubType DI_CREATE = 4;
88 const SwDocInfoSubType DI_CHANGE = 5;
89 const SwDocInfoSubType DI_PRINT = 6;
90 const SwDocInfoSubType DI_DOCNO = 7;
91 const SwDocInfoSubType DI_EDIT = 8;
92 const SwDocInfoSubType DI_CUSTOM = 9;
93 const SwDocInfoSubType DI_SUBTYPE_END = 10;
96 const SwDocInfoSubType DI_SUB_AUTHOR = 0x0100;
97 const SwDocInfoSubType DI_SUB_TIME = 0x0200;
98 const SwDocInfoSubType DI_SUB_DATE = 0x0300;
99 const SwDocInfoSubType DI_SUB_FIXED = 0x1000;
100 const SwDocInfoSubType DI_SUB_MASK = 0xff00;
104 enum RegInfoFormat // Nur noch zum laden alter Dokumente!!!
106 RF_AUTHOR,
107 RF_TIME,
108 RF_DATE,
109 RF_ALL
112 enum SwPageNumSubType
114 PG_RANDOM,
115 PG_NEXT,
116 PG_PREV
119 enum SwExtUserSubType
121 EU_COMPANY /*EU_FIRMA*/,
122 EU_FIRSTNAME /*EU_VORNAME*/,
123 EU_NAME /*EU_NAME*/,
124 EU_SHORTCUT /*EU_ABK*/,
125 EU_STREET /*EU_STRASSE*/,
126 EU_COUNTRY /*EU_LAND*/,
127 EU_ZIP /*EU_PLZ*/,
128 EU_CITY /*EU_ORT*/,
129 EU_TITLE /*EU_TITEL*/,
130 EU_POSITION /*EU_POS*/,
131 EU_PHONE_PRIVATE /*EU_TELPRIV*/,
132 EU_PHONE_COMPANY /*EU_TELFIRMA*/,
133 EU_FAX,
134 EU_EMAIL,
135 EU_STATE,
136 EU_FATHERSNAME,
137 EU_APARTMENT
140 enum SwJumpEditFormat
142 JE_FMT_TEXT,
143 JE_FMT_TABLE,
144 JE_FMT_FRAME,
145 JE_FMT_GRAPHIC,
146 JE_FMT_OLE
149 /*--------------------------------------------------------------------
150 Beschreibung: Seitennummer
151 --------------------------------------------------------------------*/
153 class SwPageNumberFieldType : public SwFieldType
155 sal_Int16 nNumberingType;
156 USHORT nNum, nMax;
157 BOOL bVirtuell;
159 public:
160 SwPageNumberFieldType();
162 String& Expand( sal_uInt32 nFmt, short nOff, const String&, String& rRet ) const;
163 void ChangeExpansion( SwDoc* pDoc, USHORT nNum, USHORT nMax,
164 BOOL bVirtPageNum, const sal_Int16* pNumFmt = 0 );
165 virtual SwFieldType* Copy() const;
168 /*--------------------------------------------------------------------
169 Beschreibung: Seitennummerierung
170 --------------------------------------------------------------------*/
172 class SW_DLLPUBLIC SwPageNumberField : public SwField
174 String sUserStr;
175 USHORT nSubType;
176 short nOffset;
178 public:
179 SwPageNumberField(SwPageNumberFieldType*, USHORT nSub = PG_RANDOM,
180 sal_uInt32 nFmt = 0, short nOff = 0);
182 virtual String Expand() const;
183 virtual SwField* Copy() const;
185 virtual String GetPar2() const;
186 virtual void SetPar2(const String& rStr);
188 virtual USHORT GetSubType() const;
189 // virtual void SetSubType(USHORT nSub); // OM: entfernt, da unbenoetigt und gefaehrlich
190 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
191 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
193 const String& GetUserString() const { return sUserStr; }
194 void SetUserString( const String& rS ) { sUserStr = rS; }
197 /*--------------------------------------------------------------------
198 Beschreibung: Autoren
199 --------------------------------------------------------------------*/
201 class SwAuthorFieldType : public SwFieldType
203 public:
204 SwAuthorFieldType();
206 String Expand(ULONG) const;
207 virtual SwFieldType* Copy() const;
210 /*--------------------------------------------------------------------
211 Beschreibung: AutorenFeld
212 --------------------------------------------------------------------*/
214 class SwAuthorField : public SwField
216 String aContent;
218 public:
219 SwAuthorField(SwAuthorFieldType*, sal_uInt32 nFmt = 0);
221 virtual String Expand() const;
222 virtual SwField* Copy() const;
224 inline void SetExpansion(const String& rStr) { aContent = rStr; }
225 inline const String& GetContent() const { return aContent; }
227 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
228 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
231 /*--------------------------------------------------------------------
232 Beschreibung: Filename
233 --------------------------------------------------------------------*/
235 class SwFileNameFieldType : public SwFieldType
237 SwDoc *pDoc;
238 public:
239 SwFileNameFieldType(SwDoc*);
241 String Expand(ULONG) const;
242 virtual SwFieldType* Copy() const;
245 /*--------------------------------------------------------------------
246 Beschreibung: FileName
247 --------------------------------------------------------------------*/
249 class SW_DLLPUBLIC SwFileNameField : public SwField
251 String aContent;
253 public:
254 SwFileNameField(SwFileNameFieldType*, sal_uInt32 nFmt = 0);
256 virtual String Expand() const;
257 virtual SwField* Copy() const;
259 inline void SetExpansion(const String& rStr) { aContent = rStr; }
260 inline const String& GetContent() const { return aContent; }
262 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
263 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
266 /*--------------------------------------------------------------------
267 Beschreibung: TemplName
268 --------------------------------------------------------------------*/
270 class SwTemplNameFieldType : public SwFieldType
272 SwDoc *pDoc;
273 public:
274 SwTemplNameFieldType(SwDoc*);
276 String Expand(ULONG) const;
277 virtual SwFieldType* Copy() const;
280 /*--------------------------------------------------------------------
281 Beschreibung: TemplName
282 --------------------------------------------------------------------*/
284 class SW_DLLPUBLIC SwTemplNameField : public SwField
286 public:
287 SwTemplNameField(SwTemplNameFieldType*, sal_uInt32 nFmt = 0);
289 virtual String Expand() const;
290 virtual SwField* Copy() const;
291 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
292 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
296 /*--------------------------------------------------------------------
297 Beschreibung: Docstatistik
298 --------------------------------------------------------------------*/
300 class SwDocStatFieldType : public SwFieldType
302 SwDoc* pDoc;
303 sal_Int16 nNumberingType;//com::sun::star::style::NumberingType
305 public:
306 SwDocStatFieldType(SwDoc*);
307 String Expand(USHORT nSubType, sal_uInt32 nFmt) const;
308 virtual SwFieldType* Copy() const;
310 inline void SetNumFormat( sal_Int16 eFmt ) { nNumberingType = eFmt; }
313 /*--------------------------------------------------------------------
314 Beschreibung: Dokumentstatistik
315 --------------------------------------------------------------------*/
317 class SW_DLLPUBLIC SwDocStatField : public SwField
319 USHORT nSubType;
321 public:
322 SwDocStatField( SwDocStatFieldType*,
323 USHORT nSubType = 0, sal_uInt32 nFmt = 0);
325 void ChangeExpansion( const SwFrm* pFrm );
327 virtual String Expand() const;
328 virtual SwField* Copy() const;
330 virtual USHORT GetSubType() const;
331 virtual void SetSubType(USHORT nSub);
332 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
333 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
336 /*--------------------------------------------------------------------
337 Beschreibung: versteckter Text
338 --------------------------------------------------------------------*/
340 class SwHiddenTxtFieldType : public SwFieldType
342 BOOL bHidden;
343 public:
344 SwHiddenTxtFieldType(BOOL bSetHidden = TRUE);
346 virtual SwFieldType* Copy() const;
348 void SetHiddenFlag( BOOL bSetHidden = TRUE );
349 inline BOOL GetHiddenFlag() const { return bHidden; }
352 /*--------------------------------------------------------------------
353 Beschreibung: Versteckter Text
354 --------------------------------------------------------------------*/
356 class SwHiddenTxtField : public SwField
358 String aTRUETxt; // Text wenn Bedingung TRUE
359 String aFALSETxt; // Wenn Bedingung falsch
360 String aContent; // Ausgewerteter DB-Text
362 String aCond; // Bedingung
363 USHORT nSubType;
365 BOOL bCanToggle : 1; // kann das Feld einzeln getoggelt werden?
366 BOOL bIsHidden : 1; // ist es nicht sichtbar?
367 BOOL bValid : 1; // DB-Feld evaluiert?
369 public:
370 SwHiddenTxtField( SwHiddenTxtFieldType*,
371 BOOL bConditional,
372 const String& rCond,
373 const String& rTxt,
374 BOOL bHidden = FALSE,
375 USHORT nSubType = TYP_HIDDENTXTFLD);
377 SwHiddenTxtField( SwHiddenTxtFieldType*,
378 const String& rCond,
379 const String& rTrue,
380 const String& rFalse,
381 USHORT nSubType = TYP_HIDDENTXTFLD);
383 virtual String GetCntnt(BOOL bName = FALSE) const;
384 virtual String Expand() const;
385 virtual SwField* Copy() const;
387 void Evaluate(SwDoc*);
389 inline void SetValue(BOOL bHidden) { bIsHidden = bHidden; }
390 String GetColumnName(const String& rName);
391 String GetDBName(const String& rName, SwDoc *pDoc);
393 // Condition
394 virtual void SetPar1(const String& rStr);
395 virtual const String& GetPar1() const;
397 // True/False - String
398 virtual void SetPar2(const String& rStr);
399 virtual String GetPar2() const;
402 virtual USHORT GetSubType() const;
403 // virtual void SetSubType(USHORT nSub); // OM: entfernt, da unbenoetigt und gefaehrlich
404 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
405 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
408 /*--------------------------------------------------------------------
409 Beschreibung: Feld das zu einer Leerzeile (ohne Hoehe) expandiert
410 --------------------------------------------------------------------*/
412 class SwHiddenParaFieldType : public SwFieldType
414 public:
415 SwHiddenParaFieldType();
417 virtual SwFieldType* Copy() const;
420 /*--------------------------------------------------------------------
421 Beschreibung: Versteckter Absatz
422 --------------------------------------------------------------------*/
424 class SwHiddenParaField : public SwField
426 String aCond;
427 BOOL bIsHidden:1;
428 public:
429 // Direkte Eingabe alten Wert loeschen
430 SwHiddenParaField(SwHiddenParaFieldType*, const String& rCond);
432 virtual String Expand() const;
433 virtual SwField* Copy() const;
435 void SetHidden(BOOL bHidden) { bIsHidden = bHidden; }
436 BOOL IsHidden() const { return bIsHidden; }
438 // Bedingung erfragen/setzen
439 virtual const String& GetPar1() const;
440 virtual void SetPar1(const String& rStr);
441 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
442 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
445 /*--------------------------------------------------------------------
446 Beschreibung: Macro ausfuehren
447 --------------------------------------------------------------------*/
449 class SwMacroFieldType : public SwFieldType
451 SwDoc* pDoc;
453 public:
454 SwMacroFieldType(SwDoc*);
456 virtual SwFieldType* Copy() const;
459 /*--------------------------------------------------------------------
460 Beschreibung: Macrofeld
461 --------------------------------------------------------------------*/
463 class SW_DLLPUBLIC SwMacroField : public SwField
465 String aMacro;
466 String aText;
467 BOOL bIsScriptURL;
469 public:
470 // Direkte Eingabe alten Wert loeschen
471 SwMacroField( SwMacroFieldType*, const String& rLibAndName,
472 const String& rTxt);
474 inline const String& GetMacro() const { return aMacro; }
475 String GetLibName() const;
476 String GetMacroName() const;
477 SvxMacro GetSvxMacro() const;
479 virtual String GetCntnt(BOOL bName = FALSE) const;
480 virtual String Expand() const;
481 virtual SwField* Copy() const;
483 // Library und FileName
484 virtual const String& GetPar1() const;
485 virtual void SetPar1(const String& rStr);
487 // Macrotext
488 virtual String GetPar2() const;
489 virtual void SetPar2(const String& rStr);
490 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
491 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
493 static void CreateMacroString( String& rMacro,
494 const String& rMacroName,
495 const String& rLibraryName );
497 static BOOL isScriptURL( const String& str );
501 /*--------------------------------------------------------------------
502 Beschreibung: PostIts
503 --------------------------------------------------------------------*/
505 class SwPostItFieldType : public SwFieldType
507 private:
508 SwDoc* mpDoc;
509 public:
510 SwPostItFieldType(SwDoc* pDoc);
512 virtual SwFieldType* Copy() const;
513 SwDoc* GetDoc() {return mpDoc;};
516 /*--------------------------------------------------------------------
517 Beschreibung: PostIt
518 --------------------------------------------------------------------*/
520 class SW_DLLPUBLIC SwPostItField : public SwField
522 String sTxt; // die Anmerkung
523 String sAuthor; // der Author
524 DateTime aDateTime; // Datum und Zeit der Anmerkung
525 OutlinerParaObject* mpText;
526 SwTextAPIObject* m_pTextObject;
528 public:
529 SwPostItField( SwPostItFieldType*,
530 const String& rAuthor, const String& rTxt, const DateTime& rDate);
531 ~SwPostItField();
533 virtual String Expand() const;
534 virtual SwField* Copy() const;
536 inline const Date GetDate() const { return aDateTime.GetDate(); }
537 inline const Time GetTime() const { return aDateTime.GetTime(); }
539 // Author
540 virtual const String& GetPar1() const;
541 virtual void SetPar1(const String& rStr);
543 // Text
544 virtual String GetPar2() const;
545 virtual void SetPar2(const String& rStr);
546 const String& GetTxt() const { return sTxt; }
548 const OutlinerParaObject* GetTextObject() const;
549 void SetTextObject( OutlinerParaObject* pText );
551 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
552 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
553 virtual String GetDescription() const;
556 /*--------------------------------------------------------------------
557 Beschreibung: DokumentInfo
558 --------------------------------------------------------------------*/
560 class SwDocInfoFieldType : public SwValueFieldType
562 public:
563 SwDocInfoFieldType(SwDoc* pDc);
565 String Expand(USHORT nSubType, sal_uInt32 nFormat, USHORT nLang, const String& rName) const;
566 virtual SwFieldType* Copy() const;
569 class SW_DLLPUBLIC SwDocInfoField : public SwValueField
571 USHORT nSubType;
572 String aContent;
573 String aName;
575 public:
576 SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, const String& rName, sal_uInt32 nFmt=0);
577 SwDocInfoField(SwDocInfoFieldType*, USHORT nSub, const String& rName, const String& rValue, sal_uInt32 nFmt=0);
579 virtual void SetSubType(USHORT);
580 virtual USHORT GetSubType() const;
581 virtual void SetLanguage(USHORT nLng);
582 virtual String Expand() const;
583 virtual String GetCntnt(BOOL bName = FALSE) const;
584 virtual SwField* Copy() const;
585 String GetName() const { return aName; }
586 void SetName( const String& rName ) { aName = rName; }
587 inline void SetExpansion(const String& rStr) { aContent = rStr; }
588 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
589 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
592 /*--------------------------------------------------------------------
593 Beschreibung: erweiterte Benutzereinstellung
594 --------------------------------------------------------------------*/
597 class SwExtUserFieldType : public SwFieldType
599 String aData;
600 public:
601 SwExtUserFieldType();
603 inline void SetData(const String& rStr) { aData = rStr; }
605 String Expand(USHORT nSubType, sal_uInt32 nFormat) const;
606 virtual SwFieldType* Copy() const;
609 class SwExtUserField : public SwField
611 String aContent;
612 USHORT nType;
614 public:
615 SwExtUserField(SwExtUserFieldType*, USHORT nSub, sal_uInt32 nFmt=0);
617 virtual String Expand() const;
618 virtual SwField* Copy() const;
620 virtual USHORT GetSubType() const;
621 virtual void SetSubType(USHORT nSub);
623 inline void SetExpansion(const String& rStr) { aContent = rStr; }
625 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
626 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
630 /*--------------------------------------------------------------------
631 Beschreibung: Relatives Seitennummern - Feld
632 --------------------------------------------------------------------*/
634 class SwRefPageSetFieldType : public SwFieldType
636 public:
637 SwRefPageSetFieldType();
639 virtual SwFieldType* Copy() const;
640 // ueberlagert, weil es nichts zum Updaten gibt!
641 virtual void Modify( SfxPoolItem *, SfxPoolItem * );
644 /*--------------------------------------------------------------------
645 Beschreibung: Relative Seitennummerierung
646 --------------------------------------------------------------------*/
648 class SwRefPageSetField : public SwField
650 short nOffset;
651 BOOL bOn;
653 public:
654 SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0,
655 BOOL bOn = TRUE );
657 virtual String Expand() const;
658 virtual SwField* Copy() const;
660 virtual String GetPar2() const;
661 virtual void SetPar2(const String& rStr);
663 BOOL IsOn() const { return bOn; }
665 short GetOffset() const { return nOffset; }
666 void SetOffset( short nOff ) { nOffset = nOff; }
667 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
668 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
671 /*--------------------------------------------------------------------
672 Beschreibung: relatives Seitennummern - Abfrage Feld
673 --------------------------------------------------------------------*/
675 class SwRefPageGetFieldType : public SwFieldType
677 SwDoc* pDoc;
678 sal_Int16 nNumberingType;
680 void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
682 public:
683 SwRefPageGetFieldType( SwDoc* pDoc );
684 virtual SwFieldType* Copy() const;
686 // ueberlagert, um alle RefPageGet-Felder zu updaten
687 virtual void Modify( SfxPoolItem *, SfxPoolItem * );
688 USHORT MakeSetList( _SetGetExpFlds& rTmpLst );
690 SwDoc* GetDoc() const { return pDoc; }
693 /*--------------------------------------------------------------------
694 Beschreibung: Relative Seitennummerierung Abfragen
695 --------------------------------------------------------------------*/
697 class SwRefPageGetField : public SwField
699 String sTxt;
700 public:
701 SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt );
703 virtual String Expand() const;
704 virtual SwField* Copy() const;
706 void SetText( const String& rTxt ) { sTxt = rTxt; }
708 void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld );
709 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
710 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
713 /*--------------------------------------------------------------------
714 Beschreibung: Feld zum Anspringen und Editieren
715 --------------------------------------------------------------------*/
717 class SwJumpEditFieldType : public SwFieldType
719 SwDoc* pDoc;
720 SwDepend aDep;
722 public:
723 SwJumpEditFieldType( SwDoc* pDoc );
724 virtual SwFieldType* Copy() const;
726 SwCharFmt* GetCharFmt();
729 class SwJumpEditField : public SwField
731 String sTxt, sHelp;
732 public:
733 SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat,
734 const String& sText, const String& sHelp );
736 virtual String Expand() const;
737 virtual SwField* Copy() const;
739 // Platzhalter-Text
740 virtual const String& GetPar1() const;
741 virtual void SetPar1(const String& rStr);
743 // HinweisText
744 virtual String GetPar2() const;
745 virtual void SetPar2(const String& rStr);
747 SwCharFmt* GetCharFmt() const
748 { return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); }
749 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
750 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
753 /*--------------------------------------------------------------------
754 Beschreibung: Script Fieldtype
755 --------------------------------------------------------------------*/
757 class SwScriptFieldType : public SwFieldType
759 SwDoc* pDoc;
760 public:
761 SwScriptFieldType( SwDoc* pDoc );
763 virtual SwFieldType* Copy() const;
766 /*--------------------------------------------------------------------
767 Beschreibung: Script Field
768 --------------------------------------------------------------------*/
770 class SwScriptField : public SwField
772 String sType; // Type von Code (Java/VBScript/...)
773 String sCode; // der Code als Text
774 // der Code als JavaCode ?
776 BOOL bCodeURL; // Code enthaelt URL eines Scripts
778 public:
779 SwScriptField( SwScriptFieldType*, const String& rType,
780 const String& rCode, BOOL bURL=FALSE );
782 virtual String GetDescription() const;
784 virtual String Expand() const;
785 virtual SwField* Copy() const;
787 // Type
788 virtual const String& GetPar1() const;
789 virtual void SetPar1(const String& rStr);
790 // Text
791 virtual String GetPar2() const;
792 virtual void SetPar2(const String& rStr);
794 BOOL IsCodeURL() const { return bCodeURL; }
795 void SetCodeURL( BOOL bURL ) { bCodeURL = bURL; }
796 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
797 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
800 /*--------------------------------------------------------------------
801 Beschreibung: Combined Character Fieldtype
802 --------------------------------------------------------------------*/
804 class SwCombinedCharFieldType : public SwFieldType
806 public:
807 SwCombinedCharFieldType();
809 virtual SwFieldType* Copy() const;
812 /*--------------------------------------------------------------------
813 Beschreibung: Script Field
814 --------------------------------------------------------------------*/
816 #define MAX_COMBINED_CHARACTERS 6
818 class SW_DLLPUBLIC SwCombinedCharField : public SwField
820 String sCharacters; // combine these characters
822 public:
823 SwCombinedCharField( SwCombinedCharFieldType*, const String& rChars );
825 virtual String Expand() const;
826 virtual SwField* Copy() const;
828 // Characters
829 virtual const String& GetPar1() const;
830 virtual void SetPar1(const String& rStr);
832 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, USHORT nWhich ) const;
833 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, USHORT nWhich );
837 #endif // _DOCUFLD_HXX