/*
 * Copyright (C) 2008, 2013, 2014-2015 Apple Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that 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.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' 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 APPLE INC. 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. 
 */

#include "config.h"
#include "AccessibilityUIElement.h"

#include "AccessibilityController.h"
#include "DumpRenderTree.h"
#include "FrameLoadDelegate.h"
#include <JavaScriptCore/JSStringRef.h>
#include <JavaScriptCore/JSStringRefBSTR.h>
#include <wtf/text/WTFString.h>
#include <comutil.h>
#include <tchar.h>
#include <string>

using std::wstring;

static COMPtr<IAccessibleComparable> comparableObject(IAccessible* accessible)
{
    COMPtr<IServiceProvider> serviceProvider(Query, accessible);
    if (!serviceProvider)
        return 0;
    COMPtr<IAccessibleComparable> comparable;
    serviceProvider->QueryService(SID_AccessibleComparable, __uuidof(IAccessibleComparable), reinterpret_cast<void**>(&comparable));
    return comparable;
}

AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
    : m_element(element)
{
}

AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
    : m_element(other.m_element)
{
}

AccessibilityUIElement::~AccessibilityUIElement()
{
}

bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
{
    COMPtr<IAccessibleComparable> comparable = comparableObject(m_element.get());
    COMPtr<IAccessibleComparable> otherComparable = comparableObject(otherElement->m_element.get());
    if (!comparable || !otherComparable)
        return false;
    BOOL isSame = FALSE;
    if (FAILED(comparable->isSameObject(otherComparable.get(), &isSame)))
        return false;
    return isSame;
}

void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>&)
{
}

void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>&)
{
}

void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& children)
{
    if (!m_element)
        return;

    long childCount;
    if (FAILED(m_element->get_accChildCount(&childCount)))
        return;
    for (long i = 0; i < childCount; ++i)
        children.append(getChildAtIndex(i));
}

void AccessibilityUIElement::getChildrenWithRange(Vector<AccessibilityUIElement>& elementVector, unsigned location, unsigned length)
{
    if (!m_element)
        return;

    long childCount;
    unsigned appendedCount = 0;
    if (FAILED(m_element->get_accChildCount(&childCount)))
        return;
    for (long i = location; i < childCount && appendedCount < length; ++i, ++appendedCount)
        elementVector.append(getChildAtIndex(i));
}

int AccessibilityUIElement::childrenCount()
{
    if (!m_element)
        return 0;

    long childCount;
    if (FAILED(m_element->get_accChildCount(&childCount)))
        return 0;

    return childCount;
}

int AccessibilityUIElement::rowCount()
{
    // FIXME: implement
    return 0;
}
 
