15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/* 25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2010 Apple Inc. All Rights Reserved. 35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without 55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions 65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * are met: 75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1. Redistributions of source code must retain the above copyright 85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer. 95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright 105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer in the 115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * documentation and/or other materials provided with the distribution. 125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2302772c6a72f1ee0b226341a4f4439970c29fc861Ben Murdoch * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */ 255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 26bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#ifndef AXMenuListOption_h 27bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#define AXMenuListOption_h 285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 29bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#include "core/accessibility/AXMockObject.h" 305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)namespace WebCore { 325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 33bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)class AXMenuListPopup; 345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)class HTMLElement; 355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 36bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)class AXMenuListOption : public AXMockObject { 375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public: 38bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) static PassRefPtr<AXMenuListOption> create() { return adoptRef(new AXMenuListOption); } 395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) void setElement(HTMLElement*); 415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private: 43bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles) AXMenuListOption(); 445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 455267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool isMenuListOption() const OVERRIDE { return true; } 465c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 475267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual AccessibilityRole roleValue() const OVERRIDE { return MenuListOptionRole; } 485267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool canHaveChildren() const OVERRIDE { return false; } 495c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 505267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual Element* actionElement() const OVERRIDE; 515267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool isEnabled() const OVERRIDE; 525267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool isVisible() const OVERRIDE; 535267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool isOffScreen() const OVERRIDE; 545267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool isSelected() const OVERRIDE; 555267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual void setSelected(bool) OVERRIDE; 565267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool canSetSelectedAttribute() const OVERRIDE; 575267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual LayoutRect elementRect() const OVERRIDE; 585267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual String stringValue() const OVERRIDE; 595267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) virtual bool computeAccessibilityIsIgnored() const OVERRIDE; 605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 615c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) RefPtr<HTMLElement> m_element; 625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}; 635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 64bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)DEFINE_AX_OBJECT_TYPE_CASTS(AXMenuListOption, isMenuListOption()); 651e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles) 665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)} // namespace WebCore 675c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 68bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#endif // AXMenuListOption_h 69