2012-05-08 09:16:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_a11y_HTMLListAccessible_h__
|
|
|
|
#define mozilla_a11y_HTMLListAccessible_h__
|
|
|
|
|
2012-06-04 16:32:29 +04:00
|
|
|
#include "BaseAccessibles.h"
|
2012-05-31 12:04:41 +04:00
|
|
|
#include "HyperTextAccessibleWrap.h"
|
2012-05-08 09:16:40 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
|
|
|
class HTMLListBulletAccessible;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for HTML list (like HTML ul).
|
|
|
|
*/
|
2012-05-31 12:04:41 +04:00
|
|
|
class HTMLListAccessible : public HyperTextAccessibleWrap
|
2012-05-08 09:16:40 +04:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 13:01:40 +04:00
|
|
|
HTMLListAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-12-18 09:22:26 +04:00
|
|
|
HyperTextAccessibleWrap(aContent, aDoc) { mGenericTypes |= eList; }
|
2012-05-08 09:16:40 +04:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2014-07-09 01:23:18 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~HTMLListAccessible() { }
|
2012-05-08 09:16:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for HTML list item (e.g. HTML li).
|
|
|
|
*/
|
2012-05-31 12:04:41 +04:00
|
|
|
class HTMLLIAccessible : public HyperTextAccessibleWrap
|
2012-05-08 09:16:40 +04:00
|
|
|
{
|
|
|
|
public:
|
2012-05-27 13:01:40 +04:00
|
|
|
HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2012-05-08 09:16:40 +04:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Shutdown() override;
|
|
|
|
virtual nsIntRect Bounds() const override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2012-05-08 09:16:40 +04:00
|
|
|
|
2016-05-31 21:46:31 +03:00
|
|
|
virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
|
|
|
|
|
2013-12-10 16:40:54 +04:00
|
|
|
// HTMLLIAccessible
|
2014-02-05 19:21:32 +04:00
|
|
|
HTMLListBulletAccessible* Bullet() const { return mBullet; }
|
2012-05-08 09:16:40 +04:00
|
|
|
void UpdateBullet(bool aHasBullet);
|
|
|
|
|
|
|
|
protected:
|
2014-07-09 01:23:18 +04:00
|
|
|
virtual ~HTMLLIAccessible() { }
|
|
|
|
|
2012-05-08 09:16:40 +04:00
|
|
|
private:
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<HTMLListBulletAccessible> mBullet;
|
2012-05-08 09:16:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for bullet of HTML list item element (for example, HTML li).
|
|
|
|
*/
|
2012-06-04 16:32:29 +04:00
|
|
|
class HTMLListBulletAccessible : public LeafAccessible
|
2012-05-08 09:16:40 +04:00
|
|
|
{
|
|
|
|
public:
|
2012-09-04 10:06:10 +04:00
|
|
|
HTMLListBulletAccessible(nsIContent* aContent, DocAccessible* aDoc);
|
2012-05-08 09:16:40 +04:00
|
|
|
virtual ~HTMLListBulletAccessible() { }
|
|
|
|
|
2012-05-29 05:18:45 +04:00
|
|
|
// Accessible
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIFrame* GetFrame() const override;
|
|
|
|
virtual ENameValueFlag Name(nsString& aName) override;
|
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aLength = UINT32_MAX) override;
|
2012-05-14 08:51:45 +04:00
|
|
|
|
|
|
|
// HTMLListBulletAccessible
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if the bullet is inside of list item element boundaries.
|
|
|
|
*/
|
|
|
|
bool IsInside() const;
|
2012-05-08 09:16:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
inline HTMLLIAccessible*
|
2012-05-29 05:18:45 +04:00
|
|
|
Accessible::AsHTMLListItem()
|
2012-05-08 09:16:40 +04:00
|
|
|
{
|
2012-12-18 09:22:26 +04:00
|
|
|
return IsHTMLListItem() ? static_cast<HTMLLIAccessible*>(this) : nullptr;
|
2012-05-08 09:16:40 +04:00
|
|
|
}
|
|
|
|
|
2012-11-18 06:01:44 +04:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-05-08 09:16:40 +04:00
|
|
|
#endif
|