int AccessibilityUIElement::columnCount()
{
    // FIXME: implement
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
{
    // FIXME: implement
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
{
    if (!m_element)
        return nullptr;

    COMPtr<IDispatch> child;
    _variant_t vChild;
    V_VT(&vChild) = VT_I4;
    // In MSAA, index 0 is the object itself.
    V_I4(&vChild) = index + 1;
    if (FAILED(m_element->get_accChild(vChild.GetVARIANT(), &child)))
        return nullptr;
    return COMPtr<IAccessible>(Query, child);
}

unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
{ 
    // FIXME: implement
    return 0;
}

JSStringRef AccessibilityUIElement::allAttributes()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
{
    return JSStringCreateWithCharacters(0, 0);
}

AccessibilityUIElement AccessibilityUIElement::titleUIElement()
{
    COMPtr<IAccessible> platformElement = platformUIElement();

    COMPtr<IAccessibleComparable> comparable = comparableObject(platformElement.get());
    if (!comparable)
        return 0;

    _variant_t value;
    _bstr_t titleUIElementAttributeKey(L"AXTitleUIElementAttribute");
    if (FAILED(comparable->get_attribute(titleUIElementAttributeKey, &value.GetVARIANT())))
        return nullptr;

    if (V_VT(&value) == VT_EMPTY)
        return nullptr;

    ASSERT(V_VT(&value) == VT_UNKNOWN);

    if (V_VT(&value) != VT_UNKNOWN)
        return nullptr;

    COMPtr<IAccessible> titleElement(Query, value.punkVal);

    return titleElement;
}

AccessibilityUIElement AccessibilityUIElement::parentElement()
{
    if (!m_element)
        return nullptr;

    COMPtr<IDispatch> parent;
    m_element->get_accParent(&parent);

    COMPtr<IAccessible> parentAccessible(Query, parent);
    return parentAccessible;
}

JSStringRef AccessibilityUIElement::attributesOfChildren()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
{
    return JSStringCreateWithCharacters(0, 0);
}

static VARIANT& self()
{
    static _variant_t vSelf;
    static bool haveInitialized;

    if (!haveInitialized) {
        V_VT(&vSelf) = VT_I4;
        V_I4(&vSelf) = CHILDID_SELF;
    }
    return vSelf;
}

static _bstr_t convertToDRTLabel(const _bstr_t roleName)
{
    if (!wcscmp(roleName, L"cell"))
        return _bstr_t(L"AXCell");
    if (!wcscmp(roleName, L"check box"))
        return _bstr_t(L"AXCheckBox");
    if (!wcscmp(roleName, L"client"))
        return _bstr_t(L"AXWebArea");
    if (!wcscmp(roleName, L"column"))
        return _bstr_t(L"AXColumn");
    if (!wcscmp(roleName, L"column header"))
        return _bstr_t(L"AXCell");
    if (!wcscmp(roleName, L"combo box"))
        return _bstr_t(L"AXComboBox");
    if (!wcscmp(roleName, L"grouping"))
        return _bstr_t(L"AXGroup");
    if (!wcscmp(roleName, L"editable text"))
        return _bstr_t(L"AXStaticText"); // Might be AXTextField, too.
    if (!wcscmp(roleName, L"graphic"))
        return _bstr_t(L"AXImage");
    if (!wcscmp(roleName, L"link"))
        return _bstr_t(L"AXLink");
    if (!wcscmp(roleName, L"list item"))
        return _bstr_t(L"AXTab");
    if (!wcscmp(roleName, L"list"))
        return _bstr_t(L"AXList");
    if (!wcscmp(roleName, L"menu bar"))
        return _bstr_t(L"AXMenuBar");
    if (!wcscmp(roleName, L"page tab list"))
        return _bstr_t(L"AXTabGroup");
    if (!wcscmp(roleName, L"page tab"))
        return _bstr_t(L"AXTab");
    if (!wcscmp(roleName, L"push button"))
        return _bstr_t(L"AXButton");
    if (!wcscmp(roleName, L"progress bar"))
        return _bstr_t(L"AXProgressIndicator");
    if (!wcscmp(roleName, L"radio button"))
        return _bstr_t(L"AXRadioButton");
    if (!wcscmp(roleName, L"row"))
        return _bstr_t(L"AXRow");
    if (!wcscmp(roleName, L"table"))
        return _bstr_t(L"AXTable");
    if (!wcscmp(roleName, L"text"))
        return _bstr_t(L"AXStaticText");

    return roleName;
}

JSStringRef AccessibilityUIElement::role()
{
    if (!m_element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXRole: "));

    _variant_t vRole;
    if (FAILED(m_element->get_accRole(self(), &vRole.GetVARIANT())))
        return JSStringCreateWithBSTR(_bstr_t(L"AXRole: "));

    ASSERT(V_VT(&vRole) == VT_I4 || V_VT(&vRole) == VT_BSTR);

    _bstr_t result;
    if (V_VT(&vRole) == VT_I4) {
        unsigned roleTextLength = ::GetRoleText(V_I4(&vRole), nullptr, 0) + 1;

        Vector<TCHAR> roleText(roleTextLength);

        ::GetRoleText(V_I4(&vRole), roleText.data(), roleTextLength);

        result = roleText.data();
    } else if (V_VT(&vRole) == VT_BSTR)
        result = V_BSTR(&vRole);

    return JSStringCreateWithBSTR(_bstr_t(L"AXRole: ") + convertToDRTLabel(result));
}

JSStringRef AccessibilityUIElement::subrole()
{
    return 0;
}

JSStringRef AccessibilityUIElement::roleDescription()
{
    return 0;
}

JSStringRef AccessibilityUIElement::computedRoleString()
{
    return 0;
}

JSStringRef AccessibilityUIElement::title()
{
    if (!m_element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXTitle: "));

    _bstr_t titleBSTR;
    if (FAILED(m_element->get_accName(self(), &titleBSTR.GetBSTR())))
        return JSStringCreateWithBSTR(_bstr_t(L"AXTitle: "));

    return JSStringCreateWithBSTR(_bstr_t(L"AXTitle: ") + titleBSTR);
}

JSStringRef AccessibilityUIElement::description()
{
    if (!m_element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXDescription: "));

    _bstr_t descriptionBSTR;
    if (FAILED(m_element->get_accDescription(self(), &descriptionBSTR.GetBSTR())))
        return JSStringCreateWithBSTR(_bstr_t(L"AXDescription: "));

    if (!descriptionBSTR.length())
        return JSStringCreateWithBSTR(_bstr_t(L"AXDescription: "));

    if (wcsstr(static_cast<wchar_t*>(descriptionBSTR), L"Description: ") == static_cast<wchar_t*>(descriptionBSTR)) {
        // The Mozilla MSAA implementation requires that the string returned to us be prefixed with "Description: "
        // To match the Mac test results, we will just prefix with AX -> AXDescription:
        return JSStringCreateWithBSTR(_bstr_t(L"AX") + descriptionBSTR);
    }

    return JSStringCreateWithBSTR(descriptionBSTR);
}

JSStringRef AccessibilityUIElement::stringValue()
{
    if (!m_element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXValue: "));

    _bstr_t valueBSTR;
    if (FAILED(m_element->get_accValue(self(), &valueBSTR.GetBSTR())))
        return JSStringCreateWithBSTR(_bstr_t(L"AXValue: "));

    return JSStringCreateWithBSTR(_bstr_t(L"AXValue: ") + valueBSTR);
}

JSStringRef AccessibilityUIElement::language()
{
    if (!m_element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: "));

    COMPtr<IAccessibleComparable> accessible2Element = comparableObject(m_element.get());
    if (!accessible2Element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: "));

    IA2Locale locale;
    if (FAILED(accessible2Element->get_locale(&locale)))
        return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: "));

    return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: ") + _bstr_t(locale.language, false));
}

JSStringRef AccessibilityUIElement::helpText() const
{
    if (!m_element)
        return JSStringCreateWithBSTR(_bstr_t(L"AXHelp: "));

    _bstr_t helpTextBSTR;
    if (FAILED(m_element->get_accHelp(self(), &helpTextBSTR.GetBSTR())))
        return JSStringCreateWithBSTR(_bstr_t(L"AXHelp: "));

    return JSStringCreateWithBSTR(_bstr_t(L"AXHelp: ") + helpTextBSTR);
}

double AccessibilityUIElement::x()
{
    if (!m_element)
        return 0;

    long x, y, width, height;
    if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
        return 0;
    return x;
}

double AccessibilityUIElement::y()
{
    if (!m_element)
        return 0;

    long x, y, width, height;
    if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
        return 0;
    return y;
}

double AccessibilityUIElement::width()
{
    if (!m_element)
        return 0;

    long x, y, width, height;
    if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
        return 0;
    return width;
}

double AccessibilityUIElement::height()
{
    if (!m_element)
        return 0;

    long x, y, width, height;
    if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
        return 0;
    return height;
}

double AccessibilityUIElement::clickPointX()
{
    return 0;
}

double AccessibilityUIElement::clickPointY()
{
    return 0;
}

JSStringRef AccessibilityUIElement::valueDescription()
{
    return nullptr;
}

static DWORD accessibilityState(COMPtr<IAccessible> element)
{
    _variant_t state;
    if (FAILED(element->get_accState(self(), &state.GetVARIANT())))
        return 0;

    ASSERT(V_VT(&state) == VT_I4);

    DWORD result = state.lVal;

    return result;
}

bool AccessibilityUIElement::isFocused() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_FOCUSED) == STATE_SYSTEM_FOCUSED;
}

bool AccessibilityUIElement::isSelected() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_SELECTED) == STATE_SYSTEM_SELECTED;
}

int AccessibilityUIElement::hierarchicalLevel() const
{
    return 0;
}

bool AccessibilityUIElement::ariaIsGrabbed() const
{
    return false;
}
 
JSStringRef AccessibilityUIElement::ariaDropEffects() const
{
    return 0;
}

bool AccessibilityUIElement::isExpanded() const
{
    return false;
}

bool AccessibilityUIElement::isChecked() const
{
    if (!m_element)
        return false;

    _variant_t vState;
    if (FAILED(m_element->get_accState(self(), &vState.GetVARIANT())))
        return false;

    return vState.lVal & STATE_SYSTEM_CHECKED;
}

bool AccessibilityUIElement::isIndeterminate() const
{
    // FIXME: implement
    return false;
}

JSStringRef AccessibilityUIElement::orientation() const
{
    return 0;
}

double AccessibilityUIElement::intValue() const
{
    if (!m_element)
        return 0;

    _bstr_t valueBSTR;
    if (FAILED(m_element->get_accValue(self(), &valueBSTR.GetBSTR())) || !valueBSTR.length())
        return 0;

    TCHAR* ignored;
    return _tcstod(static_cast<TCHAR*>(valueBSTR), &ignored);
}

double AccessibilityUIElement::minValue()
{
    return 0;
}

double AccessibilityUIElement::maxValue()
{
    return 0;
}

bool AccessibilityUIElement::isPressActionSupported()
{
    if (!m_element)
        return 0;

    _bstr_t valueBSTR;
    if (FAILED(m_element->get_accDefaultAction(self(), &valueBSTR.GetBSTR())))
        return false;

    if (!valueBSTR.length())
        return false;

    return true;
}

bool AccessibilityUIElement::isIncrementActionSupported()
{
    return false;
}

bool AccessibilityUIElement::isDecrementActionSupported()
{
    return false;
}

bool AccessibilityUIElement::isEnabled()
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_UNAVAILABLE) != STATE_SYSTEM_UNAVAILABLE;
}

bool AccessibilityUIElement::isRequired() const
{
    return false;
}


int AccessibilityUIElement::insertionPointLineNumber()
{
    return 0;
}

JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfColumns()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfRows()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributesOfHeader()
{
    return JSStringCreateWithCharacters(0, 0);
}

int AccessibilityUIElement::indexInTable()
{
    return 0;
}

JSStringRef AccessibilityUIElement::rowIndexRange()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::columnIndexRange()
{
    return JSStringCreateWithCharacters(0, 0);
}

int AccessibilityUIElement::lineForIndex(int)
{
    return 0;
}

JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
{
    return JSStringCreateWithCharacters(0, 0);
}

bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned)
{
    return false;
}

unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly)
{
    return 0;
}

JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
{
    return 0;
}

JSStringRef AccessibilityUIElement::selectedTextRange()
{
    COMPtr<IAccessibleComparable> comparable = comparableObject(platformUIElement().get());
    if (!comparable)
        return JSStringCreateWithCharacters(0, 0);

    _variant_t value;
    if (FAILED(comparable->get_attribute(_bstr_t(L"AXSelectedTextRangeAttribute"), &value.GetVARIANT())))
        return JSStringCreateWithCharacters(0, 0);    

    ASSERT(V_VT(&value) == VT_BSTR);
    return JSStringCreateWithBSTR(value.bstrVal);
}

void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
{
}

JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
{
    // FIXME: implement
    return JSStringCreateWithCharacters(0, 0);
}

double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
{
    // FIXME: implement
    return 0;
}

bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
{
    // FIXME: implement
    return false;
}

bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
{
    return false;
}

bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
{
    return false;
}

void AccessibilityUIElement::increment()
{
}

void AccessibilityUIElement::decrement()
{
}

void AccessibilityUIElement::showMenu()
{
    if (!m_element)
        return;

    ASSERT(hasPopup());
    m_element->accDoDefaultAction(self());
}

void AccessibilityUIElement::press()
{
    if (!m_element)
        return;

    m_element->accDoDefaultAction(self());
}

AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::ariaControlsElementAtIndex(unsigned index)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::rowAtIndex(unsigned index)
{
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::disclosedByRow()
{
    return 0;
}

JSStringRef AccessibilityUIElement::accessibilityValue() const
{
    if (!m_element)
        return JSStringCreateWithCharacters(0, 0);

    _bstr_t valueBSTR;
    if (FAILED(m_element->get_accValue(self(), &valueBSTR.GetBSTR())) || !valueBSTR.length())
        return JSStringCreateWithCharacters(0, 0);

    return JSStringCreateWithBSTR(valueBSTR);
}

void AccessibilityUIElement::clearSelectedChildren() const
{
    // FIXME: implement
}

JSStringRef AccessibilityUIElement::documentEncoding()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::documentURI()
{
    return JSStringCreateWithCharacters(0, 0);
}

JSStringRef AccessibilityUIElement::url()
{
    // FIXME: implement
    return JSStringCreateWithCharacters(0, 0);
}

bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
{
    if (!functionCallback)
        return false;

    sharedFrameLoadDelegate->accessibilityController()->winAddNotificationListener(m_element, functionCallback);
    return true;
}

void AccessibilityUIElement::removeNotificationListener()
{
    // FIXME: implement
}

bool AccessibilityUIElement::isFocusable() const
{
    // FIXME: implement
    return false;
}

bool AccessibilityUIElement::isSelectable() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_SELECTABLE) == STATE_SYSTEM_SELECTABLE;
}

