1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XDependentTextField.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_text_XDependentTextField_idl__
31 #define __com_sun_star_text_XDependentTextField_idl__
33 #ifndef __com_sun_star_text_XTextField_idl__
34 #include
<com
/sun
/star
/text
/XTextField.idl
>
37 #ifndef __com_sun_star_beans_XPropertySet_idl__
38 #include
<com
/sun
/star
/beans
/XPropertySet.idl
>
41 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
42 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
46 //=============================================================================
48 module com
{ module sun
{ module star
{ module text
{
50 //=============================================================================
52 /** makes it possible to attach this <type>TextField</type> to a
53 <type>TextFieldMaster</type>.
55 published
interface XDependentTextField
: com
::sun
::star
::text
::XTextField
57 //-------------------------------------------------------------------------
59 /** method must be called to attach the
60 <type>TextFieldMaster</type> to this <type>TextField</type>.
61 <p>A <type>TextFieldMaster</type> can only be assigned once.
64 @example Create and insert a user field (with a
65 <code>UserField</code>):
68 // Create a fieldmaster for our newly created User Text field, and access it's
69 // XPropertySet interface
70 XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(
71 XPropertySet.class, mxDocFactory.createInstance(
72 "com.sun.star.text.FieldMaster.User"));
73 // Set the name and value of the FieldMaster
74 xMasterPropSet.setPropertyValue ("Name", "UserEmperor");
75 xMasterPropSet.setPropertyValue ("Value", new Integer(42));
76 // Attach the field master to the user field
77 xUserField.attachTextFieldMaster (xMasterPropSet);
78 // Move the cursor to the end of the document
79 mxDocCursor.gotoEnd(false);
80 // insert a paragraph break using the XSimpleText interface
81 mxDocText.insertControlCharacter(
82 mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);
83 // Insert the user field at the end of the document
84 mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);
87 void attachTextFieldMaster
( [in] com
::sun
::star
::beans
::XPropertySet xFieldMaster
)
88 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
90 //-------------------------------------------------------------------------
93 the previously attached <type>TextFieldMaster</type>
95 com
::sun
::star
::beans
::XPropertySet getTextFieldMaster
();
99 //=============================================================================