19#ifndef INCLUDED_SW_INC_FLDBAS_HXX
20#define INCLUDED_SW_INC_FLDBAS_HXX
28#include <com/sun/star/beans/XPropertySet.hpp>
255 static void GetFieldName_();
264 return m_wXFieldMaster;
271 virtual OUString
GetName()
const;
272 virtual std::unique_ptr<SwFieldType>
Copy()
const = 0;
273 virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich )
const;
274 virtual void PutValue(
const css::uno::Any& rVal, sal_uInt16 nWhich );
278 void PrintHiddenPara();
281 SwFormatField* FindFormatForPostItId(sal_uInt32 nPostItId)
const;
282 void CollectPostIts(std::vector<SwFormatField*>& rvFormatFields,
IDocumentRedlineAccess const& rIDRA,
bool HideRedlines);
283 bool HasHiddenInformationNotes()
const;
284 void GatherNodeIndex(std::vector<SwNodeOffset>& rvNodeIndex);
285 void GatherRefFields(std::vector<SwGetRefField*>& rvRFields,
const sal_uInt16 nTyp);
286 void GatherFields(std::vector<SwFormatField*>& rvFormatFields,
bool bCollectOnlyInDocNodes=
true)
const;
287 void GatherDdeTables(std::vector<SwDDETable*>& rvTables)
const;
288 void UpdateDocPos(
const SwTwips nDocPos);
289 virtual void UpdateFields();
308 virtual std::unique_ptr<SwField>
Copy()
const = 0;
316 sal_uInt32 nFormat = 0,
318 bool m_bUseFieldValueCache =
true );
343 OUString ExpandField(
bool bCached,
SwRootFrame const* pLayout)
const;
346 virtual OUString GetFieldName()
const;
348 std::unique_ptr<SwField> CopyField()
const;
356 return m_pType->
Which();
362 virtual sal_uInt16 GetSubType()
const;
363 virtual void SetSubType(sal_uInt16);
371 virtual OUString GetPar1()
const;
372 virtual OUString GetPar2()
const;
374 virtual OUString GetFormula()
const;
376 void ChangeFormat(sal_uInt32 n);
377 virtual void SetPar1(
const OUString& rStr);
378 virtual void SetPar2(
const OUString& rStr);
380 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhichId )
const;
381 virtual bool PutValue(
const css::uno::Any& rVal, sal_uInt16 nWhichId );
384 bool HasClickHdl()
const;
385 bool IsFixed()
const;
388 return m_bIsAutomaticLanguage;
391 m_bIsAutomaticLanguage = bSet;
396 bool IsClickable()
const;
398 const OUString &
GetTitle()
const {
return m_aTitle; }
399 void SetTitle(
const OUString& rTitle) { m_aTitle = rTitle; }
445 OUString
DoubleToString(
const double &rVal, sal_uInt32 nFormat)
const;
447 OUString
GetInputOrDateTime(
const OUString& rInput,
const double& rVal, sal_uInt32 nFormat )
const;
470 virtual void SetValue(
const double& rVal );
473 return static_cast<SwValueFieldType*
>(GetTyp())->ExpandValue(rVal, nFormat, nLng);
476 static sal_uInt32 GetSystemFormat(
SvNumberFormatter* pFormatter, sal_uInt32 nFormat);
490 virtual OUString GetFormula()
const override;
491 void SetFormula(
const OUString& rStr);
493 void SetExpandedFormula(
const OUString& rStr);
494 OUString GetExpandedFormula()
const;
497 OUString GetInputOrDateTime()
const;
Instances of SwFields and those derived from it occur 0 to n times.
unotools::WeakReference< SwXFieldMaster > const & GetXObject() const
virtual std::unique_ptr< SwFieldType > Copy() const =0
unotools::WeakReference< SwXFieldMaster > m_wXFieldMaster
static std::vector< OUString > * s_pFieldNames
field names
Base class of all fields.
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const =0
bool IsAutomaticLanguage() const
OUString m_Cache
Cached expansion (for clipboard).
OUString m_aTitle
Used for tooltip purposes when it's not-empty.
void SetFormat(sal_uInt32 const nSet)
LanguageType m_nLang
this can be either SvxNumType or SwChapterFormat depending on the subtype
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
SwField(SwField &&)=default
bool m_bIsAutomaticLanguage
control the usage of the cached field value
void SetTitle(const OUString &rTitle)
SwFieldType * GetTyp() const
LanguageType GetLanguage() const
Language at field position.
virtual std::unique_ptr< SwField > Copy() const =0
void SetAutomaticLanguage(bool const bSet)
bool m_bUseFieldValueCache
const OUString & GetTitle() const
SwField(SwField const &)=default
The root element of a Writer document layout.
Fields containing values that have to be formatted via number formatter.
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
return value formatted as string
SwValueFieldType(SwDoc *pDocPtr, SwFieldIds nWhichId)
void SetDoc(SwDoc *pNewDoc)
OUString DoubleToString(const double &rVal, LanguageType eLng) const
OUString GetInputOrDateTime(const OUString &rInput, const double &rVal, sal_uInt32 nFormat) const
Query input or formatted value for dialog.
bool m_bUseFormat
Use number formatter.
void EnableFormat(bool bFormat=true)
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
struct _xmlTextWriter * xmlTextWriterPtr
virtual OUString GetName() const override
virtual void GetDescription(OUString &rName) override
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
virtual void SetValue(tools::Long nNew) override
SwFieldTypesEnum
List of FieldTypes at UI.
OUString FormatNumber(sal_uInt32 nNum, SvxNumType nFormat, LanguageType nLang=LANGUAGE_NONE)
General tools.
sal_uInt16 SwExtendedSubType
struct _xmlTextWriter * xmlTextWriterPtr
@ VVF_CUR_XX_X0
EUR 1234.56 EUR 1234.–.
@ VVF_XX_X0_CUR
1234.56 EUR 1234.
@ VVF_SYS_CUR
Format for currency from system.
@ VVF_INVISIBLE
Invisible.
@ VVF_SYS
Format for numbers from system.
@ VVF_XX_XX_CUR
1234.56 EUR 1234.00 EUR
@ VVF_CUR_XX_XX
EUR 1234.56 EUR 1234.00.
sal_uInt16 SwGetSetExpType
SwFieldTypesEnum SwFieldTypeFromString(std::u16string_view rString)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void SetLanguage(SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
const SwExtendedSubType SUB_CMD
Show command.
const SwExtendedSubType SUB_INVISIBLE
Invisible.
const SwExtendedSubType SUB_OWN_FMT
SwDBField: Don't accept formatting from database.
const SwGetSetExpType GSE_SEQ
Sequence.
const SwGetSetExpType GSE_EXPR
Expression.
const SwGetSetExpType GSE_FORMULA
Formula.
const SwGetSetExpType GSE_STRING
String.
sal_uInt16 const m_nFormat
static LanguageType nLang