bool AccessibilityUIElement::isMultiSelectable() const
{
    DWORD multiSelectable = STATE_SYSTEM_EXTSELECTABLE | STATE_SYSTEM_MULTISELECTABLE;
    DWORD state = accessibilityState(m_element);
    return (state & multiSelectable) == multiSelectable;
}

bool AccessibilityUIElement::isSelectedOptionActive() const
{
    // FIXME: implement
    return false;
}

bool AccessibilityUIElement::isVisible() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_INVISIBLE) != STATE_SYSTEM_INVISIBLE;
}

bool AccessibilityUIElement::isOffScreen() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_OFFSCREEN) == STATE_SYSTEM_OFFSCREEN;
}

bool AccessibilityUIElement::isCollapsed() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_COLLAPSED) == STATE_SYSTEM_COLLAPSED;
}

bool AccessibilityUIElement::isIgnored() const
{
    // FIXME: implement
    return false;
}

bool AccessibilityUIElement::isSingleLine() const
{
    // FIXME: implement
    return false;
}

bool AccessibilityUIElement::isMultiLine() const
{
    // FIXME: implement
    return false;
}

bool AccessibilityUIElement::hasPopup() const
{
    DWORD state = accessibilityState(m_element);
    return (state & STATE_SYSTEM_HASPOPUP) == STATE_SYSTEM_HASPOPUP;
}

void AccessibilityUIElement::takeFocus()
{
    if (!m_element)
        return;

    m_element->accSelect(SELFLAG_TAKEFOCUS, self());
}

void AccessibilityUIElement::takeSelection()
{
    if (!m_element)
        return;

    m_element->accSelect(SELFLAG_TAKESELECTION, self());
}

void AccessibilityUIElement::addSelection()
{
    if (!m_element)
        return;

    m_element->accSelect(SELFLAG_ADDSELECTION, self());
}

void AccessibilityUIElement::removeSelection()
{
    if (!m_element)
        return;

    m_element->accSelect(SELFLAG_REMOVESELECTION, self());
}

void AccessibilityUIElement::scrollToMakeVisible()
{
    // FIXME: implement
}

void AccessibilityUIElement::scrollToMakeVisibleWithSubFocus(int x, int y, int width, int height)
{
    // FIXME: implement
}

void AccessibilityUIElement::scrollToGlobalPoint(int x, int y)
{
    // FIXME: implement
}

JSStringRef AccessibilityUIElement::classList() const
{
    // FIXME: implement
    return 0;
}

unsigned AccessibilityUIElement::selectedChildrenCount() const
{
    // FIXME: implement
    return 0;
}

AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned) const
{
    // FIXME: implement
    return 0;
}

void AccessibilityUIElement::columnHeaders(Vector<AccessibilityUIElement>&) const
{
    // FIXME: implement
}

void AccessibilityUIElement::rowHeaders(Vector<AccessibilityUIElement>&) const
{
    // FIXME: implement
}
