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 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)
 

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 118 of file unofield.hxx.

Constructor & Destructor Documentation

◆ ~SwXTextField()

SwXTextField::~SwXTextField ( )
overrideprivatevirtual

Definition at line 1189 of file unofield.cxx.

◆ SwXTextField() [1/2]

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

Definition at line 1184 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 2095 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 2477 of file unofield.cxx.

◆ addVetoableChangeListener()

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

Definition at line 2487 of file unofield.cxx.

◆ attach()

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

Definition at line 1319 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(), 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 1194 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 2076 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 2552 of file unofield.cxx.

◆ getPresentation()

OUString SAL_CALL SwXTextField::getPresentation ( sal_Bool  bShowCommand)
overridevirtual

Definition at line 1307 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 1221 of file unofield.cxx.

References m_pImpl.

Referenced by SwXText::insertTextContent().

◆ getSupportedServiceNames()

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

◆ getTextFieldMaster()

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

Definition at line 1295 of file unofield.cxx.

References SwXFieldMaster::CreateXFieldMaster(), and m_pImpl.

◆ removeEventListener()

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

Definition at line 2102 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 2482 of file unofield.cxx.

◆ removeVetoableChangeListener()

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

Definition at line 2492 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 2571 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 1238 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(), 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: