1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 module com
{ module sun
{ module star
{ module text
{
25 /** makes it possible to attach this TextField to a
28 published
interface XDependentTextField
: com
::sun
::star
::text
::XTextField
31 /** method must be called to attach the
32 TextFieldMaster to this TextField.
33 <p>A TextFieldMaster can only be assigned once.
36 Example: Create and insert a user field (with a <code>UserField</code>):
39 // Create a fieldmaster for our newly created User Text field, and access it's
40 // XPropertySet interface
41 XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(
42 XPropertySet.class, mxDocFactory.createInstance(
43 "com.sun.star.text.FieldMaster.User"));
44 // Set the name and value of the FieldMaster
45 xMasterPropSet.setPropertyValue ("Name", "UserEmperor");
46 xMasterPropSet.setPropertyValue ("Value", new Integer(42));
47 // Attach the field master to the user field
48 xUserField.attachTextFieldMaster (xMasterPropSet);
49 // Move the cursor to the end of the document
50 mxDocCursor.gotoEnd(false);
51 // insert a paragraph break using the XSimpleText interface
52 mxDocText.insertControlCharacter(
53 mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);
54 // Insert the user field at the end of the document
55 mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);
58 void attachTextFieldMaster
( [in] com
::sun
::star
::beans
::XPropertySet xFieldMaster
)
59 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
63 the previously attached TextFieldMaster
65 com
::sun
::star
::beans
::XPropertySet getTextFieldMaster
();
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */