gecko-dev/accessible/xul/XULAlertAccessible.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.5 KiB
C++
Raw Normal View History

2005-03-15 15:44:02 +00:00
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 11:12:37 +00:00
/* 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/. */
2005-03-15 15:44:02 +00:00
#include "XULAlertAccessible.h"
2005-03-15 15:44:02 +00:00
#include "Accessible-inl.h"
#include "Role.h"
#include "States.h"
2005-03-15 15:44:02 +00:00
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// XULAlertAccessible
////////////////////////////////////////////////////////////////////////////////
2005-03-15 15:44:02 +00:00
XULAlertAccessible::XULAlertAccessible(nsIContent* aContent,
DocAccessible* aDoc)
: AccessibleWrap(aContent, aDoc) {
mGenericTypes |= eAlert;
2005-03-15 15:44:02 +00:00
}
XULAlertAccessible::~XULAlertAccessible() {}
role XULAlertAccessible::NativeRole() const { return roles::ALERT; }
2005-03-15 15:44:02 +00:00
uint64_t XULAlertAccessible::NativeState() const {
return Accessible::NativeState() | states::ALERT;
2005-03-15 15:44:02 +00:00
}
ENameValueFlag XULAlertAccessible::Name(nsString& aName) const {
// Screen readers need to read contents of alert, not the accessible name.
// If we have both some screen readers will read the alert twice.
aName.Truncate();
return eNameOK;
}
////////////////////////////////////////////////////////////////////////////////
// Widgets
bool XULAlertAccessible::IsWidget() const { return true; }
Accessible* XULAlertAccessible::ContainerWidget() const { return nullptr; }