/src/mozilla-central/accessible/ipc/other/ProxyAccessible.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "ProxyAccessible.h" |
8 | | #include "mozilla/a11y/DocAccessibleParent.h" |
9 | | #include "DocAccessible.h" |
10 | | #include "mozilla/a11y/DocManager.h" |
11 | | #include "mozilla/dom/Element.h" |
12 | | #include "mozilla/dom/TabParent.h" |
13 | | #include "mozilla/Unused.h" |
14 | | #include "mozilla/a11y/Platform.h" |
15 | | #include "RelationType.h" |
16 | | #include "mozilla/a11y/Role.h" |
17 | | #include "xpcAccessibleDocument.h" |
18 | | |
19 | | namespace mozilla { |
20 | | namespace a11y { |
21 | | |
22 | | uint64_t |
23 | | ProxyAccessible::State() const |
24 | 0 | { |
25 | 0 | uint64_t state = 0; |
26 | 0 | Unused << mDoc->SendState(mID, &state); |
27 | 0 | return state; |
28 | 0 | } |
29 | | |
30 | | uint64_t |
31 | | ProxyAccessible::NativeState() const |
32 | 0 | { |
33 | 0 | uint64_t state = 0; |
34 | 0 | Unused << mDoc->SendNativeState(mID, &state); |
35 | 0 | return state; |
36 | 0 | } |
37 | | |
38 | | void |
39 | | ProxyAccessible::Name(nsString& aName) const |
40 | 0 | { |
41 | 0 | Unused << mDoc->SendName(mID, &aName); |
42 | 0 | } |
43 | | |
44 | | void |
45 | | ProxyAccessible::Value(nsString& aValue) const |
46 | 0 | { |
47 | 0 | Unused << mDoc->SendValue(mID, &aValue); |
48 | 0 | } |
49 | | |
50 | | void |
51 | | ProxyAccessible::Help(nsString& aHelp) const |
52 | 0 | { |
53 | 0 | Unused << mDoc->SendHelp(mID, &aHelp); |
54 | 0 | } |
55 | | |
56 | | void |
57 | | ProxyAccessible::Description(nsString& aDesc) const |
58 | 0 | { |
59 | 0 | Unused << mDoc->SendDescription(mID, &aDesc); |
60 | 0 | } |
61 | | |
62 | | void |
63 | | ProxyAccessible::Attributes(nsTArray<Attribute> *aAttrs) const |
64 | 0 | { |
65 | 0 | Unused << mDoc->SendAttributes(mID, aAttrs); |
66 | 0 | } |
67 | | |
68 | | nsTArray<ProxyAccessible*> |
69 | | ProxyAccessible::RelationByType(RelationType aType) const |
70 | 0 | { |
71 | 0 | nsTArray<uint64_t> targetIDs; |
72 | 0 | Unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType), |
73 | 0 | &targetIDs); |
74 | 0 |
|
75 | 0 | size_t targetCount = targetIDs.Length(); |
76 | 0 | nsTArray<ProxyAccessible*> targets(targetCount); |
77 | 0 | for (size_t i = 0; i < targetCount; i++) |
78 | 0 | if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i])) |
79 | 0 | targets.AppendElement(proxy); |
80 | 0 |
|
81 | 0 | return targets; |
82 | 0 | } |
83 | | |
84 | | void |
85 | | ProxyAccessible::Relations(nsTArray<RelationType>* aTypes, |
86 | | nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets) |
87 | | const |
88 | 0 | { |
89 | 0 | nsTArray<RelationTargets> ipcRelations; |
90 | 0 | Unused << mDoc->SendRelations(mID, &ipcRelations); |
91 | 0 |
|
92 | 0 | size_t relationCount = ipcRelations.Length(); |
93 | 0 | aTypes->SetCapacity(relationCount); |
94 | 0 | aTargetSets->SetCapacity(relationCount); |
95 | 0 | for (size_t i = 0; i < relationCount; i++) { |
96 | 0 | uint32_t type = ipcRelations[i].Type(); |
97 | 0 | if (type > static_cast<uint32_t>(RelationType::LAST)) |
98 | 0 | continue; |
99 | 0 | |
100 | 0 | size_t targetCount = ipcRelations[i].Targets().Length(); |
101 | 0 | nsTArray<ProxyAccessible*> targets(targetCount); |
102 | 0 | for (size_t j = 0; j < targetCount; j++) |
103 | 0 | if (ProxyAccessible* proxy = mDoc->GetAccessible(ipcRelations[i].Targets()[j])) |
104 | 0 | targets.AppendElement(proxy); |
105 | 0 |
|
106 | 0 | if (targets.IsEmpty()) |
107 | 0 | continue; |
108 | 0 | |
109 | 0 | aTargetSets->AppendElement(std::move(targets)); |
110 | 0 | aTypes->AppendElement(static_cast<RelationType>(type)); |
111 | 0 | } |
112 | 0 | } |
113 | | |
114 | | bool |
115 | | ProxyAccessible::IsSearchbox() const |
116 | 0 | { |
117 | 0 | bool retVal = false; |
118 | 0 | Unused << mDoc->SendIsSearchbox(mID, &retVal); |
119 | 0 | return retVal; |
120 | 0 | } |
121 | | |
122 | | nsAtom* |
123 | | ProxyAccessible::LandmarkRole() const |
124 | 0 | { |
125 | 0 | nsString landmark; |
126 | 0 | Unused << mDoc->SendLandmarkRole(mID, &landmark); |
127 | 0 | return NS_GetStaticAtom(landmark); |
128 | 0 | } |
129 | | |
130 | | nsAtom* |
131 | | ProxyAccessible::ARIARoleAtom() const |
132 | 0 | { |
133 | 0 | nsString role; |
134 | 0 | Unused << mDoc->SendARIARoleAtom(mID, &role); |
135 | 0 | return NS_GetStaticAtom(role); |
136 | 0 | } |
137 | | |
138 | | int32_t |
139 | | ProxyAccessible::GetLevelInternal() |
140 | 0 | { |
141 | 0 | int32_t level = 0; |
142 | 0 | Unused << mDoc->SendGetLevelInternal(mID, &level); |
143 | 0 | return level; |
144 | 0 | } |
145 | | |
146 | | void |
147 | | ProxyAccessible::ScrollTo(uint32_t aScrollType) |
148 | 0 | { |
149 | 0 | Unused << mDoc->SendScrollTo(mID, aScrollType); |
150 | 0 | } |
151 | | |
152 | | void |
153 | | ProxyAccessible::ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY) |
154 | 0 | { |
155 | 0 | Unused << mDoc->SendScrollToPoint(mID, aScrollType, aX, aY); |
156 | 0 | } |
157 | | |
158 | | int32_t |
159 | | ProxyAccessible::CaretLineNumber() |
160 | 0 | { |
161 | 0 | int32_t line = -1; |
162 | 0 | Unused << mDoc->SendCaretOffset(mID, &line); |
163 | 0 | return line; |
164 | 0 | } |
165 | | |
166 | | int32_t |
167 | | ProxyAccessible::CaretOffset() |
168 | 0 | { |
169 | 0 | int32_t offset = 0; |
170 | 0 | Unused << mDoc->SendCaretOffset(mID, &offset); |
171 | 0 | return offset; |
172 | 0 | } |
173 | | |
174 | | void |
175 | | ProxyAccessible::SetCaretOffset(int32_t aOffset) |
176 | 0 | { |
177 | 0 | Unused << mDoc->SendSetCaretOffset(mID, aOffset); |
178 | 0 | } |
179 | | |
180 | | int32_t |
181 | | ProxyAccessible::CharacterCount() |
182 | 0 | { |
183 | 0 | int32_t count = 0; |
184 | 0 | Unused << mDoc->SendCharacterCount(mID, &count); |
185 | 0 | return count; |
186 | 0 | } |
187 | | |
188 | | int32_t |
189 | | ProxyAccessible::SelectionCount() |
190 | 0 | { |
191 | 0 | int32_t count = 0; |
192 | 0 | Unused << mDoc->SendSelectionCount(mID, &count); |
193 | 0 | return count; |
194 | 0 | } |
195 | | |
196 | | bool |
197 | | ProxyAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOfset, |
198 | | nsString& aText) const |
199 | 0 | { |
200 | 0 | bool valid; |
201 | 0 | Unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText, &valid); |
202 | 0 | return valid; |
203 | 0 | } |
204 | | |
205 | | void |
206 | | ProxyAccessible::GetTextAfterOffset(int32_t aOffset, |
207 | | AccessibleTextBoundary aBoundaryType, |
208 | | nsString& aText, int32_t* aStartOffset, |
209 | | int32_t* aEndOffset) |
210 | 0 | { |
211 | 0 | Unused << mDoc->SendGetTextAfterOffset(mID, aOffset, aBoundaryType, |
212 | 0 | &aText, aStartOffset, aEndOffset); |
213 | 0 | } |
214 | | |
215 | | void |
216 | | ProxyAccessible::GetTextAtOffset(int32_t aOffset, |
217 | | AccessibleTextBoundary aBoundaryType, |
218 | | nsString& aText, int32_t* aStartOffset, |
219 | | int32_t* aEndOffset) |
220 | 0 | { |
221 | 0 | Unused << mDoc->SendGetTextAtOffset(mID, aOffset, aBoundaryType, |
222 | 0 | &aText, aStartOffset, aEndOffset); |
223 | 0 | } |
224 | | |
225 | | void |
226 | | ProxyAccessible::GetTextBeforeOffset(int32_t aOffset, |
227 | | AccessibleTextBoundary aBoundaryType, |
228 | | nsString& aText, int32_t* aStartOffset, |
229 | | int32_t* aEndOffset) |
230 | 0 | { |
231 | 0 | Unused << mDoc->SendGetTextBeforeOffset(mID, aOffset, aBoundaryType, |
232 | 0 | &aText, aStartOffset, aEndOffset); |
233 | 0 | } |
234 | | |
235 | | char16_t |
236 | | ProxyAccessible::CharAt(int32_t aOffset) |
237 | 0 | { |
238 | 0 | uint16_t retval = 0; |
239 | 0 | Unused << mDoc->SendCharAt(mID, aOffset, &retval); |
240 | 0 | return static_cast<char16_t>(retval); |
241 | 0 | } |
242 | | |
243 | | void |
244 | | ProxyAccessible::TextAttributes(bool aIncludeDefAttrs, |
245 | | int32_t aOffset, |
246 | | nsTArray<Attribute>* aAttributes, |
247 | | int32_t* aStartOffset, |
248 | | int32_t* aEndOffset) |
249 | 0 | { |
250 | 0 | Unused << mDoc->SendTextAttributes(mID, aIncludeDefAttrs, aOffset, |
251 | 0 | aAttributes, aStartOffset, aEndOffset); |
252 | 0 | } |
253 | | |
254 | | void |
255 | | ProxyAccessible::DefaultTextAttributes(nsTArray<Attribute>* aAttrs) |
256 | 0 | { |
257 | 0 | Unused << mDoc->SendDefaultTextAttributes(mID, aAttrs); |
258 | 0 | } |
259 | | |
260 | | nsIntRect |
261 | | ProxyAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset, |
262 | | uint32_t aCoordType) |
263 | 0 | { |
264 | 0 | nsIntRect rect; |
265 | 0 | Unused << |
266 | 0 | mDoc->SendTextBounds(mID, aStartOffset, aEndOffset, aCoordType, &rect); |
267 | 0 | return rect; |
268 | 0 | } |
269 | | |
270 | | nsIntRect |
271 | | ProxyAccessible::CharBounds(int32_t aOffset, uint32_t aCoordType) |
272 | 0 | { |
273 | 0 | nsIntRect rect; |
274 | 0 | Unused << |
275 | 0 | mDoc->SendCharBounds(mID, aOffset, aCoordType, &rect); |
276 | 0 | return rect; |
277 | 0 | } |
278 | | |
279 | | int32_t |
280 | | ProxyAccessible::OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType) |
281 | 0 | { |
282 | 0 | int32_t retVal = -1; |
283 | 0 | Unused << mDoc->SendOffsetAtPoint(mID, aX, aY, aCoordType, &retVal); |
284 | 0 | return retVal; |
285 | 0 | } |
286 | | |
287 | | bool |
288 | | ProxyAccessible::SelectionBoundsAt(int32_t aSelectionNum, |
289 | | nsString& aData, |
290 | | int32_t* aStartOffset, |
291 | | int32_t* aEndOffset) |
292 | 0 | { |
293 | 0 | bool retVal = false; |
294 | 0 | Unused << mDoc->SendSelectionBoundsAt(mID, aSelectionNum, &retVal, &aData, |
295 | 0 | aStartOffset, aEndOffset); |
296 | 0 | return retVal; |
297 | 0 | } |
298 | | |
299 | | bool |
300 | | ProxyAccessible::SetSelectionBoundsAt(int32_t aSelectionNum, |
301 | | int32_t aStartOffset, |
302 | | int32_t aEndOffset) |
303 | 0 | { |
304 | 0 | bool retVal = false; |
305 | 0 | Unused << mDoc->SendSetSelectionBoundsAt(mID, aSelectionNum, aStartOffset, |
306 | 0 | aEndOffset, &retVal); |
307 | 0 | return retVal; |
308 | 0 | } |
309 | | |
310 | | bool |
311 | | ProxyAccessible::AddToSelection(int32_t aStartOffset, |
312 | | int32_t aEndOffset) |
313 | 0 | { |
314 | 0 | bool retVal = false; |
315 | 0 | Unused << mDoc->SendAddToSelection(mID, aStartOffset, aEndOffset, &retVal); |
316 | 0 | return retVal; |
317 | 0 | } |
318 | | |
319 | | bool |
320 | | ProxyAccessible::RemoveFromSelection(int32_t aSelectionNum) |
321 | 0 | { |
322 | 0 | bool retVal = false; |
323 | 0 | Unused << mDoc->SendRemoveFromSelection(mID, aSelectionNum, &retVal); |
324 | 0 | return retVal; |
325 | 0 | } |
326 | | |
327 | | void |
328 | | ProxyAccessible::ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset, |
329 | | uint32_t aScrollType) |
330 | 0 | { |
331 | 0 | Unused << mDoc->SendScrollSubstringTo(mID, aStartOffset, aEndOffset, aScrollType); |
332 | 0 | } |
333 | | |
334 | | void |
335 | | ProxyAccessible::ScrollSubstringToPoint(int32_t aStartOffset, |
336 | | int32_t aEndOffset, |
337 | | uint32_t aCoordinateType, |
338 | | int32_t aX, int32_t aY) |
339 | 0 | { |
340 | 0 | Unused << mDoc->SendScrollSubstringToPoint(mID, aStartOffset, aEndOffset, |
341 | 0 | aCoordinateType, aX, aY); |
342 | 0 | } |
343 | | |
344 | | void |
345 | | ProxyAccessible::Text(nsString* aText) |
346 | 0 | { |
347 | 0 | Unused << mDoc->SendText(mID, aText); |
348 | 0 | } |
349 | | |
350 | | void |
351 | | ProxyAccessible::ReplaceText(const nsString& aText) |
352 | 0 | { |
353 | 0 | Unused << mDoc->SendReplaceText(mID, aText); |
354 | 0 | } |
355 | | |
356 | | bool |
357 | | ProxyAccessible::InsertText(const nsString& aText, int32_t aPosition) |
358 | 0 | { |
359 | 0 | bool valid; |
360 | 0 | Unused << mDoc->SendInsertText(mID, aText, aPosition, &valid); |
361 | 0 | return valid; |
362 | 0 | } |
363 | | |
364 | | bool |
365 | | ProxyAccessible::CopyText(int32_t aStartPos, int32_t aEndPos) |
366 | 0 | { |
367 | 0 | bool valid; |
368 | 0 | Unused << mDoc->SendCopyText(mID, aStartPos, aEndPos, &valid); |
369 | 0 | return valid; |
370 | 0 | } |
371 | | |
372 | | bool |
373 | | ProxyAccessible::CutText(int32_t aStartPos, int32_t aEndPos) |
374 | 0 | { |
375 | 0 | bool valid; |
376 | 0 | Unused << mDoc->SendCutText(mID, aStartPos, aEndPos, &valid); |
377 | 0 | return valid; |
378 | 0 | } |
379 | | |
380 | | bool |
381 | | ProxyAccessible::DeleteText(int32_t aStartPos, int32_t aEndPos) |
382 | 0 | { |
383 | 0 | bool valid; |
384 | 0 | Unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos, &valid); |
385 | 0 | return valid; |
386 | 0 | } |
387 | | |
388 | | bool |
389 | | ProxyAccessible::PasteText(int32_t aPosition) |
390 | 0 | { |
391 | 0 | bool valid; |
392 | 0 | Unused << mDoc->SendPasteText(mID, aPosition, &valid); |
393 | 0 | return valid; |
394 | 0 | } |
395 | | |
396 | | nsIntPoint |
397 | | ProxyAccessible::ImagePosition(uint32_t aCoordType) |
398 | 0 | { |
399 | 0 | nsIntPoint retVal; |
400 | 0 | Unused << mDoc->SendImagePosition(mID, aCoordType, &retVal); |
401 | 0 | return retVal; |
402 | 0 | } |
403 | | |
404 | | nsIntSize |
405 | | ProxyAccessible::ImageSize() |
406 | 0 | { |
407 | 0 | nsIntSize retVal; |
408 | 0 | Unused << mDoc->SendImageSize(mID, &retVal); |
409 | 0 | return retVal; |
410 | 0 | } |
411 | | |
412 | | uint32_t |
413 | | ProxyAccessible::StartOffset(bool* aOk) |
414 | 0 | { |
415 | 0 | uint32_t retVal = 0; |
416 | 0 | Unused << mDoc->SendStartOffset(mID, &retVal, aOk); |
417 | 0 | return retVal; |
418 | 0 | } |
419 | | |
420 | | uint32_t |
421 | | ProxyAccessible::EndOffset(bool* aOk) |
422 | 0 | { |
423 | 0 | uint32_t retVal = 0; |
424 | 0 | Unused << mDoc->SendEndOffset(mID, &retVal, aOk); |
425 | 0 | return retVal; |
426 | 0 | } |
427 | | |
428 | | bool |
429 | | ProxyAccessible::IsLinkValid() |
430 | 0 | { |
431 | 0 | bool retVal = false; |
432 | 0 | Unused << mDoc->SendIsLinkValid(mID, &retVal); |
433 | 0 | return retVal; |
434 | 0 | } |
435 | | |
436 | | uint32_t |
437 | | ProxyAccessible::AnchorCount(bool* aOk) |
438 | 0 | { |
439 | 0 | uint32_t retVal = 0; |
440 | 0 | Unused << mDoc->SendAnchorCount(mID, &retVal, aOk); |
441 | 0 | return retVal; |
442 | 0 | } |
443 | | |
444 | | void |
445 | | ProxyAccessible::AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk) |
446 | 0 | { |
447 | 0 | Unused << mDoc->SendAnchorURIAt(mID, aIndex, &aURI, aOk); |
448 | 0 | } |
449 | | |
450 | | ProxyAccessible* |
451 | | ProxyAccessible::AnchorAt(uint32_t aIndex) |
452 | 0 | { |
453 | 0 | uint64_t id = 0; |
454 | 0 | bool ok = false; |
455 | 0 | Unused << mDoc->SendAnchorAt(mID, aIndex, &id, &ok); |
456 | 0 | return ok ? mDoc->GetAccessible(id) : nullptr; |
457 | 0 | } |
458 | | |
459 | | uint32_t |
460 | | ProxyAccessible::LinkCount() |
461 | 0 | { |
462 | 0 | uint32_t retVal = 0; |
463 | 0 | Unused << mDoc->SendLinkCount(mID, &retVal); |
464 | 0 | return retVal; |
465 | 0 | } |
466 | | |
467 | | ProxyAccessible* |
468 | | ProxyAccessible::LinkAt(const uint32_t& aIndex) |
469 | 0 | { |
470 | 0 | uint64_t linkID = 0; |
471 | 0 | bool ok = false; |
472 | 0 | Unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok); |
473 | 0 | return ok ? mDoc->GetAccessible(linkID) : nullptr; |
474 | 0 | } |
475 | | |
476 | | int32_t |
477 | | ProxyAccessible::LinkIndexOf(ProxyAccessible* aLink) |
478 | 0 | { |
479 | 0 | int32_t retVal = -1; |
480 | 0 | if (aLink) { |
481 | 0 | Unused << mDoc->SendLinkIndexOf(mID, aLink->ID(), &retVal); |
482 | 0 | } |
483 | 0 |
|
484 | 0 | return retVal; |
485 | 0 | } |
486 | | |
487 | | int32_t |
488 | | ProxyAccessible::LinkIndexAtOffset(uint32_t aOffset) |
489 | 0 | { |
490 | 0 | int32_t retVal = -1; |
491 | 0 | Unused << mDoc->SendLinkIndexAtOffset(mID, aOffset, &retVal); |
492 | 0 | return retVal; |
493 | 0 | } |
494 | | |
495 | | ProxyAccessible* |
496 | | ProxyAccessible::TableOfACell() |
497 | 0 | { |
498 | 0 | uint64_t tableID = 0; |
499 | 0 | bool ok = false; |
500 | 0 | Unused << mDoc->SendTableOfACell(mID, &tableID, &ok); |
501 | 0 | return ok ? mDoc->GetAccessible(tableID) : nullptr; |
502 | 0 | } |
503 | | |
504 | | uint32_t |
505 | | ProxyAccessible::ColIdx() |
506 | 0 | { |
507 | 0 | uint32_t index = 0; |
508 | 0 | Unused << mDoc->SendColIdx(mID, &index); |
509 | 0 | return index; |
510 | 0 | } |
511 | | |
512 | | uint32_t |
513 | | ProxyAccessible::RowIdx() |
514 | 0 | { |
515 | 0 | uint32_t index = 0; |
516 | 0 | Unused << mDoc->SendRowIdx(mID, &index); |
517 | 0 | return index; |
518 | 0 | } |
519 | | |
520 | | void |
521 | | ProxyAccessible::GetColRowExtents(uint32_t* aColIdx, uint32_t* aRowIdx, |
522 | | uint32_t* aColExtent, uint32_t* aRowExtent) |
523 | 0 | { |
524 | 0 | Unused << mDoc->SendGetColRowExtents(mID, aColIdx, aRowIdx, aColExtent, aRowExtent); |
525 | 0 | } |
526 | | |
527 | | void |
528 | | ProxyAccessible::GetPosition(uint32_t* aColIdx, uint32_t* aRowIdx) |
529 | 0 | { |
530 | 0 | Unused << mDoc->SendGetPosition(mID, aColIdx, aRowIdx); |
531 | 0 | } |
532 | | |
533 | | uint32_t |
534 | | ProxyAccessible::ColExtent() |
535 | 0 | { |
536 | 0 | uint32_t extent = 0; |
537 | 0 | Unused << mDoc->SendColExtent(mID, &extent); |
538 | 0 | return extent; |
539 | 0 | } |
540 | | |
541 | | uint32_t |
542 | | ProxyAccessible::RowExtent() |
543 | 0 | { |
544 | 0 | uint32_t extent = 0; |
545 | 0 | Unused << mDoc->SendRowExtent(mID, &extent); |
546 | 0 | return extent; |
547 | 0 | } |
548 | | |
549 | | void |
550 | | ProxyAccessible::ColHeaderCells(nsTArray<ProxyAccessible*>* aCells) |
551 | 0 | { |
552 | 0 | nsTArray<uint64_t> targetIDs; |
553 | 0 | Unused << mDoc->SendColHeaderCells(mID, &targetIDs); |
554 | 0 |
|
555 | 0 | size_t targetCount = targetIDs.Length(); |
556 | 0 | for (size_t i = 0; i < targetCount; i++) { |
557 | 0 | aCells->AppendElement(mDoc->GetAccessible(targetIDs[i])); |
558 | 0 | } |
559 | 0 | } |
560 | | |
561 | | void |
562 | | ProxyAccessible::RowHeaderCells(nsTArray<ProxyAccessible*>* aCells) |
563 | 0 | { |
564 | 0 | nsTArray<uint64_t> targetIDs; |
565 | 0 | Unused << mDoc->SendRowHeaderCells(mID, &targetIDs); |
566 | 0 |
|
567 | 0 | size_t targetCount = targetIDs.Length(); |
568 | 0 | for (size_t i = 0; i < targetCount; i++) { |
569 | 0 | aCells->AppendElement(mDoc->GetAccessible(targetIDs[i])); |
570 | 0 | } |
571 | 0 | } |
572 | | |
573 | | bool |
574 | | ProxyAccessible::IsCellSelected() |
575 | 0 | { |
576 | 0 | bool selected = false; |
577 | 0 | Unused << mDoc->SendIsCellSelected(mID, &selected); |
578 | 0 | return selected; |
579 | 0 | } |
580 | | |
581 | | ProxyAccessible* |
582 | | ProxyAccessible::TableCaption() |
583 | 0 | { |
584 | 0 | uint64_t captionID = 0; |
585 | 0 | bool ok = false; |
586 | 0 | Unused << mDoc->SendTableCaption(mID, &captionID, &ok); |
587 | 0 | return ok ? mDoc->GetAccessible(captionID) : nullptr; |
588 | 0 | } |
589 | | |
590 | | void |
591 | | ProxyAccessible::TableSummary(nsString& aSummary) |
592 | 0 | { |
593 | 0 | Unused << mDoc->SendTableSummary(mID, &aSummary); |
594 | 0 | } |
595 | | |
596 | | uint32_t |
597 | | ProxyAccessible::TableColumnCount() |
598 | 0 | { |
599 | 0 | uint32_t count = 0; |
600 | 0 | Unused << mDoc->SendTableColumnCount(mID, &count); |
601 | 0 | return count; |
602 | 0 | } |
603 | | |
604 | | uint32_t |
605 | | ProxyAccessible::TableRowCount() |
606 | 0 | { |
607 | 0 | uint32_t count = 0; |
608 | 0 | Unused << mDoc->SendTableRowCount(mID, &count); |
609 | 0 | return count; |
610 | 0 | } |
611 | | |
612 | | ProxyAccessible* |
613 | | ProxyAccessible::TableCellAt(uint32_t aRow, uint32_t aCol) |
614 | 0 | { |
615 | 0 | uint64_t cellID = 0; |
616 | 0 | bool ok = false; |
617 | 0 | Unused << mDoc->SendTableCellAt(mID, aRow, aCol, &cellID, &ok); |
618 | 0 | return ok ? mDoc->GetAccessible(cellID) : nullptr; |
619 | 0 | } |
620 | | |
621 | | int32_t |
622 | | ProxyAccessible::TableCellIndexAt(uint32_t aRow, uint32_t aCol) |
623 | 0 | { |
624 | 0 | int32_t index = 0; |
625 | 0 | Unused << mDoc->SendTableCellIndexAt(mID, aRow, aCol, &index); |
626 | 0 | return index; |
627 | 0 | } |
628 | | |
629 | | int32_t |
630 | | ProxyAccessible::TableColumnIndexAt(uint32_t aCellIndex) |
631 | 0 | { |
632 | 0 | int32_t index = 0; |
633 | 0 | Unused << mDoc->SendTableColumnIndexAt(mID, aCellIndex, &index); |
634 | 0 | return index; |
635 | 0 | } |
636 | | |
637 | | int32_t |
638 | | ProxyAccessible::TableRowIndexAt(uint32_t aCellIndex) |
639 | 0 | { |
640 | 0 | int32_t index = 0; |
641 | 0 | Unused << mDoc->SendTableRowIndexAt(mID, aCellIndex, &index); |
642 | 0 | return index; |
643 | 0 | } |
644 | | |
645 | | void |
646 | | ProxyAccessible::TableRowAndColumnIndicesAt(uint32_t aCellIndex, |
647 | | int32_t* aRow, int32_t* aCol) |
648 | 0 | { |
649 | 0 | Unused << mDoc->SendTableRowAndColumnIndicesAt(mID, aCellIndex, aRow, aCol); |
650 | 0 | } |
651 | | |
652 | | uint32_t |
653 | | ProxyAccessible::TableColumnExtentAt(uint32_t aRow, uint32_t aCol) |
654 | 0 | { |
655 | 0 | uint32_t extent = 0; |
656 | 0 | Unused << mDoc->SendTableColumnExtentAt(mID, aRow, aCol, &extent); |
657 | 0 | return extent; |
658 | 0 | } |
659 | | |
660 | | uint32_t |
661 | | ProxyAccessible::TableRowExtentAt(uint32_t aRow, uint32_t aCol) |
662 | 0 | { |
663 | 0 | uint32_t extent = 0; |
664 | 0 | Unused << mDoc->SendTableRowExtentAt(mID, aRow, aCol, &extent); |
665 | 0 | return extent; |
666 | 0 | } |
667 | | |
668 | | void |
669 | | ProxyAccessible::TableColumnDescription(uint32_t aCol, nsString& aDescription) |
670 | 0 | { |
671 | 0 | Unused << mDoc->SendTableColumnDescription(mID, aCol, &aDescription); |
672 | 0 | } |
673 | | |
674 | | void |
675 | | ProxyAccessible::TableRowDescription(uint32_t aRow, nsString& aDescription) |
676 | 0 | { |
677 | 0 | Unused << mDoc->SendTableRowDescription(mID, aRow, &aDescription); |
678 | 0 | } |
679 | | |
680 | | bool |
681 | | ProxyAccessible::TableColumnSelected(uint32_t aCol) |
682 | 0 | { |
683 | 0 | bool selected = false; |
684 | 0 | Unused << mDoc->SendTableColumnSelected(mID, aCol, &selected); |
685 | 0 | return selected; |
686 | 0 | } |
687 | | |
688 | | bool |
689 | | ProxyAccessible::TableRowSelected(uint32_t aRow) |
690 | 0 | { |
691 | 0 | bool selected = false; |
692 | 0 | Unused << mDoc->SendTableRowSelected(mID, aRow, &selected); |
693 | 0 | return selected; |
694 | 0 | } |
695 | | |
696 | | bool |
697 | | ProxyAccessible::TableCellSelected(uint32_t aRow, uint32_t aCol) |
698 | 0 | { |
699 | 0 | bool selected = false; |
700 | 0 | Unused << mDoc->SendTableCellSelected(mID, aRow, aCol, &selected); |
701 | 0 | return selected; |
702 | 0 | } |
703 | | |
704 | | uint32_t |
705 | | ProxyAccessible::TableSelectedCellCount() |
706 | 0 | { |
707 | 0 | uint32_t count = 0; |
708 | 0 | Unused << mDoc->SendTableSelectedCellCount(mID, &count); |
709 | 0 | return count; |
710 | 0 | } |
711 | | |
712 | | uint32_t |
713 | | ProxyAccessible::TableSelectedColumnCount() |
714 | 0 | { |
715 | 0 | uint32_t count = 0; |
716 | 0 | Unused << mDoc->SendTableSelectedColumnCount(mID, &count); |
717 | 0 | return count; |
718 | 0 | } |
719 | | |
720 | | uint32_t |
721 | | ProxyAccessible::TableSelectedRowCount() |
722 | 0 | { |
723 | 0 | uint32_t count = 0; |
724 | 0 | Unused << mDoc->SendTableSelectedRowCount(mID, &count); |
725 | 0 | return count; |
726 | 0 | } |
727 | | |
728 | | void |
729 | | ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs) |
730 | 0 | { |
731 | 0 | AutoTArray<uint64_t, 30> cellIDs; |
732 | 0 | Unused << mDoc->SendTableSelectedCells(mID, &cellIDs); |
733 | 0 | aCellIDs->SetCapacity(cellIDs.Length()); |
734 | 0 | for (uint32_t i = 0; i < cellIDs.Length(); ++i) { |
735 | 0 | aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i])); |
736 | 0 | } |
737 | 0 | } |
738 | | |
739 | | void |
740 | | ProxyAccessible::TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices) |
741 | 0 | { |
742 | 0 | Unused << mDoc->SendTableSelectedCellIndices(mID, aCellIndices); |
743 | 0 | } |
744 | | |
745 | | void |
746 | | ProxyAccessible::TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices) |
747 | 0 | { |
748 | 0 | Unused << mDoc->SendTableSelectedColumnIndices(mID, aColumnIndices); |
749 | 0 | } |
750 | | |
751 | | void |
752 | | ProxyAccessible::TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices) |
753 | 0 | { |
754 | 0 | Unused << mDoc->SendTableSelectedRowIndices(mID, aRowIndices); |
755 | 0 | } |
756 | | |
757 | | void |
758 | | ProxyAccessible::TableSelectColumn(uint32_t aCol) |
759 | 0 | { |
760 | 0 | Unused << mDoc->SendTableSelectColumn(mID, aCol); |
761 | 0 | } |
762 | | |
763 | | void |
764 | | ProxyAccessible::TableSelectRow(uint32_t aRow) |
765 | 0 | { |
766 | 0 | Unused << mDoc->SendTableSelectRow(mID, aRow); |
767 | 0 | } |
768 | | |
769 | | void |
770 | | ProxyAccessible::TableUnselectColumn(uint32_t aCol) |
771 | 0 | { |
772 | 0 | Unused << mDoc->SendTableUnselectColumn(mID, aCol); |
773 | 0 | } |
774 | | |
775 | | void |
776 | | ProxyAccessible::TableUnselectRow(uint32_t aRow) |
777 | 0 | { |
778 | 0 | Unused << mDoc->SendTableUnselectRow(mID, aRow); |
779 | 0 | } |
780 | | |
781 | | bool |
782 | | ProxyAccessible::TableIsProbablyForLayout() |
783 | 0 | { |
784 | 0 | bool forLayout = false; |
785 | 0 | Unused << mDoc->SendTableIsProbablyForLayout(mID, &forLayout); |
786 | 0 | return forLayout; |
787 | 0 | } |
788 | | |
789 | | ProxyAccessible* |
790 | | ProxyAccessible::AtkTableColumnHeader(int32_t aCol) |
791 | 0 | { |
792 | 0 | uint64_t headerID = 0; |
793 | 0 | bool ok = false; |
794 | 0 | Unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok); |
795 | 0 | return ok ? mDoc->GetAccessible(headerID) : nullptr; |
796 | 0 | } |
797 | | |
798 | | ProxyAccessible* |
799 | | ProxyAccessible::AtkTableRowHeader(int32_t aRow) |
800 | 0 | { |
801 | 0 | uint64_t headerID = 0; |
802 | 0 | bool ok = false; |
803 | 0 | Unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok); |
804 | 0 | return ok ? mDoc->GetAccessible(headerID) : nullptr; |
805 | 0 | } |
806 | | |
807 | | void |
808 | | ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems) |
809 | 0 | { |
810 | 0 | AutoTArray<uint64_t, 10> itemIDs; |
811 | 0 | Unused << mDoc->SendSelectedItems(mID, &itemIDs); |
812 | 0 | aSelectedItems->SetCapacity(itemIDs.Length()); |
813 | 0 | for (size_t i = 0; i < itemIDs.Length(); ++i) { |
814 | 0 | aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i])); |
815 | 0 | } |
816 | 0 | } |
817 | | |
818 | | uint32_t |
819 | | ProxyAccessible::SelectedItemCount() |
820 | 0 | { |
821 | 0 | uint32_t count = 0; |
822 | 0 | Unused << mDoc->SendSelectedItemCount(mID, &count); |
823 | 0 | return count; |
824 | 0 | } |
825 | | |
826 | | ProxyAccessible* |
827 | | ProxyAccessible::GetSelectedItem(uint32_t aIndex) |
828 | 0 | { |
829 | 0 | uint64_t selectedItemID = 0; |
830 | 0 | bool ok = false; |
831 | 0 | Unused << mDoc->SendGetSelectedItem(mID, aIndex, &selectedItemID, &ok); |
832 | 0 | return ok ? mDoc->GetAccessible(selectedItemID) : nullptr; |
833 | 0 | } |
834 | | |
835 | | bool |
836 | | ProxyAccessible::IsItemSelected(uint32_t aIndex) |
837 | 0 | { |
838 | 0 | bool selected = false; |
839 | 0 | Unused << mDoc->SendIsItemSelected(mID, aIndex, &selected); |
840 | 0 | return selected; |
841 | 0 | } |
842 | | |
843 | | bool |
844 | | ProxyAccessible::AddItemToSelection(uint32_t aIndex) |
845 | 0 | { |
846 | 0 | bool success = false; |
847 | 0 | Unused << mDoc->SendAddItemToSelection(mID, aIndex, &success); |
848 | 0 | return success; |
849 | 0 | } |
850 | | |
851 | | bool |
852 | | ProxyAccessible::RemoveItemFromSelection(uint32_t aIndex) |
853 | 0 | { |
854 | 0 | bool success = false; |
855 | 0 | Unused << mDoc->SendRemoveItemFromSelection(mID, aIndex, &success); |
856 | 0 | return success; |
857 | 0 | } |
858 | | |
859 | | bool |
860 | | ProxyAccessible::SelectAll() |
861 | 0 | { |
862 | 0 | bool success = false; |
863 | 0 | Unused << mDoc->SendSelectAll(mID, &success); |
864 | 0 | return success; |
865 | 0 | } |
866 | | |
867 | | bool |
868 | | ProxyAccessible::UnselectAll() |
869 | 0 | { |
870 | 0 | bool success = false; |
871 | 0 | Unused << mDoc->SendUnselectAll(mID, &success); |
872 | 0 | return success; |
873 | 0 | } |
874 | | |
875 | | void |
876 | | ProxyAccessible::TakeSelection() |
877 | 0 | { |
878 | 0 | Unused << mDoc->SendTakeSelection(mID); |
879 | 0 | } |
880 | | |
881 | | void |
882 | | ProxyAccessible::SetSelected(bool aSelect) |
883 | 0 | { |
884 | 0 | Unused << mDoc->SendSetSelected(mID, aSelect); |
885 | 0 | } |
886 | | |
887 | | bool |
888 | | ProxyAccessible::DoAction(uint8_t aIndex) |
889 | 0 | { |
890 | 0 | bool success = false; |
891 | 0 | Unused << mDoc->SendDoAction(mID, aIndex, &success); |
892 | 0 | return success; |
893 | 0 | } |
894 | | |
895 | | uint8_t |
896 | | ProxyAccessible::ActionCount() |
897 | 0 | { |
898 | 0 | uint8_t count = 0; |
899 | 0 | Unused << mDoc->SendActionCount(mID, &count); |
900 | 0 | return count; |
901 | 0 | } |
902 | | |
903 | | void |
904 | | ProxyAccessible::ActionDescriptionAt(uint8_t aIndex, nsString& aDescription) |
905 | 0 | { |
906 | 0 | Unused << mDoc->SendActionDescriptionAt(mID, aIndex, &aDescription); |
907 | 0 | } |
908 | | |
909 | | void |
910 | | ProxyAccessible::ActionNameAt(uint8_t aIndex, nsString& aName) |
911 | 0 | { |
912 | 0 | Unused << mDoc->SendActionNameAt(mID, aIndex, &aName); |
913 | 0 | } |
914 | | |
915 | | KeyBinding |
916 | | ProxyAccessible::AccessKey() |
917 | 0 | { |
918 | 0 | uint32_t key = 0; |
919 | 0 | uint32_t modifierMask = 0; |
920 | 0 | Unused << mDoc->SendAccessKey(mID, &key, &modifierMask); |
921 | 0 | return KeyBinding(key, modifierMask); |
922 | 0 | } |
923 | | |
924 | | KeyBinding |
925 | | ProxyAccessible::KeyboardShortcut() |
926 | 0 | { |
927 | 0 | uint32_t key = 0; |
928 | 0 | uint32_t modifierMask = 0; |
929 | 0 | Unused << mDoc->SendKeyboardShortcut(mID, &key, &modifierMask); |
930 | 0 | return KeyBinding(key, modifierMask); |
931 | 0 | } |
932 | | |
933 | | void |
934 | | ProxyAccessible::AtkKeyBinding(nsString& aBinding) |
935 | 0 | { |
936 | 0 | Unused << mDoc->SendAtkKeyBinding(mID, &aBinding); |
937 | 0 | } |
938 | | |
939 | | double |
940 | | ProxyAccessible::CurValue() |
941 | 0 | { |
942 | 0 | double val = UnspecifiedNaN<double>(); |
943 | 0 | Unused << mDoc->SendCurValue(mID, &val); |
944 | 0 | return val; |
945 | 0 | } |
946 | | |
947 | | bool |
948 | | ProxyAccessible::SetCurValue(double aValue) |
949 | 0 | { |
950 | 0 | bool success = false; |
951 | 0 | Unused << mDoc->SendSetCurValue(mID, aValue, &success); |
952 | 0 | return success; |
953 | 0 | } |
954 | | |
955 | | double |
956 | | ProxyAccessible::MinValue() |
957 | 0 | { |
958 | 0 | double val = UnspecifiedNaN<double>(); |
959 | 0 | Unused << mDoc->SendMinValue(mID, &val); |
960 | 0 | return val; |
961 | 0 | } |
962 | | |
963 | | double |
964 | | ProxyAccessible::MaxValue() |
965 | 0 | { |
966 | 0 | double val = UnspecifiedNaN<double>(); |
967 | 0 | Unused << mDoc->SendMaxValue(mID, &val); |
968 | 0 | return val; |
969 | 0 | } |
970 | | |
971 | | double |
972 | | ProxyAccessible::Step() |
973 | 0 | { |
974 | 0 | double step = UnspecifiedNaN<double>(); |
975 | 0 | Unused << mDoc->SendStep(mID, &step); |
976 | 0 | return step; |
977 | 0 | } |
978 | | |
979 | | void |
980 | | ProxyAccessible::TakeFocus() |
981 | 0 | { |
982 | 0 | Unused << mDoc->SendTakeFocus(mID); |
983 | 0 | } |
984 | | |
985 | | ProxyAccessible* |
986 | | ProxyAccessible::FocusedChild() |
987 | 0 | { |
988 | 0 | uint64_t childID = 0; |
989 | 0 | bool ok = false; |
990 | 0 | Unused << mDoc->SendFocusedChild(mID, &childID, &ok); |
991 | 0 | return ok ? mDoc->GetAccessible(childID) : nullptr; |
992 | 0 | } |
993 | | |
994 | | ProxyAccessible* |
995 | | ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY, |
996 | | Accessible::EWhichChildAtPoint aWhichChild) |
997 | 0 | { |
998 | 0 | uint64_t childID = 0; |
999 | 0 | bool ok = false; |
1000 | 0 | Unused << mDoc->SendAccessibleAtPoint(mID, aX, aY, false, |
1001 | 0 | static_cast<uint32_t>(aWhichChild), |
1002 | 0 | &childID, &ok); |
1003 | 0 | return ok ? mDoc->GetAccessible(childID) : nullptr; |
1004 | 0 | } |
1005 | | |
1006 | | nsIntRect |
1007 | | ProxyAccessible::Bounds() |
1008 | 0 | { |
1009 | 0 | nsIntRect rect; |
1010 | 0 | Unused << mDoc->SendExtents(mID, false, |
1011 | 0 | &(rect.x), &(rect.y), |
1012 | 0 | &(rect.width), &(rect.height)); |
1013 | 0 | return rect; |
1014 | 0 | } |
1015 | | |
1016 | | nsIntRect |
1017 | | ProxyAccessible::BoundsInCSSPixels() |
1018 | 0 | { |
1019 | 0 | nsIntRect rect; |
1020 | 0 | Unused << mDoc->SendExtentsInCSSPixels(mID, |
1021 | 0 | &rect.x, &rect.y, |
1022 | 0 | &rect.width, &rect.height); |
1023 | 0 | return rect; |
1024 | 0 | } |
1025 | | |
1026 | | void |
1027 | | ProxyAccessible::Language(nsString& aLocale) |
1028 | 0 | { |
1029 | 0 | Unused << mDoc->SendLanguage(mID, &aLocale); |
1030 | 0 | } |
1031 | | |
1032 | | void |
1033 | | ProxyAccessible::DocType(nsString& aType) |
1034 | 0 | { |
1035 | 0 | Unused << mDoc->SendDocType(mID, &aType); |
1036 | 0 | } |
1037 | | |
1038 | | void |
1039 | | ProxyAccessible::Title(nsString& aTitle) |
1040 | 0 | { |
1041 | 0 | Unused << mDoc->SendTitle(mID, &aTitle); |
1042 | 0 | } |
1043 | | |
1044 | | void |
1045 | | ProxyAccessible::URL(nsString& aURL) |
1046 | 0 | { |
1047 | 0 | Unused << mDoc->SendURL(mID, &aURL); |
1048 | 0 | } |
1049 | | |
1050 | | void |
1051 | | ProxyAccessible::MimeType(nsString aMime) |
1052 | 0 | { |
1053 | 0 | Unused << mDoc->SendMimeType(mID, &aMime); |
1054 | 0 | } |
1055 | | |
1056 | | void |
1057 | | ProxyAccessible::URLDocTypeMimeType(nsString& aURL, nsString& aDocType, |
1058 | | nsString& aMimeType) |
1059 | 0 | { |
1060 | 0 | Unused << mDoc->SendURLDocTypeMimeType(mID, &aURL, &aDocType, &aMimeType); |
1061 | 0 | } |
1062 | | |
1063 | | ProxyAccessible* |
1064 | | ProxyAccessible::AccessibleAtPoint(int32_t aX, int32_t aY, |
1065 | | bool aNeedsScreenCoords) |
1066 | 0 | { |
1067 | 0 | uint64_t childID = 0; |
1068 | 0 | bool ok = false; |
1069 | 0 | Unused << |
1070 | 0 | mDoc->SendAccessibleAtPoint(mID, aX, aY, aNeedsScreenCoords, |
1071 | 0 | static_cast<uint32_t>(Accessible::eDirectChild), |
1072 | 0 | &childID, &ok); |
1073 | 0 | return ok ? mDoc->GetAccessible(childID) : nullptr; |
1074 | 0 | } |
1075 | | |
1076 | | void |
1077 | | ProxyAccessible::Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY, |
1078 | | int32_t* aWidth, int32_t* aHeight) |
1079 | 0 | { |
1080 | 0 | Unused << mDoc->SendExtents(mID, aNeedsScreenCoords, aX, aY, aWidth, aHeight); |
1081 | 0 | } |
1082 | | |
1083 | | void |
1084 | | ProxyAccessible::DOMNodeID(nsString& aID) |
1085 | 0 | { |
1086 | 0 | Unused << mDoc->SendDOMNodeID(mID, &aID); |
1087 | 0 | } |
1088 | | |
1089 | | } |
1090 | | } |