xref: /aoo42x/main/sw/inc/docufld.hxx (revision dec99bbd)
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 
GetUserString() const186 	const String& GetUserString() const			{ return sUserStr; }
SetUserString(const String & rS)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 
SetExpansion(const String & rStr)217 	inline void 		SetExpansion(const String& rStr) { aContent = rStr; }
GetContent() const218 	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 
SetExpansion(const String & rStr)252 	inline void 		SetExpansion(const String& rStr) { aContent = rStr; }
GetContent() const253 	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 
SetNumFormat(sal_Int16 eFmt)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 );
GetHiddenFlag() const342 	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 
SetValue(sal_Bool bHidden)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 
SetHidden(sal_Bool bHidden)429 	void				SetHidden(sal_Bool bHidden)		{ bIsHidden = bHidden; }
IsHidden() const430 	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 
GetMacro() const471 	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 
GetDoc() const509     SwDoc* GetDoc() const
510     {
511         return mpDoc;
512     };
513 };
514 
515 
516 // representation for a comment/an annotation
517 class SW_DLLPUBLIC SwPostItField : public SwField
518 {
519     String      msCommentContent;   // content of the comment/annotation
520     String      msAuthor;           // author
521     String      msAuthorInitials;   // author's initials
522     String      msName;             // name (identifier) of the comment/annotation
523     DateTime    maDateTime;         // creation date and time
524 
525     OutlinerParaObject* mpText;
526     SwTextAPIObject* m_pTextObject;
527 
528 public:
529     SwPostItField(
530         SwPostItFieldType*,
531         const String& rCommentContent,
532         const String& rAuthor,
533         const String& rAuthorInitials,
534         const String& rName,
535         const DateTime& rDate);
536     ~SwPostItField();
537 
538     virtual String Expand() const;
539     virtual SwField* Copy() const;
540 
GetDate() const541     inline const Date GetDate() const
542     {
543         return maDateTime.GetDate();
544     }
GetTime() const545     inline const Time GetTime() const
546     {
547         return maDateTime.GetTime();
548     }
549 
550     // Author
551     virtual const String& GetPar1() const;
552     virtual void SetPar1(const String& rStr);
553 
554     // Text
555     virtual String GetPar2() const;
556     virtual void SetPar2(const String& rStr);
GetContent() const557     inline const String& GetContent() const
558     {
559         return msCommentContent;
560     }
561 
562     // Name
563     void SetName(const String& rStr);
564     const String& GetName() const;
565 
566     const OutlinerParaObject* GetTextObject() const;
567     void SetTextObject( OutlinerParaObject* pText );
568 
569     sal_uInt32 GetNumberOfParagraphs() const;
570 
571     virtual sal_Bool    QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
572     virtual sal_Bool    PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
573     virtual String      GetDescription() const;
574 };
575 
576 /*--------------------------------------------------------------------
577 	Beschreibung: DokumentInfo
578  --------------------------------------------------------------------*/
579 
580 class SwDocInfoFieldType : public SwValueFieldType
581 {
582 public:
583 	SwDocInfoFieldType(SwDoc* pDc);
584 
585 	String					Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, sal_uInt16 nLang, const String& rName) const;
586 	virtual SwFieldType*    Copy() const;
587 };
588 
589 class SW_DLLPUBLIC SwDocInfoField : public SwValueField
590 {
591 	sal_uInt16 	nSubType;
592 	String  aContent;
593 	String  aName;
594 
595     virtual String          Expand() const;
596     virtual SwField*        Copy() const;
597 
598 public:
599     SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt=0);
600 	SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const String& rName, const String& rValue, sal_uInt32 nFmt=0);
601 
602 	virtual void        	SetSubType(sal_uInt16);
603 	virtual sal_uInt16	 		GetSubType() const;
604 	virtual void			SetLanguage(sal_uInt16 nLng);
605     virtual String          GetFieldName() const;
GetName() const606 	String					GetName() const { return aName; }
SetName(const String & rName)607 	void                    SetName( const String& rName ) { aName = rName; }
SetExpansion(const String & rStr)608 	inline void 			SetExpansion(const String& rStr) { aContent = rStr; }
609     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
610     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
611 };
612 
613 /*--------------------------------------------------------------------
614 	Beschreibung: erweiterte Benutzereinstellung
615  --------------------------------------------------------------------*/
616 
617 
618 class SwExtUserFieldType : public SwFieldType
619 {
620 	String aData;
621 public:
622 	SwExtUserFieldType();
623 
SetData(const String & rStr)624     inline void             SetData(const String& rStr)     { aData = rStr; }
625 
626 	String					Expand(sal_uInt16 nSubType, sal_uInt32 nFormat) const;
627 	virtual SwFieldType*    Copy() const;
628 };
629 
630 class SwExtUserField : public SwField
631 {
632 	String	aContent;
633 	sal_uInt16 	nType;
634 
635 public:
636 	SwExtUserField(SwExtUserFieldType*, sal_uInt16 nSub, sal_uInt32 nFmt=0);
637 
638 	virtual String		Expand() const;
639 	virtual SwField*	Copy() const;
640 
641 	virtual sal_uInt16		GetSubType() const;
642 	virtual void		SetSubType(sal_uInt16 nSub);
643 
SetExpansion(const String & rStr)644 	inline void 		SetExpansion(const String& rStr) { aContent = rStr; }
645 
646     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
647     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
648 };
649 
650 
651 /*--------------------------------------------------------------------
652 	Beschreibung: Relatives Seitennummern - Feld
653  --------------------------------------------------------------------*/
654 
655 class SwRefPageSetFieldType : public SwFieldType
656 {
657 public:
658 	SwRefPageSetFieldType();
659 
660 	virtual SwFieldType*	Copy() const;
661 
662 protected:
663 	// ueberlagert, weil es nichts zum Updaten gibt!
664    virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
665 };
666 
667 /*--------------------------------------------------------------------
668 	Beschreibung: Relative Seitennummerierung
669  --------------------------------------------------------------------*/
670 
671 class SwRefPageSetField : public SwField
672 {
673 	short 	nOffset;
674 	sal_Bool 	bOn;
675 
676 public:
677 	SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0,
678 						sal_Bool bOn = sal_True );
679 
680 	virtual String		Expand() const;
681 	virtual SwField*	Copy() const;
682 
683 	virtual String	GetPar2() const;
684 	virtual void	SetPar2(const String& rStr);
685 
IsOn() const686 	sal_Bool IsOn() const				{ return bOn; }
687 
GetOffset() const688 	short GetOffset() const 		{ return nOffset; }
SetOffset(short nOff)689 	void SetOffset( short nOff )	{ nOffset = nOff; }
690     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
691     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
692 };
693 
694 /*--------------------------------------------------------------------
695 	Beschreibung: relatives Seitennummern - Abfrage Feld
696  --------------------------------------------------------------------*/
697 
698 class SwRefPageGetFieldType : public SwFieldType
699 {
700 	SwDoc* 			pDoc;
701 	sal_Int16		nNumberingType;
702 
703 	void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
704 protected:
705 	// ueberlagert, um alle RefPageGet-Felder zu updaten
706    virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
707 public:
708 	SwRefPageGetFieldType( SwDoc* pDoc );
709 	virtual SwFieldType*    Copy() const;
710 	sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst );
GetDoc() const711     SwDoc*  GetDoc() const                  { return pDoc; }
712 };
713 
714 /*--------------------------------------------------------------------
715 	Beschreibung: Relative Seitennummerierung Abfragen
716  --------------------------------------------------------------------*/
717 
718 class SwRefPageGetField : public SwField
719 {
720 	String sTxt;
721 public:
722 	SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt );
723 
724 	virtual String		Expand() const;
725 	virtual SwField*	Copy() const;
726 
SetText(const String & rTxt)727 	void SetText( const String& rTxt )		{ sTxt = rTxt; }
728 
729 	void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld );
730     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
731     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
732 };
733 
734 /*--------------------------------------------------------------------
735 	Beschreibung: Feld zum Anspringen und Editieren
736  --------------------------------------------------------------------*/
737 
738 class SwJumpEditFieldType : public SwFieldType
739 {
740 	SwDoc* pDoc;
741 	SwDepend aDep;
742 
743 public:
744 	SwJumpEditFieldType( SwDoc* pDoc );
745 	virtual SwFieldType*    Copy() const;
746 
747     SwCharFmt* GetCharFmt();
748 };
749 
750 class SwJumpEditField : public SwField
751 {
752 	String sTxt, sHelp;
753 public:
754 	SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat,
755 					const String& sText, const String& sHelp );
756 
757 	virtual String		Expand() const;
758 	virtual SwField*	Copy() const;
759 
760 	// Platzhalter-Text
761 	virtual const String& GetPar1() const;
762 	virtual void	SetPar1(const String& rStr);
763 
764 	// HinweisText
765 	virtual String	GetPar2() const;
766 	virtual void	SetPar2(const String& rStr);
767 
GetCharFmt() const768 	SwCharFmt* GetCharFmt() const
769 		{ return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); }
770     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
771     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
772 };
773 
774 /*--------------------------------------------------------------------
775 	Beschreibung: Script Fieldtype
776  --------------------------------------------------------------------*/
777 
778 class SwScriptFieldType : public SwFieldType
779 {
780 	SwDoc* pDoc;
781 public:
782 	SwScriptFieldType( SwDoc* pDoc );
783 
784 	virtual SwFieldType*    Copy() const;
785 };
786 
787 /*--------------------------------------------------------------------
788 	Beschreibung: Script Field
789  --------------------------------------------------------------------*/
790 
791 class SwScriptField : public SwField
792 {
793 	String	sType;		// Type von Code (Java/VBScript/...)
794 	String 	sCode;		// der Code als Text
795 						// der Code als JavaCode ?
796 
797 	sal_Bool	bCodeURL;	// Code enthaelt URL eines Scripts
798 
799 public:
800 	SwScriptField( SwScriptFieldType*, const String& rType,
801 				   const String& rCode, sal_Bool bURL=sal_False );
802 
803     virtual String          GetDescription() const;
804 
805 	virtual String			Expand() const;
806 	virtual SwField*		Copy() const;
807 
808 	// Type
809 	virtual const String& 	GetPar1() const;
810 	virtual void			SetPar1(const String& rStr);
811 	// Text
812 	virtual String 			GetPar2() const;
813 	virtual void			SetPar2(const String& rStr);
814 
IsCodeURL() const815 	sal_Bool 					IsCodeURL() const { return bCodeURL; }
SetCodeURL(sal_Bool bURL)816 	void					SetCodeURL( sal_Bool bURL ) { bCodeURL = bURL; }
817     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
818     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
819 };
820 
821 /*--------------------------------------------------------------------
822 	Beschreibung: Combined Character Fieldtype
823  --------------------------------------------------------------------*/
824 
825 class SwCombinedCharFieldType : public SwFieldType
826 {
827 public:
828 	SwCombinedCharFieldType();
829 
830 	virtual SwFieldType*    Copy() const;
831 };
832 
833 /*--------------------------------------------------------------------
834 	Beschreibung: Script Field
835  --------------------------------------------------------------------*/
836 
837 #define MAX_COMBINED_CHARACTERS		6
838 
839 class SW_DLLPUBLIC SwCombinedCharField : public SwField
840 {
841 	String	sCharacters;	// combine these characters
842 
843 public:
844 	SwCombinedCharField( SwCombinedCharFieldType*, const String& rChars );
845 
846 	virtual String			Expand() const;
847 	virtual SwField*		Copy() const;
848 
849 	// Characters
850 	virtual const String& 	GetPar1() const;
851 	virtual void			SetPar1(const String& rStr);
852 
853     virtual sal_Bool        QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
854     virtual sal_Bool        PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
855 };
856 
857 
858 #endif // SW_DOCUFLD_HXX
859