AccessibilityUIElement.cpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*
  2. * Copyright (C) 2011 Apple Inc. All Rights Reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #include "config.h"
  26. #include "AccessibilityUIElement.h"
  27. #include "JSAccessibilityUIElement.h"
  28. #include <JavaScriptCore/JSRetainPtr.h>
  29. namespace WTR {
  30. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::create(PlatformUIElement uiElement)
  31. {
  32. return adoptRef(new AccessibilityUIElement(uiElement));
  33. }
  34. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::create(const AccessibilityUIElement& uiElement)
  35. {
  36. return adoptRef(new AccessibilityUIElement(uiElement));
  37. }
  38. JSClassRef AccessibilityUIElement::wrapperClass()
  39. {
  40. return JSAccessibilityUIElement::accessibilityUIElementClass();
  41. }
  42. // Implementation
  43. bool AccessibilityUIElement::isValid() const
  44. {
  45. return m_element;
  46. }
  47. // Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified.
  48. #if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(EFL)
  49. AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement) { }
  50. AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement&) { }
  51. AccessibilityUIElement::~AccessibilityUIElement() { }
  52. bool AccessibilityUIElement::isEqual(AccessibilityUIElement*) { return false; }
  53. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::elementAtPoint(int, int) { return 0; }
  54. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::childAtIndex(unsigned) { return 0; }
  55. unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement*) { return 0; }
  56. int AccessibilityUIElement::childrenCount() { return 0; }
  57. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::titleUIElement() { return 0; }
  58. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement() { return 0; }
  59. void AccessibilityUIElement::takeFocus() { }
  60. void AccessibilityUIElement::takeSelection() { }
  61. void AccessibilityUIElement::addSelection() { }
  62. void AccessibilityUIElement::removeSelection() { }
  63. JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes() { return 0; }
  64. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements() { return 0; }
  65. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(unsigned) { return 0; }
  66. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks() { return 0; }
  67. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren() { return 0; }
  68. JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames() { return 0; }
  69. void AccessibilityUIElement::increment() { }
  70. void AccessibilityUIElement::decrement() { }
  71. void AccessibilityUIElement::showMenu() { }
  72. void AccessibilityUIElement::press() { }
  73. JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef) { return 0; }
  74. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementAttributeValue(JSStringRef) const { return 0; }
  75. double AccessibilityUIElement::numberAttributeValue(JSStringRef) { return 0; }
  76. bool AccessibilityUIElement::boolAttributeValue(JSStringRef) { return false; }
  77. bool AccessibilityUIElement::isAttributeSupported(JSStringRef) { return false; }
  78. bool AccessibilityUIElement::isAttributeSettable(JSStringRef) { return false; }
  79. bool AccessibilityUIElement::isPressActionSupported() { return false; }
  80. bool AccessibilityUIElement::isIncrementActionSupported() { return false; }
  81. bool AccessibilityUIElement::isDecrementActionSupported() { return false; }
  82. JSRetainPtr<JSStringRef> AccessibilityUIElement::role() { return 0; }
  83. JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole() { return 0; }
  84. JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription() { return 0; }
  85. JSRetainPtr<JSStringRef> AccessibilityUIElement::title() { return 0; }
  86. JSRetainPtr<JSStringRef> AccessibilityUIElement::description() { return 0; }
  87. JSRetainPtr<JSStringRef> AccessibilityUIElement::language() { return 0; }
  88. JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue() { return 0; }
  89. JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const { return 0; }
  90. JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const { return 0; }
  91. JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const { return 0; }
  92. double AccessibilityUIElement::x() { return 0; }
  93. double AccessibilityUIElement::y() { return 0; }
  94. double AccessibilityUIElement::width() { return 0; }
  95. double AccessibilityUIElement::height() { return 0; }
  96. double AccessibilityUIElement::intValue() const { return 0; }
  97. double AccessibilityUIElement::minValue() { return 0; }
  98. double AccessibilityUIElement::maxValue() { return 0; }
  99. JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription() { return 0; }
  100. int AccessibilityUIElement::insertionPointLineNumber() { return 0; }
  101. JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange() { return 0; }
  102. bool AccessibilityUIElement::isEnabled() { return false; }
  103. bool AccessibilityUIElement::isRequired() const { return false; }
  104. bool AccessibilityUIElement::isFocused() const { return false; }
  105. bool AccessibilityUIElement::isFocusable() const { return false; }
  106. bool AccessibilityUIElement::isSelected() const { return false; }
  107. bool AccessibilityUIElement::isSelectable() const { return false; }
  108. bool AccessibilityUIElement::isMultiSelectable() const { return false; }
  109. void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
  110. unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
  111. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
  112. bool AccessibilityUIElement::isExpanded() const { return false; }
  113. bool AccessibilityUIElement::isChecked() const { return false; }
  114. bool AccessibilityUIElement::isVisible() const { return false; }
  115. bool AccessibilityUIElement::isOffScreen() const { return false; }
  116. bool AccessibilityUIElement::isCollapsed() const { return false; }
  117. bool AccessibilityUIElement::isIgnored() const { return false; }
  118. bool AccessibilityUIElement::hasPopup() const { return false; }
  119. int AccessibilityUIElement::hierarchicalLevel() const { return 0; }
  120. double AccessibilityUIElement::clickPointX() { return 0; }
  121. double AccessibilityUIElement::clickPointY() { return 0; }
  122. JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding() { return 0; }
  123. JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI() { return 0; }
  124. JSRetainPtr<JSStringRef> AccessibilityUIElement::url() { return 0; }
  125. JSRetainPtr<JSStringRef> AccessibilityUIElement::speak() { return 0; }
  126. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders() { return 0; }
  127. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders() { return 0; }
  128. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns() { return 0; }
  129. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows() { return 0; }
  130. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells() { return 0; }
  131. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader() { return 0; }
  132. int AccessibilityUIElement::indexInTable() { return 0; }
  133. JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange() { return 0; }
  134. JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange() { return 0; }
  135. int AccessibilityUIElement::rowCount() { return 0; }
  136. int AccessibilityUIElement::columnCount() { return 0; }
  137. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedRowAtIndex(unsigned) { return 0; }
  138. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedByRow() { return 0; }
  139. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned) { return 0; }
  140. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::rowAtIndex(unsigned) { return 0; }
  141. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned) { return 0; }
  142. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned) { return 0; }
  143. bool AccessibilityUIElement::ariaIsGrabbed() const { return false; }
  144. JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const { return 0; }
  145. int AccessibilityUIElement::lineForIndex(int) { return 0; }
  146. JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int) { return 0; }
  147. JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
  148. JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned, unsigned) { return 0; }
  149. void AccessibilityUIElement::setSelectedTextRange(unsigned, unsigned) { }
  150. JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned, unsigned) { return 0; }
  151. JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned, unsigned) { return 0; }
  152. bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
  153. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool) { return 0; }
  154. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned, unsigned) { return 0; }
  155. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::horizontalScrollbar() const { return 0; }
  156. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const { return 0; }
  157. bool AccessibilityUIElement::addNotificationListener(JSValueRef) { return false; }
  158. bool AccessibilityUIElement::removeNotificationListener() { return false; }
  159. PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement*) { return 0; }
  160. int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange*) { return 0; }
  161. PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker*, AccessibilityTextMarker*) { return 0; }
  162. PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
  163. PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
  164. PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker*) { return 0; }
  165. PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int, int) { return 0; }
  166. PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*) { return 0; }
  167. PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*) { return 0; }
  168. JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
  169. bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef, AccessibilityTextMarkerRange*) { return false; }
  170. int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker*) { return -1; }
  171. bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker*) { return false; }
  172. PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForIndex(int) { return 0; }
  173. void AccessibilityUIElement::scrollToMakeVisible() { }
  174. JSRetainPtr<JSStringRef> AccessibilityUIElement::supportedActions() const { return 0; }
  175. JSRetainPtr<JSStringRef> AccessibilityUIElement::mathPostscriptsDescription() const { return 0; }
  176. JSRetainPtr<JSStringRef> AccessibilityUIElement::mathPrescriptsDescription() const { return 0; }
  177. JSRetainPtr<JSStringRef> AccessibilityUIElement::pathDescription() const { return 0; }
  178. #endif
  179. } // namespace WTR