LibreOffice Module sw (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwXTextField Class Referencefinal

UNO wrapper around an SwFormatField, i.e. More...

#include <unofield.hxx>

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

Classes

class  Impl
 

Public Member Functions

SwServiceType GetServiceId () const
 
virtual sal_Int64 SAL_CALL getSomething (const css::uno::Sequence< sal_Int8 > &rIdentifier) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &rServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (const css::uno::Reference< css::lang::XEventListener > &xListener) override
 
virtual void SAL_CALL removeEventListener (const css::uno::Reference< css::lang::XEventListener > &xListener) override
 
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo () override
 
virtual void SAL_CALL setPropertyValue (const OUString &rPropertyName, const css::uno::Any &rValue) override
 
virtual css::uno::Any SAL_CALL getPropertyValue (const OUString &rPropertyName) override
 
virtual void SAL_CALL addPropertyChangeListener (const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
 
virtual void SAL_CALL removePropertyChangeListener (const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
 
virtual void SAL_CALL addVetoableChangeListener (const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
 
virtual void SAL_CALL removeVetoableChangeListener (const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
 
virtual void SAL_CALL update () override
 
virtual void SAL_CALL attach (const css::uno::Reference< css::text::XTextRange > &xTextRange) override
 
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor () override
 
virtual OUString SAL_CALL getPresentation (sal_Bool bShowCommand) override
 
virtual void SAL_CALL attachTextFieldMaster (const css::uno::Reference< css::beans::XPropertySet > &xFieldMaster) override
 
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getTextFieldMaster () override
 

Static Public Member Functions

static void TransmuteLeadToInputField (SwSetExpField &rField)
 Convert between SwSetExpField with InputFlag false and InputFlag true. More...
 
static rtl::Reference< SwXTextFieldCreateXTextField (SwDoc *pDoc, SwFormatField const *pFormat, SwServiceType nServiceId=SwServiceType::Invalid)
 
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId ()
 

Private Member Functions

virtual ~SwXTextField () override
 
 SwXTextField (SwFormatField &rFormat, SwDoc &rDoc)
 
 SwXTextField (SwServiceType nServiceId, SwDoc *pDoc)
 descriptor More...
 

Private Attributes

::sw::UnoImplPtr< Implm_pImpl
 

Detailed Description

UNO wrapper around an SwFormatField, i.e.

a Writer field that the user creates via Insert -> Field.

Definition at line 127 of file unofield.hxx.

Constructor & Destructor Documentation

◆ ~SwXTextField()

SwXTextField::~SwXTextField ( )
overrideprivatevirtual

Definition at line 1211 of file unofield.cxx.

◆ SwXTextField() [1/2]

SwXTextField::SwXTextField ( SwFormatField rFormat,
SwDoc rDoc 
)
private

Definition at line 1206 of file unofield.cxx.

References Invalid, and m_pImpl.

Referenced by CreateXTextField().

◆ SwXTextField() [2/2]

SwXTextField::SwXTextField ( SwServiceType  nServiceId,
SwDoc pDoc 
)
private

Member Function Documentation

◆ addEventListener()

void SAL_CALL SwXTextField::addEventListener ( const css::uno::Reference< css::lang::XEventListener > &  xListener)
overridevirtual

Definition at line 2110 of file unofield.cxx.

References m_pImpl.

◆ addPropertyChangeListener()

void SwXTextField::addPropertyChangeListener ( const OUString &  rPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  xListener 
)
overridevirtual

Definition at line 2480 of file unofield.cxx.

◆ addVetoableChangeListener()

void SwXTextField::addVetoableChangeListener ( const OUString &  rPropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  xListener 
)
overridevirtual

Definition at line 2490 of file unofield.cxx.

◆ attach()

void SAL_CALL SwXTextField::attach ( const css::uno::Reference< css::text::XTextRange > &  xTextRange)
overridevirtual

Definition at line 1345 of file unofield.cxx.

References SL::aData, aDocInfoSubTypeFromService, AF_FIXED, AF_NAME, AF_SHORTCUT, aName, Author, Chapter, SwGetExpField::ChgExpStr(), SwSetExpField::ChgExpStr(), CombinedChars, ConditionalText, SwMacroField::CreateMacroString(), Database, DatabaseName, DATEFLD, DateTime, DbNextSet, DbNumSet, DbSetNumber, Dde, DEFAULT, sw::Default, IDocumentContentOperations::DeleteAndJoin(), nsSwDocInfoSubType::DI_SUB_DATE, nsSwDocInfoSubType::DI_SUB_FIXED, nsSwDocInfoSubType::DI_SUB_TIME, DocInfo, DocStat, Dropdown, DS_CHAR, DS_GRF, DS_OLE, DS_PAGE, DS_PARA, DS_TBL, DS_WORD, DateTime::EMPTY, SwPaM::End(), ExtUser, FF_FIXED, FIELD_PROP_DATE_TIME, FIELD_PROP_FORMAT, FIELD_PROP_PAR4, FIELD_PROP_PROP_SEQ, FIELD_PROP_SHORT1, FIELD_PROP_SUBTYPE, FIELD_PROP_USHORT1, FIELD_PROP_USHORT2, FieldTypeAnnotation, FieldTypeAuthor, FieldTypeBibliography, FieldTypeChapter, FieldTypeCharacterCount, FieldTypeCombinedCharacters, FieldTypeConditionedText, FieldTypeDatabase, FieldTypeDatabaseName, FieldTypeDatabaseNextSet, FieldTypeDatabaseNumSet, FieldTypeDatabaseSetNum, FieldTypeDateTime, FieldTypeDDE, FieldTypeDocInfo, FieldTypeDocInfoChangeAuthor, FieldTypeDocInfoChangeDateTime, FieldTypeDocInfoCreateAuthor, FieldTypeDocInfoCreateDateTime, FieldTypeDocInfoCustom, FieldTypeDocInfoDescription, FieldTypeDocInfoEditTime, FieldTypeDocInfoKeywords, FieldTypeDocInfoPrintAuthor, FieldTypeDocInfoPrintDateTime, FieldTypeDocInfoRevision, FieldTypeDocInfoSubject, FieldTypeDocInfoTitle, FieldTypeDropdown, FieldTypeEmbeddedObjectCount, FieldTypeFileName, FieldTypeGetExp, FieldTypeGetReference, FieldTypeGraphicObjectCount, FieldTypeHiddenPara, FieldTypeHiddenText, FieldTypeInput, FieldTypeInputUser, FieldTypeJumpEdit, FieldTypeMacro, FieldTypePageCount, FieldTypePageNum, FieldTypeParagraphCount, FieldTypeRefPageGet, FieldTypeRefPageSet, FieldTypeScript, FieldTypeSetExp, FieldTypeTableCount, FieldTypeTableFormula, FieldTypeTemplateName, FieldTypeUser, FieldTypeUserExt, FieldTypeWordCount, Filename, FIXEDFLD, FORCEHINTEXPAND, SwPosition::GetContentIndex(), SwPaM::GetDoc(), SwXTextRange::GetDoc(), OTextCursorHelper::GetDoc(), GetExp, SwFormatField::GetField(), SwTextNode::GetFieldTextAttrAt(), IDocumentFieldsAccess::GetFieldType(), SwTextAttr::GetFormatField(), SwDoc::getIDocumentContentOperations(), SwDoc::getIDocumentFieldsAccess(), SwDoc::getIDocumentMarkAccess(), SwPaM::GetMark(), SwPostItField::GetName(), SwPaM::GetPoint(), SwPaM::GetPointNode(), SwTextField::GetpTextNode(), GetRef, SwTextAttr::GetStart(), SwDBField::GetSubType(), IDocumentFieldsAccess::GetSysFieldType(), SwNode::GetTextNode(), SwSetExpFieldType::GetType(), SwUserFieldType::GetType(), nsSwGetSetExpType::GSE_EXPR, nsSwGetSetExpType::GSE_FORMULA, nsSwGetSetExpType::GSE_STRING, SwPaM::HasMark(), HiddenPara, HiddenText, INP_TXT, INP_USR, Input, IDocumentFieldsAccess::InsertFieldType(), IDocumentContentOperations::InsertPoolItem(), SwXTextCursor::IsAtEndOfMeta(), JumpEdit, m_pImpl, Macro, IDocumentMarkAccess::makeAnnotationMark(), SwPaM::Move(), nType, PageNumber, PG_RANDOM, Postit, RefPageGet, RefPageSet, RES_TXTATR_ANNOTATION(), Script, SetExp, SwAuthorField::SetExpansion(), SwFileNameField::SetExpansion(), SwExtUserField::SetExpansion(), SwDropDownField::SetHelp(), SwInputField::SetHelp(), SwHiddenParaField::SetHidden(), SwSetExpField::SetInputFlag(), SwDropDownField::SetItems(), SwGetExpField::SetLateInitialization(), SwChapterField::SetLevel(), SwPaM::SetMark(), SwDropDownField::SetName(), SwDateTimeField::SetOffset(), SwPostItField::SetPar2(), SwSetExpField::SetPromptText(), SwDropDownField::SetSelectedItem(), SwSetExpField::SetSeqNumber(), SwDBSetNumberField::SetSetNumber(), SwRefPageGetField::SetText(), SwPostItField::SetTextObject(), SwInputField::SetToolTip(), SwDropDownField::SetToolTip(), SwPageNumberField::SetUserString(), SwHiddenTextField::SetValue(), SwValueField::SetValue(), SwPaM::Start(), nsSwExtendedSubType::SUB_CMD, nsSwExtendedSubType::SUB_INVISIBLE, Table, TemplateName, TIMEFLD, type, u, update(), User, SwTextAttr::Which(), and sw::XTextRangeToSwPaM().

◆ attachTextFieldMaster()

void SAL_CALL SwXTextField::attachTextFieldMaster ( const css::uno::Reference< css::beans::XPropertySet > &  xFieldMaster)
overridevirtual

◆ CreateXTextField()

rtl::Reference< SwXTextField > SwXTextField::CreateXTextField ( SwDoc pDoc,
SwFormatField const *  pFormat,
SwServiceType  nServiceId = SwServiceType::Invalid 
)
static
Returns
an SwXTextField, either an already existing one or a new one

Definition at line 1216 of file unofield.cxx.

References SwFormatField::GetXTextField(), Invalid, m_pImpl, and SwXTextField().

Referenced by SwUnoCursorHelper::getCursorPropertyValue(), lcl_ExportHints(), and SwXServiceProvider::MakeInstance().

◆ dispose()

void SAL_CALL SwXTextField::dispose ( void  )
overridevirtual

Definition at line 2091 of file unofield.cxx.

References SwTextField::DeleteTextField(), and m_pImpl.

◆ getAnchor()

uno::Reference< text::XTextRange > SAL_CALL SwXTextField::getAnchor ( )
overridevirtual

◆ getImplementationName()

OUString SAL_CALL SwXTextField::getImplementationName ( )
overridevirtual

Definition at line 2555 of file unofield.cxx.

◆ getPresentation()

OUString SAL_CALL SwXTextField::getPresentation ( sal_Bool  bShowCommand)
overridevirtual

Definition at line 1333 of file unofield.cxx.

References SwField::ExpandField(), SwField::GetFieldName(), and m_pImpl.

◆ getPropertySetInfo()

uno::Reference< beans::XPropertySetInfo > SAL_CALL SwXTextField::getPropertySetInfo ( )
overridevirtual

◆ getPropertyValue()

uno::Any SAL_CALL SwXTextField::getPropertyValue ( const OUString &  rPropertyName)
overridevirtual

◆ GetServiceId()

SwServiceType SwXTextField::GetServiceId ( ) const

Definition at line 1243 of file unofield.cxx.

References m_pImpl.

Referenced by SwXText::insertTextContent().

◆ getSomething()

sal_Int64 SAL_CALL SwXTextField::getSomething ( const css::uno::Sequence< sal_Int8 > &  rIdentifier)
overridevirtual

Definition at line 1178 of file unofield.cxx.

◆ getSupportedServiceNames()

uno::Sequence< OUString > SAL_CALL SwXTextField::getSupportedServiceNames ( )
overridevirtual

◆ getTextFieldMaster()

uno::Reference< beans::XPropertySet > SAL_CALL SwXTextField::getTextFieldMaster ( )
overridevirtual

Definition at line 1323 of file unofield.cxx.

References SwXFieldMaster::CreateXFieldMaster(), and m_pImpl.

◆ getUnoTunnelId()

const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId ( )
static

Definition at line 1171 of file unofield.cxx.

References comphelper::UnoIdInit::getSeq().

◆ removeEventListener()

void SAL_CALL SwXTextField::removeEventListener ( const css::uno::Reference< css::lang::XEventListener > &  xListener)
overridevirtual

Definition at line 2117 of file unofield.cxx.

References m_pImpl.

◆ removePropertyChangeListener()

void SwXTextField::removePropertyChangeListener ( const OUString &  rPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  xListener 
)
overridevirtual

Definition at line 2485 of file unofield.cxx.

◆ removeVetoableChangeListener()

void SwXTextField::removeVetoableChangeListener ( const OUString &  rPropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  xListener 
)
overridevirtual

Definition at line 2495 of file unofield.cxx.

◆ setPropertyValue()

void SAL_CALL SwXTextField::setPropertyValue ( const OUString &  rPropertyName,
const css::uno::Any &  rValue 
)
overridevirtual

◆ supportsService()

sal_Bool SAL_CALL SwXTextField::supportsService ( const OUString &  rServiceName)
overridevirtual

Definition at line 2574 of file unofield.cxx.

References cppu::supportsService().

◆ TransmuteLeadToInputField()

void SwXTextField::TransmuteLeadToInputField ( SwSetExpField rField)
static

Convert between SwSetExpField with InputFlag false and InputFlag true.

Unfortunately the InputFlag is exposed in the API as "Input" property and is mutable; in the UI and in ODF these are 2 different types of fields, so the API design is very questionable. In order to keep the mutable property, the whole thing has to be reconstructed from scratch, to replace the SwTextField hint with SwTextInputField or vice versa. The SwFormatField will be replaced - it must be, because the Which changes - but the SwXTextField must not be disposed in the operation, it has to be disconnected first and at the end connected to the new instance!

Definition at line 1260 of file unofield.cxx.

References sw::Default, IDocumentContentOperations::DeleteAndJoin(), SwNode::GetDoc(), SwFormatField::GetField(), SwTextNode::GetFieldTextAttrAt(), SwSetExpField::GetFormatField(), SwTextAttr::GetFormatField(), SwDoc::getIDocumentContentOperations(), SwSetExpField::GetInputFlag(), SwTextField::GetPamForTextField(), SwFormatField::GetTextField(), SwTextField::GetTextNode(), SwFormatField::GetXTextField(), IDocumentContentOperations::InsertPoolItem(), m_pImpl, RES_TXTATR_FIELD(), RES_TXTATR_INPUTFIELD(), SwSetExpField::SetInputFlag(), and SfxPoolItem::Which().

Referenced by SwSetExpField::PutValue().

◆ update()

void SAL_CALL SwXTextField::update ( )
overridevirtual

Member Data Documentation

◆ m_pImpl

::sw::UnoImplPtr<Impl> SwXTextField::m_pImpl
private

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