Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / text / XDependentTextField.idl
blob6386d6b499e20a0141c6c0ac8bc6b2ad6ce52c70
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef __com_sun_star_text_XDependentTextField_idl__
20 #define __com_sun_star_text_XDependentTextField_idl__
22 #include <com/sun/star/text/XTextField.idl>
24 #include <com/sun/star/beans/XPropertySet.idl>
26 #include <com/sun/star/lang/IllegalArgumentException.idl>
30 module com { module sun { module star { module text {
33 /** makes it possible to attach this TextField to a
34 TextFieldMaster.
36 published interface XDependentTextField: com::sun::star::text::XTextField
39 /** method must be called to attach the
40 TextFieldMaster to this TextField.
41 <p>A TextFieldMaster can only be assigned once.
42 </p>
44 Example: Create and insert a user field (with a <code>UserField</code>):
46 @code{.java}
47 // Create a fieldmaster for our newly created User Text field, and access it's
48 // XPropertySet interface
49 XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(
50 XPropertySet.class, mxDocFactory.createInstance(
51 "com.sun.star.text.FieldMaster.User"));
52 // Set the name and value of the FieldMaster
53 xMasterPropSet.setPropertyValue ("Name", "UserEmperor");
54 xMasterPropSet.setPropertyValue ("Value", new Integer(42));
55 // Attach the field master to the user field
56 xUserField.attachTextFieldMaster (xMasterPropSet);
57 // Move the cursor to the end of the document
58 mxDocCursor.gotoEnd(false);
59 // insert a paragraph break using the XSimpleText interface
60 mxDocText.insertControlCharacter(
61 mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);
62 // Insert the user field at the end of the document
63 mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);
64 @endcode
66 void attachTextFieldMaster( [in] com::sun::star::beans::XPropertySet xFieldMaster )
67 raises( com::sun::star::lang::IllegalArgumentException );
70 /** @returns
71 the previously attached TextFieldMaster
73 com::sun::star::beans::XPropertySet getTextFieldMaster();
78 }; }; }; };
81 #endif
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */