gecko-dev/accessible/xul/XULAlertAccessible.cpp

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

45 строки
1.5 KiB
C++
Исходник Обычный вид История

2005-03-15 18:44:02 +03:00
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2012-05-21 15:12:37 +04: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 18:44:02 +03:00
#include "XULAlertAccessible.h"
2005-03-15 18:44:02 +03:00
#include "Accessible-inl.h"
#include "Role.h"
#include "States.h"
2005-03-15 18:44:02 +03:00
using namespace mozilla::a11y;
////////////////////////////////////////////////////////////////////////////////
// XULAlertAccessible
////////////////////////////////////////////////////////////////////////////////
2005-03-15 18:44:02 +03:00
XULAlertAccessible::XULAlertAccessible(nsIContent* aContent,
DocAccessible* aDoc)
: AccessibleWrap(aContent, aDoc) {
mGenericTypes |= eAlert;
2005-03-15 18:44:02 +03:00
}
XULAlertAccessible::~XULAlertAccessible() {}
role XULAlertAccessible::NativeRole() const { return roles::ALERT; }
2005-03-15 18:44:02 +03:00
uint64_t XULAlertAccessible::NativeState() const {
return Accessible::NativeState() | states::ALERT;
2005-03-15 18:44:02 +03: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; }