LibreOffice Module sw (master) 1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwAuthorityField Class Referencefinal

Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bibliography Entry. More...

#include <authfld.hxx>

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

Public Types

enum  TargetType : sal_uInt16 {
  UseDisplayURL = 0 ,
  UseTargetURL = 1 ,
  None = 2 ,
  BibliographyTableRow = 3
}
 

Public Member Functions

OUString ConditionalExpandAuthIdentifier (SwRootFrame const *pLayout) const
 For internal use only, in general continue using ExpandField() instead. More...
 
OUString ExpandCitation (ToxAuthorityField eField, SwRootFrame const *pLayout) const
 
 SwAuthorityField (SwAuthorityFieldType *pType, std::u16string_view rFieldContents)
 
 SwAuthorityField (SwAuthorityFieldType *pType, SwAuthEntry *pAuthEntry)
 
virtual ~SwAuthorityField () override
 
const OUString & GetFieldText (ToxAuthorityField eField) const
 
virtual void SetPar1 (const OUString &rStr) override
 
virtual SwFieldTypeChgTyp (SwFieldType *) override
 Set new type (used for copying among documents). More...
 
virtual bool QueryValue (css::uno::Any &rVal, sal_uInt16 nWhichId) const override
 
virtual bool PutValue (const css::uno::Any &rVal, sal_uInt16 nWhichId) override
 
SwAuthEntryGetAuthEntry () const
 
virtual OUString GetDescription () const override
 
OUString GetAuthority (const SwRootFrame *pLayout, const SwForm *pTOX=nullptr) const
 Returns the line matching the source's default row in the ToX. More...
 
TargetType GetTargetType () const
 Returns which target should be used when the entry (the standalone field, such as '[ASDF]', not in the table) is clicked. More...
 
OUString GetAbsoluteURL () const
 Returns absolute target URL in case there is one (GetTargetType() should be checked). More...
 
OUString GetRelativeURI () const
 Returns relative URI for the URL. More...
 
void dumpAsXml (xmlTextWriterPtr pWriter) const override
 
- Public Member Functions inherited from SwField
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...
 
SwFieldTypesEnum 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
 
const OUString & GetTitle () const
 
void SetTitle (const OUString &rTitle)
 

Private Member Functions

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

Private Attributes

rtl::Reference< SwAuthEntrym_xAuthEntry
 
sal_IntPtr m_nTempSequencePos
 
sal_IntPtr m_nTempSequencePosRLHidden
 hidden redlines More...
 

Additional Inherited Members

- Protected Member Functions inherited from SwField
void SetFormat (sal_uInt32 const nSet)
 
 SwField (SwFieldType *pTyp, sal_uInt32 nFormat=0, LanguageType nLang=LANGUAGE_SYSTEM, bool m_bUseFieldValueCache=true)
 

Detailed Description

Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bibliography Entry.

invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddField()/RemoveField() & therefore has m_nHandle set - but it's possible that multiple SwAuthorityField have the same m_nHandle & so the number of instances is an upper bound on SwAuthorityField::m_DataArr.size() - it's not clear to me if more than one one of the instances with the same m_nHandle is actually in the document, they're all cloned via CopyField()...

Definition at line 160 of file authfld.hxx.

Member Enumeration Documentation

◆ TargetType

enum SwAuthorityField::TargetType : sal_uInt16
Enumerator
UseDisplayURL 
UseTargetURL 
None 
BibliographyTableRow 

Definition at line 170 of file authfld.hxx.

Constructor & Destructor Documentation

◆ SwAuthorityField() [1/2]

SwAuthorityField::SwAuthorityField ( SwAuthorityFieldType pType,
std::u16string_view  rFieldContents 
)

Definition at line 457 of file authfld.cxx.

References SwAuthorityFieldType::AddField(), and m_xAuthEntry.

◆ SwAuthorityField() [2/2]

SwAuthorityField::SwAuthorityField ( SwAuthorityFieldType pType,
SwAuthEntry pAuthEntry 
)

Definition at line 466 of file authfld.cxx.

◆ ~SwAuthorityField()

SwAuthorityField::~SwAuthorityField ( )
overridevirtual

Definition at line 475 of file authfld.cxx.

References SwField::GetTyp(), and m_xAuthEntry.

Member Function Documentation

◆ ChgTyp()

SwFieldType * SwAuthorityField::ChgTyp ( SwFieldType pNewType)
overridevirtual

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 from SwField.

Definition at line 844 of file authfld.cxx.

References SwField::ChgTyp(), SwField::GetTyp(), m_xAuthEntry, and SwAuthorityFieldType::RemoveField().

◆ ConditionalExpandAuthIdentifier()

OUString SwAuthorityField::ConditionalExpandAuthIdentifier ( SwRootFrame const *  pLayout) const

◆ Copy()

std::unique_ptr< SwField > SwAuthorityField::Copy ( ) const
overrideprivatevirtual

Implements SwField.

Definition at line 544 of file authfld.cxx.

References SwField::GetTyp(), and m_xAuthEntry.

◆ dumpAsXml()

void SwAuthorityField::dumpAsXml ( xmlTextWriterPtr  pWriter) const
overridevirtual

Reimplemented from SwField.

Definition at line 700 of file authfld.cxx.

References SwField::dumpAsXml(), m_nTempSequencePos, m_nTempSequencePosRLHidden, and m_xAuthEntry.

◆ ExpandCitation()

OUString SwAuthorityField::ExpandCitation ( ToxAuthorityField  eField,
SwRootFrame const *  pLayout 
) const

◆ ExpandImpl()

OUString SwAuthorityField::ExpandImpl ( SwRootFrame const *  pLayout) const
overrideprivatevirtual

Implements SwField.

Definition at line 480 of file authfld.cxx.

References ConditionalExpandAuthIdentifier().

◆ GetAbsoluteURL()

OUString SwAuthorityField::GetAbsoluteURL ( ) const

◆ GetAuthEntry()

SwAuthEntry * SwAuthorityField::GetAuthEntry ( ) const
inline

◆ GetAuthority()

OUString SwAuthorityField::GetAuthority ( const SwRootFrame pLayout,
const SwForm pTOX = nullptr 
) const

Returns the line matching the source's default row in the ToX.

Parameters
pLayoutlayout to be used
pTOXbibliography table to take the format of the string from
Returns
entry formatted as the appropriate authority type in the table

Definition at line 567 of file authfld.cxx.

References AUTH_FIELD_AUTHORITY_TYPE, AUTH_FIELD_IDENTIFIER, AUTH_FIELD_URL, AUTH_TYPE_ARTICLE, AUTH_TYPE_END, SwAuthorityFieldType::CreateTOXInternational(), SwField::ExpandField(), SwAuthorityFieldType::GetAuthTypeName(), GetFieldText(), SwForm::GetPattern(), SwAuthorityFieldType::GetPrefix(), GetRelativeURI(), SwAuthorityFieldType::GetSuffix(), SwField::GetTyp(), TOKEN_AUTHORITY, TOKEN_TAB_STOP, TOKEN_TEXT, and TOX_AUTHORITIES.

Referenced by SwWrtShell::ClickToField(), and SwEditWin::RequestHelp().

◆ GetDescription()

OUString SwAuthorityField::GetDescription ( ) const
overridevirtual

Reimplemented from SwField.

Definition at line 562 of file authfld.cxx.

References SwResId().

◆ GetFieldText()

const OUString & SwAuthorityField::GetFieldText ( ToxAuthorityField  eField) const

◆ GetRelativeURI()

OUString SwAuthorityField::GetRelativeURI ( ) const

◆ GetTargetType()

SwAuthorityField::TargetType SwAuthorityField::GetTargetType ( ) const

Returns which target should be used when the entry (the standalone field, such as '[ASDF]', not in the table) is clicked.

Definition at line 642 of file authfld.cxx.

References AUTH_FIELD_TARGET_TYPE, GetAuthEntry(), and toInt32().

Referenced by SwWrtShell::ClickToField(), and GetAbsoluteURL().

◆ PutValue()

bool SwAuthorityField::PutValue ( const css::uno::Any &  rVal,
sal_uInt16  nWhichId 
)
overridevirtual

◆ QueryValue()

bool SwAuthorityField::QueryValue ( css::uno::Any &  rVal,
sal_uInt16  nWhichId 
) const
overridevirtual

Reimplemented from SwField.

Definition at line 777 of file authfld.cxx.

References aFieldNames, AUTH_FIELD_AUTHORITY_TYPE, AUTH_FIELD_END, SwField::GetTyp(), i, m_xAuthEntry, and pValues.

◆ SetPar1()

void SwAuthorityField::SetPar1 ( const OUString &  rStr)
overridevirtual

Member Data Documentation

◆ m_nTempSequencePos

sal_IntPtr SwAuthorityField::m_nTempSequencePos
mutableprivate

Definition at line 163 of file authfld.hxx.

Referenced by ConditionalExpandAuthIdentifier(), dumpAsXml(), and ExpandCitation().

◆ m_nTempSequencePosRLHidden

sal_IntPtr SwAuthorityField::m_nTempSequencePosRLHidden
mutableprivate

hidden redlines

Definition at line 164 of file authfld.hxx.

Referenced by ConditionalExpandAuthIdentifier(), dumpAsXml(), and ExpandCitation().

◆ m_xAuthEntry

rtl::Reference<SwAuthEntry> SwAuthorityField::m_xAuthEntry
private

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