1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_text_XDependentTextField_idl__
24#define __com_sun_star_text_XDependentTextField_idl__
25
26#ifndef __com_sun_star_text_XTextField_idl__
27#include <com/sun/star/text/XTextField.idl>
28#endif
29
30#ifndef __com_sun_star_beans_XPropertySet_idl__
31#include <com/sun/star/beans/XPropertySet.idl>
32#endif
33
34#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
35#include <com/sun/star/lang/IllegalArgumentException.idl>
36#endif
37
38
39//=============================================================================
40
41 module com {  module sun {  module star {  module text {
42
43//=============================================================================
44
45/** makes it possible to attach this <type>TextField</type> to a
46	<type>TextFieldMaster</type>.
47 */
48published interface XDependentTextField: com::sun::star::text::XTextField
49{
50	//-------------------------------------------------------------------------
51
52	/** method must be called to attach the
53		<type>TextFieldMaster</type> to this <type>TextField</type>.
54		<p>A <type>TextFieldMaster</type> can only be assigned once.
55		</p>
56
57		@example Create and insert a user field (with a
58                <code>UserField</code>):
59
60		<listing>
61                // Create a fieldmaster for our newly created User Text field, and access it's
62                // XPropertySet interface
63                XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(
64                                XPropertySet.class, mxDocFactory.createInstance(
65                                                "com.sun.star.text.FieldMaster.User"));
66                // Set the name and value of the FieldMaster
67                xMasterPropSet.setPropertyValue ("Name", "UserEmperor");
68                xMasterPropSet.setPropertyValue ("Value", new Integer(42));
69                // Attach the field master to the user field
70                xUserField.attachTextFieldMaster (xMasterPropSet);
71                // Move the cursor to the end of the document
72                mxDocCursor.gotoEnd(false);
73                // insert a paragraph break using the XSimpleText interface
74                mxDocText.insertControlCharacter(
75                                mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);
76                // Insert the user field at the end of the document
77                mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);
78                </listing>
79	 */
80	void attachTextFieldMaster( [in] com::sun::star::beans::XPropertySet xFieldMaster )
81			raises( com::sun::star::lang::IllegalArgumentException );
82
83	//-------------------------------------------------------------------------
84
85	/** @returns
86                the previously attached <type>TextFieldMaster</type>
87	 */
88	com::sun::star::beans::XPropertySet getTextFieldMaster();
89
90};
91
92//=============================================================================
93
94}; }; }; };
95
96
97#endif
98