1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_SW_INC_DOCUFLD_HXX
20 #define INCLUDED_SW_INC_DOCUFLD_HXX
22 #include <sal/config.h>
24 #include <string_view>
26 #include <editeng/outlobj.hxx>
27 #include <tools/solar.h>
28 #include <tools/date.hxx>
29 #include <tools/datetime.hxx>
30 #include <rtl/ref.hxx>
31 #include <svl/macitem.hxx>
35 class SetGetExpFields
;
38 class OutlinerParaObject
;
39 class SwTextAPIObject
;
50 // Subtype of document statistics.
63 typedef sal_uInt16 SwDocInfoSubType
;
64 namespace nsSwDocInfoSubType
66 /** NB: these must denote consecutive integers!
67 NB2: these are extended by 4 DI_INFO values for backward compatibility
68 in filter/html/htmlfld.cxx, so make sure that DI_SUBTYPE_END
69 really is the end, and is at least 4 less than DI_SUB_*! */
70 const SwDocInfoSubType DI_SUBTYPE_BEGIN
= 0;
71 const SwDocInfoSubType DI_TITLE
= DI_SUBTYPE_BEGIN
;
72 const SwDocInfoSubType DI_SUBJECT
= 1;
73 const SwDocInfoSubType DI_KEYS
= 2;
74 const SwDocInfoSubType DI_COMMENT
= 3;
75 const SwDocInfoSubType DI_CREATE
= 4;
76 const SwDocInfoSubType DI_CHANGE
= 5;
77 const SwDocInfoSubType DI_PRINT
= 6;
78 const SwDocInfoSubType DI_DOCNO
= 7;
79 const SwDocInfoSubType DI_EDIT
= 8;
80 const SwDocInfoSubType DI_CUSTOM
= 9;
81 const SwDocInfoSubType DI_SUBTYPE_END
= 10;
83 const SwDocInfoSubType DI_SUB_AUTHOR
= 0x0100;
84 const SwDocInfoSubType DI_SUB_TIME
= 0x0200;
85 const SwDocInfoSubType DI_SUB_DATE
= 0x0300;
86 const SwDocInfoSubType DI_SUB_FIXED
= 0x1000;
87 const SwDocInfoSubType DI_SUB_MASK
= 0x0f00;
97 // NOTE: Possibly the first 15 values in the below enum are required
98 // to exactly match the published constants in css::text::UserDataPart
99 // (see offapi/com/sun/star/text/UserDataPart.idl).
101 enum SwExtUserSubType
122 enum SwJumpEditFormat
131 class SAL_DLLPUBLIC_RTTI SwPageNumberFieldType final
: public SwFieldType
133 SvxNumType m_nNumberingType
;
137 SwPageNumberFieldType();
139 OUString
Expand( SvxNumType nFormat
, short nOff
, sal_uInt16
const nPageNumber
,
140 sal_uInt16
const nMaxPage
, const OUString
&, LanguageType
= LANGUAGE_NONE
) const;
141 void ChangeExpansion( SwDoc
* pDoc
,
142 bool bVirtPageNum
, const SvxNumType
* pNumFormat
);
143 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
147 class SW_DLLPUBLIC SwPageNumberField final
: public SwField
150 sal_uInt16 m_nSubType
;
152 // fdo#58074 store page number in SwField, not SwFieldType
153 sal_uInt16 m_nPageNumber
;
154 sal_uInt16 m_nMaxPage
;
157 SwPageNumberField(SwPageNumberFieldType
*, sal_uInt16 nSub
,
158 sal_uInt32 nFormat
, short nOff
= 0,
159 sal_uInt16
const nPageNumber
= 0,
160 sal_uInt16
const nMaxPage
= 0);
162 void ChangeExpansion(sal_uInt16
const nPageNumber
,
163 sal_uInt16
const nMaxPage
);
165 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
166 virtual std::unique_ptr
<SwField
> Copy() const override
;
168 virtual OUString
GetPar2() const override
;
169 virtual void SetPar2(const OUString
& rStr
) override
;
171 virtual sal_uInt16
GetSubType() const override
;
172 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
173 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
175 const OUString
& GetUserString() const { return m_sUserStr
; }
176 void SetUserString( const OUString
& rS
) { m_sUserStr
= rS
; }
179 class SwAuthorFieldType final
: public SwFieldType
184 static OUString
Expand(sal_uLong
);
185 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
188 class SwAuthorField final
: public SwField
193 SwAuthorField(SwAuthorFieldType
*, sal_uInt32 nFormat
);
195 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
196 virtual std::unique_ptr
<SwField
> Copy() const override
;
198 void SetExpansion(const OUString
& rStr
) { m_aContent
= rStr
; }
200 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
201 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
204 class SAL_DLLPUBLIC_RTTI SwFileNameFieldType final
: public SwFieldType
208 SwFileNameFieldType(SwDoc
&);
210 OUString
Expand(sal_uLong
) const;
211 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
214 class SW_DLLPUBLIC SwFileNameField final
: public SwField
219 SwFileNameField(SwFileNameFieldType
*, sal_uInt32 nFormat
);
221 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
222 virtual std::unique_ptr
<SwField
> Copy() const override
;
224 void SetExpansion(const OUString
& rStr
) { m_aContent
= rStr
; }
226 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
227 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
230 class SAL_DLLPUBLIC_RTTI SwTemplNameFieldType final
: public SwFieldType
234 SwTemplNameFieldType(SwDoc
&);
236 OUString
Expand(sal_uLong
) const;
237 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
240 class SW_DLLPUBLIC SwTemplNameField final
: public SwField
243 SwTemplNameField(SwTemplNameFieldType
*, sal_uInt32 nFormat
);
245 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
246 virtual std::unique_ptr
<SwField
> Copy() const override
;
247 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
248 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
251 // Document statistics
252 class SAL_DLLPUBLIC_RTTI SwDocStatFieldType final
: public SwFieldType
255 SvxNumType m_nNumberingType
;
258 SwDocStatFieldType(SwDoc
&);
259 OUString
Expand(sal_uInt16 nSubType
, SvxNumType nFormat
) const;
260 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
262 void SetNumFormat( SvxNumType eFormat
) { m_nNumberingType
= eFormat
; }
265 class SW_DLLPUBLIC SwDocStatField final
: public SwField
267 sal_uInt16 m_nSubType
;
270 SwDocStatField( SwDocStatFieldType
*,
271 sal_uInt16 nSubType
, sal_uInt32 nFormat
);
273 void ChangeExpansion( const SwFrame
* pFrame
);
275 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
276 virtual std::unique_ptr
<SwField
> Copy() const override
;
278 virtual sal_uInt16
GetSubType() const override
;
279 virtual void SetSubType(sal_uInt16 nSub
) override
;
280 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
281 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
284 class SAL_DLLPUBLIC_RTTI SwHiddenTextFieldType final
: public SwFieldType
288 SwHiddenTextFieldType(bool bSetHidden
= true);
290 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
291 virtual void UpdateFields() override
{};
293 void SetHiddenFlag( bool bSetHidden
);
294 bool GetHiddenFlag() const { return m_bHidden
; }
297 class SW_DLLPUBLIC SwHiddenTextField final
: public SwField
299 OUString m_aTRUEText
; ///< Text if condition true.
300 OUString m_aFALSEText
; ///< If condition false.
301 OUString m_aContent
; ///< Evaluated DB-text.
303 OUString m_aCond
; ///< Condition.
304 SwFieldTypesEnum m_nSubType
;
306 bool m_bCanToggle
: 1; ///< Can field be toggled alone?
307 bool m_bIsHidden
: 1; ///< Is it not visible?
308 bool m_bValid
: 1; ///< Is DB-field evaluated?
310 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
311 virtual std::unique_ptr
<SwField
> Copy() const override
;
314 SwHiddenTextField( SwHiddenTextFieldType
*,
317 const OUString
& rText
,
319 SwFieldTypesEnum nSubType
= SwFieldTypesEnum::HiddenText
);
321 SwHiddenTextField( SwHiddenTextFieldType
*,
325 SwFieldTypesEnum nSubType
= SwFieldTypesEnum::HiddenText
);
327 virtual OUString
GetFieldName() const override
;
329 void Evaluate(SwDoc
& rDoc
);
331 void SetValue(bool bHidden
) { m_bIsHidden
= bHidden
; }
332 static OUString
GetColumnName(const OUString
& rName
);
333 static OUString
GetDBName(std::u16string_view rName
, SwDoc
& rDoc
);
336 virtual void SetPar1(const OUString
& rStr
) override
;
337 virtual OUString
GetPar1() const override
;
339 /// True/False - String
340 virtual void SetPar2(const OUString
& rStr
) override
;
341 virtual OUString
GetPar2() const override
;
343 virtual sal_uInt16
GetSubType() const override
;
345 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
346 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
348 static void ParseIfFieldDefinition(std::u16string_view aFieldDefinition
,
349 OUString
& rCondition
,
354 // Field that expands to an empty line (without height).
355 class SwHiddenParaFieldType final
: public SwFieldType
358 SwHiddenParaFieldType();
360 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
361 virtual void UpdateFields() override
{};
364 class SwHiddenParaField final
: public SwField
369 /// Direct input, delete old value.
370 SwHiddenParaField(SwHiddenParaFieldType
*, OUString aCond
);
372 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
373 virtual std::unique_ptr
<SwField
> Copy() const override
;
375 void SetHidden(bool bHidden
) { m_bIsHidden
= bHidden
; }
376 bool IsHidden() const { return m_bIsHidden
; }
378 /// Query, set condition.
379 virtual OUString
GetPar1() const override
;
380 virtual void SetPar1(const OUString
& rStr
) override
;
381 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
382 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
385 class SAL_DLLPUBLIC_RTTI SwMacroFieldType final
: public SwFieldType
390 SwMacroFieldType(SwDoc
&);
392 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
395 class SW_DLLPUBLIC SwMacroField final
: public SwField
401 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
402 virtual std::unique_ptr
<SwField
> Copy() const override
;
405 /// Direct input, delete old value.
406 SwMacroField( SwMacroFieldType
*, OUString aLibAndName
,
409 const OUString
& GetMacro() const { return m_aMacro
; }
410 OUString
GetLibName() const;
411 OUString
GetMacroName() const;
412 SvxMacro
GetSvxMacro() const;
414 virtual OUString
GetFieldName() const override
;
416 /// Library and FileName
417 virtual OUString
GetPar1() const override
;
418 virtual void SetPar1(const OUString
& rStr
) override
;
421 virtual OUString
GetPar2() const override
;
422 virtual void SetPar2(const OUString
& rStr
) override
;
423 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
424 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
426 static void CreateMacroString( OUString
& rMacro
,
427 std::u16string_view rMacroName
,
428 const OUString
& rLibraryName
);
430 static bool isScriptURL( const OUString
& str
);
433 class SAL_DLLPUBLIC_RTTI SwPostItFieldType final
: public SwFieldType
438 SwPostItFieldType(SwDoc
& rDoc
);
440 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
442 SwDoc
& GetDoc() const
448 class SW_DLLPUBLIC SwPostItField final
: public SwField
452 OUString m_sInitials
; ///< Initials of the author.
453 OUString m_sName
; ///< Name of the comment.
454 DateTime m_aDateTime
;
456 std::optional
<OutlinerParaObject
> mpText
;
457 rtl::Reference
<SwTextAPIObject
> m_xTextObject
;
458 sal_uInt32 m_nPostItId
;
459 sal_uInt32 m_nParentId
;
460 sal_uInt32 m_nParaId
;
463 static sal_uInt32 s_nLastPostItId
;
465 SwPostItField( SwPostItFieldType
*,
470 const DateTime
& rDate
,
471 const bool bResolved
= false,
472 const sal_uInt32 nPostItId
= 0,
473 const sal_uInt32 nParentId
= 0,
474 const sal_uInt32 nParaId
= 0);
476 SwPostItField(const SwPostItField
&) = delete;
477 SwPostItField
* operator=(const SwPostItField
&) = delete;
479 virtual ~SwPostItField() override
;
481 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
482 virtual std::unique_ptr
<SwField
> Copy() const override
;
484 const DateTime
& GetDateTime() const { return m_aDateTime
; }
485 Date
GetDate() const { return Date(m_aDateTime
.GetDate()); }
486 tools::Time
GetTime() const { return tools::Time(m_aDateTime
.GetTime()); }
487 sal_uInt32
GetPostItId() const { return m_nPostItId
; }
488 void SetPostItId(const sal_uInt32 nPostItId
= 0);
489 sal_uInt32
GetParentId() const { return m_nParentId
; }
490 void SetParentId(const sal_uInt32 nParentId
);
491 sal_uInt32
GetParaId() const { return m_nParaId
; }
492 void SetParaId(const sal_uInt32 nParaId
);
495 virtual OUString
GetPar1() const override
;
496 virtual void SetPar1(const OUString
& rStr
) override
;
499 virtual OUString
GetPar2() const override
;
500 virtual void SetPar2(const OUString
& rStr
) override
;
501 const OUString
& GetText() const { return m_sText
; }
502 const OUString
& GetInitials() const { return m_sInitials
;}
503 void SetName(const OUString
& rStr
);
504 const OUString
& GetName() const { return m_sName
;}
506 const OutlinerParaObject
* GetTextObject() const { return mpText
? &*mpText
: nullptr;}
507 void SetTextObject( std::optional
<OutlinerParaObject
> pText
);
509 void SetResolved(bool bNewState
);
510 void ToggleResolved();
511 bool GetResolved() const;
513 sal_Int32
GetNumberOfParagraphs() const;
515 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
516 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
517 virtual OUString
GetDescription() const override
;
518 virtual void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
521 class SAL_DLLPUBLIC_RTTI SwDocInfoFieldType final
: public SwValueFieldType
524 SwDocInfoFieldType(SwDoc
* pDc
);
526 OUString
Expand(sal_uInt16 nSubType
, sal_uInt32 nFormat
, LanguageType nLang
, const OUString
& rName
) const;
527 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
530 class SW_DLLPUBLIC SwDocInfoField final
: public SwValueField
532 sal_uInt16 m_nSubType
;
536 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
537 virtual std::unique_ptr
<SwField
> Copy() const override
;
540 SwDocInfoField(SwDocInfoFieldType
*, sal_uInt16 nSub
, const OUString
& rName
, sal_uInt32 nFormat
=0);
541 SwDocInfoField(SwDocInfoFieldType
*, sal_uInt16 nSub
, const OUString
& rName
, const OUString
& rValue
, sal_uInt32 nFormat
=0);
543 virtual void SetSubType(sal_uInt16
) override
;
544 virtual sal_uInt16
GetSubType() const override
;
545 virtual void SetLanguage(LanguageType nLng
) override
;
546 virtual OUString
GetFieldName() const override
;
547 const OUString
& GetName() const { return m_aName
; }
548 void SetName( const OUString
& rName
) { m_aName
= rName
; }
549 void SetExpansion(const OUString
& rStr
) { m_aContent
= rStr
; }
550 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
551 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
554 // Extended User settings.
555 class SwExtUserFieldType final
: public SwFieldType
558 SwExtUserFieldType();
560 static OUString
Expand(sal_uInt16 nSubType
);
561 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
564 class SwExtUserField final
: public SwField
570 SwExtUserField(SwExtUserFieldType
*, sal_uInt16 nSub
, sal_uInt32 nFormat
);
572 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
573 virtual std::unique_ptr
<SwField
> Copy() const override
;
575 virtual sal_uInt16
GetSubType() const override
;
576 virtual void SetSubType(sal_uInt16 nSub
) override
;
578 void SetExpansion(const OUString
& rStr
) { m_aContent
= rStr
; }
580 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
581 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
584 // Relative page numbers - field.
585 class SwRefPageSetFieldType final
: public SwFieldType
588 SwRefPageSetFieldType();
590 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
591 virtual void UpdateFields() override
{};
594 /// noop, there is nothing to update!
595 virtual void SwClientNotify(const SwModify
&, const SfxHint
&) override
;
598 // Relative page numbering.
599 class SAL_DLLPUBLIC_RTTI SwRefPageSetField final
: public SwField
605 SwRefPageSetField( SwRefPageSetFieldType
*, short nOff
, bool bOn
);
607 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
608 virtual std::unique_ptr
<SwField
> Copy() const override
;
610 virtual OUString
GetPar2() const override
;
611 virtual void SetPar2(const OUString
& rStr
) override
;
613 bool IsOn() const { return m_bOn
; }
615 short GetOffset() const { return m_nOffset
; }
616 void SetOffset( short nOff
) { m_nOffset
= nOff
; }
617 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
618 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
621 // Relative page numbers - query field.
622 class SwRefPageGetFieldType final
: public SwFieldType
625 sal_Int16 m_nNumberingType
;
627 void UpdateField(SwTextField
const * pTextField
,
628 SetGetExpFields
const & rSetList
, SwRootFrame
const* pLayout
);
630 /// overwritten to update all RefPageGet fields
631 virtual void SwClientNotify(const SwModify
&, const SfxHint
&) override
;
633 SwRefPageGetFieldType( SwDoc
& rDoc
);
634 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
635 bool MakeSetList(SetGetExpFields
& rTmpLst
, SwRootFrame
const* pLayout
);
636 SwDoc
& GetDoc() const { return m_rDoc
; }
639 // Query relative page numbering.
640 class SwRefPageGetField final
: public SwField
643 OUString m_sTextRLHidden
; ///< hidden redlines
646 SwRefPageGetField( SwRefPageGetFieldType
*, sal_uInt32 nFormat
);
648 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
649 virtual std::unique_ptr
<SwField
> Copy() const override
;
651 void SetText(const OUString
& rText
, SwRootFrame
const* pLayout
);
653 void ChangeExpansion(const SwFrame
& rFrame
, const SwTextField
* pField
);
654 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
655 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
658 // Field to jump to and edit.
659 class SwJumpEditFieldType final
: public SwFieldType
662 sw::WriterMultiListener m_aDep
;
665 SwJumpEditFieldType( SwDoc
& rDoc
);
666 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
667 virtual void UpdateFields() override
{};
669 SwCharFormat
* GetCharFormat();
672 class SwJumpEditField final
: public SwField
677 SwJumpEditField( SwJumpEditFieldType
*, sal_uInt32 nFormat
,
678 OUString sText
, OUString sHelp
);
680 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
681 virtual std::unique_ptr
<SwField
> Copy() const override
;
684 virtual OUString
GetPar1() const override
;
685 virtual void SetPar1(const OUString
& rStr
) override
;
688 virtual OUString
GetPar2() const override
;
689 virtual void SetPar2(const OUString
& rStr
) override
;
691 SwCharFormat
* GetCharFormat() const
692 { return static_cast<SwJumpEditFieldType
*>(GetTyp())->GetCharFormat(); }
693 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
694 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
697 class SwScriptFieldType final
: public SwFieldType
701 SwScriptFieldType( SwDoc
& rDoc
);
703 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
706 class SW_DLLPUBLIC SwScriptField final
: public SwField
708 OUString m_sType
; ///< Type of Code (Java/VBScript/...)
709 OUString m_sCode
; /**< Code as text.
710 Code as JavaCode ? */
712 bool m_bCodeURL
; ///< Code contains URL of a script.
715 SwScriptField( SwScriptFieldType
*, OUString aType
,
716 OUString aCode
, bool bURL
);
718 virtual OUString
GetDescription() const override
;
720 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
721 virtual std::unique_ptr
<SwField
> Copy() const override
;
724 virtual OUString
GetPar1() const override
;
725 virtual void SetPar1(const OUString
& rStr
) override
;
727 virtual OUString
GetPar2() const override
;
728 virtual void SetPar2(const OUString
& rStr
) override
;
730 bool IsCodeURL() const { return m_bCodeURL
; }
731 void SetCodeURL( bool bURL
) { m_bCodeURL
= bURL
; }
732 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
733 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
736 // Combined Character Fieldtype
737 class SAL_DLLPUBLIC_RTTI SwCombinedCharFieldType final
: public SwFieldType
740 SwCombinedCharFieldType();
742 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
746 #define MAX_COMBINED_CHARACTERS 6
748 class SW_DLLPUBLIC SwCombinedCharField final
: public SwField
750 OUString m_sCharacters
; ///< combine these characters
753 SwCombinedCharField( SwCombinedCharFieldType
*, const OUString
& rChars
);
755 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
756 virtual std::unique_ptr
<SwField
> Copy() const override
;
759 virtual OUString
GetPar1() const override
;
760 virtual void SetPar1(const OUString
& rStr
) override
;
762 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
763 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
766 #endif // INCLUDED_SW_INC_DOCUFLD_HXX
768 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */