blob: c1987cd3a73e2aabca75b17e5675b1c48dc778c0 [file] [log] [blame]
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +00001/*
2 * Copyright (C) 2010 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
commit-queue@webkit.orgd862d772016-10-31 22:07:53 +000026#pragma once
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000027
cfleizach@apple.comf0e3a9a2011-10-07 19:12:59 +000028#include "AccessibilityMockObject.h"
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000029
30namespace WebCore {
31
32class AccessibilityMenuList;
33class AccessibilityMenuListOption;
34class HTMLElement;
35
cdumez@apple.comb6fc8472014-10-28 22:42:37 +000036class AccessibilityMenuListPopup final : public AccessibilityMockObject {
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000037public:
akling@apple.comad2beb52014-12-25 07:50:20 +000038 static Ref<AccessibilityMenuListPopup> create() { return adoptRef(*new AccessibilityMenuListPopup); }
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000039
darin@apple.com11ff47c2016-03-04 16:47:55 +000040 bool isEnabled() const override;
41 bool isOffScreen() const override;
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000042
jhoneycutt@apple.coma461af42011-07-18 23:16:31 +000043 void didUpdateActiveOption(int optionIndex);
44
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000045private:
46 AccessibilityMenuListPopup();
47
darin@apple.com11ff47c2016-03-04 16:47:55 +000048 bool isMenuListPopup() const override { return true; }
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000049
darin@apple.com11ff47c2016-03-04 16:47:55 +000050 LayoutRect elementRect() const override { return LayoutRect(); }
51 AccessibilityRole roleValue() const override { return MenuListPopupRole; }
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000052
darin@apple.com11ff47c2016-03-04 16:47:55 +000053 bool isVisible() const override;
54 bool press() override;
55 void addChildren() override;
56 void childrenChanged() override;
57 bool computeAccessibilityIsIgnored() const override;
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000058
59 AccessibilityMenuListOption* menuListOptionAccessibilityObject(HTMLElement*) const;
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000060};
61
jhoneycutt@apple.comc344ece2010-01-20 01:43:26 +000062} // namespace WebCore
63
cdumez@apple.com234cbdc2014-10-20 19:08:40 +000064SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityMenuListPopup, isMenuListPopup())