LibreOffice Module sw (master)  1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SwField Class Referenceabstract

Base class of all fields. More...

#include <fldbas.hxx>

Inheritance diagram for SwField:
[legend]
Collaboration diagram for SwField:
[legend]

Public Member Functions

virtual ~SwField ()
 
 SwField (SwField const &)=default
 
 SwField (SwField &&)=default
 
SwFieldoperator= (SwField const &)=default
 
SwFieldoperator= (SwField &&)=default
 
SwFieldTypeGetTyp () const
 
virtual SwFieldTypeChgTyp (SwFieldType *)
 Set new type (used for copying among documents). More...
 
OUString ExpandField (bool bCached, SwRootFrame const *pLayout) const
 expand the field. More...
 
virtual OUString GetFieldName () const
 get name or content More...
 
std::unique_ptr< SwFieldCopyField () const
 
SwFieldIds Which () const
 ResId. More...
 
sal_uInt16 GetTypeId () const
 
virtual sal_uInt16 GetSubType () const
 
virtual void SetSubType (sal_uInt16)
 
LanguageType GetLanguage () const
 Language at field position. More...
 
virtual void SetLanguage (LanguageType nLng)
 
sal_uInt32 GetFormat () const
 Query parameters for dialog and for BASIC. More...
 
virtual OUString GetPar1 () const
 
virtual OUString GetPar2 () const
 
virtual OUString GetFormula () const
 
void ChangeFormat (sal_uInt32 n)
 
virtual void SetPar1 (const OUString &rStr)
 
virtual void SetPar2 (const OUString &rStr)
 
virtual bool QueryValue (css::uno::Any &rVal, sal_uInt16 nWhichId) const
 
virtual bool PutValue (const css::uno::Any &rVal, sal_uInt16 nWhichId)
 
bool HasClickHdl () const
 Does the field possess an action on its ClickHandler? (e.g. INetFields, ...). More...
 
bool IsFixed () const
 
bool IsAutomaticLanguage () const
 
void SetAutomaticLanguage (bool const bSet)
 
virtual OUString GetDescription () const
 
bool IsClickable () const
 Is this field clickable? More...
 
virtual void dumpAsXml (xmlTextWriterPtr pWriter) const
 

Protected Member Functions

void SetFormat (sal_uInt32 const nSet)
 
 SwField (SwFieldType *pTyp, sal_uInt32 nFormat=0, LanguageType nLang=LANGUAGE_SYSTEM, bool m_bUseFieldValueCache=true)
 

Private Member Functions

virtual OUString ExpandImpl (SwRootFrame const *pLayout) const =0
 
virtual std::unique_ptr< SwFieldCopy () const =0
 

Private Attributes

OUString m_Cache
 Cached expansion (for clipboard). More...
 
bool m_bUseFieldValueCache
 
LanguageType m_nLang
 control the usage of the cached field value More...
 
bool m_bIsAutomaticLanguage
 
sal_uInt32 m_nFormat
 
SwFieldTypem_pType
 this can be either SvxNumType or SwChapterFormat depending on the subtype More...
 

Detailed Description

Base class of all fields.

Type of field is queried via Which. Expanded content of field is queried via ExpandField().

Definition at line 279 of file fldbas.hxx.

Constructor & Destructor Documentation

SwField::SwField ( SwFieldType pTyp,
sal_uInt32  nFormat = 0,
LanguageType  nLang = LANGUAGE_SYSTEM,
bool  m_bUseFieldValueCache = true 
)
protected

Definition at line 180 of file fldbas.cxx.

References m_pType.

SwField::~SwField ( )
virtual

Definition at line 195 of file fldbas.cxx.

SwField::SwField ( SwField const &  )
default
SwField::SwField ( SwField &&  )
default

Member Function Documentation

void SwField::ChangeFormat ( sal_uInt32  n)

Definition at line 375 of file fldbas.cxx.

References m_nFormat.

Referenced by SwDateTimeField::PutValue(), and SwDateTimeField::SwDateTimeField().

SwFieldType * SwField::ChgTyp ( SwFieldType pNewType)
virtual

Set new type (used for copying among documents).

Set a new type.

This is needed/used for copying between documents. Needs to be always of the same type.

Parameters
pNewTypeThe new type.
Returns
The old type.

Reimplemented in SwValueField, SwAuthorityField, and SwDBField.

Definition at line 338 of file fldbas.cxx.

References m_pType, and SwFieldType::Which().

Referenced by SwDoc::ChangeDBFields(), SwAuthorityField::ChgTyp(), SwValueField::ChgTyp(), SwTextField::CopyTextField(), and SwpHints::TryInsertHint().

virtual std::unique_ptr<SwField> SwField::Copy ( ) const
privatepure virtual
std::unique_ptr< SwField > SwField::CopyField ( ) const
void SwField::dumpAsXml ( xmlTextWriterPtr  pWriter) const
virtual
OUString SwField::ExpandField ( bool  bCached,
SwRootFrame const *  pLayout 
) const

expand the field.

Parameters
bCachedreturn cached field value.
Remarks
most callers should use the cached field value. this is because various fields need special handing (ChangeExpansion()) to return correct values, and only SwTextFormatter::NewFieldPortion() sets things up properly.
Parameters
pLayoutthe layout to use for expansion; there are a few fields that expand differently via layout mode.
Returns
the generated text (suitable for display)

Definition at line 412 of file fldbas.cxx.

References SwAuthorityField::ConditionalExpandAuthIdentifier(), ExpandImpl(), GetTypeId(), m_bUseFieldValueCache, m_Cache, and TYP_AUTHORITY.

Referenced by SwDoc::ConvertFieldsToText(), RtfExport::DoFormText(), WW8Export::DoFormText(), SwTextField::ExpandTextField(), SwDoc::FieldHidesPara(), sw::DocumentFieldsManager::FieldsToExpand(), SwTextInputField::GetFieldContent(), SwTextNode::GetMinMaxSize(), SwXTextField::getPresentation(), SwTextFrame::GetScalingOfSelectedText(), SwTableBox::GetValue(), lcl_ExportHints(), lcl_GetExpandedField(), lcl_GetText(), lcl_IsNoEndTextAttrAtPos(), SwTextFormatter::NewFieldPortion(), OutHTML_SwField(), SwEditWin::RequestHelp(), SwFieldInputDlg::SwFieldInputDlg(), sw::DocumentFieldsManager::UpdateExpFieldsImpl(), and RtfAttributeOutput::WriteField_Impl().

virtual OUString SwField::ExpandImpl ( SwRootFrame const *  pLayout) const
privatepure virtual
OUString SwField::GetDescription ( ) const
virtual

Reimplemented in SwScriptField, SwPostItField, SwAuthorityField, and SwGetRefField.

Definition at line 761 of file fldbas.cxx.

References SwResId().

Referenced by SwWrtShell::Insert().

OUString SwField::GetFieldName ( ) const
virtual
sal_uInt32 SwField::GetFormat ( ) const
inline

Query parameters for dialog and for BASIC.

Definition at line 387 of file fldbas.hxx.

References m_nFormat.

Referenced by SwGetExpField::ChangeExpansion(), SwDocStatField::ChangeExpansion(), SwRefPageGetField::ChangeExpansion(), SwValueField::ChgTyp(), SwDBField::ChgValue(), SwWrtShell::ClickToField(), SwDateTimeField::Copy(), SwDBField::Copy(), SwChapterField::Copy(), SwGetExpField::Copy(), SwGetRefField::Copy(), SwUserField::Copy(), SwPageNumberField::Copy(), SwAuthorField::Copy(), SwSetExpField::Copy(), SwFileNameField::Copy(), SwTemplNameField::Copy(), SwDBNameField::Copy(), SwDocStatField::Copy(), SwDBSetNumberField::Copy(), SwInputField::Copy(), SwHiddenTextField::Copy(), SwTableField::Copy(), SwDocInfoField::Copy(), SwExtUserField::Copy(), SwRefPageGetField::Copy(), SwJumpEditField::Copy(), SwDBField::Evaluate(), SwTextShell::ExecField(), SwTextShell::Execute(), SwDateTimeField::ExpandImpl(), SwChapterField::ExpandImpl(), SwUserField::ExpandImpl(), SwPageNumberField::ExpandImpl(), SwAuthorField::ExpandImpl(), SwFileNameField::ExpandImpl(), SwTemplNameField::ExpandImpl(), SwDocStatField::ExpandImpl(), SwDBSetNumberField::ExpandImpl(), SwDocInfoField::ExpandImpl(), SwFieldVarPage::FillFormatLB(), AttributeOutputBase::GenerateBookmarksForSequenceField(), SwFieldMgr::GetCurField(), SwFormulaField::GetExpandedFormula(), SwAccessibleParagraph::GetFieldTypeNameAtIndex(), MSWordExportBase::GetNumberFormat(), AttributeOutputBase::GetNumberPara(), SwUserField::GetPar2(), SwSetExpFieldType::GetSeqFormat(), IsFixed(), SwJavaEditDialog::IsUpdate(), SwTextFormatter::NewFieldPortion(), OutHTML_SwField(), SwAuthorField::PutValue(), SwFileNameField::PutValue(), SwExtUserField::PutValue(), SwDateTimeField::QueryValue(), SwChapterField::QueryValue(), SwDBField::QueryValue(), SwUserField::QueryValue(), SwGetExpField::QueryValue(), SwGetRefField::QueryValue(), SwPageNumberField::QueryValue(), SwAuthorField::QueryValue(), SwFileNameField::QueryValue(), SwTemplNameField::QueryValue(), SwSetExpField::QueryValue(), SwDocStatField::QueryValue(), SwDBSetNumberField::QueryValue(), SwTableField::QueryValue(), SwDocInfoField::QueryValue(), SwRefPageGetField::QueryValue(), SwJumpEditField::QueryValue(), SwFieldDokInfPage::Reset(), SwFieldDokPage::Reset(), SwFieldDBPage::Reset(), SwFieldVarPage::Reset(), SwFieldFuncPage::Reset(), SwFormulaField::SetExpandedFormula(), sw::DocumentFieldsManager::SetFixFields(), SwFormulaField::SetFormula(), SwValueField::SetLanguage(), SwDocInfoField::SetLanguage(), SwUserField::SetPar2(), SwGetExpField::SetValue(), SwSetExpField::SetValue(), SwTableField::SetValue(), SwAuthorField::SwAuthorField(), SwFileNameField::SwFileNameField(), AttributeOutputBase::TextField(), SwFieldDBPage::TypeHdl(), SwXTextField::update(), SwGetRefField::UpdateField(), and SwRefPageGetFieldType::UpdateField().

OUString SwField::GetFormula ( ) const
virtual

Reimplemented in SwFormulaField.

Definition at line 281 of file fldbas.cxx.

References GetPar2().

Referenced by SwDoc::ChangeDBFields(), and SwDoc::GetAllUsedDB().

LanguageType SwField::GetLanguage ( ) const
inline
OUString SwField::GetPar1 ( ) const
virtual
OUString SwField::GetPar2 ( ) const
virtual
sal_uInt16 SwField::GetSubType ( ) const
virtual
SwFieldType * SwField::GetTyp ( ) const
inline

Definition at line 382 of file fldbas.hxx.

References m_pType.

Referenced by SwInputField::applyFieldContent(), SwpHints::CalcFlags(), SwpHints::CalcHiddenParaField(), SwDoc::ChangeDBFields(), SwGetExpField::ChangeExpansion(), SwDocStatField::ChangeExpansion(), SwRefPageGetField::ChangeExpansion(), SwNodes::ChgNode(), SwAuthorityField::ChgTyp(), SwValueField::ChgTyp(), SwDBField::ChgValue(), SwWrtShell::ClickToField(), SwAuthorityField::ConditionalExpandAuthIdentifier(), SwDoc::ConvertFieldsToText(), SwGetRefField::ConvertProgrammaticToUIName(), SwDateTimeField::Copy(), SwDBField::Copy(), SwChapterField::Copy(), SwGetExpField::Copy(), SwGetRefField::Copy(), SwUserField::Copy(), SwDDEField::Copy(), SwAuthorityField::Copy(), SwPageNumberField::Copy(), SwDBNextSetField::Copy(), SwAuthorField::Copy(), SwDBNumSetField::Copy(), SwSetExpField::Copy(), SwFileNameField::Copy(), SwTemplNameField::Copy(), SwDBNameField::Copy(), SwDocStatField::Copy(), SwDBSetNumberField::Copy(), SwInputField::Copy(), SwHiddenTextField::Copy(), SwHiddenParaField::Copy(), SwTableField::Copy(), SwMacroField::Copy(), SwPostItField::Copy(), SwDocInfoField::Copy(), SwExtUserField::Copy(), SwRefPageSetField::Copy(), SwRefPageGetField::Copy(), SwJumpEditField::Copy(), SwScriptField::Copy(), SwCombinedCharField::Copy(), SwTextField::CopyTextField(), SwpHints::DeleteAtPos(), SwTextNode::DestroyAttr(), SwUndoFieldFromDoc::DoImpl(), sw::DropDownFieldDialog::DropDownFieldDialog(), SwDBField::Evaluate(), SwTextShell::ExecField(), SwAuthorityField::ExpandCitation(), SwUserField::ExpandImpl(), SwDDEField::ExpandImpl(), SwPageNumberField::ExpandImpl(), SwSetExpField::ExpandImpl(), SwFileNameField::ExpandImpl(), SwTemplNameField::ExpandImpl(), SwDBNameField::ExpandImpl(), SwDocStatField::ExpandImpl(), SwInputField::ExpandImpl(), SwHiddenTextField::ExpandImpl(), SwDocInfoField::ExpandImpl(), SwTextField::ExpandTextField(), SwValueField::ExpandValue(), SwDoc::FieldHidesPara(), sw::DocumentFieldsManager::FieldsToExpand(), SwTOXAuthority::FillText(), AttributeOutputBase::GenerateBookmarksForSequenceField(), SwDoc::GetAllUsedDB(), SwJumpEditField::GetCharFormat(), SwCursorShell::GetCurField(), SwDBField::GetDBData(), SwValueField::GetDoc(), SwFormulaField::GetExpandedFormula(), SwDBField::GetFieldName(), SwGetRefField::GetFieldName(), SwUserField::GetFieldName(), SwSetExpField::GetFieldName(), SwInputField::GetFieldName(), GetFieldName(), SwTableField::GetFieldName(), SwMacroField::GetFieldName(), SwXTextField::Impl::GetFieldType(), SwAccessibleParagraph::GetFieldTypeNameAtIndex(), SwTextShell::GetIdxState(), SwTableField::GetNodeOfFormula(), SwDBField::GetPar1(), SwDDEField::GetPar1(), SwUserField::GetPar1(), SwSetExpField::GetPar1(), SwDDEField::GetPar2(), SwUserField::GetPar2(), SwSetExpField::GetPar2(), sw::DocumentFieldsManager::GetRecordsPerDocument(), SwGetRefField::GetReferencedTextNode(), SwUserField::GetSubType(), SwSetExpField::GetSubType(), SwUserField::GetValue(), SwTableBox::GetValue(), SwFieldMgr::GoNextPrev(), IMPL_LINK(), SwDBField::InitContent(), SwAuthorMarkPane::InitControls(), SwDocUpdateField::InsDelFieldInFieldLst(), SwWrtShell::Insert(), SwTextNode::InsertHint(), SwWrtShell::InsertPostIt(), SwEditShell::IsFieldDataSourceAvailable(), SwTextFrame::IsHiddenNow(), SwSetExpField::IsSequenceField(), lcl_CopyHint(), lcl_FindInputField(), SwXFieldMaster::LocalizeFormula(), SwDocUpdateField::MakeFieldList_(), SwTextFormatter::NewFieldPortion(), IsPostitField::operator()(), IsPostitFieldWithAuthorOf::operator()(), IsPostitFieldWithPostitId::operator()(), OutHTML_SwField(), OutHTML_SwFormatField(), WW8Export::OutputField(), SwDBField::PutValue(), SwAuthorityField::PutValue(), SwSetExpField::PutValue(), SwAuthorityField::QueryValue(), SwPostItField::QueryValue(), DocxAttributeOutput::RefField(), SwFormulaField::SetExpandedFormula(), sw::DocumentFieldsManager::SetFixFields(), SwValueField::SetLanguage(), SwAuthorityField::SetPar1(), SwDDEField::SetPar2(), SwUserField::SetPar2(), SwSetExpField::SetPar2(), SwUserField::SetSubType(), SwSetExpField::SetSubType(), SwGetExpField::SetValue(), SwUserField::SetValue(), SwSetExpField::SetValue(), SwTableField::SetValue(), SwTOXAuthority::sort_lt(), SwTextShell::StateField(), SwFieldVarPage::SubTypeHdl(), SwDBField::SwDBField(), SwDocInfoField::SwDocInfoField(), SwFieldInputDlg::SwFieldInputDlg(), SwFileNameField::SwFileNameField(), SwFormatField::SwFormatField(), SwJavaEditDialog::SwJavaEditDialog(), AttributeOutputBase::TextField(), SwpHints::TryInsertHint(), SwFieldDBPage::TypeHdl(), SwXTextField::update(), sw::DocumentFieldsManager::UpdateExpFieldsImpl(), sw::DocumentFieldsManager::UpdateField(), SwGetRefField::UpdateField(), SwWrtShell::UpdateInputFields(), SwEditShell::UpdateOneField(), RtfAttributeOutput::WriteExpand(), DocxAttributeOutput::WriteField_Impl(), SwAuthorityField::~SwAuthorityField(), SwDBField::~SwDBField(), SwDDEField::~SwDDEField(), and SwHandleAnchorNodeChg::~SwHandleAnchorNodeChg().

