LibreOffice LibreOffice 6.2 SDK API Reference

Public Member Functions | List of all members
XDependentTextField Interface Referencepublished

makes it possible to attach this TextField to a TextFieldMaster. More...

`import"XDependentTextField.idl";`

Inheritance diagram for XDependentTextField:

## Public Member Functions
void | attachTextFieldMaster ([in] com::sun::star::beans::XPropertySet xFieldMaster) raises ( com::sun::star::lang::IllegalArgumentException )
| method must be called to attach the TextFieldMaster to this TextField. More...
com::sun::star::beans::XPropertySet | getTextFieldMaster ()
Public Member Functions inherited from XTextField
string | getPresentation ([in] boolean bShowCommand)
Public Member Functions inherited from XTextContent
void | attach ([in] com::sun::star::text::XTextRange xTextRange) raises ( com::sun::star::lang::IllegalArgumentException )
| is called when this object gets embedded in a text. More...
com::sun::star::text::XTextRange | getAnchor ()
Public Member Functions inherited from XComponent
void | dispose ()
| The owner of an object calls this method to explicitly free all resources kept by this object and thus break cyclic references. More...
void | addEventListener ([in] XEventListener xListener)
| adds an event listener to the object. More...
void | removeEventListener ([in] XEventListener aListener)
| removes an event listener from the listener list. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

makes it possible to attach this TextField to a TextFieldMaster.

## Member Function Documentation

## ◆ attachTextFieldMaster()

void attachTextFieldMaster | ( | [in] com::sun::star::beans::XPropertySet | xFieldMaster | ) |
raises | ( | com::sun::star::lang::IllegalArgumentException
| ) |  |

method must be called to attach the TextFieldMaster to this TextField.

A TextFieldMaster can only be assigned once.

Example: Create and insert a user field (with a `UserField`):

// Create a fieldmaster for our newly created User Text field, and access it's
// XPropertySet interface
XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, mxDocFactory.createInstance(
"com.sun.star.text.FieldMaster.User"));
// Set the name and value of the FieldMaster
xMasterPropSet.setPropertyValue ("Name", "UserEmperor");
xMasterPropSet.setPropertyValue ("Value", new Integer(42));
// Attach the field master to the user field
xUserField.attachTextFieldMaster (xMasterPropSet);
// Move the cursor to the end of the document
mxDocCursor.gotoEnd(false);
// insert a paragraph break using the XSimpleText interface
mxDocText.insertControlCharacter(
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);
// Insert the user field at the end of the document
mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);

## ◆ getTextFieldMaster()

com::sun::star::beans::XPropertySet getTextFieldMaster | ( |  | ) |

Returns
  the previously attached TextFieldMaster

The documentation for this interface was generated from the following file:

- com/sun/star/text/XDependentTextField.idl