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
*,
316 const OUString
& rCond
,
317 const OUString
& rText
,
319 SwFieldTypesEnum nSubType
= SwFieldTypesEnum::HiddenText
);
321 SwHiddenTextField( SwHiddenTextFieldType
*,
322 const OUString
& rCond
,
323 const OUString
& rTrue
,
324 const OUString
& rFalse
,
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(const OUString
& 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
*, const OUString
& rCond
);
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
*, const OUString
& rLibAndName
,
407 const OUString
& rText
);
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
;
461 static sal_uInt32 s_nLastPostItId
;
463 SwPostItField( SwPostItFieldType
*,
464 const OUString
& rAuthor
,
465 const OUString
& rText
,
466 const OUString
& rInitials
,
467 const OUString
& rName
,
468 const DateTime
& rDate
,
469 const bool bResolved
= false,
470 const sal_uInt32 nPostItId
= 0);
472 SwPostItField(const SwPostItField
&) = delete;
473 SwPostItField
* operator=(const SwPostItField
&) = delete;
475 virtual ~SwPostItField() override
;
477 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
478 virtual std::unique_ptr
<SwField
> Copy() const override
;
480 const DateTime
& GetDateTime() const { return m_aDateTime
; }
481 Date
GetDate() const { return Date(m_aDateTime
.GetDate()); }
482 tools::Time
GetTime() const { return tools::Time(m_aDateTime
.GetTime()); }
483 sal_uInt32
GetPostItId() const { return m_nPostItId
; }
484 void SetPostItId(const sal_uInt32 nPostItId
= 0);
487 virtual OUString
GetPar1() const override
;
488 virtual void SetPar1(const OUString
& rStr
) override
;
491 virtual OUString
GetPar2() const override
;
492 virtual void SetPar2(const OUString
& rStr
) override
;
493 const OUString
& GetText() const { return m_sText
; }
494 const OUString
& GetInitials() const { return m_sInitials
;}
495 void SetName(const OUString
& rStr
);
496 const OUString
& GetName() const { return m_sName
;}
498 const OutlinerParaObject
* GetTextObject() const { return mpText
? &*mpText
: nullptr;}
499 void SetTextObject( std::optional
<OutlinerParaObject
> pText
);
501 void SetResolved(bool bNewState
);
502 void ToggleResolved();
503 bool GetResolved() const;
505 sal_Int32
GetNumberOfParagraphs() const;
507 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
508 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
509 virtual OUString
GetDescription() const override
;
510 virtual void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
513 class SAL_DLLPUBLIC_RTTI SwDocInfoFieldType final
: public SwValueFieldType
516 SwDocInfoFieldType(SwDoc
* pDc
);
518 OUString
Expand(sal_uInt16 nSubType
, sal_uInt32 nFormat
, LanguageType nLang
, const OUString
& rName
) const;
519 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
522 class SW_DLLPUBLIC SwDocInfoField final
: public SwValueField
524 sal_uInt16 m_nSubType
;
528 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
529 virtual std::unique_ptr
<SwField
> Copy() const override
;
532 SwDocInfoField(SwDocInfoFieldType
*, sal_uInt16 nSub
, const OUString
& rName
, sal_uInt32 nFormat
=0);
533 SwDocInfoField(SwDocInfoFieldType
*, sal_uInt16 nSub
, const OUString
& rName
, const OUString
& rValue
, sal_uInt32 nFormat
=0);
535 virtual void SetSubType(sal_uInt16
) override
;
536 virtual sal_uInt16
GetSubType() const override
;
537 virtual void SetLanguage(LanguageType nLng
) override
;
538 virtual OUString
GetFieldName() const override
;
539 const OUString
& GetName() const { return m_aName
; }
540 void SetName( const OUString
& rName
) { m_aName
= rName
; }
541 void SetExpansion(const OUString
& rStr
) { m_aContent
= rStr
; }
542 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
543 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
546 // Extended User settings.
547 class SwExtUserFieldType final
: public SwFieldType
550 SwExtUserFieldType();
552 static OUString
Expand(sal_uInt16 nSubType
);
553 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
556 class SwExtUserField final
: public SwField
562 SwExtUserField(SwExtUserFieldType
*, sal_uInt16 nSub
, sal_uInt32 nFormat
);
564 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
565 virtual std::unique_ptr
<SwField
> Copy() const override
;
567 virtual sal_uInt16
GetSubType() const override
;
568 virtual void SetSubType(sal_uInt16 nSub
) override
;
570 void SetExpansion(const OUString
& rStr
) { m_aContent
= rStr
; }
572 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
573 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
576 // Relative page numbers - field.
577 class SwRefPageSetFieldType final
: public SwFieldType
580 SwRefPageSetFieldType();
582 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
583 virtual void UpdateFields() override
{};
586 /// noop, there is nothing to update!
587 virtual void SwClientNotify(const SwModify
&, const SfxHint
&) override
;
590 // Relative page numbering.
591 class SAL_DLLPUBLIC_RTTI SwRefPageSetField final
: public SwField
597 SwRefPageSetField( SwRefPageSetFieldType
*, short nOff
, bool bOn
);
599 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
600 virtual std::unique_ptr
<SwField
> Copy() const override
;
602 virtual OUString
GetPar2() const override
;
603 virtual void SetPar2(const OUString
& rStr
) override
;
605 bool IsOn() const { return m_bOn
; }
607 short GetOffset() const { return m_nOffset
; }
608 void SetOffset( short nOff
) { m_nOffset
= nOff
; }
609 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
610 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
613 // Relative page numbers - query field.
614 class SwRefPageGetFieldType final
: public SwFieldType
617 sal_Int16 m_nNumberingType
;
619 void UpdateField(SwTextField
const * pTextField
,
620 SetGetExpFields
const & rSetList
, SwRootFrame
const* pLayout
);
622 /// overwritten to update all RefPageGet fields
623 virtual void SwClientNotify(const SwModify
&, const SfxHint
&) override
;
625 SwRefPageGetFieldType( SwDoc
& rDoc
);
626 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
627 bool MakeSetList(SetGetExpFields
& rTmpLst
, SwRootFrame
const* pLayout
);
628 SwDoc
& GetDoc() const { return m_rDoc
; }
631 // Query relative page numbering.
632 class SwRefPageGetField final
: public SwField
635 OUString m_sTextRLHidden
; ///< hidden redlines
638 SwRefPageGetField( SwRefPageGetFieldType
*, sal_uInt32 nFormat
);
640 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
641 virtual std::unique_ptr
<SwField
> Copy() const override
;
643 void SetText(const OUString
& rText
, SwRootFrame
const* pLayout
);
645 void ChangeExpansion(const SwFrame
& rFrame
, const SwTextField
* pField
);
646 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
647 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
650 // Field to jump to and edit.
651 class SwJumpEditFieldType final
: public SwFieldType
654 sw::WriterMultiListener m_aDep
;
657 SwJumpEditFieldType( SwDoc
& rDoc
);
658 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
659 virtual void UpdateFields() override
{};
661 SwCharFormat
* GetCharFormat();
664 class SwJumpEditField final
: public SwField
669 SwJumpEditField( SwJumpEditFieldType
*, sal_uInt32 nFormat
,
670 const OUString
& sText
, const OUString
& sHelp
);
672 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
673 virtual std::unique_ptr
<SwField
> Copy() const override
;
676 virtual OUString
GetPar1() const override
;
677 virtual void SetPar1(const OUString
& rStr
) override
;
680 virtual OUString
GetPar2() const override
;
681 virtual void SetPar2(const OUString
& rStr
) override
;
683 SwCharFormat
* GetCharFormat() const
684 { return static_cast<SwJumpEditFieldType
*>(GetTyp())->GetCharFormat(); }
685 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
686 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
689 class SwScriptFieldType final
: public SwFieldType
693 SwScriptFieldType( SwDoc
& rDoc
);
695 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
698 class SW_DLLPUBLIC SwScriptField final
: public SwField
700 OUString m_sType
; ///< Type of Code (Java/VBScript/...)
701 OUString m_sCode
; /**< Code as text.
702 Code as JavaCode ? */
704 bool m_bCodeURL
; ///< Code contains URL of a script.
707 SwScriptField( SwScriptFieldType
*, const OUString
& rType
,
708 const OUString
& rCode
, bool bURL
);
710 virtual OUString
GetDescription() const override
;
712 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
713 virtual std::unique_ptr
<SwField
> Copy() const override
;
716 virtual OUString
GetPar1() const override
;
717 virtual void SetPar1(const OUString
& rStr
) override
;
719 virtual OUString
GetPar2() const override
;
720 virtual void SetPar2(const OUString
& rStr
) override
;
722 bool IsCodeURL() const { return m_bCodeURL
; }
723 void SetCodeURL( bool bURL
) { m_bCodeURL
= bURL
; }
724 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
725 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
728 // Combined Character Fieldtype
729 class SAL_DLLPUBLIC_RTTI SwCombinedCharFieldType final
: public SwFieldType
732 SwCombinedCharFieldType();
734 virtual std::unique_ptr
<SwFieldType
> Copy() const override
;
738 #define MAX_COMBINED_CHARACTERS 6
740 class SW_DLLPUBLIC SwCombinedCharField final
: public SwField
742 OUString m_sCharacters
; ///< combine these characters
745 SwCombinedCharField( SwCombinedCharFieldType
*, const OUString
& rChars
);
747 virtual OUString
ExpandImpl(SwRootFrame
const* pLayout
) const override
;
748 virtual std::unique_ptr
<SwField
> Copy() const override
;
751 virtual OUString
GetPar1() const override
;
752 virtual void SetPar1(const OUString
& rStr
) override
;
754 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt16 nWhich
) const override
;
755 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt16 nWhich
) override
;
758 #endif // INCLUDED_SW_INC_DOCUFLD_HXX
760 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */