| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2009 Google 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 are | |
| 6 * met: | |
| 7 * | |
| 8 * * Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * * Redistributions in binary form must reproduce the above | |
| 11 * copyright notice, this list of conditions and the following disclaimer | |
| 12 * in the documentation and/or other materials provided with the | |
| 13 * distribution. | |
| 14 * * Neither the name of Google Inc. nor the names of its | |
| 15 * contributors may be used to endorse or promote products derived from | |
| 16 * this software without specific prior written permission. | |
| 17 * | |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 29 */ | |
| 30 | |
| 31 #ifndef WebAccessibilityObject_h | |
| 32 #define WebAccessibilityObject_h | |
| 33 | |
| 34 #include "WebAccessibilityRole.h" | |
| 35 #include "WebCommon.h" | |
| 36 | |
| 37 #if WEBKIT_IMPLEMENTATION | |
| 38 namespace WebCore { class AccessibilityObject; } | |
| 39 namespace WTF { template <typename T> class PassRefPtr; } | |
| 40 #endif | |
| 41 | |
| 42 namespace WebKit { | |
| 43 | |
| 44 class WebAccessibilityObjectPrivate; | |
| 45 class WebString; | |
| 46 struct WebPoint; | |
| 47 struct WebRect; | |
| 48 | |
| 49 // A container for passing around a reference to AccessibilityObject. | |
| 50 class WebAccessibilityObject { | |
| 51 public: | |
| 52 ~WebAccessibilityObject() { reset(); } | |
| 53 | |
| 54 WebAccessibilityObject() : m_private(0) { } | |
| 55 WebAccessibilityObject(const WebAccessibilityObject& o) : m_private(0) { assign(o); } | |
| 56 WebAccessibilityObject& operator=(const WebAccessibilityObject& o) | |
| 57 { | |
| 58 assign(o); | |
| 59 return *this; | |
| 60 } | |
| 61 | |
| 62 WEBKIT_API void reset(); | |
| 63 WEBKIT_API void assign(const WebAccessibilityObject&); | |
| 64 | |
| 65 bool isNull() const { return !m_private; } | |
| 66 | |
| 67 WebString accessibilityDescription() const; | |
| 68 WebString actionVerb() const; | |
| 69 bool canSetFocusAttribute() const; | |
| 70 | |
| 71 unsigned childCount() const; | |
| 72 | |
| 73 WebAccessibilityObject childAt(unsigned) const; | |
| 74 WebAccessibilityObject firstChild() const; | |
| 75 WebAccessibilityObject focusedChild() const; | |
| 76 WebAccessibilityObject lastChild() const; | |
| 77 WebAccessibilityObject nextSibling() const; | |
| 78 WebAccessibilityObject parentObject() const; | |
| 79 WebAccessibilityObject previousSibling() const; | |
| 80 | |
| 81 bool isAnchor() const; | |
| 82 bool isChecked() const; | |
| 83 bool isFocused() const; | |
| 84 bool isEnabled() const; | |
| 85 bool isHovered() const; | |
| 86 bool isIndeterminate() const; | |
| 87 bool isMultiSelect() const; | |
| 88 bool isOffScreen() const; | |
| 89 bool isPasswordField() const; | |
| 90 bool isPressed() const; | |
| 91 bool isReadOnly() const; | |
| 92 bool isVisited() const; | |
| 93 | |
| 94 WebRect boundingBoxRect() const; | |
| 95 WebString helpText() const; | |
| 96 WebAccessibilityObject hitTest(const WebPoint&) const; | |
| 97 WebString keyboardShortcut() const; | |
| 98 bool performDefaultAction() const; | |
| 99 WebAccessibilityRole roleValue() const; | |
| 100 WebString stringValue() const; | |
| 101 WebString title() const; | |
| 102 | |
| 103 #if WEBKIT_IMPLEMENTATION | |
| 104 WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>&); | |
| 105 WebAccessibilityObject& operator=(const WTF::PassRefPtr<WebCore::AccessibilityObject>&); | |
| 106 operator WTF::PassRefPtr<WebCore::AccessibilityObject>() const; | |
| 107 #endif | |
| 108 | |
| 109 private: | |
| 110 void assign(WebAccessibilityObjectPrivate*); | |
| 111 WebAccessibilityObjectPrivate* m_private; | |
| 112 }; | |
| 113 | |
| 114 } // namespace WebKit | |
| 115 | |
| 116 #endif | |
| OLD | NEW |