summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/iaccessible2/idl/AccessibleEditableText.idl
blob: 48fefd30ef9bd79fb677853e0fe9db31a41ba559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/*************************************************************************
 *
 *  File Name (AccessibleEditableText.idl)
 *
 *  IAccessible2 IDL Specification
 *
 *  Copyright (c) 2007, 2010 Linux Foundation
 *  Copyright (c) 2006 IBM Corporation
 *  Copyright (c) 2000, 2006 Sun Microsystems, Inc.
 *  All rights reserved.
 *
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *   1. Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *   2. Redistributions in binary form must reproduce the above
 *      copyright notice, this list of conditions and the following
 *      disclaimer in the documentation and/or other materials
 *      provided with the distribution.
 *
 *   3. Neither the name of the Linux Foundation nor the names of its
 *      contributors may be used to endorse or promote products
 *      derived from this software without specific prior written
 *      permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 *  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 *  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *  This BSD License conforms to the Open Source Initiative "Simplified
 *  BSD License" as published at:
 *  http://www.opensource.org/licenses/bsd-license.php
 *
 *  IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
 *  mark may be used in accordance with the Linux Foundation Trademark
 *  Policy to indicate compliance with the IAccessible2 specification.
 *
 ************************************************************************/

import "objidl.idl";
import "oaidl.idl";
import "oleacc.idl";
import "IA2CommonTypes.idl";

/** @brief This interface provides clipboard capability to text objects.

 This interface is typically used in conjunction with the IAccessibleText
  interface and complements that interface with the additional capability of
  clipboard operations.  Note that even a read only text object can support
  the copy capability so this interface is not limited to editable objects.

 The substrings used with this interface are specified as follows:
  If startOffset is less than endOffset, the substring starts with the
  character at startOffset and ends with the character just before endOffset.
  If endOffset is lower than startOffset,  the result is the same as a call
  with the two arguments exchanged. The whole text can be defined by passing
  the indices zero and IAccessibleText::nCharacters. If both indices have the
  same value, an empty string is defined.

 Refer to the @ref _specialOffsets
  "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
  for information about a special offset constant that can be used in %IAccessibleEditableText methods.
*/
[object, uuid(A59AA09A-7011-4b65-939D-32B1FB5547E3)]
interface IAccessibleEditableText : IUnknown
{

  /** @brief Copies the text range into the clipboard.

   The selection is set to the specified offsets and then selection is copied into
   the system clipboard.

   @param [in] startOffset
    Start index of the text to moved into the clipboard.
    The valid range is 0..length.
   @param [in] endOffset
    End index of the text to moved into the clipboard.
    The valid range is 0..length.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
   @note Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
  */
  HRESULT copyText
    (
     [in] long startOffset,
     [in] long endOffset
    );

  /** @brief Deletes a range of text.

   The text between and including the two given indices is deleted
    from the text represented by this object.

   @param [in] startOffset
    Start index of the text to be deleted.
    The valid range is 0..length.
   @param [in] endOffset
    End index of the text to be deleted.
    The valid range is 0..length.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
   @note Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
  */
  HRESULT deleteText
    (
     [in] long startOffset,
     [in] long endOffset
    );

  /** @brief Inserts text at the specified position.

   The specified string is inserted at the given index into the text
    represented by this object.

   @param [in] offset
    Index at which to insert the text.
    The valid range is 0..length.
    Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
   @param [in] text
    Text that is inserted.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
  */
  HRESULT insertText
    (
     [in] long offset,
     [in] BSTR *text
    );

  /** @brief Deletes a range of text and copies it to the clipboard.

   The selection is set to the specified offsets, the selection is then copied into
    the system clipboard, and then the selection is deleted.

   @param [in] startOffset
    Start index of the text to be deleted.
    The valid range is 0..length.
   @param [in] endOffset
    End index of the text to be deleted.
    The valid range is 0..length.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
   @note Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
  */
  HRESULT cutText
    (
     [in] long startOffset,
     [in] long endOffset
    );

  /** @brief Pastes content from the clipboard.

   Any existing selection is removed, the clipboard content is then pasted into
    this object's text at the given offset.  This method is similar to the insertText
    method.  If the index is not valid the system clipboard content is not inserted. The
    behavior is the same as    when Ctrl+V is used, i.e. the pasted contents are not
    necessarily plain text.

   @param [in] offset
    Index at which to insert the content from the system clipboard into
    the text represented by this object.
    The valid range is 0..length.
    Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
  */
  HRESULT pasteText
    (
     [in] long offset
    );

  /** @brief Replaces text.

   The text between the two given indices is replaced by the specified
    replacement string. This method is equivalent to calling first
    IAccessibleEditableText::deleteText with the two indices and then
    calling IAccessibleEditableText::insertText with the replacement text
    at the start index.

   @param [in] startOffset
    Start index of the text to be replaced.
    The valid range is 0..length.
   @param [in] endOffset
    End index of the text to be replaced.
    The valid range is 0..length.
   @param [in] text
    The Text that replaces the text between the given indices.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
   @note Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
  */
  HRESULT replaceText
    (
     [in] long startOffset,
     [in] long endOffset,
     [in] BSTR *text
    );

  /** @brief Replaces the attributes of a text range by the given set of attributes.

   Sets the attributes for the text between the two given indices. The old
    attributes are replaced by the new list of attributes.

   @param [in] startOffset
    Start index of the text whose attributes are modified.
    The valid range is 0..length.
   @param [in] endOffset
    End index of the text whose attributes are modified.
    The valid range is 0..length.
   @param [in] attributes
    Set of attributes that replaces the old list of attributes of
    the specified text portion.
   @retval S_OK
   @retval E_INVALIDARG if bad [in] passed
   @note Refer to @ref _specialOffsets
    "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
    for information about special offsets that can be used in %IAccessibleEditableText
    methods.
  */
  HRESULT setAttributes
    (
     [in] long startOffset,
     [in] long endOffset,
     [in] BSTR *attributes
    );
}