sal_uInt16 SwField::GetTypeId ( ) const
bool SwField::HasClickHdl ( ) const

Does the field possess an action on its ClickHandler? (e.g. INetFields, ...).

Does the field have an action on a ClickHandler? (E.g. INetFields,...)

Definition at line 348 of file fldbas.cxx.

References Dropdown, GetRef, Input, Internet, JumpEdit, m_pType, Macro, SetExp, and SwFieldType::Which().

Referenced by SwCursorShell::GetContentAtPos().

bool SwField::IsAutomaticLanguage ( ) const
inline
bool SwField::IsClickable ( ) const

Is this field clickable?

Definition at line 766 of file fldbas.cxx.

References Dropdown, GetRef, Input, JumpEdit, Macro, SetExp, and Which().

Referenced by SwWrtShell::ClickToField(), and SwPageFrame::GetCursorOfst().

bool SwField::IsFixed ( ) const
SwField& SwField::operator= ( SwField const &  )
default
SwField& SwField::operator= ( SwField &&  )
default
bool SwField::PutValue ( const css::uno::Any &  rVal,
sal_uInt16  nWhichId 
)
virtual
bool SwField::QueryValue ( css::uno::Any &  rVal,
sal_uInt16  nWhichId 
) const
virtual
void SwField::SetAutomaticLanguage ( bool const  bSet)
inline

Definition at line 372 of file fldbas.hxx.

Referenced by SwWW8ImplReader::ForceFieldLanguage().

void SwField::SetFormat ( sal_uInt32 const  nSet)
inlineprotected
void SwField::SetLanguage ( LanguageType  nLng)
virtual
void SwField::SetPar1 ( const OUString &  rStr)
virtual
void SwField::SetPar2 ( const OUString &  rStr)
virtual
void SwField::SetSubType ( sal_uInt16  )
virtual
SwFieldIds SwField::Which ( ) const

Member Data Documentation

bool SwField::m_bIsAutomaticLanguage
private

Definition at line 285 of file fldbas.hxx.

Referenced by PutValue(), and QueryValue().

bool SwField::m_bUseFieldValueCache
private

Definition at line 283 of file fldbas.hxx.

Referenced by CopyField(), and ExpandField().

OUString SwField::m_Cache
mutableprivate

Cached expansion (for clipboard).

Definition at line 282 of file fldbas.hxx.

Referenced by CopyField(), and ExpandField().

sal_uInt32 SwField::m_nFormat
private

Definition at line 286 of file fldbas.hxx.

Referenced by ChangeFormat(), dumpAsXml(), and GetFormat().

LanguageType SwField::m_nLang
private

control the usage of the cached field value

Always change via SetLanguage!

Definition at line 284 of file fldbas.hxx.

Referenced by dumpAsXml(), GetLanguage(), and SetLanguage().

SwFieldType* SwField::m_pType
private

this can be either SvxNumType or SwChapterFormat depending on the subtype

Definition at line 287 of file fldbas.hxx.

Referenced by ChgTyp(), GetTyp(), GetTypeId(), HasClickHdl(), IsFixed(), SwField(), and Which().


The documentation for this class was generated from the following files: