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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
/*
* Copyright (c) 2024. The RigelA open source project team and
* its contributors reserve all rights.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*/
use ;
use interface;
use BSTR;
use HRESULT;
use HWND;
use UI;
//noinspection SpellCheckingInspection
/**
* @section _interfaces Interfaces
* IAccessible2\n
* IAccessible2_2\n
* IAccessible2_3\n
* IAccessibleAction\n
* IAccessibleApplication\n
* IAccessibleComponent\n
* IAccessibleDocument\n
* IAccessibleEditableText\n
* IAccessibleHypertext\n
* IAccessibleHypertext2\n
* IAccessibleHyperlink\n
* IAccessibleImage\n
* IAccessibleRelation\n
* IAccessibleTable (Deprecated)\n
* IAccessibleTable2\n
* IAccessibleTableCell\n
* IAccessibleText\n
* IAccessibleText2\n
* IAccessibleValue
*
* @section _structs Structs
* IA2Locale\n
* IA2Range\n
* IA2TableModelChange\n
* IA2TextSegment
*
* @section _enums Enums
* ::IA2Actions values are predefined actions for use when implementing support for HTML5 media.\n
* ::IA2CoordinateType values define the requested coordinate type (screen or parent window).\n
* ::IA2EventID values identify events.\n
* ::IA2Role values defines roles which are in addition to the existing MSAA roles.\n
* ::IA2ScrollType values define where to place an object or substring on the screen.\n
* ::IA2States values define states which are in addition to the existing MSAA states.\n
* ::IA2TableModelChangeType values describe the kinds of changes made to a table (insert, delete, update).\n
* ::IA2TextBoundaryType values define the requested text unit (character, word, sentence, line, paragraph).\n
* ::IA2TextSpecialOffsets values define special offsets for use in the text interfaces.
*
* @section _constants Constants
* @ref grpRelations
*
* @section _misc Miscellaneous
* @ref _licensePage "BSD License"\n
* @ref _generalInfo "General Information"\n
*
* @page _licensePage BSD License
* %IAccessible2 IDL Specification
*
* Copyright (c) 2007, 2013 Linux Foundation\n
* Copyright (c) 2006 IBM Corporation\n
* Copyright (c) 2000, 2006 Sun Microsystems, Inc.\n
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted if 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 ARE" 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
* <a href="http://www.linuxfoundation.org/collaborate/workgroups/accessibility/trademark-policy">
* Linux Foundation Trademark Policy</a>
* to indicate compliance with the %IAccessible2 specification.
*
* @page _generalInfo General Information
* The following information is applicable to two or more interfaces.
*
* @ref _errors\n
* @ref _memory\n
* @ref _arrayConsideration\n
* @ref _indexes\n
* @ref _enums\n
* @ref _specialOffsets\n
* @ref _discoveringInterfaces\n
* @ref _changingInterfaces\n
* @ref _applicationInfo\n
* @ref _childIDs\n
* @ref _variants\n
* @ref _iaAction-iaHyperlink\n
* @ref _trademark
*
* @section _errors Error Handling
* HRESULT values are defined by the Microsoft® Win32® API.
* For more information, refer to
* <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137%28v=vs.85%29.aspx"> Interpreting HRESULT Values</a> in MSDN®.
*
* Note that the S_FALSE return value is considered a non-error value and the
* SUCCEEDED macro will return TRUE.
* S_FALSE is used when there is no failure,
* but there was nothing valid to return, e.g.,
* in IAccessible2::attributes when there are no attributes.
* When S_FALSE is returned `[out]` pointer types should be NULL, and `[out]` longs should generally be 0,
* but sometimes -1 is used such as IAccessible2::indexInParent,
* IAccessibleText::caretOffset, and IAccessibleHypertext::hyperlinkIndex.
*
* Note that for BSTR `[out]` variables common COM practice is
* that the server does the SysAllocString and the client does the SysFreeString.
* Also note that when NULL is returned, there is no need for the client to call SysFreeString.
* Please refer to the documentation for each method for more details regarding error handling.
*
* @section _memory Memory Management
* The following memory management issues should be considered:
* @li Although `[out]` BSTR variables are declared by the client,
* their space is allocated by the server.
* They need to be freed with SysFreeString by the client at the end of life;
* the same is true when BSTRs are used in structs or arrays which are passed to the server.
* @li If there is no valid `[out]` BSTR to return,
* the server should return S_FALSE and assign NULL to the output,
* e.g. `*theOutBSTR = NULL;`.
* @li At the end of life,
* COM interfaces need to be referenced with AddRef when used and dereferenced with Release.
* @li Single `[out]` longs, HWNDs, booleans,
* and structs are declared by the caller and passed by reference.
* The marshaler does all the memory management.
*
* The following articles may be helpful for understanding memory management issues:
* @li An article by Don Box in an
* <a href="http://www.microsoft.com/msj/1196/activex1196.aspx">Q & A section</a>
* of the Microsoft Systems Journal's November 1996 edition.
* @li A posting to a CodeGuru forum,
* <a href="http://www.codeguru.com/forum/showthread.php?t=364511">Windows SDK
* String: What are the rules for BSTR allocation and deallocation?</a>
*
* @subsection _arrayConsideration Special Consideration, when using Arrays,
* There are several methods which return arrays.
* In the case of IAccessible2::relations and IAccessibleRelation::targets the client must allocate and free the arrays.
*
* For the remaining methods which return arrays,
* the server must allocate the array and the client must free the array when no longer needed.
* These methods are
* IAccessible2::extendedStates, IAccessible2::localizedExtendedStates,
* IAccessible2_2::relationTargetsOfType,
* IAccessibleAction::keyBinding, IAccessibleHypertext2::hyperlinks,
* IAccessibleTable::selectedChildren, IAccessibleTable::selectedColumns,
* IAccessibleTable::selectedRows, IAccessibleTable2::selectedCells,
* IAccessibleTable2::selectedColumns,
* IAccessibleTable2::selectedRows, IAccessibleTableCell::columnHeaderCells,
* and IAccessibleTableCell::rowHeaderCells.
* For those methods,
* the server must allocate both the top level array and any storage associated with it,
* e.g., for BSTRs.
* The server must allocate the arrays with
* CoTaskMemAlloc and any BSTRs with SysAllocString.
* The client must use CoTaskMemFree to free the array,
* and any BSTRs must be freed with SysFreeString.
*
* Also, the IDL for IAccessible2::extendedStates, IAccessible2::localizedExtendedStates,
* IAccessibleAction::keyBinding, IAccessibleTable::selectedChildren,
* IAccessibleTable::selectedColumns,
* and IAccessibleTable::selectedRows includes an extraneous `[in]` parameter
* for the caller to specify the max size of the array.
* This parameter will be ignored by the COM server.
*
* @section _indexes Zero and One-Based Indexes
* Unless otherwise specified, all offsets and indexes are 0 based.
*
* @section _enums Enums
* Note that enums start at 0.
*
* @section _specialOffsets Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods IAccessibleText and IAccessibleEditableText can use one or more of the following special offset values.
* They are defined in the IA2TextSpecialOffsets enum.
* @li Using IA2_TEXT_OFFSET_LENGTH (-1)
* as an offset in any of the IAccessibleText or IAccessibleEditableText methods is the same
* as specifying the length of the string.
* @li Using IA2_TEXT_OFFSET_CARET (-2) as an offset for IAccessibleText::textBeforeOffset,
* IAccessibleText::textAtOffset,
* and IAccessibleText::textAfterOffset indicates
* that the text related to the physical location of the caret should be used.
* This is needed for applications that consider the end's character offset of one line
* (as reached by pressing the End key)
* the same as the offset of the first character on the next line.
* Since the same offset is associated with two different lines,
* a special means is needed to fetch text from the line where the caret is physically located.
*
* @section _discoveringInterfaces Discovery of Interfaces
* In general AT (Assistive Technology) should try IAccessible2 interfaces,
* followed by using the MSAA (Microsoft Active Accessibility) interfaces.
* (In cases where the application is known to have custom interfaces which provide information not supplied by IAccessible2 or MSAA, then those custom interfaces can be used.) The AT can then, by default, support unknown IAccessible2/MSAA applications, without the application developers having to request AT vendors for support on an individual application by application basis.
*
* When you have a reference to an IAccessible and require a reference to an IAccessible2,
* use QueryService as follows:
* ```c
* // pAcc is a reference to the accessible object's IAccessible interface.
* IServiceProvider *pService = NULL;
* hr = pAcc->QueryInterface(IID_IServiceProvider, (void **)&pService);
* if(SUCCEEDED(hr)) {
* IAccessible2 *pIA2 = NULL;
* hr = pService->QueryService(IID_IAccessible, IID_IAccessible2, (void**)&pIA2);
* if (SUCCEEDED(hr) && pIA2) {
* // The control supports IAccessible2.
* // pIA2 is the reference to the accessible object's IAccessible2 interface.
* }
* }
* ```
*
* @section _changingInterfaces Changing between Accessible Interfaces
* Note that developers must always implement MSAA's IAccessible and,
* if needed, some of the interfaces in the set of IAccessible2 interfaces.
* Although the IAccessible2
* IDL is coded such that IAccessible2 is a subclass of MSAA's IAccessible, none of
* MSAA's IAccessible methods are redefined by IAccessible2.
*
* QueryService must be used
* to switch from a reference to an MSAA IAccessible interface to another interface.
* This has been
* <a href="http://www.atia.org/files/public/Introducing_IAccessibleEx.doc">documented</a> and the pertinent facts have been extracted below:
*
* @par
* Why use QueryService instead of just using QueryInterface to get IAccessibleEx directly?
* The reason is that since MSAA 2.0, clients don't talk to a server's
* IAccessible interface directly;
* instead they talk to an intermediate MSAA-provided wrapper
* that calls through the original IAccessible.
* This wrapper provides services such as implementing IDispatch,
* supplying information from MSAA 2.0's Dynamic Annotation service,
* and scaling locations when running on Windows Vista with DPI scaling enabled.
* QueryService is the supported way to expose additional interfaces from an existing IAccessible
* and was originally used by MSHTML to expose IHTMLElement objects corresponding to IAccessibles.
* QueryService is often more convenient for servers to implement than QueryInterface.
* Because it does not have the same requirements
* for preserving object identity or symmetry/transitivity as QueryInterface,
* so QueryService allows servers
* to easily implement the interface on the same object or a separate object.
* The latter is often hard to do with QueryInterface unless the original object supports aggregation.
*
* Two related references in MSDN® are:
* @li <a href="http://msdn.microsoft.com/en-us/library/ms696078(VS.85).aspx"> "Using QueryService to expose a native object model interface for an IAccessible object"</a>
* @li <a href="http://msdn.microsoft.com/en-us/library/ms528415.aspx#acc_obj">"Accessing the Internet Explorer Object Associated with an Accessible Object"</a>
*
* Based on this information from Microsoft,
* QueryService must be used
* to switch back and forth between a reference to an MSAA IAccessible interface and any of the IAccessible2 interfaces.
*
* Regarding switching between any of the IAccessible2 interfaces,
* applications implementing IAccessible2 should implement the IAccessible2 interfaces on a single object
* since ATs will be using QueryInterface to switch between the IAccessible2 interfaces.
* Implementing the IAccessible2 interfaces on separate objects would require the use of QueryService.
* There is one exception,
* IAccessibleApplication can be implemented on a separate object
* so its common code doesn't have to be included in each accessible object.
* ATs should use QueryService to access IAccessibleApplication.
*
* @section _applicationInfo Access to Information about the Application
* Servers implementing IAccessible2 should provide access to the IAccessibleApplication interface via QueryService from any object
* so that ATs can easily determine specific information about the application such as its name or version.
*
* @section _childIDs Child IDs
* The IAccessible2 interfaces do not support child IDs, i.e., simple child elements.
* Full accessible objects must be created for each object that supports IAccessible2.
* Therefore,
* MSAA's get_accChild should never return a child ID (other than CHILDID_SELF)
* for an object that implements any of the IAccessible2 interfaces.
*
* Microsoft's UI Automation specification has the same limitation,
* and this was resolved in the UI Automation Express specification
* by adding IAccessibleEx::GetObjectForChild and IAccessibleEx::GetIAccessiblePair.
* These methods allow mapping back and forth between an IAccessibleEx and an {IAccessible,
* Child ID} pair.
* A future version of IAccessible2 may include similar methods
* to map back and forth between an IAccessible2 and an {IAccessible,
* Child ID} pair.
*
* @section _variants VARIANTs
* Some methods return a VARIANT.
* Implementers need to make sure that the return type is specified, i.e., VT_I4, VT_IDISPATCH, etc.
* The methods that return VARIANTs are IAccessibleHyperlink::anchor,
* IAccessibleHyperlink::anchorTarget,
* IAccessibleValue::currentValue, IAccessibleValue::maximumValue, IAccessibleValue::minimumValue.
*
* @section _iaaction-iahyperlink IAccessibleHyperlink as subclass of IAccessibleAction
* In this version of the IDL, IAccessibleHyperlink is a subclass of IAccessibleAction.
* However, there is no practical need for that inheritance,
* and in some cases, such as an image map of smart tags,
* it doesn't make sense because such an image map doesn't have actionable objects;
* it's the secondary smart tags that are actionable.
* As a result,
* implementations should not rely on the inheritance
* as it may be removed in a later version of the IDL.
*
* @section _trademark Trademark Attribution
* The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
* In particular, Active Accessibility, Microsoft, MSDN,
* and Win32 are trademarks of the Microsoft group of companies in the U.S.A. and/or other countries.
*
* */
/**
* A structure defining the locale of an accessible object.
* IAccessible2::locale returns this struct.
* */
/**
* This interface exposes the primary set of information about an
* IAccessible2 enabled accessible object.
* This interface must always be provided for objects
* that support some portion of the collection of the %IAccessible2 interfaces.
* Please refer to @ref _changingInterfaces "Changing between Accessible Interfaces"
* for special considerations related to use of the MSAA IAccessible interface and the set of %IAccessible2 interfaces.
* */
pub unsafe
/*
* Idl file copyright information:
* File Name (Accessible2.idl)
*
* IAccessible2 IDL Specification
*
* Copyright (c) 2007, 2013 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 if 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 ARE" 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.
*/