fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sw / inc / docufld.hxx
blob272a6d3bb1c50a48971bf0a851b3170dc709039c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef SW_DOCUFLD_HXX
20 #define SW_DOCUFLD_HXX
23 #include <tools/date.hxx>
24 #include <tools/datetime.hxx>
27 #include <svl/macitem.hxx>
29 #include "fldbas.hxx"
30 #include "numrule.hxx"
32 class _SetGetExpFlds;
33 class SwTxtFld;
34 class SwFrm;
35 class OutlinerParaObject;
36 class SwTextAPIObject;
37 class SwFmtFld;
39 enum SwAuthorFormat
41 AF_BEGIN,
42 AF_NAME = AF_BEGIN,
43 AF_SHORTCUT,
44 AF_END,
45 AF_FIXED = 0x8000
48 /*--------------------------------------------------------------------
49 Subtype of document statistics.
50 --------------------------------------------------------------------*/
52 enum SwDocStatSubType
54 DS_BEGIN,
55 DS_PAGE = DS_BEGIN,
56 DS_PARA,
57 DS_WORD,
58 DS_CHAR,
59 DS_TBL,
60 DS_GRF,
61 DS_OLE,
62 DS_END
65 typedef sal_uInt16 SwDocInfoSubType;
66 namespace nsSwDocInfoSubType
68 /** NB: these must denote consecutive integers!
69 NB2: these are extended by 4 DI_INFO values for backward compatibility
70 in filter/html/htmlfld.cxx, so make sure that DI_SUBTYPE_END
71 really is the end, and is at least 4 less than DI_SUB_*! */
72 const SwDocInfoSubType DI_SUBTYPE_BEGIN = 0;
73 const SwDocInfoSubType DI_TITEL = DI_SUBTYPE_BEGIN;
74 const SwDocInfoSubType DI_THEMA = 1;
75 const SwDocInfoSubType DI_KEYS = 2;
76 const SwDocInfoSubType DI_COMMENT = 3;
77 const SwDocInfoSubType DI_CREATE = 4;
78 const SwDocInfoSubType DI_CHANGE = 5;
79 const SwDocInfoSubType DI_PRINT = 6;
80 const SwDocInfoSubType DI_DOCNO = 7;
81 const SwDocInfoSubType DI_EDIT = 8;
82 const SwDocInfoSubType DI_CUSTOM = 9;
83 const SwDocInfoSubType DI_SUBTYPE_END = 10;
86 const SwDocInfoSubType DI_SUB_AUTHOR = 0x0100;
87 const SwDocInfoSubType DI_SUB_TIME = 0x0200;
88 const SwDocInfoSubType DI_SUB_DATE = 0x0300;
89 const SwDocInfoSubType DI_SUB_FIXED = 0x1000;
90 const SwDocInfoSubType DI_SUB_MASK = 0xff00;
94 enum RegInfoFormat ///< Only for loading of old documents!!!
96 RF_AUTHOR,
97 RF_TIME,
98 RF_DATE,
99 RF_ALL
102 enum SwPageNumSubType
104 PG_RANDOM,
105 PG_NEXT,
106 PG_PREV
109 enum SwExtUserSubType
111 EU_COMPANY,
112 EU_FIRSTNAME,
113 EU_NAME,
114 EU_SHORTCUT,
115 EU_STREET,
116 EU_COUNTRY,
117 EU_ZIP,
118 EU_CITY,
119 EU_TITLE,
120 EU_POSITION,
121 EU_PHONE_PRIVATE,
122 EU_PHONE_COMPANY,
123 EU_FAX,
124 EU_EMAIL,
125 EU_STATE,
126 EU_FATHERSNAME,
127 EU_APARTMENT
130 enum SwJumpEditFormat
132 JE_FMT_TEXT,
133 JE_FMT_TABLE,
134 JE_FMT_FRAME,
135 JE_FMT_GRAPHIC,
136 JE_FMT_OLE
139 /*--------------------------------------------------------------------
140 Page number.
141 --------------------------------------------------------------------*/
143 class SwPageNumberFieldType : public SwFieldType
145 sal_Int16 nNumberingType;
146 bool bVirtuell;
148 public:
149 SwPageNumberFieldType();
151 String& Expand( sal_uInt32 nFmt, short nOff, sal_uInt16 const nPageNumber,
152 sal_uInt16 const nMaxPage, const String&, String& rRet ) const;
153 void ChangeExpansion( SwDoc* pDoc,
154 sal_Bool bVirtPageNum, const sal_Int16* pNumFmt = 0 );
155 virtual SwFieldType* Copy() const;
158 /*--------------------------------------------------------------------
159 Page numbering.
160 --------------------------------------------------------------------*/
162 class SW_DLLPUBLIC SwPageNumberField : public SwField
164 String sUserStr;
165 sal_uInt16 nSubType;
166 short nOffset;
167 // fdo#58074 store page number in SwField, not SwFieldType
168 sal_uInt16 m_nPageNumber;
169 sal_uInt16 m_nMaxPage;
171 public:
172 SwPageNumberField(SwPageNumberFieldType*, sal_uInt16 nSub = PG_RANDOM,
173 sal_uInt32 nFmt = 0, short nOff = 0,
174 sal_uInt16 const nPageNumber = 0,
175 sal_uInt16 const nMaxPage = 0);
177 void ChangeExpansion(sal_uInt16 const nPageNumber,
178 sal_uInt16 const nMaxPage);
180 virtual String Expand() const;
181 virtual SwField* Copy() const;
183 virtual OUString GetPar2() const;
184 virtual void SetPar2(const OUString& rStr);
186 virtual sal_uInt16 GetSubType() const;
187 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
188 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
190 const String& GetUserString() const { return sUserStr; }
191 void SetUserString( const String& rS ) { sUserStr = rS; }
194 /*--------------------------------------------------------------------
195 Authors.
196 --------------------------------------------------------------------*/
198 class SwAuthorFieldType : public SwFieldType
200 public:
201 SwAuthorFieldType();
203 String Expand(sal_uLong) const;
204 virtual SwFieldType* Copy() const;
207 /*--------------------------------------------------------------------
208 Author field.
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, sal_uInt16 nWhich ) const;
225 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
228 /*--------------------------------------------------------------------
229 Filename
230 --------------------------------------------------------------------*/
232 class SwFileNameFieldType : public SwFieldType
234 SwDoc *pDoc;
235 public:
236 SwFileNameFieldType(SwDoc*);
238 String Expand(sal_uLong) const;
239 virtual SwFieldType* Copy() const;
242 /*--------------------------------------------------------------------
243 FileNameField
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, sal_uInt16 nWhich ) const;
260 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
263 /*--------------------------------------------------------------------
264 TemplName
265 --------------------------------------------------------------------*/
267 class SwTemplNameFieldType : public SwFieldType
269 SwDoc *pDoc;
270 public:
271 SwTemplNameFieldType(SwDoc*);
273 String Expand(sal_uLong) const;
274 virtual SwFieldType* Copy() const;
277 /*--------------------------------------------------------------------
278 TemplNameField
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, sal_uInt16 nWhich ) const;
289 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
293 /*--------------------------------------------------------------------
294 Document statistics
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(sal_uInt16 nSubType, sal_uInt32 nFmt) const;
305 virtual SwFieldType* Copy() const;
307 inline void SetNumFormat( sal_Int16 eFmt ) { nNumberingType = eFmt; }
310 /*--------------------------------------------------------------------
311 DocStatField
312 --------------------------------------------------------------------*/
314 class SW_DLLPUBLIC SwDocStatField : public SwField
316 sal_uInt16 nSubType;
318 public:
319 SwDocStatField( SwDocStatFieldType*,
320 sal_uInt16 nSubType = 0, sal_uInt32 nFmt = 0);
322 void ChangeExpansion( const SwFrm* pFrm );
324 virtual String Expand() const;
325 virtual SwField* Copy() const;
327 virtual sal_uInt16 GetSubType() const;
328 virtual void SetSubType(sal_uInt16 nSub);
329 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
330 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
333 /*--------------------------------------------------------------------
334 Hidden text.
335 --------------------------------------------------------------------*/
337 class SwHiddenTxtFieldType : public SwFieldType
339 sal_Bool bHidden;
340 public:
341 SwHiddenTxtFieldType(sal_Bool bSetHidden = sal_True);
343 virtual SwFieldType* Copy() const;
345 void SetHiddenFlag( sal_Bool bSetHidden = sal_True );
346 inline sal_Bool GetHiddenFlag() const { return bHidden; }
349 /*--------------------------------------------------------------------
350 HiddenTxtField
351 --------------------------------------------------------------------*/
353 class SwHiddenTxtField : public SwField
355 OUString aTRUETxt; ///< Text if condition sal_True.
356 OUString aFALSETxt; ///< If condition false.
357 OUString aContent; ///< Evaluated DB-text.
359 OUString aCond; ///< Condition.
360 sal_uInt16 nSubType;
362 sal_Bool bCanToggle : 1; ///< Can field be toggled alone?
363 sal_Bool bIsHidden : 1; ///< Is it not visible?
364 sal_Bool bValid : 1; ///< Is DB-field evaluated?
366 virtual String Expand() const;
367 virtual SwField* Copy() const;
369 public:
370 SwHiddenTxtField( SwHiddenTxtFieldType*,
371 sal_Bool bConditional,
372 const String& rCond,
373 const String& rTxt,
374 sal_Bool bHidden = sal_False,
375 sal_uInt16 nSubType = TYP_HIDDENTXTFLD);
377 SwHiddenTxtField( SwHiddenTxtFieldType*,
378 const String& rCond,
379 const String& rTrue,
380 const String& rFalse,
381 sal_uInt16 nSubType = TYP_HIDDENTXTFLD);
383 virtual String GetFieldName() const;
385 void Evaluate(SwDoc*);
387 inline void SetValue(sal_Bool bHidden) { bIsHidden = bHidden; }
388 String GetColumnName(const String& rName);
389 String GetDBName(const String& rName, SwDoc *pDoc);
391 /// Condition
392 virtual void SetPar1(const OUString& rStr);
393 virtual const OUString& GetPar1() const;
395 /// True/False - String
396 virtual void SetPar2(const OUString& rStr);
397 virtual OUString GetPar2() const;
400 virtual sal_uInt16 GetSubType() const;
402 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
403 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
406 /*--------------------------------------------------------------------
407 Field that expands to an empty line (without height).
408 --------------------------------------------------------------------*/
410 class SwHiddenParaFieldType : public SwFieldType
412 public:
413 SwHiddenParaFieldType();
415 virtual SwFieldType* Copy() const;
418 /*--------------------------------------------------------------------
419 Hidded paragraph.
420 --------------------------------------------------------------------*/
422 class SwHiddenParaField : public SwField
424 OUString aCond;
425 sal_Bool bIsHidden:1;
426 public:
427 /// Direct input, delete old value.
428 SwHiddenParaField(SwHiddenParaFieldType*, const String& rCond);
430 virtual String Expand() const;
431 virtual SwField* Copy() const;
433 void SetHidden(sal_Bool bHidden) { bIsHidden = bHidden; }
434 sal_Bool IsHidden() const { return bIsHidden; }
436 /// Query, set condition.
437 virtual const OUString& GetPar1() const;
438 virtual void SetPar1(const OUString& rStr);
439 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
440 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
443 /*--------------------------------------------------------------------
444 Run Macro.
445 --------------------------------------------------------------------*/
447 class SwMacroFieldType : public SwFieldType
449 SwDoc* pDoc;
451 public:
452 SwMacroFieldType(SwDoc*);
454 virtual SwFieldType* Copy() const;
457 /*--------------------------------------------------------------------
458 MacroField.
459 --------------------------------------------------------------------*/
461 class SW_DLLPUBLIC SwMacroField : public SwField
463 OUString aMacro;
464 OUString aText;
465 sal_Bool bIsScriptURL;
467 virtual String Expand() const;
468 virtual SwField* Copy() const;
470 public:
471 /// Direct input, delete old value.
472 SwMacroField( SwMacroFieldType*, const String& rLibAndName,
473 const String& rTxt);
475 inline const OUString& GetMacro() const { return aMacro; }
476 String GetLibName() const;
477 String GetMacroName() const;
478 SvxMacro GetSvxMacro() const;
480 virtual String GetFieldName() const;
482 /// Library and FileName
483 virtual const OUString& GetPar1() const;
484 virtual void SetPar1(const OUString& rStr);
486 /// Macrotext
487 virtual OUString GetPar2() const;
488 virtual void SetPar2(const OUString& rStr);
489 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
490 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
492 static void CreateMacroString( OUString& rMacro,
493 const String& rMacroName,
494 const String& rLibraryName );
496 static sal_Bool isScriptURL( const String& str );
500 /*--------------------------------------------------------------------
501 PostIts
502 --------------------------------------------------------------------*/
504 class SwPostItFieldType : public SwFieldType
506 private:
507 SwDoc* mpDoc;
508 public:
509 SwPostItFieldType(SwDoc* pDoc);
511 virtual SwFieldType* Copy() const;
512 SwDoc* GetDoc() {return mpDoc;};
515 /*--------------------------------------------------------------------
516 PostItField
517 --------------------------------------------------------------------*/
519 class SW_DLLPUBLIC SwPostItField : public SwField
521 OUString sTxt;
522 OUString sAuthor;
523 OUString sInitials; ///< Initials of the author.
524 OUString sName; ///< Name of the comment.
525 DateTime aDateTime;
526 OutlinerParaObject* mpText;
527 SwTextAPIObject* m_pTextObject;
529 public:
530 SwPostItField( SwPostItFieldType*,
531 const String& rAuthor, const String& rTxt, const String& rInitials, const String& rName, const DateTime& rDate);
532 ~SwPostItField();
534 /// Looks up a field identified by its unique name (used to get the postit field of a comment fieldmark)
535 static const SwFmtFld* GetByName(SwDoc* pDoc, const OUString& rName);
537 virtual String Expand() const;
538 virtual SwField* Copy() const;
540 inline const DateTime GetDateTime() const { return aDateTime; }
541 inline const Date GetDate() const { return aDateTime.GetDate(); }
542 inline const Time GetTime() const { return aDateTime.GetTime(); }
544 /// Author
545 virtual const OUString& GetPar1() const;
546 virtual void SetPar1(const OUString& rStr);
548 /// Text
549 virtual OUString GetPar2() const;
550 virtual void SetPar2(const OUString& rStr);
551 const OUString& GetTxt() const { return sTxt; }
552 const OUString& GetInitials() const;
553 void SetName(const OUString& rStr);
554 const OUString& GetName() const;
556 const OutlinerParaObject* GetTextObject() const;
557 void SetTextObject( OutlinerParaObject* pText );
559 sal_Int32 GetNumberOfParagraphs() const;
561 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
562 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
563 virtual String GetDescription() const;
566 /*--------------------------------------------------------------------
567 DocumentInfo
568 --------------------------------------------------------------------*/
570 class SwDocInfoFieldType : public SwValueFieldType
572 public:
573 SwDocInfoFieldType(SwDoc* pDc);
575 String Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, sal_uInt16 nLang, const String& rName) const;
576 virtual SwFieldType* Copy() const;
579 class SW_DLLPUBLIC SwDocInfoField : public SwValueField
581 sal_uInt16 nSubType;
582 String aContent;
583 String aName;
585 virtual String Expand() const;
586 virtual SwField* Copy() const;
588 public:
589 SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt=0);
590 SwDocInfoField(SwDocInfoFieldType*, sal_uInt16 nSub, const String& rName, const String& rValue, sal_uInt32 nFmt=0);
592 virtual void SetSubType(sal_uInt16);
593 virtual sal_uInt16 GetSubType() const;
594 virtual void SetLanguage(sal_uInt16 nLng);
595 virtual String GetFieldName() const;
596 String GetName() const { return aName; }
597 void SetName( const String& rName ) { aName = rName; }
598 inline void SetExpansion(const String& rStr) { aContent = rStr; }
599 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
600 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
603 /*--------------------------------------------------------------------
604 Extended User settings.
605 --------------------------------------------------------------------*/
608 class SwExtUserFieldType : public SwFieldType
610 String aData;
611 public:
612 SwExtUserFieldType();
614 inline void SetData(const String& rStr) { aData = rStr; }
616 String Expand(sal_uInt16 nSubType, sal_uInt32 nFormat) const;
617 virtual SwFieldType* Copy() const;
620 class SwExtUserField : public SwField
622 String aContent;
623 sal_uInt16 nType;
625 public:
626 SwExtUserField(SwExtUserFieldType*, sal_uInt16 nSub, sal_uInt32 nFmt=0);
628 virtual String Expand() const;
629 virtual SwField* Copy() const;
631 virtual sal_uInt16 GetSubType() const;
632 virtual void SetSubType(sal_uInt16 nSub);
634 inline void SetExpansion(const String& rStr) { aContent = rStr; }
636 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
637 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
641 /*--------------------------------------------------------------------
642 Relative page numbers - field.
643 --------------------------------------------------------------------*/
645 class SwRefPageSetFieldType : public SwFieldType
647 public:
648 SwRefPageSetFieldType();
650 virtual SwFieldType* Copy() const;
652 protected:
653 /// Overlay, because there is nothing to update!
654 virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
657 /*--------------------------------------------------------------------
658 Relative page numbering.
659 --------------------------------------------------------------------*/
661 class SwRefPageSetField : public SwField
663 short nOffset;
664 sal_Bool bOn;
666 public:
667 SwRefPageSetField( SwRefPageSetFieldType*, short nOff = 0,
668 sal_Bool bOn = sal_True );
670 virtual String Expand() const;
671 virtual SwField* Copy() const;
673 virtual OUString GetPar2() const;
674 virtual void SetPar2(const OUString& rStr);
676 sal_Bool IsOn() const { return bOn; }
678 short GetOffset() const { return nOffset; }
679 void SetOffset( short nOff ) { nOffset = nOff; }
680 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
681 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
684 /*--------------------------------------------------------------------
685 Relative page numbers - query field.
686 --------------------------------------------------------------------*/
688 class SwRefPageGetFieldType : public SwFieldType
690 SwDoc* pDoc;
691 sal_Int16 nNumberingType;
693 void UpdateField( SwTxtFld* pTxtFld, _SetGetExpFlds& rSetList );
694 protected:
695 /// overwritten to update all RefPageGet fields
696 virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
697 public:
698 SwRefPageGetFieldType( SwDoc* pDoc );
699 virtual SwFieldType* Copy() const;
700 sal_uInt16 MakeSetList( _SetGetExpFlds& rTmpLst );
701 SwDoc* GetDoc() const { return pDoc; }
704 /*--------------------------------------------------------------------
705 Query relative page numbering.
706 --------------------------------------------------------------------*/
708 class SwRefPageGetField : public SwField
710 String sTxt;
711 public:
712 SwRefPageGetField( SwRefPageGetFieldType*, sal_uInt32 nFmt );
714 virtual String Expand() const;
715 virtual SwField* Copy() const;
717 void SetText( const String& rTxt ) { sTxt = rTxt; }
719 void ChangeExpansion( const SwFrm* pFrm, const SwTxtFld* pFld );
720 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
721 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
724 /*--------------------------------------------------------------------
725 Field to jump to and edit.
726 --------------------------------------------------------------------*/
728 class SwJumpEditFieldType : public SwFieldType
730 SwDoc* pDoc;
731 SwDepend aDep;
733 public:
734 SwJumpEditFieldType( SwDoc* pDoc );
735 virtual SwFieldType* Copy() const;
737 SwCharFmt* GetCharFmt();
740 class SwJumpEditField : public SwField
742 OUString sTxt, sHelp;
743 public:
744 SwJumpEditField( SwJumpEditFieldType*, sal_uInt32 nFormat,
745 const String& sText, const String& sHelp );
747 virtual String Expand() const;
748 virtual SwField* Copy() const;
750 /// Placeholder-Text
751 virtual const OUString& GetPar1() const;
752 virtual void SetPar1(const OUString& rStr);
754 /// Hint-Text
755 virtual OUString GetPar2() const;
756 virtual void SetPar2(const OUString& rStr);
758 SwCharFmt* GetCharFmt() const
759 { return ((SwJumpEditFieldType*)GetTyp())->GetCharFmt(); }
760 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
761 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
764 /*--------------------------------------------------------------------
765 Script Fieldtype.
766 --------------------------------------------------------------------*/
768 class SwScriptFieldType : public SwFieldType
770 SwDoc* pDoc;
771 public:
772 SwScriptFieldType( SwDoc* pDoc );
774 virtual SwFieldType* Copy() const;
777 /*--------------------------------------------------------------------
778 ScriptField.
779 --------------------------------------------------------------------*/
781 class SwScriptField : public SwField
783 OUString sType; ///< Type of Code (Java/VBScript/...)
784 OUString sCode; /**< Code as text.
785 Code as JavaCode ? */
787 sal_Bool bCodeURL; ///< Code contains URL of a script.
789 public:
790 SwScriptField( SwScriptFieldType*, const String& rType,
791 const String& rCode, sal_Bool bURL=sal_False );
793 virtual String GetDescription() const;
795 virtual String Expand() const;
796 virtual SwField* Copy() const;
798 /// Type
799 virtual const OUString& GetPar1() const;
800 virtual void SetPar1(const OUString& rStr);
801 /// Text
802 virtual OUString GetPar2() const;
803 virtual void SetPar2(const OUString& rStr);
805 sal_Bool IsCodeURL() const { return bCodeURL; }
806 void SetCodeURL( sal_Bool bURL ) { bCodeURL = bURL; }
807 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
808 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
811 /*--------------------------------------------------------------------
812 Combined Character Fieldtype
813 --------------------------------------------------------------------*/
815 class SwCombinedCharFieldType : public SwFieldType
817 public:
818 SwCombinedCharFieldType();
820 virtual SwFieldType* Copy() const;
823 /*--------------------------------------------------------------------
824 ScriptField
825 --------------------------------------------------------------------*/
827 #define MAX_COMBINED_CHARACTERS 6
829 class SW_DLLPUBLIC SwCombinedCharField : public SwField
831 OUString sCharacters; ///< combine these characters
833 public:
834 SwCombinedCharField( SwCombinedCharFieldType*, const String& rChars );
836 virtual String Expand() const;
837 virtual SwField* Copy() const;
839 /// Characters
840 virtual const OUString& GetPar1() const;
841 virtual void SetPar1(const OUString& rStr);
843 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
844 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
848 #endif // SW_DOCUFLD_HXX
850 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */