xref: /AOO41X/main/offapi/com/sun/star/awt/XTextComponent.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
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_awt_XTextComponent_idl__
24#define __com_sun_star_awt_XTextComponent_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_awt_XTextListener_idl__
31#include <com/sun/star/awt/XTextListener.idl>
32#endif
33
34#ifndef __com_sun_star_awt_Selection_idl__
35#include <com/sun/star/awt/Selection.idl>
36#endif
37
38
39//=============================================================================
40
41 module com {  module sun {  module star {  module awt {
42
43//=============================================================================
44
45/** gives access to the text of a component and makes it possible
46    to register event listeners.
47 */
48published interface XTextComponent: com::sun::star::uno::XInterface
49{
50    //-------------------------------------------------------------------------
51
52    /** registers a text event listener.
53     */
54    [oneway] void addTextListener( [in] com::sun::star::awt::XTextListener l );
55
56    //-------------------------------------------------------------------------
57
58    /** unregisters a text event listener.
59     */
60    [oneway] void removeTextListener( [in] com::sun::star::awt::XTextListener l );
61
62    //-------------------------------------------------------------------------
63
64    /** sets the text of the component.
65     */
66    [oneway] void setText( [in] string aText );
67
68    //-------------------------------------------------------------------------
69
70    /** inserts text at the specified position.
71     */
72    [oneway] void insertText( [in] com::sun::star::awt::Selection Sel,
73             [in] string Text );
74
75    //-------------------------------------------------------------------------
76
77    /** returns the text of the component.
78     */
79    string getText();
80
81    //-------------------------------------------------------------------------
82
83    /** returns the currently selected text.
84     */
85    string getSelectedText();
86
87    //-------------------------------------------------------------------------
88
89    /** sets the user selection.
90     */
91    [oneway] void setSelection( [in] com::sun::star::awt::Selection aSelection );
92
93    //-------------------------------------------------------------------------
94
95    /** returns the current user selection.
96     */
97    com::sun::star::awt::Selection getSelection();
98
99    //-------------------------------------------------------------------------
100
101    /** returns if the text is editable by the user.
102     */
103    boolean isEditable();
104
105    //-------------------------------------------------------------------------
106
107    /** makes the text editable for the user or read-only.
108     */
109    [oneway] void setEditable( [in] boolean bEditable );
110
111    //-------------------------------------------------------------------------
112
113    /** sets the maximum text length.
114     */
115    [oneway] void setMaxTextLen( [in] short nLen );
116
117    //-------------------------------------------------------------------------
118
119    /** returns the currently set maximum text length.
120     */
121    short getMaxTextLen();
122
123};
124
125//=============================================================================
126
127}; }; }; };
128
129#endif
130