1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_a11y_HTMLListAccessible_h__
8 #define mozilla_a11y_HTMLListAccessible_h__
10 #include "BaseAccessibles.h"
11 #include "HyperTextAccessibleWrap.h"
16 class HTMLListBulletAccessible
;
19 * Used for HTML list (like HTML ul).
21 class HTMLListAccessible
: public HyperTextAccessibleWrap
{
23 HTMLListAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
)
24 : HyperTextAccessibleWrap(aContent
, aDoc
) {
25 mGenericTypes
|= eList
;
29 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLListAccessible
,
30 HyperTextAccessibleWrap
)
33 virtual a11y::role
NativeRole() const override
;
34 virtual uint64_t NativeState() const override
;
37 virtual ~HTMLListAccessible() {}
41 * Used for HTML list item (e.g. HTML li).
43 class HTMLLIAccessible
: public HyperTextAccessibleWrap
{
45 HTMLLIAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
48 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLIAccessible
,
49 HyperTextAccessibleWrap
)
52 virtual nsRect
BoundsInAppUnits() const override
;
53 virtual a11y::role
NativeRole() const override
;
54 virtual uint64_t NativeState() const override
;
57 LocalAccessible
* Bullet() const;
60 virtual ~HTMLLIAccessible() {}
64 * Used for bullet of HTML list item element (for example, HTML li).
66 class HTMLListBulletAccessible
: public LeafAccessible
{
68 HTMLListBulletAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
69 virtual ~HTMLListBulletAccessible() {}
72 virtual ENameValueFlag
Name(nsString
& aName
) const override
;
73 virtual a11y::role
NativeRole() const override
;
74 virtual uint64_t NativeState() const override
;
75 virtual already_AddRefed
<AccAttributes
> NativeAttributes() override
;
76 virtual void AppendTextTo(nsAString
& aText
, uint32_t aStartOffset
= 0,
77 uint32_t aLength
= UINT32_MAX
) override
;
80 inline HTMLLIAccessible
* LocalAccessible::AsHTMLListItem() {
81 return IsHTMLListItem() ? static_cast<HTMLLIAccessible
*>(this) : nullptr;
85 } // namespace mozilla