gecko-dev/accessible/xul/XULAlertAccessible.cpp

69 строки
1.6 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)
2005-03-15 18:44:02 +03:00
{
mGenericTypes |= eAlert;
2005-03-15 18:44:02 +03:00
}
XULAlertAccessible::~XULAlertAccessible()
{
}
NS_IMPL_ISUPPORTS_INHERITED0(XULAlertAccessible, Accessible)
role
XULAlertAccessible::NativeRole()
2005-03-15 18:44:02 +03:00
{
return roles::ALERT;
2005-03-15 18:44:02 +03:00
}
uint64_t
XULAlertAccessible::NativeState()
2005-03-15 18:44:02 +03:00
{
return Accessible::NativeState() | states::ALERT;
2005-03-15 18:44:02 +03:00
}
ENameValueFlag
XULAlertAccessible::Name(nsString& aName)
{
// 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
{
// If a part of colorpicker widget.
if (mParent && mParent->IsMenuButton())
return mParent;
return nullptr;
}