2012-06-02 04:30:29 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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_HTMLElementAccessibles_h__
|
|
|
|
#define mozilla_a11y_HTMLElementAccessibles_h__
|
|
|
|
|
2012-06-04 05:32:29 -07:00
|
|
|
#include "BaseAccessibles.h"
|
2012-06-02 04:30:29 -07:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace a11y {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for HTML hr element.
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class HTMLHRAccessible : public LeafAccessible
|
2012-06-02 04:30:29 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
HTMLHRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-12-09 09:23:19 -08:00
|
|
|
LeafAccessible(aContent, aDoc) {}
|
2012-06-02 04:30:29 -07:00
|
|
|
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual a11y::role NativeRole() override;
|
2012-06-02 04:30:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for HTML br element.
|
|
|
|
*/
|
2012-06-04 05:32:29 -07:00
|
|
|
class HTMLBRAccessible : public LeafAccessible
|
2012-06-02 04:30:29 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
HTMLBRAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2013-09-11 09:56:01 -07:00
|
|
|
LeafAccessible(aContent, aDoc)
|
|
|
|
{
|
|
|
|
mType = eHTMLBRType;
|
|
|
|
}
|
2012-06-02 04:30:29 -07:00
|
|
|
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual a11y::role NativeRole() override;
|
|
|
|
virtual uint64_t NativeState() override;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) override;
|
2012-06-02 04:30:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for HTML label element.
|
|
|
|
*/
|
|
|
|
class HTMLLabelAccessible : public HyperTextAccessibleWrap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
HTMLLabelAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-12-09 09:23:19 -08:00
|
|
|
HyperTextAccessibleWrap(aContent, aDoc) {}
|
2012-06-02 04:30:29 -07:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual Relation RelationByType(RelationType aType) override;
|
2012-10-13 21:18:39 -07:00
|
|
|
|
2016-01-14 12:37:15 -08:00
|
|
|
// ActionAccessible
|
|
|
|
virtual uint8_t ActionCount() override;
|
|
|
|
virtual void ActionNameAt(uint8_t aIndex, nsAString& aName) override;
|
|
|
|
virtual bool DoAction(uint8_t aIndex) override;
|
|
|
|
|
2012-10-13 21:18:39 -07:00
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~HTMLLabelAccessible() {}
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual ENameValueFlag NativeName(nsString& aName) override;
|
2012-06-02 04:30:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for HTML output element.
|
|
|
|
*/
|
|
|
|
class HTMLOutputAccessible : public HyperTextAccessibleWrap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
HTMLOutputAccessible(nsIContent* aContent, DocAccessible* aDoc) :
|
2012-12-09 09:23:19 -08:00
|
|
|
HyperTextAccessibleWrap(aContent, aDoc) {}
|
2012-06-02 04:30:29 -07:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// Accessible
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual Relation RelationByType(RelationType aType) override;
|
2014-07-08 14:23:18 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~HTMLOutputAccessible() {}
|
2012-06-02 04:30:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace a11y
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|