[EFL][GTK] Adapt accessibility feature to WebKitTestRunner.
[WebKit-https.git] / Tools / WebKitTestRunner / InjectedBundle / AccessibilityUIElement.cpp
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
26 #include "config.h"
27 #include "AccessibilityUIElement.h"
28
29 #include "JSAccessibilityUIElement.h"
30 #include <JavaScriptCore/JSRetainPtr.h>
31
32 namespace WTR {
33
34 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::create(PlatformUIElement uiElement)
35 {
36     return adoptRef(new AccessibilityUIElement(uiElement));
37 }
38     
39 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::create(const AccessibilityUIElement& uiElement)
40 {
41     return adoptRef(new AccessibilityUIElement(uiElement));
42 }
43
44 JSClassRef AccessibilityUIElement::wrapperClass()
45 {
46     return JSAccessibilityUIElement::accessibilityUIElementClass();
47 }
48     
49 // Implementation
50
51 bool AccessibilityUIElement::isValid() const
52 {
53     return m_element;            
54 }
55
56 // Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified.
57 #if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(EFL)
58 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement) { }
59 AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement&) { }
60 AccessibilityUIElement::~AccessibilityUIElement() { }
61 bool AccessibilityUIElement::isEqual(AccessibilityUIElement*) { return false; }
62 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::elementAtPoint(int, int) { return 0; }
63 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::childAtIndex(unsigned) { return 0; }
64 unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement*) { return 0; }
65 int AccessibilityUIElement::childrenCount() { return 0; }
66 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::titleUIElement() { return 0; }
67 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement() { return 0; }
68 void AccessibilityUIElement::takeFocus() { }
69 void AccessibilityUIElement::takeSelection() { }
70 void AccessibilityUIElement::addSelection() { }
71 void AccessibilityUIElement::removeSelection() { }
72 JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes() { return 0; }
73 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements() { return 0; }
74 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(unsigned) { return 0; }
75 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks() { return 0; }
76 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren() { return 0; }
77 JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames() { return 0; }
78 void AccessibilityUIElement::increment() { }
79 void AccessibilityUIElement::decrement() { }
80 void AccessibilityUIElement::showMenu() { }
81 void AccessibilityUIElement::press() { }
82 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef) { return 0; }
83 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementAttributeValue(JSStringRef) const { return 0; }
84 double AccessibilityUIElement::numberAttributeValue(JSStringRef) { return 0; }
85 bool AccessibilityUIElement::boolAttributeValue(JSStringRef) { return false; }
86 bool AccessibilityUIElement::isAttributeSupported(JSStringRef) { return false; }
87 bool AccessibilityUIElement::isAttributeSettable(JSStringRef) { return false; }
88 bool AccessibilityUIElement::isActionSupported(JSStringRef) { return false; }
89 JSRetainPtr<JSStringRef> AccessibilityUIElement::role() { return 0; }
90 JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole() { return 0; }
91 JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription() { return 0; }
92 JSRetainPtr<JSStringRef> AccessibilityUIElement::title() { return 0; }
93 JSRetainPtr<JSStringRef> AccessibilityUIElement::description() { return 0; }
94 JSRetainPtr<JSStringRef> AccessibilityUIElement::language() { return 0; }
95 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue() { return 0; }
96 JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const { return 0; }
97 JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const { return 0; }
98 JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const { return 0; }
99 double AccessibilityUIElement::x() { return 0; }
100 double AccessibilityUIElement::y() { return 0; }
101 double AccessibilityUIElement::width() { return 0; }
102 double AccessibilityUIElement::height() { return 0; }
103 double AccessibilityUIElement::intValue() const { return 0; }
104 double AccessibilityUIElement::minValue() { return 0; }
105 double AccessibilityUIElement::maxValue() { return 0; }
106 JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription() { return 0; }
107 int AccessibilityUIElement::insertionPointLineNumber() { return 0; }
108 JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange() { return 0; }
109 bool AccessibilityUIElement::isEnabled() { return false; }
110 bool AccessibilityUIElement::isRequired() const { return false; }
111 bool AccessibilityUIElement::isFocused() const { return false; }
112 bool AccessibilityUIElement::isFocusable() const { return false; }
113 bool AccessibilityUIElement::isSelected() const { return false; }
114 bool AccessibilityUIElement::isSelectable() const { return false; }
115 bool AccessibilityUIElement::isMultiSelectable() const { return false; }
116 void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
117 unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
118 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
119 bool AccessibilityUIElement::isExpanded() const { return false; }
120 bool AccessibilityUIElement::isChecked() const { return false; }
121 bool AccessibilityUIElement::isVisible() const { return false; }
122 bool AccessibilityUIElement::isOffScreen() const { return false; }
123 bool AccessibilityUIElement::isCollapsed() const { return false; }
124 bool AccessibilityUIElement::isIgnored() const { return false; }
125 bool AccessibilityUIElement::hasPopup() const { return false; }
126 int AccessibilityUIElement::hierarchicalLevel() const { return 0; }
127 double AccessibilityUIElement::clickPointX() { return 0; }
128 double AccessibilityUIElement::clickPointY() { return 0; }
129 JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding() { return 0; }
130 JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI() { return 0; }
131 JSRetainPtr<JSStringRef> AccessibilityUIElement::url() { return 0; }
132 JSRetainPtr<JSStringRef> AccessibilityUIElement::speak() { return 0; }
133 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders() { return 0; }
134 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders() { return 0; }
135 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns() { return 0; }
136 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows() { return 0; }
137 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells() { return 0; }
138 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader() { return 0; }
139 int AccessibilityUIElement::indexInTable() { return 0; }
140 JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange() { return 0; }
141 JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange() { return 0; }
142 int AccessibilityUIElement::rowCount() { return 0; }
143 int AccessibilityUIElement::columnCount() { return 0; }
144 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedRowAtIndex(unsigned) { return 0; }
145 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedByRow() { return 0; }
146 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned) { return 0; }
147 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::rowAtIndex(unsigned) { return 0; }
148 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned) { return 0; }
149 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned) { return 0; }
150 bool AccessibilityUIElement::ariaIsGrabbed() const { return false; }
151 JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const { return 0; }
152 int AccessibilityUIElement::lineForIndex(int) { return 0; }
153 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int) { return 0; }
154 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
155 JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned, unsigned) { return 0; }
156 void AccessibilityUIElement::setSelectedTextRange(unsigned, unsigned) { }
157 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned, unsigned) { return 0; }
158 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned, unsigned) { return 0; }
159 bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
160 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement*, bool, JSStringRef, JSStringRef) { return 0; }
161 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned, unsigned) { return 0; }
162 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::horizontalScrollbar() const { return 0; }
163 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const { return 0; }
164 bool AccessibilityUIElement::addNotificationListener(JSValueRef) { return false; }
165 bool AccessibilityUIElement::removeNotificationListener() { return false; }
166 PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement*) { return 0; }
167 int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange*) { return 0; }
168 PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker*, AccessibilityTextMarker*) { return 0; }
169 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
170 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
171 PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker*) { return 0; }
172 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int, int) { return 0; }
173 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*) { return 0; }
174 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*) { return 0; }
175 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
176 bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef, AccessibilityTextMarkerRange*) { return false; }
177 int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker*) { return -1; }
178 bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker*) { return false; }
179 PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForIndex(int) { return 0; }
180
181 #endif
182
183 } // namespace WTR
184