19#ifndef INCLUDED_SW_INC_FLDBAS_HXX
20#define INCLUDED_SW_INC_FLDBAS_HXX
27#include <com/sun/star/beans/XPropertySet.hpp>
251 static void GetFieldName_();
259 SAL_DLLPRIVATE css::uno::WeakReference<css::beans::XPropertySet>
const&
GetXObject()
const {
260 return m_wXFieldMaster;
262 SAL_DLLPRIVATE
void SetXObject(css::uno::Reference<css::beans::XPropertySet>
const& xFieldMaster) {
263 m_wXFieldMaster = xFieldMaster;
269 virtual OUString
GetName()
const;
270 virtual std::unique_ptr<SwFieldType>
Copy()
const = 0;
271 virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich )
const;
272 virtual void PutValue(
const css::uno::Any& rVal, sal_uInt16 nWhich );
276 void PrintHiddenPara();
279 SwFormatField* FindFormatForPostItId(sal_uInt32 nPostItId)
const;
280 void CollectPostIts(std::vector<SwFormatField*>& rvFormatFields,
IDocumentRedlineAccess const& rIDRA,
bool HideRedlines);
281 bool HasHiddenInformationNotes()
const;
282 void GatherNodeIndex(std::vector<SwNodeOffset>& rvNodeIndex);
283 void GatherRefFields(std::vector<SwGetRefField*>& rvRFields,
const sal_uInt16 nTyp);
284 void GatherFields(std::vector<SwFormatField*>& rvFormatFields,
bool bCollectOnlyInDocNodes=
true)
const;
285 void GatherDdeTables(std::vector<SwDDETable*>& rvTables)
const;
286 virtual void UpdateFields();
305 virtual std::unique_ptr<SwField>
Copy()
const = 0;
313 sal_uInt32 nFormat = 0,
315 bool m_bUseFieldValueCache =
true );
340 OUString ExpandField(
bool bCached,
SwRootFrame const* pLayout)
const;
343 virtual OUString GetFieldName()
const;
345 std::unique_ptr<SwField> CopyField()
const;
353 return m_pType->
Which();
359 virtual sal_uInt16 GetSubType()
const;
360 virtual void SetSubType(sal_uInt16);
368 virtual OUString GetPar1()
const;
369 virtual OUString GetPar2()
const;
371 virtual OUString GetFormula()
const;
373 void ChangeFormat(sal_uInt32 n);
374 virtual void SetPar1(
const OUString& rStr);
375 virtual void SetPar2(
const OUString& rStr);
377 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt16 nWhichId )
const;
378 virtual bool PutValue(
const css::uno::Any& rVal, sal_uInt16 nWhichId );
381 bool HasClickHdl()
const;
382 bool IsFixed()
const;
385 return m_bIsAutomaticLanguage;
388 m_bIsAutomaticLanguage = bSet;
393 bool IsClickable()
const;
395 const OUString &
GetTitle()
const {
return m_aTitle; }
396 void SetTitle(
const OUString& rTitle) { m_aTitle = rTitle; }
442 OUString
DoubleToString(
const double &rVal, sal_uInt32 nFormat)
const;
465 virtual void SetValue(
const double& rVal );
468 return static_cast<SwValueFieldType*
>(GetTyp())->ExpandValue(rVal, nFormat, nLng);
471 static sal_uInt32 GetSystemFormat(
SvNumberFormatter* pFormatter, sal_uInt32 nFormat);
485 virtual OUString GetFormula()
const override;
486 void SetFormula(
const OUString& rStr);
488 void SetExpandedFormula(
const OUString& rStr);
489 OUString GetExpandedFormula()
const;
struct _xmlTextWriter * xmlTextWriterPtr
Instances of SwFields and those derived from it occur 0 to n times.
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::beans::XPropertySet > const &xFieldMaster)
SAL_DLLPRIVATE css::uno::WeakReference< css::beans::XPropertySet > const & GetXObject() const
css::uno::WeakReference< css::beans::XPropertySet > m_wXFieldMaster
virtual std::unique_ptr< SwFieldType > Copy() const =0
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
bool m_bUseFormat
Use number formatter.
void EnableFormat(bool bFormat=true)
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
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